1165 lines
2.0 MiB

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
*/
"use strict";var vke=Object.create;var mC=Object.defineProperty;var bke=Object.getOwnPropertyDescriptor;var xke=Object.getOwnPropertyNames;var wke=Object.getPrototypeOf,kke=Object.prototype.hasOwnProperty;var PU=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),RU=t=>{throw TypeError(t)};var yt=(t,e)=>()=>(t&&(e=t(t=0)),e);var L=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ln=(t,e)=>{for(var r in e)mC(t,r,{get:e[r],enumerable:!0})},LU=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xke(e))!kke.call(t,i)&&i!==r&&mC(t,i,{get:()=>e[i],enumerable:!(n=bke(e,i))||n.enumerable});return t};var Z=(t,e,r)=>(r=t!=null?vke(wke(t)):{},LU(e||!t||!t.__esModule?mC(r,"default",{value:t,enumerable:!0}):r,t)),MU=t=>LU(mC({},"__esModule",{value:!0}),t);var J=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&RU("Object expected");var n,i;r&&(n=e[PU("asyncDispose")]),n===void 0&&(n=e[PU("dispose")],r&&(i=n)),typeof n!="function"&&RU("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},ee=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,l,c){return c=Error(l),c.name="SuppressedError",c.error=a,c.suppressed=o,c},i=a=>e=r?new n(a,e,"An error was suppressed during disposal"):(r=!0,a),s=a=>{for(;a=t.pop();)try{var o=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(o).then(s,l=>(i(l),s()))}catch(l){i(l)}if(r)throw e};return s()};var ar=L((g_,_U)=>{"use strict";var rb=function(t){return t&&t.Math===Math&&t};_U.exports=rb(typeof globalThis=="object"&&globalThis)||rb(typeof window=="object"&&window)||rb(typeof self=="object"&&self)||rb(typeof global=="object"&&global)||rb(typeof g_=="object"&&g_)||function(){return this}()||Function("return this")()});var di=L((_et,OU)=>{"use strict";OU.exports=function(t){try{return!!t()}catch{return!0}}});var ms=L((Oet,DU)=>{"use strict";var Ske=di();DU.exports=!Ske(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var nb=L((Det,NU)=>{"use strict";var Cke=di();NU.exports=!Cke(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")})});var Ni=L((Net,FU)=>{"use strict";var Tke=nb(),gC=Function.prototype.call;FU.exports=Tke?gC.bind(gC):function(){return gC.apply(gC,arguments)}});var $U=L(jU=>{"use strict";var BU={}.propertyIsEnumerable,VU=Object.getOwnPropertyDescriptor,Eke=VU&&!BU.call({1:2},1);jU.f=Eke?function(e){var r=VU(this,e);return!!r&&r.enumerable}:BU});var ib=L((Bet,UU)=>{"use strict";UU.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}});var cn=L((Vet,HU)=>{"use strict";var zU=nb(),qU=Function.prototype,y_=qU.call,Ike=zU&&qU.bind.bind(y_,y_);HU.exports=zU?Ike:function(t){return function(){return y_.apply(t,arguments)}}});var sb=L((jet,WU)=>{"use strict";var GU=cn(),Ake=GU({}.toString),Pke=GU("".slice);WU.exports=function(t){return Pke(Ake(t),8,-1)}});var YU=L(($et,KU)=>{"use strict";var Rke=cn(),Lke=di(),Mke=sb(),v_=Object,_ke=Rke("".split);KU.exports=Lke(function(){return!v_("z").propertyIsEnumerable(0)})?function(t){return Mke(t)==="String"?_ke(t,""):v_(t)}:v_});var zh=L((Uet,XU)=>{"use strict";XU.exports=function(t){return t==null}});var qh=L((zet,QU)=>{"use strict";var Oke=zh(),Dke=TypeError;QU.exports=function(t){if(Oke(t))throw new Dke("Can't call method on "+t);return t}});var ab=L((qet,ZU)=>{"use strict";var Nke=YU(),Fke=qh();ZU.exports=function(t){return Nke(Fke(t))}});var Pr=L((Het,JU)=>{"use strict";var b_=typeof document=="object"&&document.all;JU.exports=typeof b_>"u"&&b_!==void 0?function(t){return typeof t=="function"||t===b_}:function(t){return typeof t=="function"}});var qa=L((Get,ez)=>{"use strict";var Bke=Pr();ez.exports=function(t){return typeof t=="object"?t!==null:Bke(t)}});var Js=L((Wet,tz)=>{"use strict";var x_=ar(),Vke=Pr(),jke=function(t){return Vke(t)?t:void 0};tz.exports=function(t,e){return arguments.length<2?jke(x_[t]):x_[t]&&x_[t][e]}});var ob=L((Ket,rz)=>{"use strict";var $ke=cn();rz.exports=$ke({}.isPrototypeOf)});var Hh=L((Yet,sz)=>{"use strict";var Uke=ar(),nz=Uke.navigator,iz=nz&&nz.userAgent;sz.exports=iz?String(iz):""});var vC=L((Xet,dz)=>{"use strict";var uz=ar(),w_=Hh(),az=uz.process,oz=uz.Deno,lz=az&&az.versions||oz&&oz.version,cz=lz&&lz.v8,Ha,yC;cz&&(Ha=cz.split("."),yC=Ha[0]>0&&Ha[0]<4?1:+(Ha[0]+Ha[1]));!yC&&w_&&(Ha=w_.match(/Edge\/(\d+)/),(!Ha||Ha[1]>=74)&&(Ha=w_.match(/Chrome\/(\d+)/),Ha&&(yC=+Ha[1])));dz.exports=yC});var k_=L((Qet,pz)=>{"use strict";var fz=vC(),zke=di(),qke=ar(),Hke=qke.String;pz.exports=!!Object.getOwnPropertySymbols&&!zke(function(){var t=Symbol("symbol detection");return!Hke(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&fz&&fz<41})});var S_=L((Zet,hz)=>{"use strict";var Gke=k_();hz.exports=Gke&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var C_=L((Jet,mz)=>{"use strict";var Wke=Js(),Kke=Pr(),Yke=ob(),Xke=S_(),Qke=Object;mz.exports=Xke?function(t){return typeof t=="symbol"}:function(t){var e=Wke("Symbol");return Kke(e)&&Yke(e.prototype,Qke(t))}});var lb=L((ett,gz)=>{"use strict";var Zke=String;gz.exports=function(t){try{return Zke(t)}catch{return"Object"}}});var ea=L((ttt,yz)=>{"use strict";var Jke=Pr(),eSe=lb(),tSe=TypeError;yz.exports=function(t){if(Jke(t))return t;throw new tSe(eSe(t)+" is not a function")}});var kf=L((rtt,vz)=>{"use strict";var rSe=ea(),nSe=zh();vz.exports=function(t,e){var r=t[e];return nSe(r)?void 0:rSe(r)}});var xz=L((ntt,bz)=>{"use strict";var T_=Ni(),E_=Pr(),I_=qa(),iSe=TypeError;bz.exports=function(t,e){var r,n;if(e==="string"&&E_(r=t.toString)&&!I_(n=T_(r,t))||E_(r=t.valueOf)&&!I_(n=T_(r,t))||e!=="string"&&E_(r=t.toString)&&!I_(n=T_(r,t)))return n;throw new iSe("Can't convert object to primitive value")}});var Bl=L((itt,wz)=>{"use strict";wz.exports=!1});var bC=L((stt,Sz)=>{"use strict";var kz=ar(),sSe=Object.defineProperty;Sz.exports=function(t,e){try{sSe(kz,t,{value:e,configurable:!0,writable:!0})}catch{kz[t]=e}return e}});var cb=L((att,Ez)=>{"use strict";var aSe=Bl(),oSe=ar(),lSe=bC(),Cz="__core-js_shared__",Tz=Ez.exports=oSe[Cz]||lSe(Cz,{});(Tz.versions||(Tz.versions=[])).push({version:"3.41.0",mode:aSe?"pure":"global",copyright:"\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var A_=L((ott,Az)=>{"use strict";var Iz=cb();Az.exports=function(t,e){return Iz[t]||(Iz[t]=e||{})}});var P_=L((ltt,Pz)=>{"use strict";var cSe=qh(),uSe=Object;Pz.exports=function(t){return uSe(cSe(t))}});var fi=L((ctt,Rz)=>{"use strict";var dSe=cn(),fSe=P_(),pSe=dSe({}.hasOwnProperty);Rz.exports=Object.hasOwn||function(e,r){return pSe(fSe(e),r)}});var R_=L((utt,Lz)=>{"use strict";var hSe=cn(),mSe=0,gSe=Math.random(),ySe=hSe(1 .toString);Lz.exports=function(t){return"Symbol("+(t===void 0?"":t)+")_"+ySe(++mSe+gSe,36)}});var Br=L((dtt,_z)=>{"use strict";var vSe=ar(),bSe=A_(),Mz=fi(),xSe=R_(),wSe=k_(),kSe=S_(),Gh=vSe.Symbol,L_=bSe("wks"),SSe=kSe?Gh.for||Gh:Gh&&Gh.withoutSetter||xSe;_z.exports=function(t){return Mz(L_,t)||(L_[t]=wSe&&Mz(Gh,t)?Gh[t]:SSe("Symbol."+t)),L_[t]}});var Fz=L((ftt,Nz)=>{"use strict";var CSe=Ni(),Oz=qa(),Dz=C_(),TSe=kf(),ESe=xz(),ISe=Br(),ASe=TypeError,PSe=ISe("toPrimitive");Nz.exports=function(t,e){if(!Oz(t)||Dz(t))return t;var r=TSe(t,PSe),n;if(r){if(e===void 0&&(e="default"),n=CSe(r,t,e),!Oz(n)||Dz(n))return n;throw new ASe("Can't convert object to primitive value")}return e===void 0&&(e="number"),ESe(t,e)}});var M_=L((ptt,Bz)=>{"use strict";var RSe=Fz(),LSe=C_();Bz.exports=function(t){var e=RSe(t,"string");return LSe(e)?e:e+""}});var xC=L((htt,jz)=>{"use strict";var MSe=ar(),Vz=qa(),__=MSe.document,_Se=Vz(__)&&Vz(__.createElement);jz.exports=function(t){return _Se?__.createElement(t):{}}});var O_=L((mtt,$z)=>{"use strict";var OSe=ms(),DSe=di(),NSe=xC();$z.exports=!OSe&&!DSe(function(){return Object.defineProperty(NSe("div"),"a",{get:function(){return 7}}).a!==7})});var ub=L(zz=>{"use strict";var FSe=ms(),BSe=Ni(),VSe=$U(),jSe=ib(),$Se=ab(),USe=M_(),zSe=fi(),qSe=O_(),Uz=Object.getOwnPropertyDescriptor;zz.f=FSe?Uz:function(e,r){if(e=$Se(e),r=USe(r),qSe)try{return Uz(e,r)}catch{}if(zSe(e,r))return jSe(!BSe(VSe.f,e,r),e[r])}});var D_=L((ytt,qz)=>{"use strict";var HSe=ms(),GSe=di();qz.exports=HSe&&GSe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Ga=L((vtt,Hz)=>{"use strict";var WSe=qa(),KSe=String,YSe=TypeError;Hz.exports=function(t){if(WSe(t))return t;throw new YSe(KSe(t)+" is not an object")}});var Uo=L(Wz=>{"use strict";var XSe=ms(),QSe=O_(),ZSe=D_(),wC=Ga(),Gz=M_(),JSe=TypeError,N_=Object.defineProperty,eCe=Object.getOwnPropertyDescriptor,F_="enumerable",B_="configurable",V_="writable";Wz.f=XSe?ZSe?function(e,r,n){if(wC(e),r=Gz(r),wC(n),typeof e=="function"&&r==="prototype"&&"value"in n&&V_ in n&&!n[V_]){var i=eCe(e,r);i&&i[V_]&&(e[r]=n.value,n={configurable:B_ in n?n[B_]:i[B_],enumerable:F_ in n?n[F_]:i[F_],writable:!1})}return N_(e,r,n)}:N_:function(e,r,n){if(wC(e),r=Gz(r),wC(n),QSe)try{return N_(e,r,n)}catch{}if("get"in n||"set"in n)throw new JSe("Accessors not supported");return"value"in n&&(e[r]=n.value),e}});var db=L((xtt,Kz)=>{"use strict";var tCe=ms(),rCe=Uo(),nCe=ib();Kz.exports=tCe?function(t,e,r){return rCe.f(t,e,nCe(1,r))}:function(t,e,r){return t[e]=r,t}});var Qz=L((wtt,Xz)=>{"use strict";var j_=ms(),iCe=fi(),Yz=Function.prototype,sCe=j_&&Object.getOwnPropertyDescriptor,$_=iCe(Yz,"name"),aCe=$_&&function(){}.name==="something",oCe=$_&&(!j_||j_&&sCe(Yz,"name").configurable);Xz.exports={EXISTS:$_,PROPER:aCe,CONFIGURABLE:oCe}});var kC=L((ktt,Zz)=>{"use strict";var lCe=cn(),cCe=Pr(),U_=cb(),uCe=lCe(Function.toString);cCe(U_.inspectSource)||(U_.inspectSource=function(t){return uCe(t)});Zz.exports=U_.inspectSource});var tq=L((Stt,eq)=>{"use strict";var dCe=ar(),fCe=Pr(),Jz=dCe.WeakMap;eq.exports=fCe(Jz)&&/native code/.test(String(Jz))});var SC=L((Ctt,nq)=>{"use strict";var pCe=A_(),hCe=R_(),rq=pCe("keys");nq.exports=function(t){return rq[t]||(rq[t]=hCe(t))}});var CC=L((Ttt,iq)=>{"use strict";iq.exports={}});var pb=L((Ett,oq)=>{"use strict";var mCe=tq(),aq=ar(),gCe=qa(),yCe=db(),z_=fi(),q_=cb(),vCe=SC(),bCe=CC(),sq="Object already initialized",H_=aq.TypeError,xCe=aq.WeakMap,TC,fb,EC,wCe=function(t){return EC(t)?fb(t):TC(t,{})},kCe=function(t){return function(e){var r;if(!gCe(e)||(r=fb(e)).type!==t)throw new H_("Incompatible receiver, "+t+" required");return r}};mCe||q_.state?(Wa=q_.state||(q_.state=new xCe),Wa.get=Wa.get,Wa.has=Wa.has,Wa.set=Wa.set,TC=function(t,e){if(Wa.has(t))throw new H_(sq);return e.facade=t,Wa.set(t,e),e},fb=function(t){return Wa.get(t)||{}},EC=function(t){return Wa.has(t)}):(Sf=vCe("state"),bCe[Sf]=!0,TC=function(t,e){if(z_(t,Sf))throw new H_(sq);return e.facade=t,yCe(t,Sf,e),e},fb=function(t){return z_(t,Sf)?t[Sf]:{}},EC=function(t){return z_(t,Sf)});var Wa,Sf;oq.exports={set:TC,get:fb,has:EC,enforce:wCe,getterFor:kCe}});var K_=L((Itt,uq)=>{"use strict";var W_=cn(),SCe=di(),CCe=Pr(),IC=fi(),G_=ms(),TCe=Qz().CONFIGURABLE,ECe=kC(),cq=pb(),ICe=cq.enforce,ACe=cq.get,lq=String,AC=Object.defineProperty,PCe=W_("".slice),RCe=W_("".replace),LCe=W_([].join),MCe=G_&&!SCe(function(){return AC(function(){},"length",{value:8}).length!==8}),_Ce=String(String).split("String"),OCe=uq.exports=function(t,e,r){PCe(lq(e),0,7)==="Symbol("&&(e="["+RCe(lq(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!IC(t,"name")||TCe&&t.name!==e)&&(G_?AC(t,"name",{value:e,configurable:!0}):t.name=e),MCe&&r&&IC(r,"arity")&&t.length!==r.arity&&AC(t,"length",{value:r.arity});try{r&&IC(r,"constructor")&&r.constructor?G_&&AC(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=ICe(t);return IC(n,"source")||(n.source=LCe(_Ce,typeof e=="string"?e:"")),t};Function.prototype.toString=OCe(function(){return CCe(this)&&ACe(this).source||ECe(this)},"toString")});var Ka=L((Att,dq)=>{"use strict";var DCe=Pr(),NCe=Uo(),FCe=K_(),BCe=bC();dq.exports=function(t,e,r,n){n||(n={});var i=n.enumerable,s=n.name!==void 0?n.name:e;if(DCe(r)&&FCe(r,s,n),n.global)i?t[e]=r:BCe(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:NCe.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t}});var pq=L((Ptt,fq)=>{"use strict";var VCe=Math.ceil,jCe=Math.floor;fq.exports=Math.trunc||function(e){var r=+e;return(r>0?jCe:VCe)(r)}});var PC=L((Rtt,hq)=>{"use strict";var $Ce=pq();hq.exports=function(t){var e=+t;return e!==e||e===0?0:$Ce(e)}});var gq=L((Ltt,mq)=>{"use strict";var UCe=PC(),zCe=Math.max,qCe=Math.min;mq.exports=function(t,e){var r=UCe(t);return r<0?zCe(r+e,0):qCe(r,e)}});var Y_=L((Mtt,yq)=>{"use strict";var HCe=PC(),GCe=Math.min;yq.exports=function(t){var e=HCe(t);return e>0?GCe(e,9007199254740991):0}});var X_=L((_tt,vq)=>{"use strict";var WCe=Y_();vq.exports=function(t){return WCe(t.length)}});var wq=L((Ott,xq)=>{"use strict";var KCe=ab(),YCe=gq(),XCe=X_(),bq=function(t){return function(e,r,n){var i=KCe(e),s=XCe(i);if(s===0)return!t&&-1;var a=YCe(n,s),o;if(t&&r!==r){for(;s>a;)if(o=i[a++],o!==o)return!0}else for(;s>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}};xq.exports={includes:bq(!0),indexOf:bq(!1)}});var Z_=L((Dtt,Sq)=>{"use strict";var QCe=cn(),Q_=fi(),ZCe=ab(),JCe=wq().indexOf,eTe=CC(),kq=QCe([].push);Sq.exports=function(t,e){var r=ZCe(t),n=0,i=[],s;for(s in r)!Q_(eTe,s)&&Q_(r,s)&&kq(i,s);for(;e.length>n;)Q_(r,s=e[n++])&&(~JCe(i,s)||kq(i,s));return i}});var RC=L((Ntt,Cq)=>{"use strict";Cq.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Eq=L(Tq=>{"use strict";var tTe=Z_(),rTe=RC(),nTe=rTe.concat("length","prototype");Tq.f=Object.getOwnPropertyNames||function(e){return tTe(e,nTe)}});var Aq=L(Iq=>{"use strict";Iq.f=Object.getOwnPropertySymbols});var Rq=L((Vtt,Pq)=>{"use strict";var iTe=Js(),sTe=cn(),aTe=Eq(),oTe=Aq(),lTe=Ga(),cTe=sTe([].concat);Pq.exports=iTe("Reflect","ownKeys")||function(e){var r=aTe.f(lTe(e)),n=oTe.f;return n?cTe(r,n(e)):r}});var J_=L((jtt,Mq)=>{"use strict";var Lq=fi(),uTe=Rq(),dTe=ub(),fTe=Uo();Mq.exports=function(t,e,r){for(var n=uTe(e),i=fTe.f,s=dTe.f,a=0;a<n.length;a++){var o=n[a];!Lq(t,o)&&!(r&&Lq(r,o))&&i(t,o,s(e,o))}}});var eO=L(($tt,_q)=>{"use strict";var pTe=di(),hTe=Pr(),mTe=/#|\.prototype\./,hb=function(t,e){var r=yTe[gTe(t)];return r===bTe?!0:r===vTe?!1:hTe(e)?pTe(e):!!e},gTe=hb.normalize=function(t){return String(t).replace(mTe,".").toLowerCase()},yTe=hb.data={},vTe=hb.NATIVE="N",bTe=hb.POLYFILL="P";_q.exports=hb});var ta=L((Utt,Oq)=>{"use strict";var LC=ar(),xTe=ub().f,wTe=db(),kTe=Ka(),STe=bC(),CTe=J_(),TTe=eO();Oq.exports=function(t,e){var r=t.target,n=t.global,i=t.stat,s,a,o,l,c,u;if(n?a=LC:i?a=LC[r]||STe(r,{}):a=LC[r]&&LC[r].prototype,a)for(o in e){if(c=e[o],t.dontCallGetSet?(u=xTe(a,o),l=u&&u.value):l=a[o],s=TTe(n?o:r+(i?".":"#")+o,t.forced),!s&&l!==void 0){if(typeof c==typeof l)continue;CTe(c,l)}(t.sham||l&&l.sham)&&wTe(c,"sham",!0),kTe(a,o,c,t)}}});var Nq=L((ztt,Dq)=>{"use strict";var ETe=di();Dq.exports=!ETe(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})});var MC=L((qtt,Bq)=>{"use strict";var ITe=fi(),ATe=Pr(),PTe=P_(),RTe=SC(),LTe=Nq(),Fq=RTe("IE_PROTO"),tO=Object,MTe=tO.prototype;Bq.exports=LTe?tO.getPrototypeOf:function(t){var e=PTe(t);if(ITe(e,Fq))return e[Fq];var r=e.constructor;return ATe(r)&&e instanceof r?r.prototype:e instanceof tO?MTe:null}});var jq=L((Htt,Vq)=>{"use strict";var _Te=cn(),OTe=ea();Vq.exports=function(t,e,r){try{return _Te(OTe(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}}});var Uq=L((Gtt,$q)=>{"use strict";var DTe=qa();$q.exports=function(t){return DTe(t)||t===null}});var qq=L((Wtt,zq)=>{"use strict";var NTe=Uq(),FTe=String,BTe=TypeError;zq.exports=function(t){if(NTe(t))return t;throw new BTe("Can't set "+FTe(t)+" as a prototype")}});var rO=L((Ktt,Hq)=>{"use strict";var VTe=jq(),jTe=qa(),$Te=qh(),UTe=qq();Hq.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=VTe(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(i,s){return $Te(i),UTe(s),jTe(i)&&(t?r(i,s):i.__proto__=s),i}}():void 0)});var Wq=L((Ytt,Gq)=>{"use strict";var zTe=Z_(),qTe=RC();Gq.exports=Object.keys||function(e){return zTe(e,qTe)}});var Yq=L(Kq=>{"use strict";var HTe=ms(),GTe=D_(),WTe=Uo(),KTe=Ga(),YTe=ab(),XTe=Wq();Kq.f=HTe&&!GTe?Object.defineProperties:function(e,r){KTe(e);for(var n=YTe(r),i=XTe(r),s=i.length,a=0,o;s>a;)WTe.f(e,o=i[a++],n[o]);return e}});var nO=L((Qtt,Xq)=>{"use strict";var QTe=Js();Xq.exports=QTe("document","documentElement")});var DC=L((Ztt,nH)=>{"use strict";var ZTe=Ga(),JTe=Yq(),Qq=RC(),eEe=CC(),tEe=nO(),rEe=xC(),nEe=SC(),Zq=">",Jq="<",sO="prototype",aO="script",tH=nEe("IE_PROTO"),iO=function(){},rH=function(t){return Jq+aO+Zq+t+Jq+"/"+aO+Zq},eH=function(t){t.write(rH("")),t.close();var e=t.parentWindow.Object;return t=null,e},iEe=function(){var t=rEe("iframe"),e="java"+aO+":",r;return t.style.display="none",tEe.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(rH("document.F=Object")),r.close(),r.F},_C,OC=function(){try{_C=new ActiveXObject("htmlfile")}catch{}OC=typeof document<"u"?document.domain&&_C?eH(_C):iEe():eH(_C);for(var t=Qq.length;t--;)delete OC[sO][Qq[t]];return OC()};eEe[tH]=!0;nH.exports=Object.create||function(e,r){var n;return e!==null?(iO[sO]=ZTe(e),n=new iO,iO[sO]=null,n[tH]=e):n=OC(),r===void 0?n:JTe.f(n,r)}});var oH=L((Jtt,aH)=>{"use strict";var sEe=cn(),iH=Error,aEe=sEe("".replace),oEe=function(t){return String(new iH(t).stack)}("zxcasd"),sH=/\n\s*at [^:]*:[^\n]*/,lEe=sH.test(oEe);aH.exports=function(t,e){if(lEe&&typeof t=="string"&&!iH.prepareStackTrace)for(;e--;)t=aEe(t,sH,"");return t}});var cH=L((ert,lH)=>{"use strict";var cEe=di(),uEe=ib();lH.exports=!cEe(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",uEe(1,7)),t.stack!==7):!0})});var fH=L((trt,dH)=>{"use strict";var dEe=db(),fEe=oH(),pEe=cH(),uH=Error.captureStackTrace;dH.exports=function(t,e,r,n){pEe&&(uH?uH(t,e):dEe(t,"stack",fEe(r,n)))}});var mH=L((rrt,hH)=>{"use strict";var hEe=Br(),mEe=hEe("toStringTag"),pH={};pH[mEe]="z";hH.exports=String(pH)==="[object z]"});var FC=L((nrt,gH)=>{"use strict";var gEe=mH(),yEe=Pr(),NC=sb(),vEe=Br(),bEe=vEe("toStringTag"),xEe=Object,wEe=NC(function(){return arguments}())==="Arguments",kEe=function(t,e){try{return t[e]}catch{}};gH.exports=gEe?NC:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=kEe(e=xEe(t),bEe))=="string"?r:wEe?NC(e):(n=NC(e))==="Object"&&yEe(e.callee)?"Arguments":n}});var BC=L((irt,yH)=>{"use strict";var SEe=FC(),CEe=String;yH.exports=function(t){if(SEe(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return CEe(t)}});var bH=L((srt,vH)=>{"use strict";var TEe=BC();vH.exports=function(t,e){return t===void 0?arguments.length<2?"":e:TEe(t)}});var kH=L(()=>{"use strict";var EEe=ta(),IEe=ar(),AEe=ob(),xH=MC(),jC=rO(),PEe=J_(),wH=DC(),VC=db(),oO=ib(),REe=fH(),LEe=bH(),MEe=Br(),_Ee=di(),OEe=Bl(),Wh=IEe.SuppressedError,DEe=MEe("toStringTag"),$C=Error,NEe=!!Wh&&Wh.length!==3,FEe=!!Wh&&_Ee(function(){return new Wh(1,2,3,{cause:4}).cause===4}),UC=NEe||FEe,Cf=function(e,r,n){var i=AEe(mb,this),s;return jC?s=UC&&(!i||xH(this)===mb)?new Wh:jC(new $C,i?xH(this):mb):(s=i?this:wH(mb),VC(s,DEe,"Error")),n!==void 0&&VC(s,"message",LEe(n)),REe(s,Cf,s.stack,1),VC(s,"error",e),VC(s,"suppressed",r),s};jC?jC(Cf,$C):PEe(Cf,$C,{name:!0});var mb=Cf.prototype=UC?Wh.prototype:wH($C.prototype,{constructor:oO(1,Cf),message:oO(1,""),name:oO(1,"SuppressedError")});UC&&!OEe&&(mb.constructor=Cf);EEe({global:!0,constructor:!0,arity:3,forced:UC},{SuppressedError:Cf})});var zC=L((lrt,SH)=>{"use strict";var BEe=ob(),VEe=TypeError;SH.exports=function(t,e){if(BEe(e,t))return t;throw new VEe("Incorrect invocation")}});var lO=L((crt,CH)=>{"use strict";var jEe=Ka();CH.exports=function(t,e,r){for(var n in e)jEe(t,n,e[n],r);return t}});var qC=L((urt,EH)=>{"use strict";var TH=K_(),$Ee=Uo();EH.exports=function(t,e,r){return r.get&&TH(r.get,e,{getter:!0}),r.set&&TH(r.set,e,{setter:!0}),$Ee.f(t,e,r)}});var AH=L((drt,IH)=>{"use strict";var UEe=sb(),zEe=cn();IH.exports=function(t){if(UEe(t)==="Function")return zEe(t)}});var gb=L((frt,RH)=>{"use strict";var PH=AH(),qEe=ea(),HEe=nb(),GEe=PH(PH.bind);RH.exports=function(t,e){return qEe(t),e===void 0?t:HEe?GEe(t,e):function(){return t.apply(e,arguments)}}});var uO=L((prt,DH)=>{"use strict";var WEe=Js(),KEe=Ni(),YEe=cn(),XEe=gb(),QEe=Ga(),ZEe=ea(),_H=zh(),cO=kf(),OH=Br(),JEe=OH("asyncDispose"),LH=OH("dispose"),e2e=YEe([].push),t2e=function(t,e){if(e==="async-dispose"){var r=cO(t,JEe);return r!==void 0||(r=cO(t,LH),r===void 0)?r:function(){var n=this,i=WEe("Promise");return new i(function(s){KEe(r,n),s(void 0)})}}return cO(t,LH)},MH=function(t,e,r){return arguments.length<3&&!_H(t)&&(r=ZEe(t2e(QEe(t),e))),r===void 0?function(){}:XEe(r,t)};DH.exports=function(t,e,r,n){var i;if(arguments.length<4){if(_H(e)&&r==="sync-dispose")return;i=MH(e,r)}else i=MH(void 0,r,n);e2e(t.stack,i)}});var zH=L(()=>{"use strict";var r2e=ta(),GC=ms(),VH=Js(),NH=ea(),n2e=zC(),jH=Ka(),i2e=lO(),s2e=qC(),$H=Br(),UH=pb(),dO=uO(),FH=vC(),BH=VH("Promise"),a2e=VH("SuppressedError"),o2e=ReferenceError,l2e=$H("asyncDispose"),c2e=$H("toStringTag"),KC="AsyncDisposableStack",u2e=UH.set,WC=UH.getterFor(KC),fO="async-dispose",yb="disposed",d2e="pending",HC=function(t){var e=WC(t);if(e.state===yb)throw new o2e(KC+" already disposed");return e},pO=function(){u2e(n2e(this,Kh),{type:KC,state:d2e,stack:[]}),GC||(this.disposed=!1)},Kh=pO.prototype;i2e(Kh,{disposeAsync:function(){var e=this;return new BH(function(r,n){var i=WC(e);if(i.state===yb)return r(void 0);i.state=yb,GC||(e.disposed=!0);var s=i.stack,a=s.length,o=!1,l,c=function(d){o?l=new a2e(d,l):(o=!0,l=d),u()},u=function(){if(a){var d=s[--a];s[a]=null;try{BH.resolve(d()).then(u,c)}catch(f){c(f)}}else i.stack=null,o?n(l):r(void 0)};u()})},use:function(e){return dO(HC(this),e,fO),e},adopt:function(e,r){var n=HC(this);return NH(r),dO(n,void 0,fO,function(){return r(e)}),e},defer:function(e){var r=HC(this);NH(e),dO(r,void 0,fO,e)},move:function(){var e=HC(this),r=new pO;return WC(r).stack=e.stack,e.stack=[],e.state=yb,GC||(this.disposed=!0),r}});GC&&s2e(Kh,"disposed",{configurable:!0,get:function(){return WC(this).state===yb}});jH(Kh,l2e,Kh.disposeAsync,{name:"disposeAsync"});jH(Kh,c2e,KC,{nonWritable:!0});var f2e=FH&&FH<136;r2e({global:!0,constructor:!0,forced:f2e},{AsyncDisposableStack:pO})});var ZH=L((grt,QH)=>{"use strict";var KH=ar(),YH=cb(),XH=Pr(),p2e=DC(),YC=MC(),h2e=Ka(),m2e=Br(),g2e=Bl(),qH="USE_FUNCTION_CONSTRUCTOR",HH=m2e("asyncIterator"),GH=KH.AsyncIterator,WH=YH.AsyncIteratorPrototype,zo,hO;if(WH)zo=WH;else if(XH(GH))zo=GH.prototype;else if(YH[qH]||KH[qH])try{hO=YC(YC(YC(Function("return async function*(){}()")()))),YC(hO)===Object.prototype&&(zo=hO)}catch{}zo?g2e&&(zo=p2e(zo)):zo={};XH(zo[HH])||h2e(zo,HH,function(){return this});QH.exports=zo});var rG=L(()=>{"use strict";var y2e=Ni(),v2e=Ka(),b2e=Js(),x2e=kf(),w2e=fi(),k2e=Br(),JH=ZH(),eG=k2e("asyncDispose"),tG=b2e("Promise");w2e(JH,eG)||v2e(JH,eG,function(){var t=this;return new tG(function(e,r){var n=x2e(t,"return");n?tG.resolve(y2e(n,t)).then(function(){e(void 0)},r):e(void 0)})})});var oG=L(()=>{"use strict";var S2e=ta(),QC=ms(),C2e=Js(),nG=ea(),T2e=zC(),iG=Ka(),E2e=lO(),I2e=qC(),sG=Br(),aG=pb(),mO=uO(),A2e=C2e("SuppressedError"),P2e=ReferenceError,R2e=sG("dispose"),L2e=sG("toStringTag"),JC="DisposableStack",M2e=aG.set,ZC=aG.getterFor(JC),gO="sync-dispose",vb="disposed",_2e="pending",XC=function(t){var e=ZC(t);if(e.state===vb)throw new P2e(JC+" already disposed");return e},yO=function(){M2e(T2e(this,Yh),{type:JC,state:_2e,stack:[]}),QC||(this.disposed=!1)},Yh=yO.prototype;E2e(Yh,{dispose:function(){var e=ZC(this);if(e.state!==vb){e.state=vb,QC||(this.disposed=!0);for(var r=e.stack,n=r.length,i=!1,s;n;){var a=r[--n];r[n]=null;try{a()}catch(o){i?s=new A2e(o,s):(i=!0,s=o)}}if(e.stack=null,i)throw s}},use:function(e){return mO(XC(this),e,gO),e},adopt:function(e,r){var n=XC(this);return nG(r),mO(n,void 0,gO,function(){r(e)}),e},defer:function(e){var r=XC(this);nG(e),mO(r,void 0,gO,e)},move:function(){var e=XC(this),r=new yO;return ZC(r).stack=e.stack,e.stack=[],e.state=vb,QC||(this.disposed=!0),r}});QC&&I2e(Yh,"disposed",{configurable:!0,get:function(){return ZC(this).state===vb}});iG(Yh,R2e,Yh.dispose,{name:"dispose"});iG(Yh,L2e,JC,{nonWritable:!0});S2e({global:!0,constructor:!0},{DisposableStack:yO})});var dG=L((wrt,uG)=>{"use strict";var O2e=di(),D2e=Pr(),N2e=qa(),F2e=DC(),lG=MC(),B2e=Ka(),V2e=Br(),j2e=Bl(),xO=V2e("iterator"),cG=!1,Vl,vO,bO;[].keys&&(bO=[].keys(),"next"in bO?(vO=lG(lG(bO)),vO!==Object.prototype&&(Vl=vO)):cG=!0);var $2e=!N2e(Vl)||O2e(function(){var t={};return Vl[xO].call(t)!==t});$2e?Vl={}:j2e&&(Vl=F2e(Vl));D2e(Vl[xO])||B2e(Vl,xO,function(){return this});uG.exports={IteratorPrototype:Vl,BUGGY_SAFARI_ITERATORS:cG}});var hG=L(()=>{"use strict";var U2e=Ni(),z2e=Ka(),q2e=kf(),H2e=fi(),G2e=Br(),fG=dG().IteratorPrototype,pG=G2e("dispose");H2e(fG,pG)||z2e(fG,pG,function(){var t=q2e(this,"return");t&&U2e(t,this)})});var eT=L((Crt,mG)=>{"use strict";var W2e=ar();mG.exports=W2e});var yG=L(gG=>{"use strict";var K2e=Br();gG.f=K2e});var wO=L((Ert,bG)=>{"use strict";var vG=eT(),Y2e=fi(),X2e=yG(),Q2e=Uo().f;bG.exports=function(t){var e=vG.Symbol||(vG.Symbol={});Y2e(e,t)||Q2e(e,t,{value:X2e.f(t)})}});var xG=L(()=>{"use strict";var Z2e=ar(),J2e=wO(),eIe=Uo().f,tIe=ub().f,kO=Z2e.Symbol;J2e("asyncDispose");kO&&(bb=tIe(kO,"asyncDispose"),bb.enumerable&&bb.configurable&&bb.writable&&eIe(kO,"asyncDispose",{value:bb.value,enumerable:!1,configurable:!1,writable:!1}));var bb});var wG=L(()=>{"use strict";var rIe=ar(),nIe=wO(),iIe=Uo().f,sIe=ub().f,SO=rIe.Symbol;nIe("dispose");SO&&(xb=sIe(SO,"dispose"),xb.enumerable&&xb.configurable&&xb.writable&&iIe(SO,"dispose",{value:xb.value,enumerable:!1,configurable:!1,writable:!1}));var xb});var kG=L(()=>{"use strict";kH();zH();rG();oG();hG();xG();wG()});var CO=L((Ort,SG)=>{"use strict";var wb=ar(),aIe=Hh(),oIe=sb(),tT=function(t){return aIe.slice(0,t.length)===t};SG.exports=function(){return tT("Bun/")?"BUN":tT("Cloudflare-Workers")?"CLOUDFLARE":tT("Deno/")?"DENO":tT("Node.js/")?"NODE":wb.Bun&&typeof Bun.version=="string"?"BUN":wb.Deno&&typeof Deno.version=="object"?"DENO":oIe(wb.process)==="process"?"NODE":wb.window&&wb.document?"BROWSER":"REST"}()});var rT=L((Drt,CG)=>{"use strict";var lIe=CO();CG.exports=lIe==="NODE"});var IG=L((Nrt,EG)=>{"use strict";var cIe=Uo().f,uIe=fi(),dIe=Br(),TG=dIe("toStringTag");EG.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!uIe(t,TG)&&cIe(t,TG,{configurable:!0,value:e})}});var RG=L((Frt,PG)=>{"use strict";var fIe=Js(),pIe=qC(),hIe=Br(),mIe=ms(),AG=hIe("species");PG.exports=function(t){var e=fIe(t);mIe&&e&&!e[AG]&&pIe(e,AG,{configurable:!0,get:function(){return this}})}});var NG=L((Brt,DG)=>{"use strict";var gIe=cn(),yIe=di(),LG=Pr(),vIe=FC(),bIe=Js(),xIe=kC(),MG=function(){},_G=bIe("Reflect","construct"),TO=/^\s*(?:class|function)\b/,wIe=gIe(TO.exec),kIe=!TO.test(MG),kb=function(e){if(!LG(e))return!1;try{return _G(MG,[],e),!0}catch{return!1}},OG=function(e){if(!LG(e))return!1;switch(vIe(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return kIe||!!wIe(TO,xIe(e))}catch{return!0}};OG.sham=!0;DG.exports=!_G||yIe(function(){var t;return kb(kb.call)||!kb(Object)||!kb(function(){t=!0})||t})?OG:kb});var BG=L((Vrt,FG)=>{"use strict";var SIe=NG(),CIe=lb(),TIe=TypeError;FG.exports=function(t){if(SIe(t))return t;throw new TIe(CIe(t)+" is not a constructor")}});var $G=L((jrt,jG)=>{"use strict";var VG=Ga(),EIe=BG(),IIe=zh(),AIe=Br(),PIe=AIe("species");jG.exports=function(t,e){var r=VG(t).constructor,n;return r===void 0||IIe(n=VG(r)[PIe])?e:EIe(n)}});var GG=L(($rt,HG)=>{"use strict";var RIe=nb(),qG=Function.prototype,UG=qG.apply,zG=qG.call;HG.exports=typeof Reflect=="object"&&Reflect.apply||(RIe?zG.bind(UG):function(){return zG.apply(UG,arguments)})});var KG=L((Urt,WG)=>{"use strict";var LIe=cn();WG.exports=LIe([].slice)});var XG=L((zrt,YG)=>{"use strict";var MIe=TypeError;YG.exports=function(t,e){if(t<e)throw new MIe("Not enough arguments");return t}});var EO=L((qrt,QG)=>{"use strict";var _Ie=Hh();QG.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(_Ie)});var DO=L((Hrt,aW)=>{"use strict";var gs=ar(),OIe=GG(),DIe=gb(),ZG=Pr(),NIe=fi(),sW=di(),JG=nO(),FIe=KG(),eW=xC(),BIe=XG(),VIe=EO(),jIe=rT(),MO=gs.setImmediate,_O=gs.clearImmediate,$Ie=gs.process,IO=gs.Dispatch,UIe=gs.Function,tW=gs.MessageChannel,zIe=gs.String,AO=0,Sb={},rW="onreadystatechange",Cb,Tf,PO,RO;sW(function(){Cb=gs.location});var OO=function(t){if(NIe(Sb,t)){var e=Sb[t];delete Sb[t],e()}},LO=function(t){return function(){OO(t)}},nW=function(t){OO(t.data)},iW=function(t){gs.postMessage(zIe(t),Cb.protocol+"//"+Cb.host)};(!MO||!_O)&&(MO=function(e){BIe(arguments.length,1);var r=ZG(e)?e:UIe(e),n=FIe(arguments,1);return Sb[++AO]=function(){OIe(r,void 0,n)},Tf(AO),AO},_O=function(e){delete Sb[e]},jIe?Tf=function(t){$Ie.nextTick(LO(t))}:IO&&IO.now?Tf=function(t){IO.now(LO(t))}:tW&&!VIe?(PO=new tW,RO=PO.port2,PO.port1.onmessage=nW,Tf=DIe(RO.postMessage,RO)):gs.addEventListener&&ZG(gs.postMessage)&&!gs.importScripts&&Cb&&Cb.protocol!=="file:"&&!sW(iW)?(Tf=iW,gs.addEventListener("message",nW,!1)):rW in eW("script")?Tf=function(t){JG.appendChild(eW("script"))[rW]=function(){JG.removeChild(this),OO(t)}}:Tf=function(t){setTimeout(LO(t),0)});aW.exports={set:MO,clear:_O}});var cW=L((Grt,lW)=>{"use strict";var oW=ar(),qIe=ms(),HIe=Object.getOwnPropertyDescriptor;lW.exports=function(t){if(!qIe)return oW[t];var e=HIe(oW,t);return e&&e.value}});var NO=L((Wrt,dW)=>{"use strict";var uW=function(){this.head=null,this.tail=null};uW.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t){var e=this.head=t.next;return e===null&&(this.tail=null),t.item}}};dW.exports=uW});var pW=L((Krt,fW)=>{"use strict";var GIe=Hh();fW.exports=/ipad|iphone|ipod/i.test(GIe)&&typeof Pebble<"u"});var mW=L((Yrt,hW)=>{"use strict";var WIe=Hh();hW.exports=/web0s(?!.*chrome)/i.test(WIe)});var kW=L((Xrt,wW)=>{"use strict";var Qh=ar(),KIe=cW(),gW=gb(),FO=DO().set,YIe=NO(),XIe=EO(),QIe=pW(),ZIe=mW(),BO=rT(),yW=Qh.MutationObserver||Qh.WebKitMutationObserver,vW=Qh.document,bW=Qh.process,nT=Qh.Promise,$O=KIe("queueMicrotask"),Xh,VO,jO,iT,xW;$O||(Tb=new YIe,Eb=function(){var t,e;for(BO&&(t=bW.domain)&&t.exit();e=Tb.get();)try{e()}catch(r){throw Tb.head&&Xh(),r}t&&t.enter()},!XIe&&!BO&&!ZIe&&yW&&vW?(VO=!0,jO=vW.createTextNode(""),new yW(Eb).observe(jO,{characterData:!0}),Xh=function(){jO.data=VO=!VO}):!QIe&&nT&&nT.resolve?(iT=nT.resolve(void 0),iT.constructor=nT,xW=gW(iT.then,iT),Xh=function(){xW(Eb)}):BO?Xh=function(){bW.nextTick(Eb)}:(FO=gW(FO,Qh),Xh=function(){FO(Eb)}),$O=function(t){Tb.head||Xh(),Tb.add(t)});var Tb,Eb;wW.exports=$O});var CW=L((Qrt,SW)=>{"use strict";SW.exports=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}});var sT=L((Zrt,TW)=>{"use strict";TW.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}});var Zh=L((Jrt,EW)=>{"use strict";var JIe=ar();EW.exports=JIe.Promise});var Jh=L((ent,RW)=>{"use strict";var eAe=ar(),Ib=Zh(),tAe=Pr(),rAe=eO(),nAe=kC(),iAe=Br(),IW=CO(),sAe=Bl(),UO=vC(),AW=Ib&&Ib.prototype,aAe=iAe("species"),zO=!1,PW=tAe(eAe.PromiseRejectionEvent),oAe=rAe("Promise",function(){var t=nAe(Ib),e=t!==String(Ib);if(!e&&UO===66||sAe&&!(AW.catch&&AW.finally))return!0;if(!UO||UO<51||!/native code/.test(t)){var r=new Ib(function(s){s(1)}),n=function(s){s(function(){},function(){})},i=r.constructor={};if(i[aAe]=n,zO=r.then(function(){})instanceof n,!zO)return!0}return!e&&(IW==="BROWSER"||IW==="DENO")&&!PW});RW.exports={CONSTRUCTOR:oAe,REJECTION_EVENT:PW,SUBCLASSING:zO}});var Ef=L((tnt,MW)=>{"use strict";var LW=ea(),lAe=TypeError,cAe=function(t){var e,r;this.promise=new t(function(n,i){if(e!==void 0||r!==void 0)throw new lAe("Bad Promise constructor");e=n,r=i}),this.resolve=LW(e),this.reject=LW(r)};MW.exports.f=function(t){return new cAe(t)}});var QW=L(()=>{"use strict";var uAe=ta(),dAe=Bl(),cT=rT(),uu=ar(),nm=Ni(),_W=Ka(),OW=rO(),fAe=IG(),pAe=RG(),hAe=ea(),lT=Pr(),mAe=qa(),gAe=zC(),yAe=$G(),VW=DO().set,KO=kW(),vAe=CW(),bAe=sT(),xAe=NO(),jW=pb(),uT=Zh(),YO=Jh(),$W=Ef(),dT="Promise",UW=YO.CONSTRUCTOR,wAe=YO.REJECTION_EVENT,kAe=YO.SUBCLASSING,qO=jW.getterFor(dT),SAe=jW.set,em=uT&&uT.prototype,If=uT,aT=em,zW=uu.TypeError,HO=uu.document,XO=uu.process,GO=$W.f,CAe=GO,TAe=!!(HO&&HO.createEvent&&uu.dispatchEvent),qW="unhandledrejection",EAe="rejectionhandled",DW=0,HW=1,IAe=2,QO=1,GW=2,oT,NW,AAe,FW,WW=function(t){var e;return mAe(t)&&lT(e=t.then)?e:!1},KW=function(t,e){var r=e.value,n=e.state===HW,i=n?t.ok:t.fail,s=t.resolve,a=t.reject,o=t.domain,l,c,u;try{i?(n||(e.rejection===GW&&RAe(e),e.rejection=QO),i===!0?l=r:(o&&o.enter(),l=i(r),o&&(o.exit(),u=!0)),l===t.promise?a(new zW("Promise-chain cycle")):(c=WW(l))?nm(c,l,s,a):s(l)):a(r)}catch(d){o&&!u&&o.exit(),a(d)}},YW=function(t,e){t.notified||(t.notified=!0,KO(function(){for(var r=t.reactions,n;n=r.get();)KW(n,t);t.notified=!1,e&&!t.rejection&&PAe(t)}))},XW=function(t,e,r){var n,i;TAe?(n=HO.createEvent("Event"),n.promise=e,n.reason=r,n.initEvent(t,!1,!0),uu.dispatchEvent(n)):n={promise:e,reason:r},!wAe&&(i=uu["on"+t])?i(n):t===qW&&vAe("Unhandled promise rejection",r)},PAe=function(t){nm(VW,uu,function(){var e=t.facade,r=t.value,n=BW(t),i;if(n&&(i=bAe(function(){cT?XO.emit("unhandledRejection",r,e):XW(qW,e,r)}),t.rejection=cT||BW(t)?GW:QO,i.error))throw i.value})},BW=function(t){return t.rejection!==QO&&!t.parent},RAe=function(t){nm(VW,uu,function(){var e=t.facade;cT?XO.emit("rejectionHandled",e):XW(EAe,e,t.value)})},tm=function(t,e,r){return function(n){t(e,n,r)}},rm=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=IAe,YW(t,!0))},WO=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new zW("Promise can't be resolved itself");var n=WW(e);n?KO(function(){var i={done:!1};try{nm(n,e,tm(WO,i,t),tm(rm,i,t))}catch(s){rm(i,s,t)}}):(t.value=e,t.state=HW,YW(t,!1))}catch(i){rm({done:!1},i,t)}}};if(UW&&(If=function(e){gAe(this,aT),hAe(e),nm(oT,this);var r=qO(this);try{e(tm(WO,r),tm(rm,r))}catch(n){rm(r,n)}},aT=If.prototype,oT=function(e){SAe(this,{type:dT,done:!1,notified:!1,parent:!1,reactions:new xAe,rejection:!1,state:DW,value:null})},oT.prototype=_W(aT,"then",function(e,r){var n=qO(this),i=GO(yAe(this,If));return n.parent=!0,i.ok=lT(e)?e:!0,i.fail=lT(r)&&r,i.domain=cT?XO.domain:void 0,n.state===DW?n.reactions.add(i):KO(function(){KW(i,n)}),i.promise}),NW=function(){var t=new oT,e=qO(t);this.promise=t,this.resolve=tm(WO,e),this.reject=tm(rm,e)},$W.f=GO=function(t){return t===If||t===AAe?new NW(t):CAe(t)},!dAe&&lT(uT)&&em!==Object.prototype)){FW=em.then,kAe||_W(em,"then",function(e,r){var n=this;return new If(function(i,s){nm(FW,n,i,s)}).then(e,r)},{unsafe:!0});try{delete em.constructor}catch{}OW&&OW(em,aT)}uAe({global:!0,constructor:!0,wrap:!0,forced:UW},{Promise:If});fAe(If,dT,!1,!0);pAe(dT)});var ZO=L((int,ZW)=>{"use strict";ZW.exports={}});var eK=L((snt,JW)=>{"use strict";var LAe=Br(),MAe=ZO(),_Ae=LAe("iterator"),OAe=Array.prototype;JW.exports=function(t){return t!==void 0&&(MAe.Array===t||OAe[_Ae]===t)}});var JO=L((ant,rK)=>{"use strict";var DAe=FC(),tK=kf(),NAe=zh(),FAe=ZO(),BAe=Br(),VAe=BAe("iterator");rK.exports=function(t){if(!NAe(t))return tK(t,VAe)||tK(t,"@@iterator")||FAe[DAe(t)]}});var iK=L((ont,nK)=>{"use strict";var jAe=Ni(),$Ae=ea(),UAe=Ga(),zAe=lb(),qAe=JO(),HAe=TypeError;nK.exports=function(t,e){var r=arguments.length<2?qAe(t):e;if($Ae(r))return UAe(jAe(r,t));throw new HAe(zAe(t)+" is not iterable")}});var oK=L((lnt,aK)=>{"use strict";var GAe=Ni(),sK=Ga(),WAe=kf();aK.exports=function(t,e,r){var n,i;sK(t);try{if(n=WAe(t,"return"),!n){if(e==="throw")throw r;return r}n=GAe(n,t)}catch(s){i=!0,n=s}if(e==="throw")throw r;if(i)throw n;return sK(n),r}});var e6=L((cnt,dK)=>{"use strict";var KAe=gb(),YAe=Ni(),XAe=Ga(),QAe=lb(),ZAe=eK(),JAe=X_(),lK=ob(),ePe=iK(),tPe=JO(),cK=oK(),rPe=TypeError,fT=function(t,e){this.stopped=t,this.result=e},uK=fT.prototype;dK.exports=function(t,e,r){var n=r&&r.that,i=!!(r&&r.AS_ENTRIES),s=!!(r&&r.IS_RECORD),a=!!(r&&r.IS_ITERATOR),o=!!(r&&r.INTERRUPTED),l=KAe(e,n),c,u,d,f,p,h,m,v=function(y){return c&&cK(c,"normal",y),new fT(!0,y)},b=function(y){return i?(XAe(y),o?l(y[0],y[1],v):l(y[0],y[1])):o?l(y,v):l(y)};if(s)c=t.iterator;else if(a)c=t;else{if(u=tPe(t),!u)throw new rPe(QAe(t)+" is not iterable");if(ZAe(u)){for(d=0,f=JAe(t);f>d;d++)if(p=b(t[d]),p&&lK(uK,p))return p;return new fT(!1)}c=ePe(t,u)}for(h=s?t.next:c.next;!(m=YAe(h,c)).done;){try{p=b(m.value)}catch(y){cK(c,"throw",y)}if(typeof p=="object"&&p&&lK(uK,p))return p}return new fT(!1)}});var gK=L((unt,mK)=>{"use strict";var nPe=Br(),pK=nPe("iterator"),hK=!1;try{fK=0,t6={next:function(){return{done:!!fK++}},return:function(){hK=!0}},t6[pK]=function(){return this},Array.from(t6,function(){throw 2})}catch{}var fK,t6;mK.exports=function(t,e){try{if(!e&&!hK)return!1}catch{return!1}var r=!1;try{var n={};n[pK]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r}});var r6=L((dnt,yK)=>{"use strict";var iPe=Zh(),sPe=gK(),aPe=Jh().CONSTRUCTOR;yK.exports=aPe||!sPe(function(t){iPe.all(t).then(void 0,function(){})})});var vK=L(()=>{"use strict";var oPe=ta(),lPe=Ni(),cPe=ea(),uPe=Ef(),dPe=sT(),fPe=e6(),pPe=r6();oPe({target:"Promise",stat:!0,forced:pPe},{all:function(e){var r=this,n=uPe.f(r),i=n.resolve,s=n.reject,a=dPe(function(){var o=cPe(r.resolve),l=[],c=0,u=1;fPe(e,function(d){var f=c++,p=!1;u++,lPe(o,r,d).then(function(h){p||(p=!0,l[f]=h,--u||i(l))},s)}),--u||i(l)});return a.error&&s(a.value),n.promise}})});var xK=L(()=>{"use strict";var hPe=ta(),mPe=Bl(),gPe=Jh().CONSTRUCTOR,i6=Zh(),yPe=Js(),vPe=Pr(),bPe=Ka(),bK=i6&&i6.prototype;hPe({target:"Promise",proto:!0,forced:gPe,real:!0},{catch:function(t){return this.then(void 0,t)}});!mPe&&vPe(i6)&&(n6=yPe("Promise").prototype.catch,bK.catch!==n6&&bPe(bK,"catch",n6,{unsafe:!0}));var n6});var wK=L(()=>{"use strict";var xPe=ta(),wPe=Ni(),kPe=ea(),SPe=Ef(),CPe=sT(),TPe=e6(),EPe=r6();xPe({target:"Promise",stat:!0,forced:EPe},{race:function(e){var r=this,n=SPe.f(r),i=n.reject,s=CPe(function(){var a=kPe(r.resolve);TPe(e,function(o){wPe(a,r,o).then(n.resolve,i)})});return s.error&&i(s.value),n.promise}})});var kK=L(()=>{"use strict";var IPe=ta(),APe=Ef(),PPe=Jh().CONSTRUCTOR;IPe({target:"Promise",stat:!0,forced:PPe},{reject:function(e){var r=APe.f(this),n=r.reject;return n(e),r.promise}})});var CK=L((xnt,SK)=>{"use strict";var RPe=Ga(),LPe=qa(),MPe=Ef();SK.exports=function(t,e){if(RPe(t),LPe(e)&&e.constructor===t)return e;var r=MPe.f(t),n=r.resolve;return n(e),r.promise}});var IK=L(()=>{"use strict";var _Pe=ta(),OPe=Js(),TK=Bl(),DPe=Zh(),EK=Jh().CONSTRUCTOR,NPe=CK(),FPe=OPe("Promise"),BPe=TK&&!EK;_Pe({target:"Promise",stat:!0,forced:TK||EK},{resolve:function(e){return NPe(BPe&&this===FPe?DPe:this,e)}})});var AK=L(()=>{"use strict";QW();vK();xK();wK();kK();IK()});var PK=L(()=>{"use strict";var VPe=ta(),jPe=Ef();VPe({target:"Promise",stat:!0},{withResolvers:function(){var e=jPe.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}})});var MK=L((Int,LK)=>{"use strict";AK();PK();var $Pe=Ni(),UPe=Pr(),zPe=eT(),RK=zPe.Promise,qPe=RK.withResolvers;LK.exports=function(){return $Pe(qPe,UPe(this)?this:RK)}});var OK=L((Ant,_K)=>{"use strict";var HPe=MK();_K.exports=HPe});var NK=L((Rnt,DK)=>{"use strict";var GPe=TypeError;DK.exports=function(t){if(typeof t=="string")return t;throw new GPe("Argument is not a string")}});var BK=L((Lnt,FK)=>{"use strict";var WPe=PC(),KPe=BC(),YPe=qh(),XPe=RangeError;FK.exports=function(e){var r=KPe(YPe(this)),n="",i=WPe(e);if(i<0||i===1/0)throw new XPe("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(r+=r))i&1&&(n+=r);return n}});var zK=L((Mnt,UK)=>{"use strict";var $K=cn(),QPe=Y_(),VK=BC(),ZPe=BK(),JPe=qh(),eRe=$K(ZPe),tRe=$K("".slice),rRe=Math.ceil,jK=function(t){return function(e,r,n){var i=VK(JPe(e)),s=QPe(r),a=i.length,o=n===void 0?" ":VK(n),l,c;return s<=a||o===""?i:(l=s-a,c=eRe(o,rRe(l/o.length)),c.length>l&&(c=tRe(c,0,l)),t?i+c:c+i)}};UK.exports={start:jK(!1),end:jK(!0)}});var HK=L((_nt,qK)=>{"use strict";qK.exports=`
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`});var QK=L(()=>{"use strict";var nRe=ta(),Ab=cn(),iRe=NK(),sRe=fi(),GK=zK().start,aRe=HK(),oRe=Array,WK=RegExp.escape,KK=Ab("".charAt),o6=Ab("".charCodeAt),lRe=Ab(1.1.toString),cRe=Ab([].join),XK=/^[0-9a-z]/i,uRe=/^[$()*+./?[\\\]^{|}]/,dRe=RegExp("^[!\"#%&',\\-:;<=>@`~"+aRe+"]"),s6=Ab(XK.exec),YK={" ":"t","\n":"n","\v":"v","\f":"f","\r":"r"},a6=function(t){var e=lRe(o6(t,0),16);return e.length<3?"\\x"+GK(e,2,"0"):"\\u"+GK(e,4,"0")},fRe=!WK||WK("ab")!=="\\x61b";nRe({target:"RegExp",stat:!0,forced:fRe},{escape:function(e){iRe(e);for(var r=e.length,n=oRe(r),i=0;i<r;i++){var s=KK(e,i);if(i===0&&s6(XK,s))n[i]=a6(s);else if(sRe(YK,s))n[i]="\\"+YK[s];else if(s6(uRe,s))n[i]="\\"+s;else if(s6(dRe,s))n[i]=a6(s);else{var a=o6(s,0);(a&63488)!==55296?n[i]=s:a>=56320||i+1>=r||(o6(e,i+1)&64512)!==56320?n[i]=a6(s):(n[i]=s,n[++i]=KK(e,i))}}return cRe(n,"")}})});var JK=L((Nnt,ZK)=>{"use strict";QK();var pRe=eT();ZK.exports=pRe.RegExp.escape});var tY=L((Fnt,eY)=>{"use strict";var hRe=JK();eY.exports=hRe});var xY=L(pT=>{"use strict";var qRe=Symbol.for("react.transitional.element"),HRe=Symbol.for("react.fragment");function bY(t,e,r){var n=null;if(r!==void 0&&(n=""+r),e.key!==void 0&&(n=""+e.key),"key"in e){r={};for(var i in e)i!=="key"&&(r[i]=e[i])}else r=e;return e=r.ref,{$$typeof:qRe,type:t,key:n,ref:e!==void 0?e:null,props:r}}pT.Fragment=HRe;pT.jsx=bY;pT.jsxs=bY});var Ge=L((Znt,wY)=>{"use strict";wY.exports=xY()});var _Y=L(Xe=>{"use strict";var p6=Symbol.for("react.transitional.element"),GRe=Symbol.for("react.portal"),WRe=Symbol.for("react.fragment"),KRe=Symbol.for("react.strict_mode"),YRe=Symbol.for("react.profiler"),XRe=Symbol.for("react.consumer"),QRe=Symbol.for("react.context"),ZRe=Symbol.for("react.forward_ref"),JRe=Symbol.for("react.suspense"),eLe=Symbol.for("react.memo"),IY=Symbol.for("react.lazy"),kY=Symbol.iterator;function tLe(t){return t===null||typeof t!="object"?null:(t=kY&&t[kY]||t["@@iterator"],typeof t=="function"?t:null)}var AY={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},PY=Object.assign,RY={};function am(t,e,r){this.props=t,this.context=e,this.refs=RY,this.updater=r||AY}am.prototype.isReactComponent={};am.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};am.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function LY(){}LY.prototype=am.prototype;function h6(t,e,r){this.props=t,this.context=e,this.refs=RY,this.updater=r||AY}var m6=h6.prototype=new LY;m6.constructor=h6;PY(m6,am.prototype);m6.isPureReactComponent=!0;var SY=Array.isArray,or={H:null,A:null,T:null,S:null,V:null},MY=Object.prototype.hasOwnProperty;function g6(t,e,r,n,i,s){return r=s.ref,{$$typeof:p6,type:t,key:e,ref:r!==void 0?r:null,props:s}}function rLe(t,e){return g6(t.type,e,void 0,void 0,void 0,t.props)}function y6(t){return typeof t=="object"&&t!==null&&t.$$typeof===p6}function nLe(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var CY=/\/+/g;function f6(t,e){return typeof t=="object"&&t!==null&&t.key!=null?nLe(""+t.key):e.toString(36)}function TY(){}function iLe(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(TY,TY):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function sm(t,e,r,n,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case p6:case GRe:a=!0;break;case IY:return a=t._init,sm(a(t._payload),e,r,n,i)}}if(a)return i=i(t),a=n===""?"."+f6(t,0):n,SY(i)?(r="",a!=null&&(r=a.replace(CY,"$&/")+"/"),sm(i,e,r,"",function(c){return c})):i!=null&&(y6(i)&&(i=rLe(i,r+(i.key==null||t&&t.key===i.key?"":(""+i.key).replace(CY,"$&/")+"/")+a)),e.push(i)),1;a=0;var o=n===""?".":n+":";if(SY(t))for(var l=0;l<t.length;l++)n=t[l],s=o+f6(n,l),a+=sm(n,e,r,s,i);else if(l=tLe(t),typeof l=="function")for(t=l.call(t),l=0;!(n=t.next()).done;)n=n.value,s=o+f6(n,l++),a+=sm(n,e,r,s,i);else if(s==="object"){if(typeof t.then=="function")return sm(iLe(t),e,r,n,i);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return a}function hT(t,e,r){if(t==null)return t;var n=[],i=0;return sm(t,n,"","",function(s){return e.call(r,s,i++)}),n}function sLe(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var EY=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function aLe(){}Xe.Children={map:hT,forEach:function(t,e,r){hT(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return hT(t,function(){e++}),e},toArray:function(t){return hT(t,function(e){return e})||[]},only:function(t){if(!y6(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Xe.Component=am;Xe.Fragment=WRe;Xe.Profiler=YRe;Xe.PureComponent=h6;Xe.StrictMode=KRe;Xe.Suspense=JRe;Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=or;Xe.__COMPILER_RUNTIME={__proto__:null,c:function(t){return or.H.useMemoCache(t)}};Xe.cache=function(t){return function(){return t.apply(null,arguments)}};Xe.cloneElement=function(t,e,r){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var n=PY({},t.props),i=t.key,s=void 0;if(e!=null)for(a in e.ref!==void 0&&(s=void 0),e.key!==void 0&&(i=""+e.key),e)!MY.call(e,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&e.ref===void 0||(n[a]=e[a]);var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];n.children=o}return g6(t.type,i,void 0,void 0,s,n)};Xe.createContext=function(t){return t={$$typeof:QRe,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:XRe,_context:t},t};Xe.createElement=function(t,e,r){var n,i={},s=null;if(e!=null)for(n in e.key!==void 0&&(s=""+e.key),e)MY.call(e,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];i.children=o}if(t&&t.defaultProps)for(n in a=t.defaultProps,a)i[n]===void 0&&(i[n]=a[n]);return g6(t,s,void 0,void 0,null,i)};Xe.createRef=function(){return{current:null}};Xe.forwardRef=function(t){return{$$typeof:ZRe,render:t}};Xe.isValidElement=y6;Xe.lazy=function(t){return{$$typeof:IY,_payload:{_status:-1,_result:t},_init:sLe}};Xe.memo=function(t,e){return{$$typeof:eLe,type:t,compare:e===void 0?null:e}};Xe.startTransition=function(t){var e=or.T,r={};or.T=r;try{var n=t(),i=or.S;i!==null&&i(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(aLe,EY)}catch(s){EY(s)}finally{or.T=e}};Xe.unstable_useCacheRefresh=function(){return or.H.useCacheRefresh()};Xe.use=function(t){return or.H.use(t)};Xe.useActionState=function(t,e,r){return or.H.useActionState(t,e,r)};Xe.useCallback=function(t,e){return or.H.useCallback(t,e)};Xe.useContext=function(t){return or.H.useContext(t)};Xe.useDebugValue=function(){};Xe.useDeferredValue=function(t,e){return or.H.useDeferredValue(t,e)};Xe.useEffect=function(t,e,r){var n=or.H;if(typeof r=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return n.useEffect(t,e)};Xe.useId=function(){return or.H.useId()};Xe.useImperativeHandle=function(t,e,r){return or.H.useImperativeHandle(t,e,r)};Xe.useInsertionEffect=function(t,e){return or.H.useInsertionEffect(t,e)};Xe.useLayoutEffect=function(t,e){return or.H.useLayoutEffect(t,e)};Xe.useMemo=function(t,e){return or.H.useMemo(t,e)};Xe.useOptimistic=function(t,e){return or.H.useOptimistic(t,e)};Xe.useReducer=function(t,e,r){return or.H.useReducer(t,e,r)};Xe.useRef=function(t){return or.H.useRef(t)};Xe.useState=function(t){return or.H.useState(t)};Xe.useSyncExternalStore=function(t,e,r){return or.H.useSyncExternalStore(t,e,r)};Xe.useTransition=function(){return or.H.useTransition()};Xe.version="19.1.0"});var Te=L((eit,OY)=>{"use strict";OY.exports=_Y()});var BY=L(hi=>{"use strict";var fLe=Te();function FY(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function pu(){}var pi={d:{f:pu,r:function(){throw Error(FY(522))},D:pu,C:pu,L:pu,m:pu,X:pu,S:pu,M:pu},p:0,findDOMNode:null},pLe=Symbol.for("react.portal");function hLe(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pLe,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}var Mb=fLe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function mT(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}hi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=pi;hi.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(FY(299));return hLe(t,e,null,r)};hi.flushSync=function(t){var e=Mb.T,r=pi.p;try{if(Mb.T=null,pi.p=2,t)return t()}finally{Mb.T=e,pi.p=r,pi.d.f()}};hi.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,pi.d.C(t,e))};hi.prefetchDNS=function(t){typeof t=="string"&&pi.d.D(t)};hi.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var r=e.as,n=mT(r,e.crossOrigin),i=typeof e.integrity=="string"?e.integrity:void 0,s=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;r==="style"?pi.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:s}):r==="script"&&pi.d.X(t,{crossOrigin:n,integrity:i,fetchPriority:s,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};hi.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var r=mT(e.as,e.crossOrigin);pi.d.M(t,{crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&pi.d.M(t)};hi.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var r=e.as,n=mT(r,e.crossOrigin);pi.d.L(t,r,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};hi.preloadModule=function(t,e){if(typeof t=="string")if(e){var r=mT(e.as,e.crossOrigin);pi.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else pi.d.m(t)};hi.requestFormReset=function(t){pi.d.r(t)};hi.unstable_batchedUpdates=function(t,e){return t(e)};hi.useFormState=function(t,e,r){return Mb.H.useFormState(t,e,r)};hi.useFormStatus=function(){return Mb.H.useHostTransitionStatus()};hi.version="19.1.0"});var Af=L((sit,jY)=>{"use strict";function VY(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VY)}catch(t){console.error(t)}}VY(),jY.exports=BY()});var Lf={};ln(Lf,{Headers:()=>A6,Request:()=>SLe,Response:()=>CLe,default:()=>I6,fetch:()=>kLe});var wLe,fm,kLe,I6,A6,SLe,CLe,mu=yt(()=>{"use strict";wLe=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},fm=wLe(),kLe=fm.fetch,I6=fm.fetch.bind(fm),A6=fm.Headers,SLe=fm.Request,CLe=fm.Response});var L6=L(R6=>{"use strict";Object.defineProperty(R6,"__esModule",{value:!0});var P6=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};R6.default=P6});var _6=L(Db=>{"use strict";var tX=Db&&Db.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Db,"__esModule",{value:!0});var ELe=tX((mu(),MU(Lf))),ILe=tX(L6()),M6=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=ELe.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{var a,o,l;let c=null,u=null,d=null,f=s.status,p=s.statusText;if(s.ok){if(this.method!=="HEAD"){let b=await s.text();b===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?u=b:u=JSON.parse(b))}let m=(a=this.headers.Prefer)===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),v=(o=s.headers.get("content-range"))===null||o===void 0?void 0:o.split("/");m&&v&&v.length>1&&(d=parseInt(v[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(u)&&(u.length>1?(c={code:"PGRST116",details:`Results contain ${u.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},u=null,d=null,f=406,p="Not Acceptable"):u.length===1?u=u[0]:u=null)}else{let m=await s.text();try{c=JSON.parse(m),Array.isArray(c)&&s.status===404&&(u=[],c=null,f=200,p="OK")}catch{s.status===404&&m===""?(f=204,p="No Content"):c={message:m}}if(c&&this.isMaybeSingle&&(!((l=c?.details)===null||l===void 0)&&l.includes("0 rows"))&&(c=null,f=200,p="OK"),c&&this.shouldThrowOnError)throw new ILe.default(c)}return{error:c,data:u,count:d,status:f,statusText:p}});return this.shouldThrowOnError||(i=i.catch(s=>{var a,o,l;return{error:{message:`${(a=s?.name)!==null&&a!==void 0?a:"FetchError"}: ${s?.message}`,details:`${(o=s?.stack)!==null&&o!==void 0?o:""}`,hint:"",code:`${(l=s?.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}returns(){return this}overrideTypes(){return this}};Db.default=M6});var D6=L(Nb=>{"use strict";var ALe=Nb&&Nb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nb,"__esModule",{value:!0});var PLe=ALe(_6()),O6=class extends PLe.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:s=i}={}){let a=s?`${s}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let s=typeof i>"u"?"offset":`${i}.offset`,a=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(a,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:s=!1,format:a="text"}={}){var o;let l=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.Accept)!==null&&o!==void 0?o:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${a}; for="${c}"; options=${l};`,a==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Nb.default=O6});var CT=L(Fb=>{"use strict";var RLe=Fb&&Fb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fb,"__esModule",{value:!0});var LLe=RLe(D6()),N6=class extends LLe.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let s="";i==="plain"?s="pl":i==="phrase"?s="ph":i==="websearch"&&(s="w");let a=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${a}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};Fb.default=N6});var B6=L(Vb=>{"use strict";var MLe=Vb&&Vb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vb,"__esModule",{value:!0});var Bb=MLe(CT()),F6=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=r,this.schema=n,this.fetch=i}select(e,{head:r=!1,count:n}={}){let i=r?"HEAD":"GET",s=!1,a=(e??"*").split("").map(o=>/\s/.test(o)&&!s?"":(o==='"'&&(s=!s),o)).join("");return this.url.searchParams.set("select",a),n&&(this.headers.Prefer=`count=${n}`),new Bb.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:r,defaultToNull:n=!0}={}){let i="POST",s=[];if(this.headers.Prefer&&s.push(this.headers.Prefer),r&&s.push(`count=${r}`),n||s.push("missing=default"),this.headers.Prefer=s.join(","),Array.isArray(e)){let a=e.reduce((o,l)=>o.concat(Object.keys(l)),[]);if(a.length>0){let o=[...new Set(a)].map(l=>`"${l}"`);this.url.searchParams.set("columns",o.join(","))}}return new Bb.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:s=!0}={}){let a="POST",o=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&o.push(this.headers.Prefer),i&&o.push(`count=${i}`),s||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){let c=[...new Set(l)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new Bb.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:r}={}){let n="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),r&&i.push(`count=${r}`),this.headers.Prefer=i.join(","),new Bb.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let r="DELETE",n=[];return e&&n.push(`count=${e}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new Bb.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Vb.default=F6});var rX=L(TT=>{"use strict";Object.defineProperty(TT,"__esModule",{value:!0});TT.version=void 0;TT.version="0.0.0-automated"});var nX=L(ET=>{"use strict";Object.defineProperty(ET,"__esModule",{value:!0});ET.DEFAULT_HEADERS=void 0;var _Le=rX();ET.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${_Le.version}`}});var sX=L(jb=>{"use strict";var iX=jb&&jb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jb,"__esModule",{value:!0});var OLe=iX(B6()),DLe=iX(CT()),NLe=nX(),V6=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},NLe.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new OLe.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:s}={}){let a,o=new URL(`${this.url}/rpc/${e}`),l;n||i?(a=n?"HEAD":"GET",Object.entries(r).filter(([u,d])=>d!==void 0).map(([u,d])=>[u,Array.isArray(d)?`{${d.join(",")}}`:`${d}`]).forEach(([u,d])=>{o.searchParams.append(u,d)})):(a="POST",l=r);let c=Object.assign({},this.headers);return s&&(c.Prefer=`count=${s}`),new DLe.default({method:a,url:o,headers:c,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};jb.default=V6});var fX=L(In=>{"use strict";var pm=In&&In.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(In,"__esModule",{value:!0});In.PostgrestError=In.PostgrestBuilder=In.PostgrestTransformBuilder=In.PostgrestFilterBuilder=In.PostgrestQueryBuilder=In.PostgrestClient=void 0;var aX=pm(sX());In.PostgrestClient=aX.default;var oX=pm(B6());In.PostgrestQueryBuilder=oX.default;var lX=pm(CT());In.PostgrestFilterBuilder=lX.default;var cX=pm(D6());In.PostgrestTransformBuilder=cX.default;var uX=pm(_6());In.PostgrestBuilder=uX.default;var dX=pm(L6());In.PostgrestError=dX.default;In.default={PostgrestClient:aX.default,PostgrestQueryBuilder:oX.default,PostgrestFilterBuilder:lX.default,PostgrestTransformBuilder:cX.default,PostgrestBuilder:uX.default,PostgrestError:dX.default}});var wX=L((Nst,xX)=>{"use strict";xX.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});function O_e(){oE=!0,queueMicrotask(cZ)}function cZ(){if(!Wm.length){oE=!1;return}CD=!0;for(let t=0;t<Wm.length;t++)Wm[t].$st!==Xm&&D_e(Wm[t]);Wm=[],oE=!1,CD=!1}function D_e(t){let e=[t];for(;t=t[no];)t.$e&&t.$st!==Xm&&e.push(t);for(let r=e.length-1;r>=0;r--)MD(e[r])}function ID(t){let e=yi();return ix(e,t.length?t.bind(null,tp.bind(e)):t,null)}function te(t){return ix(ro,t,null)}function tl(t){return ix(null,t,null)}function Cs(){CD||cZ()}function rp(){return ro}function pn(t,e){try{return ix(e,t,null)}catch(r){AD(e,r);return}}function nx(t,e=ro){return e?.$cx[t]}function uZ(t,e,r=ro){r&&(r.$cx={...r.$cx,[t]:e})}function Ne(t){if(!t||!ro)return t||__e;let e=ro;return e.$d?Array.isArray(e.$d)?e.$d.push(t):e.$d=[e.$d,t]:e.$d=t,function(){e.$st!==uE&&(t.call(null),sx(e.$d)?e.$d=null:Array.isArray(e.$d)&&e.$d.splice(e.$d.indexOf(t),1))}}function tp(t=!0){if(this.$st!==uE){if(this.$h)if(Array.isArray(this.$h))for(let e=this.$h.length-1;e>=0;e--)tp.call(this.$h[e]);else tp.call(this.$h);if(t){let e=this[no];e&&(Array.isArray(e.$h)?e.$h.splice(e.$h.indexOf(this),1):e.$h=null),N_e(this)}}}function N_e(t){t.$st=uE,t.$d&&dZ(t),t.$s&&TD(t,0),t[no]=null,t.$s=null,t.$o=null,t.$h=null,t.$cx=ED,t.$eh=null}function dZ(t){try{if(Array.isArray(t.$d))for(let e=t.$d.length-1;e>=0;e--){let r=t.$d[e];r.call(r)}else t.$d.call(t.$d);t.$d=null}catch(e){AD(t,e)}}function ix(t,e,r){let n=ro,i=Km;ro=t,Km=r;try{return e.call(t)}finally{ro=n,Km=i}}function AD(t,e){if(!t||!t.$eh)throw e;let r=0,n=t.$eh.length,i=e;for(r=0;r<n;r++)try{t.$eh[r](i);break}catch(s){i=s}if(r===n)throw i}function dE(){return this.$st===uE?this.$v:(Km&&!this.$e&&(!fa&&Km.$s&&Km.$s[Ss]==this?Ss++:fa?fa.push(this):fa=[this]),this.$c&&MD(this),this.$v)}function PD(t){let e=sx(t)?t(this.$v):t;if(this.$ch(this.$v,e)&&(this.$v=e,this.$o))for(let r=0;r<this.$o.length;r++)pZ(this.$o[r],lE);return this.$v}function yi(){return new RD}function fE(t,e,r){return new fZ(t,e,r)}function F_e(t,e){return t!==e}function sx(t){return typeof t=="function"}function MD(t){if(t.$st===lZ)for(let e=0;e<t.$s.length&&(MD(t.$s[e]),t.$st!==lE);e++);t.$st===lE?_D(t):t.$st=Xm}function B_e(t){t.$h&&tp.call(t,!1),t.$d&&dZ(t),t.$eh=t[no]?t[no].$eh:null}function _D(t){let e=fa,r=Ss;fa=null,Ss=0;try{B_e(t);let n=ix(t,t.$c,t);oZ(t),!t.$e&&t.$i?PD.call(t,n):(t.$v=n,t.$i=!0)}catch(n){oZ(t),AD(t,n)}finally{fa=e,Ss=r,t.$st=Xm}}function oZ(t){if(fa){if(t.$s&&TD(t,Ss),t.$s&&Ss>0){t.$s.length=Ss+fa.length;for(let r=0;r<fa.length;r++)t.$s[Ss+r]=fa[r]}else t.$s=fa;let e;for(let r=Ss;r<t.$s.length;r++)e=t.$s[r],e.$o?e.$o.push(t):e.$o=[t]}else t.$s&&Ss<t.$s.length&&(TD(t,Ss),t.$s.length=Ss)}function pZ(t,e){if(!(t.$st>=e)&&(t.$e&&t.$st===Xm&&(Wm.push(t),oE||O_e()),t.$st=e,t.$o))for(let r=0;r<t.$o.length;r++)pZ(t.$o[r],lZ)}function TD(t,e){let r,n;for(let i=e;i<t.$s.length;i++)r=t.$s[i],r.$o&&(n=r.$o.indexOf(t),r.$o[n]=r.$o[r.$o.length-1],r.$o.pop())}function io(...t){}function pa(t){return t===null}function Jt(t){return typeof t>"u"}function OD(t){return pa(t)||Jt(t)}function ax(t){return t?.constructor===Object}function Rr(t){return typeof t=="number"&&!Number.isNaN(t)}function me(t){return typeof t=="string"}function pE(t){return typeof t=="boolean"}function hn(t){return typeof t=="function"}function Lr(t){return Array.isArray(t)}function mZ(t){return!!t?.[hZ]}function We(t,e,r,n){return t.addEventListener(e,r,n),Ne(()=>t.removeEventListener(e,r,n))}function gZ(...t){let e=new AbortController,r={signal:e.signal};function n(i){e.abort(i.target.reason)}for(let i of t){if(i.aborted){e.abort(i.reason);break}i.addEventListener("abort",n,r)}return e.signal}function hE(t){return!!t?.type.startsWith("pointer")}function Qm(t){return!!t?.type.startsWith("touch")}function DD(t){return/^(click|mouse)/.test(t?.type??"")}function Zm(t){return!!t?.type.startsWith("key")}function ND(t){return Zm(t)&&t.key==="Enter"}function mE(t){return Zm(t)&&(t.key==="Enter"||t.key===" ")}function FD(t){return t instanceof Node}function Ae(t,e,r){if(t)if(!r&&r!==""&&r!==0)t.removeAttribute(e);else{let n=r===!0?"":r+"";t.getAttribute(e)!==n&&t.setAttribute(e,n)}else return}function Gn(t,e,r){if(t)!r&&r!==0?t.style.removeProperty(e):t.style.setProperty(e,r+"");else return}var no,oE,CD,ro,Km,fa,Ss,Wm,ED,__e,Xm,lZ,lE,uE,RD,np,fZ,LD,V_e,hZ,Ie,cE,Ym,it,ip=yt(()=>{no=Symbol(0),oE=!1,CD=!1,ro=null,Km=null,fa=null,Ss=0,Wm=[],ED={},__e=()=>{},Xm=0,lZ=1,lE=2,uE=3;RD=function(){this[no]=null,this.$h=null,ro&&ro.append(this)},np=RD.prototype;np.$cx=ED;np.$eh=null;np.$c=null;np.$d=null;np.append=function(t){t[no]=this,this.$h?Array.isArray(this.$h)?this.$h.push(t):this.$h=[this.$h,t]:this.$h=t,t.$cx=t.$cx===ED?this.$cx:{...this.$cx,...t.$cx},this.$eh&&(t.$eh=t.$eh?[...t.$eh,...this.$eh]:this.$eh)};np.dispose=function(){tp.call(this)};fZ=function(e,r,n){RD.call(this),this.$st=r?lE:Xm,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=e,r&&(this.$c=r),n&&n.dirty&&(this.$ch=n.dirty)},LD=fZ.prototype;Object.setPrototypeOf(LD,np);LD.$ch=F_e;LD.call=dE;V_e=Event,hZ=Symbol("DOM_EVENT"),Ie=class extends V_e{[hZ]=!0;detail;triggers=new cE;get trigger(){return this.triggers.source}get originEvent(){return this.triggers.origin}get isOriginTrusted(){return this.triggers.origin?.isTrusted??!1}constructor(e,...r){super(e,r[0]),this.detail=r[0]?.detail;let n=r[0]?.trigger;n&&this.triggers.add(n)}},cE=class{chain=[];get source(){return this.chain[0]}get origin(){return this.chain[this.chain.length-1]}add(e){this.chain.push(e),mZ(e)&&this.chain.push(...e.triggers)}remove(e){return this.chain.splice(this.chain.indexOf(e),1)[0]}has(e){return this.chain.some(r=>r===e)}hasType(e){return!!this.findType(e)}findType(e){return this.chain.find(r=>r.type===e)}walk(e){for(let r of this.chain){let n=e(r);if(n)return[r,n]}}[Symbol.iterator](){return this.chain.values()}};Ym=class extends EventTarget{$ts__events;addEventListener(e,r,n){return super.addEventListener(e,r,n)}removeEventListener(e,r,n){return super.removeEventListener(e,r,n)}};it=class{#e;#t;get signal(){return this.#t.signal}constructor(e){this.#e=e,this.#t=new AbortController,Ne(this.abort.bind(this))}add(e,r,n){if(this.signal.aborted)throw Error("aborted");return this.#e.addEventListener(e,r,{...n,signal:n?.signal?gZ(this.signal,n.signal):this.signal}),this}remove(e,r){return this.#e.removeEventListener(e,r),this}abort(e){this.#t.abort(e)}}});function be(t,e){let r=fE(t,null,e),n=dE.bind(r);return n[no]=!0,n.set=PD.bind(r),n}function yZ(t){return sx(t)&&no in t}function ec(t,e){let r=fE(e?.initial,t,e),n=dE.bind(r);return n[no]=!0,n}function VD(t,e){let r=fE(null,function(){let i=t();return sx(i)&&Ne(i),null},void 0);return r.$e=!0,_D(r),tp.bind(r,!0)}function jD(t){return yZ(t)&&"set"in t}function rl(t){return{id:Symbol(),provide:t}}function vi(t,e,r=rp()){let n=!Jt(e);uZ(t.id,n?e:t.provide?.(),r)}function mr(t){return nx(t.id)}function so(t){return!Jt(nx(t.id))}function j_e(t){let e={};for(let r of Object.keys(t)){let n=t[r];e[r]=be(n,n)}return e}function $D(t,e){return ID(()=>{ox.$$=new gE(t,rp(),e);let r=new t;return ox.$$.component=r,ox.$$=null,r})}var U,yE,vE,lx,BD,gE,ox,Wn,bE=yt(()=>{ip();U=VD;yE=Symbol(0),vE=Symbol(0),lx=Symbol(0),BD={},gE=class{$ts__events;$ts__vars;[lx]=null;$el=be(null);el=null;scope=null;attachScope=null;connectScope=null;component=null;destroyed=!1;props=BD;attrs=null;styles=null;state;$state;#e=[];#t=[];#r=[];#n=[];constructor(e,r,n){this.scope=r,n?.scope&&n.scope.append(r);let i=e.state,s=e.props;if(i&&(this.$state=i.create(),this.state=new Proxy(this.$state,{get:(a,o)=>this.$state[o]()}),vi(i,this.$state)),s&&(this.props=j_e(s),n?.props))for(let a of Object.keys(n.props))this.props[a]?.set(n.props[a]);Ne(this.destroy.bind(this))}setup(){pn(()=>{for(let e of this.#e)e()},this.scope)}attach(e){this.el||(this.el=e,this.$el.set(e),pn(()=>{this.attachScope=yi(),pn(()=>{for(let r of this.#t)r(this.el);this.#i(),this.#s()},this.attachScope)},this.scope),e.dispatchEvent(new Event("attached")))}detach(){this.attachScope?.dispose(),this.attachScope=null,this.connectScope=null,this.el=null,this.$el.set(null)}connect(){!this.el||!this.attachScope||!this.#r.length||pn(()=>{this.connectScope=yi(),pn(()=>{for(let e of this.#r)e(this.el)},this.connectScope)},this.attachScope)}disconnect(){this.connectScope?.dispose(),this.connectScope=null}destroy(){if(this.destroyed)return;this.destroyed=!0,pn(()=>{for(let r of this.#n)r(this.el)},this.scope);let e=this.el;this.detach(),this.scope.dispose(),this.#e.length=0,this.#t.length=0,this.#r.length=0,this.#n.length=0,this.component=null,this.attrs=null,this.styles=null,this.props=BD,this.scope=null,this.state=BD,this.$state=null,e&&delete e.$}addHooks(e){e.onSetup&&this.#e.push(e.onSetup.bind(e)),e.onAttach&&this.#t.push(e.onAttach.bind(e)),e.onConnect&&this.#r.push(e.onConnect.bind(e)),e.onDestroy&&this.#n.push(e.onDestroy.bind(e))}#i(){if(this.attrs)for(let e of Object.keys(this.attrs))hn(this.attrs[e])?U(this.#a.bind(this,e)):Ae(this.el,e,this.attrs[e])}#s(){if(this.styles)for(let e of Object.keys(this.styles))hn(this.styles[e])?U(this.#o.bind(this,e)):Gn(this.el,e,this.styles[e])}#a(e){Ae(this.el,e,this.attrs[e].call(this.component))}#o(e){Gn(this.el,e,this.styles[e].call(this.component))}};ox={$$:null};Wn=class extends EventTarget{$$;get el(){return this.$$.el}get $el(){return this.$$.$el()}get scope(){return this.$$.scope}get attachScope(){return this.$$.attachScope}get connectScope(){return this.$$.connectScope}get $props(){return this.$$.props}get $state(){return this.$$.$state}get state(){return this.$$.state}constructor(){super(),ox.$$&&this.attach(ox)}attach({$$:e}){return this.$$=e,e.addHooks(this),this}addEventListener(e,r,n){this.listen(e,r,n)}removeEventListener(e,r,n){this.el?.removeEventListener(e,r,n)}setAttributes(e){this.$$.attrs||(this.$$.attrs={}),Object.assign(this.$$.attrs,e)}setStyles(e){this.$$.styles||(this.$$.styles={}),Object.assign(this.$$.styles,e)}setCSSVars(e){this.setStyles(e)}createEvent(e,...r){return new Ie(e,r[0])}dispatch(e,...r){if(!this.el)return!1;let n=e instanceof Event?e:new Ie(e,r[0]);return Object.defineProperty(n,"target",{get:()=>this.$$.component}),tl(()=>(this.$$[lx]?.(n),this.el.dispatchEvent(n)))}dispatchEvent(e){return this.dispatch(e)}listen(e,r,n){return this.el?We(this.el,e,r,n):io}}});function Ru(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function UD(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function zD(t){return vZ(t).replace(/\s/g,"")}function vZ(t){return xE(t.replace(/-./g,e=>" "+e[1].toUpperCase()))}function xE(t){return t.charAt(0).toUpperCase()+t.slice(1)}var qD=yt(()=>{});function $_e(t,...e){return $t.createElement(kE.Provider,{value:t},...e)}function HD(){return $t.useContext(kE).current}function GD(t){let e=HD();return $t.useMemo(()=>nx(t.id,e),[e])}function kZ(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function st(...t){return e=>t.forEach(r=>kZ(r,e))}function U_e(t,e){let r=$t.forwardRef((n,i)=>{let s=$t.useContext(kE),a=$t.useRef(null),o=$t.useRef();if(!o.current){let v=q_e(),b=wZ(t,v,n,s.current);v.component=b,o.current=v,a.current=b.scope}function l(){let v=o.current,b=s.current;if(window.cancelAnimationFrame(v.destroyId),v.destroyId=-1,v.component.$$.destroyed){let y=wZ(t,v,n,b);v.component=y,v.attached=!1,v.forwardRef=!1,a.current=y.scope}return v.el&&xZ(v,v.el),v.forwardRef||(kZ(i,v.component),v.forwardRef=!0),()=>wE(v)}function c(v){let b=o.current;if(!b.forwardRef){b.el=v;return}window.cancelAnimationFrame(b.refChangeId),b.refChangeId=window.requestAnimationFrame(()=>{let y=o.current;y.refChangeId=-1,y.el!==v&&(wE(y),v&&xZ(y,v),y.el=v)})}$t.useEffect(()=>{let v=o.current;return window.cancelAnimationFrame(v.destroyId),v.destroyId=-1,function(){hn(n.children)&&(window.cancelAnimationFrame(v.refChangeId),v.refChangeId=-1,window.cancelAnimationFrame(v.connectId),v.connectId=-1,window.cancelAnimationFrame(v.destroyId),v.destroyId=window.requestAnimationFrame(()=>{v.destroyId=-1,wE(v),v.component.$$.destroy(),v.component.$$[lx]=null,v.callbacks={},v.domCallbacks={},a.current=null}))}},[]),$t.useEffect(Cs);let u=o.current,{children:d,...f}=n,p={},h=u.prevProps,m=Object.keys(f);u.callbacks={};for(let v of[...h,...m])if(e.props.has(v))u.component.$props[v].set(Jt(f[v])?t.props?.[v]:f[v]);else if(e.events?.has(v)||e.eventsRE?.test(v))u.callbacks[v]=f[v];else if(e.domEvents?.has(v)||e.domEventsRE?.test(v)){let b=Ru(v.slice(2));u.domCallbacks[b]=f[v],m.includes(v)?u.el&&!u.listening?.has(b)&&(u.listening||(u.listening=new Set),u.listening.add(b),u.el.addEventListener(b,u.onDOMEvent)):(u.el?.removeEventListener(b,u.onDOMEvent),u.listening?.delete(b))}else p[v]=f[v];return u.prevProps=m,$_e(a,$t.createElement(z_e,{effect:l}),hn(d)?d?.({...p,suppressHydrationWarning:!0,ref:c},u.component):d)});return r.displayName=t.name+"Bridge",r}function z_e({effect:t}){return $t.useEffect(t,[]),null}function q_e(){let t={el:null,prevProps:[],callbacks:{},domCallbacks:{},refChangeId:-1,connectId:-1,destroyId:-1,attached:!1,forwardRef:!1,listening:null,onDOMEvent(e){let r=Jt(e.detail)?[e]:[e.detail,e];t.domCallbacks[e.type]?.(...r)}};return t}function xZ(t,e){if(!(t.el===e&&t.attached)){if(t.attached&&wE(t),t.domCallbacks){t.listening||(t.listening=new Set);for(let r of Object.keys(t.domCallbacks))t.listening.has(r)||(e.addEventListener(r,t.onDOMEvent),t.listening.add(r))}t.component.$$.attach(e),t.connectId=window.requestAnimationFrame(()=>{t.component.$$.connect(),t.connectId=-1}),t.attached=!0}}function wE(t){if(t.attached&&(window.cancelAnimationFrame(t.connectId),t.connectId=-1,t.component.$$.detach(),t.attached=!1,t.el&&t.listening)){for(let e of t.listening)t.el.removeEventListener(e,t.onDOMEvent);t.listening.clear()}}function H_e(t){let e=bZ.get(t.type),r=Jt(t.detail)?[t]:[t.detail,t];e||bZ.set(t.type,e=`on${zD(t.type)}`),this.callbacks[e]?.(...r)}function wZ(t,e,r,n){let i=$D(t,{props:r,scope:n});return i.$$[lx]=H_e.bind(e),i.$$.setup(),i}function tc(t){return GD(t)}function Ut(t,e){let[,r]=$t.useState();return $t.useEffect(()=>VD(()=>{t(),r({})}),[e??t]),t()}function WD(t){let[,e]=$t.useState(),r=$t.useRef(null);return r.current==null&&(r.current={state:{},$update:be({}),props:new Set}),$t.useEffect(()=>{let{state:n,$update:i,props:s}=r.current;return U(()=>{for(let a of s){let o=t[a]();n[a]=Lr(o)?[...o]:o}i(),e({})})},[t]),$t.useMemo(()=>{let{state:n,$update:i,props:s}=r.current,a=!1;return s.clear(),new Proxy(n,{get(o,l){if(!s.has(l)&&l in t){s.add(l);let c=t[l]();n[l]=Lr(c)?[...c]:c,a||(i.set({}),a=!0,queueMicrotask(()=>a=!1))}return n[l]},set(o,l,c){return l in t||(n[l]=c),!0}})},[t])}function ze(t,e){return U_e(t,{props:new Set(Object.keys(t.props||{})),events:new Set(e?.events),eventsRE:e?.eventsRegex,domEvents:e?.domEvents,domEventsRE:e?.domEventsRegex})}var $t,kE,bZ,cx=yt(()=>{$t=Z(Te(),1);bE();qD();ip();kE=$t.createContext({current:null});kE.displayName="Scope";bZ=new Map});function ht(t,e,r){t[yE]||(t[yE]=new Set),t[yE].add(e)}function $r(t,e,r){t[vE]||(t[vE]=new Set),t[vE].add(e)}function Jm(t){return mr(t)}var je,ao,oo=yt(()=>{bE();bE();ip();ip();je=class extends Wn{subscribe(e){return pn(()=>U(()=>e(this.state)),this.$$.scope)}destroy(){this.$$.destroy()}};ao=class{id=Symbol(0);record;#e;constructor(e){this.record=e,this.#e=Object.getOwnPropertyDescriptors(e)}create(){let e={},r=new Proxy(e,{get:(n,i)=>e[i]()});for(let n of Object.keys(this.record)){let i=this.#e[n].get;e[n]=i?ec(i.bind(r)):be(this.record[n])}return e}reset(e,r){for(let n of Object.keys(e))!this.#e[n].get&&(!r||r(n))&&e[n].set(this.record[n])}}});function ux(t){return t?"true":"false"}function KD(t){return Object.keys(t)}function rc(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}function SZ(t){return new Promise(e=>setTimeout(e,t))}function sp(t){let e=-1,r;function n(...i){r=i,!(e>=0)&&(e=window.requestAnimationFrame(()=>{t.apply(this,r),e=-1,r=void 0}))}return n}function CZ(t,e){return new Promise(r=>{G_e(n=>{t?.(n),r()},e)})}var G_e,lo=yt(()=>{ip();ip();qD();G_e=typeof window<"u"?"requestIdleCallback"in window?window.requestIdleCallback:t=>window.setTimeout(t,1):io});var LZ={};ln(LZ,{Icon$0:()=>X_e,Icon$104:()=>TOe,Icon$105:()=>EOe,Icon$11:()=>J_e,Icon$13:()=>eOe,Icon$16:()=>tOe,Icon$19:()=>rOe,Icon$22:()=>nOe,Icon$24:()=>RZ,Icon$26:()=>sOe,Icon$27:()=>aOe,Icon$31:()=>oOe,Icon$33:()=>lOe,Icon$34:()=>cOe,Icon$35:()=>uOe,Icon$39:()=>dOe,Icon$40:()=>fOe,Icon$5:()=>Q_e,Icon$53:()=>pOe,Icon$54:()=>hOe,Icon$56:()=>mOe,Icon$59:()=>gOe,Icon$60:()=>yOe,Icon$61:()=>vOe,Icon$62:()=>bOe,Icon$63:()=>xOe,Icon$74:()=>wOe,Icon$77:()=>kOe,Icon$8:()=>Z_e,Icon$81:()=>SOe,Icon$88:()=>COe,chromecast:()=>iOe,fscreen:()=>nc,functionDebounce:()=>dx,functionThrottle:()=>ic,r:()=>YD});function W_e(t,e,r){var n=null,i=null,s=r&&r.leading,a=r&&r.trailing;s==null&&(s=!0),a==null&&(a=!s),s==!0&&(a=!1);var o=function(){n&&(clearTimeout(n),n=null)},l=function(){var u=i;o(),u&&u()},c=function(){var u=s&&!n,d=this,f=arguments;if(i=function(){return t.apply(d,f)},n||(n=setTimeout(function(){if(n=null,a)return i()},e)),u)return u=!1,i()};return c.cancel=o,c.flush=l,c}function K_e(t,e,r){var n=null,i=null,s=function(){n&&(clearTimeout(n),i=null,n=null)},a=function(){var l=i;s(),l&&l()},o=function(){if(!e)return t.apply(this,arguments);var l=this,c=arguments,u=r&&!n;if(s(),i=function(){t.apply(l,c)},n=setTimeout(function(){if(n=null,!u){var d=i;return i=null,d()}},e),u)return i()};return o.cancel=s,o.flush=a,o}var Ts,TZ,EZ,IZ,zi,ha,nc,ic,dx,AZ,PZ,SE,CE,Y_e,YD,X_e,Q_e,Z_e,J_e,eOe,tOe,rOe,nOe,RZ,iOe,sOe,aOe,oOe,lOe,cOe,uOe,dOe,fOe,pOe,hOe,mOe,gOe,yOe,vOe,bOe,xOe,wOe,kOe,SOe,COe,TOe,EOe,XD=yt(()=>{"use client";Ts={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},TZ=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],EZ=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],IZ=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],zi=typeof window<"u"&&typeof window.document<"u"?window.document:{},ha="fullscreenEnabled"in zi&&Object.keys(Ts)||TZ[0]in zi&&TZ||EZ[0]in zi&&EZ||IZ[0]in zi&&IZ||[],nc={requestFullscreen:function(t){return t[ha[Ts.requestFullscreen]]()},requestFullscreenFunction:function(t){return t[ha[Ts.requestFullscreen]]},get exitFullscreen(){return zi[ha[Ts.exitFullscreen]].bind(zi)},get fullscreenPseudoClass(){return":"+ha[Ts.fullscreen]},addEventListener:function(t,e,r){return zi.addEventListener(ha[Ts[t]],e,r)},removeEventListener:function(t,e,r){return zi.removeEventListener(ha[Ts[t]],e,r)},get fullscreenEnabled(){return!!zi[ha[Ts.fullscreenEnabled]]},set fullscreenEnabled(t){},get fullscreenElement(){return zi[ha[Ts.fullscreenElement]]},set fullscreenElement(t){},get onfullscreenchange(){return zi[("on"+ha[Ts.fullscreenchange]).toLowerCase()]},set onfullscreenchange(t){return zi[("on"+ha[Ts.fullscreenchange]).toLowerCase()]=t},get onfullscreenerror(){return zi[("on"+ha[Ts.fullscreenerror]).toLowerCase()]},set onfullscreenerror(t){return zi[("on"+ha[Ts.fullscreenerror]).toLowerCase()]=t}},ic=W_e;dx=K_e;AZ=t=>typeof t=="object"&&t!=null&&t.nodeType===1,PZ=(t,e)=>(!e||t!=="hidden")&&t!=="visible"&&t!=="clip",SE=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){let r=getComputedStyle(t,null);return PZ(r.overflowY,e)||PZ(r.overflowX,e)||(n=>{let i=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)})(t)}return!1},CE=(t,e,r,n,i,s,a,o)=>s<t&&a>e||s>t&&a<e?0:s<=t&&o<=r||a>=e&&o>=r?s-t-n:a>e&&o<r||s<t&&o>r?a-e+i:0,Y_e=t=>{let e=t.parentElement;return e??(t.getRootNode().host||null)},YD=(t,e)=>{var r,n,i,s;if(typeof document>"u")return[];let{scrollMode:a,block:o,inline:l,boundary:c,skipOverflowHiddenElements:u}=e,d=typeof c=="function"?c:G=>G!==c;if(!AZ(t))throw new TypeError("Invalid target");let f=document.scrollingElement||document.documentElement,p=[],h=t;for(;AZ(h)&&d(h);){if(h=Y_e(h),h===f){p.push(h);break}h!=null&&h===document.body&&SE(h)&&!SE(document.documentElement)||h!=null&&SE(h,u)&&p.push(h)}let m=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,v=(s=(i=window.visualViewport)==null?void 0:i.height)!=null?s:innerHeight,{scrollX:b,scrollY:y}=window,{height:x,width:w,top:C,right:O,bottom:S,left:T}=t.getBoundingClientRect(),{top:E,right:P,bottom:R,left:I}=(G=>{let V=window.getComputedStyle(G);return{top:parseFloat(V.scrollMarginTop)||0,right:parseFloat(V.scrollMarginRight)||0,bottom:parseFloat(V.scrollMarginBottom)||0,left:parseFloat(V.scrollMarginLeft)||0}})(t),B=o==="start"||o==="nearest"?C-E:o==="end"?S+R:C+x/2-E+R,M=l==="center"?T+w/2-I+P:l==="end"?O+P:T-I,z=[];for(let G=0;G<p.length;G++){let V=p[G],{height:K,width:de,top:Me,right:pt,bottom:At,left:Ue}=V.getBoundingClientRect();if(a==="if-needed"&&C>=0&&T>=0&&S<=v&&O<=m&&(V===f&&!SE(V)||C>=Me&&S<=At&&T>=Ue&&O<=pt))return z;let Gt=getComputedStyle(V),Kr=parseInt(Gt.borderLeftWidth,10),Di=parseInt(Gt.borderTopWidth,10),lt=parseInt(Gt.borderRightWidth,10),ps=parseInt(Gt.borderBottomWidth,10),Ir=0,Ar=0,Zs="offsetWidth"in V?V.offsetWidth-V.clientWidth-Kr-lt:0,ui="offsetHeight"in V?V.offsetHeight-V.clientHeight-Di-ps:0,xf="offsetWidth"in V?V.offsetWidth===0?0:de/V.offsetWidth:0,Fl="offsetHeight"in V?V.offsetHeight===0?0:K/V.offsetHeight:0;if(f===V)Ir=o==="start"?B:o==="end"?B-v:o==="nearest"?CE(y,y+v,v,Di,ps,y+B,y+B+x,x):B-v/2,Ar=l==="start"?M:l==="center"?M-m/2:l==="end"?M-m:CE(b,b+m,m,Kr,lt,b+M,b+M+w,w),Ir=Math.max(0,Ir+y),Ar=Math.max(0,Ar+b);else{Ir=o==="start"?B-Me-Di:o==="end"?B-At+ps+ui:o==="nearest"?CE(Me,At,K,Di,ps+ui,B,B+x,x):B-(Me+K/2)+ui/2,Ar=l==="start"?M-Ue-Kr:l==="center"?M-(Ue+de/2)+Zs/2:l==="end"?M-pt+lt+Zs:CE(Ue,pt,de,Kr,lt+Zs,M,M+w,w);let{scrollLeft:cu,scrollTop:Uh}=V;Ir=Fl===0?0:Math.max(0,Math.min(Uh+Ir/Fl,V.scrollHeight-K/Fl+ui)),Ar=xf===0?0:Math.max(0,Math.min(cu+Ar/xf,V.scrollWidth-de/xf+Zs)),B+=Uh-Ir,M+=cu-Ar}z.push({el:V,top:Ir,left:Ar})}return z},X_e='<path fill-rule="evenodd" clip-rule="evenodd" d="M15.0007 28.7923C15.0007 29.0152 14.9774 29.096 14.9339 29.1775C14.8903 29.259 14.8263 29.323 14.7449 29.3665C14.6634 29.4101 14.5826 29.4333 14.3597 29.4333H12.575C12.3521 29.4333 12.2713 29.4101 12.1898 29.3665C12.1083 29.323 12.0443 29.259 12.0008 29.1775C11.9572 29.096 11.934 29.0152 11.934 28.7923V12.2993L5.97496 12.3C5.75208 12.3 5.67125 12.2768 5.58977 12.2332C5.50829 12.1896 5.44434 12.1257 5.40077 12.0442C5.35719 11.9627 5.33398 11.8819 5.33398 11.659V9.87429C5.33398 9.65141 5.35719 9.57059 5.40077 9.48911C5.44434 9.40762 5.50829 9.34368 5.58977 9.3001C5.67125 9.25652 5.75208 9.23332 5.97496 9.23332H26.0263C26.2492 9.23332 26.33 9.25652 26.4115 9.3001C26.493 9.34368 26.557 9.40762 26.6005 9.48911C26.6441 9.57059 26.6673 9.65141 26.6673 9.87429V11.659C26.6673 11.8819 26.6441 11.9627 26.6005 12.0442C26.557 12.1257 26.493 12.1896 26.4115 12.2332C26.33 12.2768 26.2492 12.3 26.0263 12.3L20.067 12.2993L20.0673 28.7923C20.0673 29.0152 20.0441 29.096 20.0005 29.1775C19.957 29.259 19.893 29.323 19.8115 29.3665C19.73 29.4101 19.6492 29.4333 19.4263 29.4333H17.6416C17.4187 29.4333 17.3379 29.4101 17.2564 29.3665C17.175 29.323 17.111 29.259 17.0674 29.1775C17.0239 29.096 17.0007 29.0152 17.0007 28.7923L17 22.7663H15L15.0007 28.7923Z" fill="currentColor"/> <path d="M16.0007 7.89998C17.4734 7.89998 18.6673 6.70608 18.6673 5.23332C18.6673 3.76056 17.4734 2.56665 16.0007 2.56665C14.5279 2.56665 13.334 3.76056 13.334 5.23332C13.334 6.70608 14.5279 7.89998 16.0007 7.89998Z" fill="currentColor"/>',Q_e='<path d="M5.33334 6.00001C5.33334 5.63182 5.63181 5.33334 6 5.33334H26C26.3682 5.33334 26.6667 5.63182 26.6667 6.00001V20.6667C26.6667 21.0349 26.3682 21.3333 26 21.3333H23.7072C23.4956 21.3333 23.2966 21.233 23.171 21.0628L22.1859 19.7295C21.8607 19.2894 22.1749 18.6667 22.7221 18.6667H23.3333C23.7015 18.6667 24 18.3682 24 18V8.66668C24 8.29849 23.7015 8.00001 23.3333 8.00001H8.66667C8.29848 8.00001 8 8.29849 8 8.66668V18C8 18.3682 8.29848 18.6667 8.66667 18.6667H9.29357C9.84072 18.6667 10.1549 19.2894 9.82976 19.7295L8.84467 21.0628C8.71898 21.233 8.52 21.3333 8.30848 21.3333H6C5.63181 21.3333 5.33334 21.0349 5.33334 20.6667V6.00001Z" fill="currentColor"/> <path d="M8.78528 25.6038C8.46013 26.0439 8.77431 26.6667 9.32147 26.6667L22.6785 26.6667C23.2256 26.6667 23.5398 26.0439 23.2146 25.6038L16.5358 16.5653C16.2693 16.2046 15.73 16.2047 15.4635 16.5653L8.78528 25.6038Z" fill="currentColor"/>',Z_e='<path d="M17.4853 18.9093C17.4853 19.0281 17.6289 19.0875 17.7129 19.0035L22.4185 14.2979C22.6788 14.0376 23.1009 14.0376 23.3613 14.2979L24.7755 15.7122C25.0359 15.9725 25.0359 16.3946 24.7755 16.655L16.2902 25.1403C16.0299 25.4006 15.6078 25.4006 15.3474 25.1403L13.9332 23.726L13.9319 23.7247L6.86189 16.6547C6.60154 16.3944 6.60154 15.9723 6.86189 15.7119L8.2761 14.2977C8.53645 14.0373 8.95856 14.0373 9.21891 14.2977L13.9243 19.0031C14.0083 19.0871 14.1519 19.0276 14.1519 18.9088L14.1519 6.00004C14.1519 5.63185 14.4504 5.33337 14.8186 5.33337L16.8186 5.33337C17.1868 5.33337 17.4853 5.63185 17.4853 6.00004L17.4853 18.9093Z" fill="currentColor"/>',J_e='<path d="M13.0908 14.3334C12.972 14.3334 12.9125 14.1898 12.9965 14.1058L17.7021 9.40022C17.9625 9.13987 17.9625 8.71776 17.7021 8.45741L16.2879 7.04319C16.0275 6.78284 15.6054 6.78284 15.3451 7.04319L6.8598 15.5285C6.59945 15.7888 6.59945 16.2109 6.8598 16.4713L8.27401 17.8855L8.27536 17.8868L15.3453 24.9568C15.6057 25.2172 16.0278 25.2172 16.2881 24.9568L17.7024 23.5426C17.9627 23.2822 17.9627 22.8601 17.7024 22.5998L12.9969 17.8944C12.9129 17.8104 12.9724 17.6668 13.0912 17.6668L26 17.6668C26.3682 17.6668 26.6667 17.3683 26.6667 17.0001V15.0001C26.6667 14.6319 26.3682 14.3334 26 14.3334L13.0908 14.3334Z" fill="currentColor"/>',eOe='<path d="M14.1521 13.0929C14.1521 12.9741 14.0085 12.9147 13.9245 12.9987L9.21891 17.7043C8.95856 17.9646 8.53645 17.9646 8.2761 17.7043L6.86189 16.29C6.60154 16.0297 6.60154 15.6076 6.86189 15.3472L15.3472 6.86195C15.6075 6.6016 16.0296 6.6016 16.29 6.86195L17.7042 8.27616L17.7055 8.27751L24.7755 15.3475C25.0359 15.6078 25.0359 16.0299 24.7755 16.2903L23.3613 17.7045C23.1009 17.9649 22.6788 17.9649 22.4185 17.7045L17.7131 12.9991C17.6291 12.9151 17.4855 12.9746 17.4855 13.0934V26.0022C17.4855 26.3704 17.187 26.6688 16.8188 26.6688H14.8188C14.4506 26.6688 14.1521 26.3704 14.1521 26.0022L14.1521 13.0929Z" fill="currentColor"/>',tOe='<path d="M16.6927 25.3346C16.3245 25.3346 16.026 25.0361 16.026 24.6679L16.026 7.3346C16.026 6.96641 16.3245 6.66794 16.6927 6.66794L18.6927 6.66794C19.0609 6.66794 19.3594 6.96642 19.3594 7.3346L19.3594 24.6679C19.3594 25.0361 19.0609 25.3346 18.6927 25.3346H16.6927Z" fill="currentColor"/> <path d="M24.026 25.3346C23.6578 25.3346 23.3594 25.0361 23.3594 24.6679L23.3594 7.3346C23.3594 6.96641 23.6578 6.66794 24.026 6.66794L26.026 6.66794C26.3942 6.66794 26.6927 6.96642 26.6927 7.3346V24.6679C26.6927 25.0361 26.3942 25.3346 26.026 25.3346H24.026Z" fill="currentColor"/> <path d="M5.48113 23.9407C5.38584 24.2963 5.59689 24.6619 5.95254 24.7572L7.88439 25.2748C8.24003 25.3701 8.60559 25.159 8.70089 24.8034L13.1871 8.06067C13.2824 7.70503 13.0713 7.33947 12.7157 7.24417L10.7838 6.72654C10.4282 6.63124 10.0626 6.8423 9.96733 7.19794L5.48113 23.9407Z" fill="currentColor"/>',rOe='<path fill-rule="evenodd" clip-rule="evenodd" d="M24.9266 7.57992C25.015 7.60672 25.0886 7.64746 25.2462 7.80506L26.956 9.51488C27.1136 9.67248 27.1543 9.74604 27.1811 9.83447C27.2079 9.9229 27.2079 10.0133 27.1811 10.1018C27.1543 10.1902 27.1136 10.2638 26.956 10.4214L13.1822 24.1951C13.0246 24.3527 12.951 24.3935 12.8626 24.4203C12.797 24.4402 12.7304 24.4453 12.6642 24.4357L12.7319 24.4203C12.6435 24.4471 12.553 24.4471 12.4646 24.4203C12.3762 24.3935 12.3026 24.3527 12.145 24.1951L5.04407 17.0942C4.88647 16.9366 4.84573 16.863 4.81893 16.7746C4.79213 16.6862 4.79213 16.5957 4.81893 16.5073C4.84573 16.4189 4.88647 16.3453 5.04407 16.1877L6.7539 14.4779C6.9115 14.3203 6.98506 14.2796 7.07349 14.2528C7.16191 14.226 7.25235 14.226 7.34078 14.2528C7.42921 14.2796 7.50277 14.3203 7.66037 14.4779L12.6628 19.4808L24.3397 7.80506C24.4973 7.64746 24.5709 7.60672 24.6593 7.57992C24.7477 7.55311 24.8382 7.55311 24.9266 7.57992Z" fill="currentColor"/>',nOe='<path d="M17.947 16.095C17.999 16.043 17.999 15.9585 17.947 15.9065L11.6295 9.58899C11.3691 9.32864 11.3691 8.90653 11.6295 8.64618L13.2323 7.04341C13.4926 6.78306 13.9147 6.78306 14.1751 7.04341L21.0289 13.8973C21.0392 13.9064 21.0493 13.9158 21.0591 13.9257L22.6619 15.5285C22.9223 15.7888 22.9223 16.2109 22.6619 16.4713L14.1766 24.9565C13.9163 25.2169 13.4942 25.2169 13.2338 24.9565L11.631 23.3538C11.3707 23.0934 11.3707 22.6713 11.631 22.411L17.947 16.095Z" fill="currentColor"/>',RZ='<path fill-rule="evenodd" clip-rule="evenodd" d="M6 7C5.63181 7 5.33333 7.29848 5.33333 7.66667V14.8667C5.33333 14.9403 5.39361 14.9999 5.46724 15.0009C10.8844 15.0719 15.2614 19.449 15.3325 24.8661C15.3334 24.9397 15.393 25 15.4667 25H26C26.3682 25 26.6667 24.7015 26.6667 24.3333V7.66667C26.6667 7.29848 26.3682 7 26 7H6ZM17.0119 22.2294C17.0263 22.29 17.0802 22.3333 17.1425 22.3333H23.3333C23.7015 22.3333 24 22.0349 24 21.6667V10.3333C24 9.96514 23.7015 9.66667 23.3333 9.66667H8.66667C8.29848 9.66667 8 9.96514 8 10.3333V13.1909C8 13.2531 8.04332 13.3071 8.10392 13.3214C12.5063 14.3618 15.9715 17.827 17.0119 22.2294Z" fill="currentColor"/> <path d="M13.2 25C13.2736 25 13.3334 24.9398 13.3322 24.8661C13.2615 20.5544 9.77889 17.0718 5.46718 17.0011C5.39356 16.9999 5.33333 17.0597 5.33333 17.1333V18.8667C5.33333 18.9403 5.39348 18.9999 5.4671 19.0015C8.67465 19.0716 11.2617 21.6587 11.3319 24.8662C11.3335 24.9399 11.393 25 11.4667 25H13.2Z" fill="currentColor"/> <path d="M5.33333 21.1333C5.33333 21.0597 5.39332 20.9998 5.46692 21.0022C7.57033 21.0712 9.26217 22.763 9.33114 24.8664C9.33356 24.94 9.27364 25 9.2 25H6C5.63181 25 5.33333 24.7015 5.33333 24.3333V21.1333Z" fill="currentColor"/>',iOe=Object.freeze({__proto__:null,default:RZ}),sOe='<path d="M8 28.0003C8 27.6321 8.29848 27.3336 8.66667 27.3336H23.3333C23.7015 27.3336 24 27.6321 24 28.0003V29.3336C24 29.7018 23.7015 30.0003 23.3333 30.0003H8.66667C8.29848 30.0003 8 29.7018 8 29.3336V28.0003Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M4.66602 6.66699C4.29783 6.66699 3.99935 6.96547 3.99935 7.33366V24.667C3.99935 25.0352 4.29783 25.3337 4.66602 25.3337H27.3327C27.7009 25.3337 27.9994 25.0352 27.9994 24.667V7.33366C27.9994 6.96547 27.7009 6.66699 27.3327 6.66699H4.66602ZM8.66659 21.3333C8.2984 21.3333 7.99992 21.0349 7.99992 20.6667V11.3333C7.99992 10.9651 8.2984 10.6667 8.66659 10.6667H13.9999C14.3681 10.6667 14.6666 10.9651 14.6666 11.3333V12.6667C14.6666 13.0349 14.3681 13.3333 13.9999 13.3333H10.7999C10.7263 13.3333 10.6666 13.393 10.6666 13.4667V18.5333C10.6666 18.607 10.7263 18.6667 10.7999 18.6667H13.9999C14.3681 18.6667 14.6666 18.9651 14.6666 19.3333V20.6667C14.6666 21.0349 14.3681 21.3333 13.9999 21.3333H8.66659ZM17.9999 21.3333C17.6317 21.3333 17.3333 21.0349 17.3333 20.6667V11.3333C17.3333 10.9651 17.6317 10.6667 17.9999 10.6667H23.3333C23.7014 10.6667 23.9999 10.9651 23.9999 11.3333V12.6667C23.9999 13.0349 23.7014 13.3333 23.3333 13.3333H20.1333C20.0596 13.3333 19.9999 13.393 19.9999 13.4667V18.5333C19.9999 18.607 20.0596 18.6667 20.1333 18.6667H23.3333C23.7014 18.6667 23.9999 18.9651 23.9999 19.3333V20.6667C23.9999 21.0349 23.7014 21.3333 23.3333 21.3333H17.9999Z" fill="currentColor"/>',aOe='<path fill-rule="evenodd" clip-rule="evenodd" d="M4.6661 6.66699C4.29791 6.66699 3.99943 6.96547 3.99943 7.33366V24.667C3.99943 25.0352 4.29791 25.3337 4.6661 25.3337H27.3328C27.701 25.3337 27.9994 25.0352 27.9994 24.667V7.33366C27.9994 6.96547 27.701 6.66699 27.3328 6.66699H4.6661ZM8.66667 21.3333C8.29848 21.3333 8 21.0349 8 20.6667V11.3333C8 10.9651 8.29848 10.6667 8.66667 10.6667H14C14.3682 10.6667 14.6667 10.9651 14.6667 11.3333V12.6667C14.6667 13.0349 14.3682 13.3333 14 13.3333H10.8C10.7264 13.3333 10.6667 13.393 10.6667 13.4667V18.5333C10.6667 18.607 10.7264 18.6667 10.8 18.6667H14C14.3682 18.6667 14.6667 18.9651 14.6667 19.3333V20.6667C14.6667 21.0349 14.3682 21.3333 14 21.3333H8.66667ZM18 21.3333C17.6318 21.3333 17.3333 21.0349 17.3333 20.6667V11.3333C17.3333 10.9651 17.6318 10.6667 18 10.6667H23.3333C23.7015 10.6667 24 10.9651 24 11.3333V12.6667C24 13.0349 23.7015 13.3333 23.3333 13.3333H20.1333C20.0597 13.3333 20 13.393 20 13.4667V18.5333C20 18.607 20.0597 18.6667 20.1333 18.6667H23.3333C23.7015 18.6667 24 18.9651 24 19.3333V20.6667C24 21.0349 23.7015 21.3333 23.3333 21.3333H18Z" fill="currentColor"/>',oOe='<path d="M14.2225 13.7867C14.3065 13.8706 14.4501 13.8112 14.4501 13.6924V5.99955C14.4501 5.63136 14.7486 5.33289 15.1167 5.33289H16.8501C17.2183 5.33289 17.5167 5.63136 17.5167 5.99955V13.6916C17.5167 13.8104 17.6604 13.8699 17.7444 13.7859L19.9433 11.5869C20.2037 11.3266 20.6258 11.3266 20.8861 11.5869L22.1118 12.8126C22.3722 13.0729 22.3722 13.4951 22.1118 13.7554L16.4549 19.4123C16.1946 19.6726 15.772 19.6731 15.5116 19.4128L9.85479 13.7559C9.59444 13.4956 9.59444 13.0734 9.85479 12.8131L11.0804 11.5874C11.3408 11.3271 11.7629 11.3271 12.0233 11.5874L14.2225 13.7867Z" fill="currentColor"/> <path d="M5.99998 20.267C5.63179 20.267 5.33331 20.5654 5.33331 20.9336V25.9997C5.33331 26.3678 5.63179 26.6663 5.99998 26.6663H26C26.3682 26.6663 26.6666 26.3678 26.6666 25.9997V20.9336C26.6666 20.5654 26.3682 20.267 26 20.267H24.2666C23.8985 20.267 23.6 20.5654 23.6 20.9336V22.9333C23.6 23.3014 23.3015 23.5999 22.9333 23.5999H9.06638C8.69819 23.5999 8.39972 23.3014 8.39972 22.9333V20.9336C8.39972 20.5654 8.10124 20.267 7.73305 20.267H5.99998Z" fill="currentColor"/>',lOe='<path d="M16 20C18.2091 20 20 18.2092 20 16C20 13.7909 18.2091 12 16 12C13.7909 12 12 13.7909 12 16C12 18.2092 13.7909 20 16 20Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M28 16.0058C28 18.671 23.5 25.3334 16 25.3334C8.5 25.3334 4 18.6762 4 16.0058C4 13.3354 8.50447 6.66669 16 6.66669C23.4955 6.66669 28 13.3406 28 16.0058ZM25.3318 15.9934C25.3328 16.0017 25.3328 16.0099 25.3318 16.0182C25.3274 16.0571 25.3108 16.1728 25.2485 16.3708C25.1691 16.6229 25.0352 16.9462 24.8327 17.3216C24.4264 18.0749 23.7969 18.9398 22.9567 19.754C21.2791 21.3798 18.9148 22.6667 16 22.6667C13.0845 22.6667 10.7202 21.3805 9.04298 19.7557C8.20295 18.9419 7.57362 18.0773 7.16745 17.3241C6.96499 16.9486 6.83114 16.6252 6.75172 16.3729C6.67942 16.1431 6.66856 16.0243 6.66695 16.0066L6.66695 16.005C6.66859 15.9871 6.67951 15.8682 6.75188 15.6383C6.83145 15.3854 6.96554 15.0614 7.16831 14.6853C7.57507 13.9306 8.20514 13.0644 9.04577 12.249C10.7245 10.6208 13.0886 9.33335 16 9.33335C18.9108 9.33335 21.2748 10.6215 22.9539 12.2507C23.7947 13.0664 24.4249 13.933 24.8318 14.6877C25.0346 15.0639 25.1688 15.3878 25.2483 15.6404C25.3107 15.8386 25.3274 15.9545 25.3318 15.9934Z" fill="currentColor"/>',cOe='<path d="M15.8747 8.11857C16.3148 7.79342 16.9375 8.10759 16.9375 8.65476V14.2575C16.9375 14.3669 17.0621 14.4297 17.1501 14.3647L25.6038 8.11857C26.0439 7.79342 26.6667 8.10759 26.6667 8.65476V23.3451C26.6667 23.8923 26.0439 24.2064 25.6038 23.8813L17.1501 17.6346C17.0621 17.5695 16.9375 17.6324 16.9375 17.7418L16.9375 23.3451C16.9375 23.8923 16.3147 24.2064 15.8747 23.8813L5.93387 16.5358C5.57322 16.2693 5.57323 15.7299 5.93389 15.4634L15.8747 8.11857Z" fill="currentColor"/>',uOe='<path d="M16.1253 8.11866C15.6852 7.7935 15.0625 8.10768 15.0625 8.65484V14.2576C15.0625 14.367 14.9379 14.4298 14.8499 14.3648L6.39615 8.11866C5.95607 7.7935 5.33331 8.10768 5.33331 8.65484V23.3452C5.33331 23.8923 5.9561 24.2065 6.39617 23.8813L14.8499 17.6347C14.9379 17.5696 15.0625 17.6325 15.0625 17.7419L15.0625 23.3452C15.0625 23.8923 15.6853 24.2065 16.1253 23.8813L26.0661 16.5358C26.4268 16.2694 26.4268 15.73 26.0661 15.4635L16.1253 8.11866Z" fill="currentColor"/>',dOe='<path d="M19.3334 13.3333C18.9652 13.3333 18.6667 13.0349 18.6667 12.6667L18.6667 7.33333C18.6667 6.96514 18.9652 6.66666 19.3334 6.66666H21.3334C21.7015 6.66666 22 6.96514 22 7.33333V9.86666C22 9.9403 22.0597 10 22.1334 10L24.6667 10C25.0349 10 25.3334 10.2985 25.3334 10.6667V12.6667C25.3334 13.0349 25.0349 13.3333 24.6667 13.3333L19.3334 13.3333Z" fill="currentColor"/> <path d="M13.3334 19.3333C13.3334 18.9651 13.0349 18.6667 12.6667 18.6667H7.33335C6.96516 18.6667 6.66669 18.9651 6.66669 19.3333V21.3333C6.66669 21.7015 6.96516 22 7.33335 22H9.86669C9.94032 22 10 22.0597 10 22.1333L10 24.6667C10 25.0349 10.2985 25.3333 10.6667 25.3333H12.6667C13.0349 25.3333 13.3334 25.0349 13.3334 24.6667L13.3334 19.3333Z" fill="currentColor"/> <path d="M18.6667 24.6667C18.6667 25.0349 18.9652 25.3333 19.3334 25.3333H21.3334C21.7015 25.3333 22 25.0349 22 24.6667V22.1333C22 22.0597 22.0597 22 22.1334 22H24.6667C25.0349 22 25.3334 21.7015 25.3334 21.3333V19.3333C25.3334 18.9651 25.0349 18.6667 24.6667 18.6667L19.3334 18.6667C18.9652 18.6667 18.6667 18.9651 18.6667 19.3333L18.6667 24.6667Z" fill="currentColor"/> <path d="M10.6667 13.3333H12.6667C13.0349 13.3333 13.3334 13.0349 13.3334 12.6667L13.3334 10.6667V7.33333C13.3334 6.96514 13.0349 6.66666 12.6667 6.66666H10.6667C10.2985 6.66666 10 6.96514 10 7.33333L10 9.86666C10 9.9403 9.94033 10 9.86669 10L7.33335 10C6.96516 10 6.66669 10.2985 6.66669 10.6667V12.6667C6.66669 13.0349 6.96516 13.3333 7.33335 13.3333L10.6667 13.3333Z" fill="currentColor"/>',fOe='<path d="M25.3299 7.26517C25.2958 6.929 25.0119 6.66666 24.6667 6.66666H19.3334C18.9652 6.66666 18.6667 6.96514 18.6667 7.33333V9.33333C18.6667 9.70152 18.9652 10 19.3334 10L21.8667 10C21.9403 10 22 10.0597 22 10.1333V12.6667C22 13.0349 22.2985 13.3333 22.6667 13.3333H24.6667C25.0349 13.3333 25.3334 13.0349 25.3334 12.6667V7.33333C25.3334 7.31032 25.3322 7.28758 25.3299 7.26517Z" fill="currentColor"/> <path d="M22 21.8667C22 21.9403 21.9403 22 21.8667 22L19.3334 22C18.9652 22 18.6667 22.2985 18.6667 22.6667V24.6667C18.6667 25.0349 18.9652 25.3333 19.3334 25.3333L24.6667 25.3333C25.0349 25.3333 25.3334 25.0349 25.3334 24.6667V19.3333C25.3334 18.9651 25.0349 18.6667 24.6667 18.6667H22.6667C22.2985 18.6667 22 18.9651 22 19.3333V21.8667Z" fill="currentColor"/> <path d="M12.6667 22H10.1334C10.0597 22 10 21.9403 10 21.8667V19.3333C10 18.9651 9.70154 18.6667 9.33335 18.6667H7.33335C6.96516 18.6667 6.66669 18.9651 6.66669 19.3333V24.6667C6.66669 25.0349 6.96516 25.3333 7.33335 25.3333H12.6667C13.0349 25.3333 13.3334 25.0349 13.3334 24.6667V22.6667C13.3334 22.2985 13.0349 22 12.6667 22Z" fill="currentColor"/> <path d="M10 12.6667V10.1333C10 10.0597 10.0597 10 10.1334 10L12.6667 10C13.0349 10 13.3334 9.70152 13.3334 9.33333V7.33333C13.3334 6.96514 13.0349 6.66666 12.6667 6.66666H7.33335C6.96516 6.66666 6.66669 6.96514 6.66669 7.33333V12.6667C6.66669 13.0349 6.96516 13.3333 7.33335 13.3333H9.33335C9.70154 13.3333 10 13.0349 10 12.6667Z" fill="currentColor"/>',pOe='<path fill-rule="evenodd" clip-rule="evenodd" d="M26.6667 5.99998C26.6667 5.63179 26.3682 5.33331 26 5.33331H11.3333C10.9651 5.33331 10.6667 5.63179 10.6667 5.99998V17.5714C10.6667 17.6694 10.5644 17.7342 10.4741 17.6962C9.91823 17.4625 9.30754 17.3333 8.66667 17.3333C6.08934 17.3333 4 19.4226 4 22C4 24.5773 6.08934 26.6666 8.66667 26.6666C11.244 26.6666 13.3333 24.5773 13.3333 22V8.66665C13.3333 8.29846 13.6318 7.99998 14 7.99998L23.3333 7.99998C23.7015 7.99998 24 8.29846 24 8.66665V14.9048C24 15.0027 23.8978 15.0675 23.8075 15.0296C23.2516 14.7958 22.6409 14.6666 22 14.6666C19.4227 14.6666 17.3333 16.756 17.3333 19.3333C17.3333 21.9106 19.4227 24 22 24C24.5773 24 26.6667 21.9106 26.6667 19.3333V5.99998ZM22 21.3333C23.1046 21.3333 24 20.4379 24 19.3333C24 18.2287 23.1046 17.3333 22 17.3333C20.8954 17.3333 20 18.2287 20 19.3333C20 20.4379 20.8954 21.3333 22 21.3333ZM8.66667 24C9.77124 24 10.6667 23.1045 10.6667 22C10.6667 20.8954 9.77124 20 8.66667 20C7.5621 20 6.66667 20.8954 6.66667 22C6.66667 23.1045 7.5621 24 8.66667 24Z" fill="currentColor"/>',hOe='<path d="M17.5091 24.6594C17.5091 25.2066 16.8864 25.5208 16.4463 25.1956L9.44847 20.0252C9.42553 20.0083 9.39776 19.9991 9.36923 19.9991H4.66667C4.29848 19.9991 4 19.7006 4 19.3325V12.6658C4 12.2976 4.29848 11.9991 4.66667 11.9991H9.37115C9.39967 11.9991 9.42745 11.99 9.45039 11.973L16.4463 6.8036C16.8863 6.47842 17.5091 6.79259 17.5091 7.33977L17.5091 24.6594Z" fill="currentColor"/> <path d="M28.8621 13.6422C29.1225 13.3818 29.1225 12.9597 28.8621 12.6994L27.9193 11.7566C27.659 11.4962 27.2368 11.4962 26.9765 11.7566L24.7134 14.0197C24.6613 14.0717 24.5769 14.0717 24.5248 14.0197L22.262 11.7568C22.0016 11.4964 21.5795 11.4964 21.3191 11.7568L20.3763 12.6996C20.116 12.9599 20.116 13.382 20.3763 13.6424L22.6392 15.9053C22.6913 15.9573 22.6913 16.0418 22.6392 16.0938L20.3768 18.3562C20.1165 18.6166 20.1165 19.0387 20.3768 19.299L21.3196 20.2419C21.58 20.5022 22.0021 20.5022 22.2624 20.2418L24.5248 17.9795C24.5769 17.9274 24.6613 17.9274 24.7134 17.9795L26.976 20.2421C27.2363 20.5024 27.6585 20.5024 27.9188 20.2421L28.8616 19.2992C29.122 19.0389 29.122 18.6168 28.8616 18.3564L26.599 16.0938C26.547 16.0418 26.547 15.9573 26.599 15.9053L28.8621 13.6422Z" fill="currentColor"/>',mOe='<path d="M26.6009 16.0725C26.6009 16.424 26.4302 17.1125 25.9409 18.0213C25.4676 18.8976 24.7542 19.8715 23.8182 20.7783C21.9489 22.5905 19.2662 24.0667 15.9342 24.0667C12.6009 24.0667 9.91958 22.5915 8.04891 20.78C7.11424 19.8736 6.40091 18.9 5.92758 18.0236C5.43824 17.1149 5.26758 16.4257 5.26758 16.0725C5.26758 15.7193 5.43824 15.0293 5.92891 14.1193C6.40224 13.2416 7.11558 12.2665 8.05158 11.3587C9.92224 9.54398 12.6049 8.06665 15.9342 8.06665C19.2636 8.06665 21.9449 9.54505 23.8169 11.3604C24.7529 12.2687 25.4662 13.2441 25.9396 14.1216C26.4302 15.0317 26.6009 15.7209 26.6009 16.0725Z" stroke="currentColor" stroke-width="3"/> <path d="M15.9336 20.0667C18.1427 20.0667 19.9336 18.2758 19.9336 16.0667C19.9336 13.8575 18.1427 12.0667 15.9336 12.0667C13.7245 12.0667 11.9336 13.8575 11.9336 16.0667C11.9336 18.2758 13.7245 20.0667 15.9336 20.0667Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M27.2323 25.0624L6.93878 4.76886C6.78118 4.61126 6.70762 4.57052 6.61919 4.54372C6.53077 4.51692 6.44033 4.51691 6.3519 4.54372C6.26347 4.57052 6.18991 4.61126 6.03231 4.76886L4.77032 6.03085C4.61272 6.18845 4.57198 6.26201 4.54518 6.35044C4.51838 6.43887 4.51838 6.5293 4.54518 6.61773C4.57198 6.70616 4.61272 6.77972 4.77032 6.93732L25.0639 27.2308C25.2215 27.3884 25.295 27.4292 25.3834 27.456C25.4719 27.4828 25.5623 27.4828 25.6507 27.456C25.7392 27.4292 25.8127 27.3885 25.9703 27.2309L27.2323 25.9689C27.3899 25.8113 27.4307 25.7377 27.4575 25.6493C27.4843 25.5608 27.4843 25.4704 27.4575 25.382C27.4307 25.2935 27.3899 25.22 27.2323 25.0624Z" fill="currentColor"/>',gOe='<path d="M8.66667 6.66667C8.29848 6.66667 8 6.96514 8 7.33333V24.6667C8 25.0349 8.29848 25.3333 8.66667 25.3333H12.6667C13.0349 25.3333 13.3333 25.0349 13.3333 24.6667V7.33333C13.3333 6.96514 13.0349 6.66667 12.6667 6.66667H8.66667Z" fill="currentColor"/> <path d="M19.3333 6.66667C18.9651 6.66667 18.6667 6.96514 18.6667 7.33333V24.6667C18.6667 25.0349 18.9651 25.3333 19.3333 25.3333H23.3333C23.7015 25.3333 24 25.0349 24 24.6667V7.33333C24 6.96514 23.7015 6.66667 23.3333 6.66667H19.3333Z" fill="currentColor"/>',yOe='<path d="M5.33334 26V19.4667C5.33334 19.393 5.39304 19.3333 5.46668 19.3333H7.86668C7.94031 19.3333 8.00001 19.393 8.00001 19.4667V23.3333C8.00001 23.7015 8.29849 24 8.66668 24H23.3333C23.7015 24 24 23.7015 24 23.3333V8.66666C24 8.29847 23.7015 7.99999 23.3333 7.99999H19.4667C19.393 7.99999 19.3333 7.9403 19.3333 7.86666V5.46666C19.3333 5.39302 19.393 5.33333 19.4667 5.33333H26C26.3682 5.33333 26.6667 5.63181 26.6667 5.99999V26C26.6667 26.3682 26.3682 26.6667 26 26.6667H6.00001C5.63182 26.6667 5.33334 26.3682 5.33334 26Z" fill="currentColor"/> <path d="M14.0098 8.42359H10.806C10.6872 8.42359 10.6277 8.56721 10.7117 8.6512L16.5491 14.4886C16.8094 14.7489 16.8094 15.171 16.5491 15.4314L15.3234 16.657C15.0631 16.9174 14.641 16.9174 14.3806 16.657L8.63739 10.9138C8.55339 10.8298 8.40978 10.8893 8.40978 11.0081V14.0236C8.40978 14.3918 8.1113 14.6903 7.74311 14.6903H6.00978C5.64159 14.6903 5.34311 14.3918 5.34311 14.0236L5.34311 6.02359C5.34311 5.6554 5.64159 5.35692 6.00978 5.35692L14.0098 5.35692C14.378 5.35692 14.6764 5.6554 14.6764 6.02359V7.75692C14.6764 8.12511 14.378 8.42359 14.0098 8.42359Z" fill="currentColor"/>',vOe='<path d="M16 15.3333C15.6318 15.3333 15.3333 15.6318 15.3333 16V20C15.3333 20.3682 15.6318 20.6667 16 20.6667H21.3333C21.7015 20.6667 22 20.3682 22 20V16C22 15.6318 21.7015 15.3333 21.3333 15.3333H16Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M5.33333 7.33334C5.33333 6.96515 5.63181 6.66667 5.99999 6.66667H26C26.3682 6.66667 26.6667 6.96515 26.6667 7.33334V24.6667C26.6667 25.0349 26.3682 25.3333 26 25.3333H5.99999C5.63181 25.3333 5.33333 25.0349 5.33333 24.6667V7.33334ZM7.99999 10C7.99999 9.63182 8.29847 9.33334 8.66666 9.33334H23.3333C23.7015 9.33334 24 9.63182 24 10V22C24 22.3682 23.7015 22.6667 23.3333 22.6667H8.66666C8.29847 22.6667 7.99999 22.3682 7.99999 22V10Z" fill="currentColor"/>',bOe='<path d="M10.6667 6.6548C10.6667 6.10764 11.2894 5.79346 11.7295 6.11862L24.377 15.4634C24.7377 15.7298 24.7377 16.2692 24.3771 16.5357L11.7295 25.8813C11.2895 26.2065 10.6667 25.8923 10.6667 25.3451L10.6667 6.6548Z" fill="currentColor"/>',xOe='<path d="M13.9213 5.53573C14.3146 5.45804 14.6666 5.76987 14.6666 6.17079V7.57215C14.6666 7.89777 14.4305 8.17277 14.114 8.24925C12.5981 8.61559 11.2506 9.41368 10.2091 10.506C9.98474 10.7414 9.62903 10.8079 9.34742 10.6453L8.14112 9.94885C7.79394 9.7484 7.69985 9.28777 7.96359 8.98585C9.48505 7.24409 11.5636 6.00143 13.9213 5.53573Z" fill="currentColor"/> <path d="M5.88974 12.5908C6.01805 12.2101 6.46491 12.0603 6.81279 12.2611L8.01201 12.9535C8.29379 13.1162 8.41396 13.4577 8.32238 13.7699C8.11252 14.4854 7.99998 15.2424 7.99998 16.0257C7.99998 16.809 8.11252 17.566 8.32238 18.2814C8.41396 18.5936 8.29378 18.9352 8.01201 19.0979L6.82742 19.7818C6.48051 19.9821 6.03488 19.8337 5.90521 19.4547C5.5345 18.3712 5.33331 17.2091 5.33331 16C5.33331 14.8078 5.5289 13.6613 5.88974 12.5908Z" fill="currentColor"/> <path d="M8.17106 22.0852C7.82291 22.2862 7.72949 22.7486 7.99532 23.0502C9.51387 24.773 11.5799 26.0017 13.9213 26.4642C14.3146 26.5419 14.6666 26.2301 14.6666 25.8291V24.4792C14.6666 24.1536 14.4305 23.8786 14.114 23.8021C12.5981 23.4358 11.2506 22.6377 10.2091 21.5453C9.98474 21.31 9.62903 21.2435 9.34742 21.4061L8.17106 22.0852Z" fill="currentColor"/> <path d="M17.3333 25.8291C17.3333 26.2301 17.6857 26.5418 18.079 26.4641C22.9748 25.4969 26.6666 21.1796 26.6666 16C26.6666 10.8204 22.9748 6.50302 18.079 5.5358C17.6857 5.4581 17.3333 5.76987 17.3333 6.17079V7.57215C17.3333 7.89777 17.5697 8.17282 17.8862 8.24932C21.3942 9.09721 24 12.2572 24 16.0257C24 19.7942 21.3942 22.9542 17.8862 23.802C17.5697 23.8785 17.3333 24.1536 17.3333 24.4792V25.8291Z" fill="currentColor"/> <path d="M14.3961 10.4163C13.9561 10.0911 13.3333 10.4053 13.3333 10.9525L13.3333 21.0474C13.3333 21.5946 13.9561 21.9087 14.3962 21.5836L21.2273 16.5359C21.5879 16.2694 21.5879 15.73 21.2273 15.4635L14.3961 10.4163Z" fill="currentColor"/>',wOe='<path d="M15.6038 12.2147C16.0439 12.5399 16.6667 12.2257 16.6667 11.6786V10.1789C16.6667 10.1001 16.7351 10.0384 16.8134 10.0479C20.1116 10.4494 22.6667 13.2593 22.6667 16.6659C22.6667 20.3481 19.6817 23.3332 15.9995 23.3332C12.542 23.3332 9.69927 20.7014 9.36509 17.332C9.32875 16.9655 9.03371 16.6662 8.66548 16.6662L6.66655 16.6666C6.29841 16.6666 5.99769 16.966 6.02187 17.3334C6.36494 22.5454 10.7012 26.6667 16 26.6667C21.5228 26.6667 26 22.1895 26 16.6667C26 11.4103 21.9444 7.10112 16.7916 6.69757C16.7216 6.69209 16.6667 6.63396 16.6667 6.56372V4.98824C16.6667 4.44106 16.0439 4.12689 15.6038 4.45206L11.0765 7.79738C10.7159 8.06387 10.7159 8.60326 11.0766 8.86973L15.6038 12.2147Z" fill="currentColor"/>',kOe='<path d="M16.6667 10.3452C16.6667 10.8924 16.0439 11.2066 15.6038 10.8814L11.0766 7.5364C10.7159 7.26993 10.7159 6.73054 11.0766 6.46405L15.6038 3.11873C16.0439 2.79356 16.6667 3.10773 16.6667 3.6549V5.22682C16.6667 5.29746 16.7223 5.35579 16.7927 5.36066C22.6821 5.76757 27.3333 10.674 27.3333 16.6667C27.3333 22.9259 22.2592 28 16 28C9.96483 28 5.03145 23.2827 4.68601 17.3341C4.66466 16.9665 4.96518 16.6673 5.33339 16.6673H7.3334C7.70157 16.6673 7.99714 16.9668 8.02743 17.3337C8.36638 21.4399 11.8064 24.6667 16 24.6667C20.4183 24.6667 24 21.085 24 16.6667C24 12.5225 20.8483 9.11428 16.8113 8.70739C16.7337 8.69957 16.6667 8.76096 16.6667 8.83893V10.3452Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M17.0879 19.679C17.4553 19.9195 17.8928 20.0398 18.4004 20.0398C18.9099 20.0398 19.3474 19.9205 19.7129 19.6818C20.0803 19.4413 20.3635 19.0938 20.5623 18.6392C20.7612 18.1847 20.8606 17.6373 20.8606 16.9972C20.8625 16.3608 20.764 15.8192 20.5652 15.3722C20.3663 14.9252 20.0822 14.5853 19.7129 14.3523C19.3455 14.1175 18.908 14 18.4004 14C17.8928 14 17.4553 14.1175 17.0879 14.3523C16.7224 14.5853 16.4402 14.9252 16.2413 15.3722C16.0443 15.8173 15.9449 16.3589 15.943 16.9972C15.9411 17.6354 16.0396 18.1818 16.2385 18.6364C16.4373 19.089 16.7205 19.4366 17.0879 19.679ZM19.1362 18.4262C18.9487 18.7349 18.7034 18.8892 18.4004 18.8892C18.1996 18.8892 18.0226 18.8211 17.8691 18.6847C17.7157 18.5464 17.5964 18.3372 17.5112 18.0568C17.4279 17.7765 17.3871 17.4233 17.389 16.9972C17.3909 16.3684 17.4847 15.9025 17.6703 15.5995C17.8559 15.2945 18.0993 15.1421 18.4004 15.1421C18.603 15.1421 18.7801 15.2093 18.9316 15.3438C19.0832 15.4782 19.2015 15.6828 19.2868 15.9574C19.372 16.2301 19.4146 16.5767 19.4146 16.9972C19.4165 17.6392 19.3237 18.1156 19.1362 18.4262Z" fill="currentColor"/> <path d="M13.7746 19.8978C13.8482 19.8978 13.9079 19.8381 13.9079 19.7644V14.2129C13.9079 14.1393 13.8482 14.0796 13.7746 14.0796H12.642C12.6171 14.0796 12.5927 14.0865 12.5716 14.0997L11.2322 14.9325C11.1931 14.9568 11.1693 14.9996 11.1693 15.0457V15.9497C11.1693 16.0539 11.2833 16.1178 11.3722 16.0635L12.464 15.396C12.4682 15.3934 12.473 15.3921 12.4779 15.3921C12.4926 15.3921 12.5045 15.404 12.5045 15.4187V19.7644C12.5045 19.8381 12.5642 19.8978 12.6378 19.8978H13.7746Z" fill="currentColor"/>',SOe='<path d="M15.3333 10.3452C15.3333 10.8924 15.9561 11.2066 16.3962 10.8814L20.9234 7.5364C21.2841 7.26993 21.2841 6.73054 20.9235 6.46405L16.3962 3.11873C15.9561 2.79356 15.3333 3.10773 15.3333 3.6549V5.22682C15.3333 5.29746 15.2778 5.35579 15.2073 5.36066C9.31791 5.76757 4.66667 10.674 4.66667 16.6667C4.66667 22.9259 9.74078 28 16 28C22.0352 28 26.9686 23.2827 27.314 17.3341C27.3354 16.9665 27.0348 16.6673 26.6666 16.6673H24.6666C24.2984 16.6673 24.0029 16.9668 23.9726 17.3337C23.6336 21.4399 20.1937 24.6667 16 24.6667C11.5817 24.6667 8 21.085 8 16.6667C8 12.5225 11.1517 9.11428 15.1887 8.70739C15.2663 8.69957 15.3333 8.76096 15.3333 8.83893V10.3452Z" fill="currentColor"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M17.0879 19.679C17.4553 19.9195 17.8928 20.0398 18.4004 20.0398C18.9099 20.0398 19.3474 19.9205 19.7129 19.6818C20.0803 19.4413 20.3635 19.0938 20.5623 18.6392C20.7612 18.1847 20.8606 17.6373 20.8606 16.9972C20.8625 16.3608 20.764 15.8192 20.5652 15.3722C20.3663 14.9252 20.0822 14.5853 19.7129 14.3523C19.3455 14.1175 18.908 14 18.4004 14C17.8928 14 17.4553 14.1175 17.0879 14.3523C16.7224 14.5853 16.4402 14.9252 16.2413 15.3722C16.0443 15.8173 15.9449 16.3589 15.943 16.9972C15.9411 17.6354 16.0396 18.1818 16.2385 18.6364C16.4373 19.089 16.7205 19.4366 17.0879 19.679ZM19.1362 18.4262C18.9487 18.7349 18.7034 18.8892 18.4004 18.8892C18.1996 18.8892 18.0225 18.8211 17.8691 18.6847C17.7157 18.5464 17.5964 18.3372 17.5112 18.0568C17.4278 17.7765 17.3871 17.4233 17.389 16.9972C17.3909 16.3684 17.4847 15.9025 17.6703 15.5995C17.8559 15.2945 18.0992 15.1421 18.4004 15.1421C18.603 15.1421 18.7801 15.2093 18.9316 15.3438C19.0831 15.4782 19.2015 15.6828 19.2867 15.9574C19.372 16.2301 19.4146 16.5767 19.4146 16.9972C19.4165 17.6392 19.3237 18.1156 19.1362 18.4262Z" fill="currentColor"/> <path d="M13.7746 19.8978C13.8482 19.8978 13.9079 19.8381 13.9079 19.7644V14.2129C13.9079 14.1393 13.8482 14.0796 13.7746 14.0796H12.642C12.6171 14.0796 12.5927 14.0865 12.5716 14.0997L11.2322 14.9325C11.1931 14.9568 11.1693 14.9996 11.1693 15.0457V15.9497C11.1693 16.0539 11.2833 16.1178 11.3722 16.0635L12.464 15.396C12.4682 15.3934 12.473 15.3921 12.4779 15.3921C12.4926 15.3921 12.5045 15.404 12.5045 15.4187V19.7644C12.5045 19.8381 12.5642 19.8978 12.6378 19.8978H13.7746Z" fill="currentColor"/>',COe='<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5722 5.33333C13.2429 5.33333 12.9629 5.57382 12.9132 5.89938L12.4063 9.21916C12.4 9.26058 12.3746 9.29655 12.3378 9.31672C12.2387 9.37118 12.1409 9.42779 12.0444 9.48648C12.0086 9.5083 11.9646 9.51242 11.9255 9.49718L8.79572 8.27692C8.48896 8.15732 8.14083 8.27958 7.9762 8.56472L5.5491 12.7686C5.38444 13.0538 5.45271 13.4165 5.70981 13.6223L8.33308 15.7225C8.3658 15.7487 8.38422 15.7887 8.38331 15.8306C8.38209 15.8867 8.38148 15.9429 8.38148 15.9993C8.38148 16.0558 8.3821 16.1121 8.38332 16.1684C8.38423 16.2102 8.36582 16.2503 8.33313 16.2765L5.7103 18.3778C5.45334 18.5836 5.38515 18.9462 5.54978 19.2314L7.97688 23.4352C8.14155 23.7205 8.48981 23.8427 8.79661 23.723L11.926 22.5016C11.9651 22.4864 12.009 22.4905 12.0449 22.5123C12.1412 22.5709 12.2388 22.6274 12.3378 22.6818C12.3745 22.7019 12.4 22.7379 12.4063 22.7793L12.9132 26.0993C12.9629 26.4249 13.2429 26.6654 13.5722 26.6654H18.4264C18.7556 26.6654 19.0356 26.425 19.0854 26.0995L19.5933 22.7801C19.5997 22.7386 19.6252 22.7027 19.6619 22.6825C19.7614 22.6279 19.8596 22.5711 19.9564 22.5121C19.9923 22.4903 20.0362 22.4862 20.0754 22.5015L23.2035 23.7223C23.5103 23.842 23.8585 23.7198 24.0232 23.4346L26.4503 19.2307C26.6149 18.9456 26.5467 18.583 26.2898 18.3771L23.6679 16.2766C23.6352 16.2504 23.6168 16.2104 23.6177 16.1685C23.619 16.1122 23.6196 16.0558 23.6196 15.9993C23.6196 15.9429 23.619 15.8866 23.6177 15.8305C23.6168 15.7886 23.6353 15.7486 23.668 15.7224L26.2903 13.623C26.5474 13.4172 26.6156 13.0544 26.451 12.7692L24.0239 8.56537C23.8592 8.28023 23.5111 8.15797 23.2043 8.27757L20.0758 9.49734C20.0367 9.51258 19.9927 9.50846 19.9569 9.48664C19.8599 9.42762 19.7616 9.37071 19.6618 9.31596C19.6251 9.2958 19.5997 9.25984 19.5933 9.21843L19.0854 5.89915C19.0356 5.57369 18.7556 5.33333 18.4264 5.33333H13.5722ZM16.0001 20.2854C18.3672 20.2854 20.2862 18.3664 20.2862 15.9993C20.2862 13.6322 18.3672 11.7132 16.0001 11.7132C13.6329 11.7132 11.714 13.6322 11.714 15.9993C11.714 18.3664 13.6329 20.2854 16.0001 20.2854Z" fill="currentColor"/>',TOe='<path d="M17.5091 24.6595C17.5091 25.2066 16.8864 25.5208 16.4463 25.1956L9.44847 20.0252C9.42553 20.0083 9.39776 19.9992 9.36923 19.9992H4.66667C4.29848 19.9992 4 19.7007 4 19.3325V12.6658C4 12.2976 4.29848 11.9992 4.66667 11.9992H9.37115C9.39967 11.9992 9.42745 11.99 9.45039 11.9731L16.4463 6.80363C16.8863 6.47845 17.5091 6.79262 17.5091 7.3398L17.5091 24.6595Z" fill="currentColor"/> <path d="M27.5091 9.33336C27.8773 9.33336 28.1758 9.63184 28.1758 10V22C28.1758 22.3682 27.8773 22.6667 27.5091 22.6667H26.1758C25.8076 22.6667 25.5091 22.3682 25.5091 22V10C25.5091 9.63184 25.8076 9.33336 26.1758 9.33336L27.5091 9.33336Z" fill="currentColor"/> <path d="M22.1758 12C22.544 12 22.8424 12.2985 22.8424 12.6667V19.3334C22.8424 19.7016 22.544 20 22.1758 20H20.8424C20.4743 20 20.1758 19.7016 20.1758 19.3334V12.6667C20.1758 12.2985 20.4743 12 20.8424 12H22.1758Z" fill="currentColor"/>',EOe='<path d="M17.5091 24.6594C17.5091 25.2066 16.8864 25.5207 16.4463 25.1956L9.44847 20.0252C9.42553 20.0083 9.39776 19.9991 9.36923 19.9991H4.66667C4.29848 19.9991 4 19.7006 4 19.3324V12.6658C4 12.2976 4.29848 11.9991 4.66667 11.9991H9.37115C9.39967 11.9991 9.42745 11.99 9.45039 11.973L16.4463 6.80358C16.8863 6.4784 17.5091 6.79258 17.5091 7.33975L17.5091 24.6594Z" fill="currentColor"/> <path d="M22.8424 12.6667C22.8424 12.2985 22.544 12 22.1758 12H20.8424C20.4743 12 20.1758 12.2985 20.1758 12.6667V19.3333C20.1758 19.7015 20.4743 20 20.8424 20H22.1758C22.544 20 22.8424 19.7015 22.8424 19.3333V12.6667Z" fill="currentColor"/>'});function QD(t,e,r){return sc(t,eg(e,r))}function EE(t,e){return typeof t=="function"?t(e):t}function ap(t){return t.split("-")[0]}function IE(t){return t.split("-")[1]}function ZD(t){return t==="x"?"y":"x"}function JD(t){return t==="y"?"height":"width"}function tg(t){return["top","bottom"].includes(ap(t))?"y":"x"}function eN(t){return ZD(tg(t))}function MZ(t,e,r){r===void 0&&(r=!1);let n=IE(t),i=eN(t),s=JD(i),a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=fx(a)),[a,fx(a)]}function _Z(t){let e=fx(t);return[TE(t),e,TE(e)]}function TE(t){return t.replace(/start|end/g,e=>AOe[e])}function POe(t,e,r){let n=["left","right"],i=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:a;default:return[]}}function OZ(t,e,r,n){let i=IE(t),s=POe(ap(t),r==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(TE)))),s}function fx(t){return t.replace(/left|right|bottom|top/g,e=>IOe[e])}function ROe(t){return{top:0,right:0,bottom:0,left:0,...t}}function DZ(t){return typeof t!="number"?ROe(t):{top:t,right:t,bottom:t,left:t}}function op(t){let{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}var eg,sc,px,hx,co,IOe,AOe,AE=yt(()=>{eg=Math.min,sc=Math.max,px=Math.round,hx=Math.floor,co=t=>({x:t,y:t}),IOe={left:"right",right:"left",bottom:"top",top:"bottom"},AOe={start:"end",end:"start"}});function NZ(t,e,r){let{reference:n,floating:i}=t,s=tg(e),a=eN(e),o=JD(a),l=ap(e),c=s==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[o]/2-i[o]/2,p;switch(l){case"top":p={x:u,y:n.y-i.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}switch(IE(e)){case"start":p[a]-=f*(r&&c?-1:1);break;case"end":p[a]+=f*(r&&c?-1:1);break}return p}async function tN(t,e){var r;e===void 0&&(e={});let{x:n,y:i,platform:s,rects:a,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=EE(e,t),h=DZ(p),v=o[f?d==="floating"?"reference":"floating":d],b=op(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(v)))==null||r?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),w=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},C=op(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:y,offsetParent:x,strategy:l}):y);return{top:(b.top-C.top+h.top)/w.y,bottom:(C.bottom-b.bottom+h.bottom)/w.y,left:(b.left-C.left+h.left)/w.x,right:(C.right-b.right+h.right)/w.x}}var FZ,BZ,VZ,jZ=yt(()=>{AE();AE();FZ=async(t,e,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a}=r,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e)),c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=NZ(c,n,l),f=n,p={},h=0;for(let m=0;m<o.length;m++){let{name:v,fn:b}=o[m],{x:y,y:x,data:w,reset:C}=await b({x:u,y:d,initialPlacement:n,placement:f,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:t,floating:e}});u=y??u,d=x??d,p={...p,[v]:{...p[v],...w}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):C.rects),{x:u,y:d}=NZ(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};BZ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;let{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...v}=EE(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};let b=ap(i),y=tg(o),x=ap(o)===o,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!m?[fx(o)]:_Z(o)),O=h!=="none";!f&&O&&C.push(...OZ(o,m,h,w));let S=[o,...C],T=await tN(e,v),E=[],P=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&E.push(T[b]),d){let M=MZ(i,a,w);E.push(T[M[0]],T[M[1]])}if(P=[...P,{placement:i,overflows:E}],!E.every(M=>M<=0)){var R,I;let M=(((R=s.flip)==null?void 0:R.index)||0)+1,z=S[M];if(z)return{data:{index:M,overflows:P},reset:{placement:z}};let G=(I=P.filter(V=>V.overflows[0]<=0).sort((V,K)=>V.overflows[1]-K.overflows[1])[0])==null?void 0:I.placement;if(!G)switch(p){case"bestFit":{var B;let V=(B=P.filter(K=>{if(O){let de=tg(K.placement);return de===y||de==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(de=>de>0).reduce((de,Me)=>de+Me,0)]).sort((K,de)=>K[1]-de[1])[0])==null?void 0:B[0];V&&(G=V);break}case"initialPlacement":G=o;break}if(i!==G)return{reset:{placement:G}}}return{}}}},VZ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:v=>{let{x:b,y}=v;return{x:b,y}}},...l}=EE(t,e),c={x:r,y:n},u=await tN(e,l),d=tg(ap(i)),f=ZD(d),p=c[f],h=c[d];if(s){let v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=p+u[v],x=p-u[b];p=QD(y,p,x)}if(a){let v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",y=h+u[v],x=h-u[b];h=QD(y,h,x)}let m=o.fn({...e,[f]:p,[d]:h});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[f]:s,[d]:a}}}}}}});function PE(){return typeof window<"u"}function lp(t){return UZ(t)?(t.nodeName||"").toLowerCase():"#document"}function qi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function uo(t){var e;return(e=(UZ(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function UZ(t){return PE()?t instanceof Node||t instanceof qi(t).Node:!1}function ma(t){return PE()?t instanceof Element||t instanceof qi(t).Element:!1}function fo(t){return PE()?t instanceof HTMLElement||t instanceof qi(t).HTMLElement:!1}function $Z(t){return!PE()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof qi(t).ShadowRoot}function ng(t){let{overflow:e,overflowX:r,overflowY:n,display:i}=ga(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function zZ(t){return["table","td","th"].includes(lp(t))}function mx(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function RE(t){let e=LE(),r=ma(t)?ga(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function qZ(t){let e=ac(t);for(;fo(e)&&!cp(e);){if(RE(e))return e;if(mx(e))return null;e=ac(e)}return null}function LE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function cp(t){return["html","body","#document"].includes(lp(t))}function ga(t){return qi(t).getComputedStyle(t)}function gx(t){return ma(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ac(t){if(lp(t)==="html")return t;let e=t.assignedSlot||t.parentNode||$Z(t)&&t.host||uo(t);return $Z(e)?e.host:e}function HZ(t){let e=ac(t);return cp(e)?t.ownerDocument?t.ownerDocument.body:t.body:fo(e)&&ng(e)?e:HZ(e)}function rg(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);let i=HZ(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),a=qi(i);if(s){let o=ME(a);return e.concat(a,a.visualViewport||[],ng(i)?i:[],o&&r?rg(o):[])}return e.concat(i,rg(i,[],r))}function ME(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}var GZ=yt(()=>{});function YZ(t){let e=ga(t),r=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=fo(t),s=i?t.offsetWidth:r,a=i?t.offsetHeight:n,o=px(r)!==s||px(n)!==a;return o&&(r=s,n=a),{width:r,height:n,$:o}}function nN(t){return ma(t)?t:t.contextElement}function ig(t){let e=nN(t);if(!fo(e))return co(1);let r=e.getBoundingClientRect(),{width:n,height:i,$:s}=YZ(e),a=(s?px(r.width):r.width)/n,o=(s?px(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}function XZ(t){let e=qi(t);return!LE()||!e.visualViewport?LOe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function MOe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==qi(t)?!1:e}function up(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);let i=t.getBoundingClientRect(),s=nN(t),a=co(1);e&&(n?ma(n)&&(a=ig(n)):a=ig(t));let o=MOe(s,r,n)?XZ(s):co(0),l=(i.left+o.x)/a.x,c=(i.top+o.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(s){let f=qi(s),p=n&&ma(n)?qi(n):n,h=f,m=ME(h);for(;m&&n&&p!==h;){let v=ig(m),b=m.getBoundingClientRect(),y=ga(m),x=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*v.x,w=b.top+(m.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=x,c+=w,h=qi(m),m=ME(h)}}return op({width:u,height:d,x:l,y:c})}function iN(t,e){let r=gx(t).scrollLeft;return e?e.left+r:up(uo(t)).left+r}function QZ(t,e,r){r===void 0&&(r=!1);let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(r?0:iN(t,n)),s=n.top+e.scrollTop;return{x:i,y:s}}function _Oe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t,s=i==="fixed",a=uo(n),o=e?mx(e.floating):!1;if(n===a||o&&s)return r;let l={scrollLeft:0,scrollTop:0},c=co(1),u=co(0),d=fo(n);if((d||!d&&!s)&&((lp(n)!=="body"||ng(a))&&(l=gx(n)),fo(n))){let p=up(n);c=ig(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}let f=a&&!d&&!s?QZ(a,l,!0):co(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-l.scrollTop*c.y+u.y+f.y}}function OOe(t){return Array.from(t.getClientRects())}function DOe(t){let e=uo(t),r=gx(t),n=t.ownerDocument.body,i=sc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=sc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+iN(t),o=-r.scrollTop;return ga(n).direction==="rtl"&&(a+=sc(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}function NOe(t,e){let r=qi(t),n=uo(t),i=r.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;let c=LE();(!c||c&&e==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}function FOe(t,e){let r=up(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=fo(t)?ig(t):co(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:a,height:o,x:l,y:c}}function WZ(t,e,r){let n;if(e==="viewport")n=NOe(t,r);else if(e==="document")n=DOe(uo(t));else if(ma(e))n=FOe(e,r);else{let i=XZ(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return op(n)}function ZZ(t,e){let r=ac(t);return r===e||!ma(r)||cp(r)?!1:ga(r).position==="fixed"||ZZ(r,e)}function BOe(t,e){let r=e.get(t);if(r)return r;let n=rg(t,[],!1).filter(o=>ma(o)&&lp(o)!=="body"),i=null,s=ga(t).position==="fixed",a=s?ac(t):t;for(;ma(a)&&!cp(a);){let o=ga(a),l=RE(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ng(a)&&!l&&ZZ(t,a))?n=n.filter(u=>u!==a):i=o,a=ac(a)}return e.set(t,n),n}function VOe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t,a=[...r==="clippingAncestors"?mx(e)?[]:BOe(e,this._c):[].concat(r),n],o=a[0],l=a.reduce((c,u)=>{let d=WZ(e,u,i);return c.top=sc(d.top,c.top),c.right=eg(d.right,c.right),c.bottom=eg(d.bottom,c.bottom),c.left=sc(d.left,c.left),c},WZ(e,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function jOe(t){let{width:e,height:r}=YZ(t);return{width:e,height:r}}function $Oe(t,e,r){let n=fo(e),i=uo(e),s=r==="fixed",a=up(t,!0,s,e),o={scrollLeft:0,scrollTop:0},l=co(0);if(n||!n&&!s)if((lp(e)!=="body"||ng(i))&&(o=gx(e)),n){let f=up(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=iN(i));let c=i&&!n&&!s?QZ(i,o):co(0),u=a.left+o.scrollLeft-l.x-c.x,d=a.top+o.scrollTop-l.y-c.y;return{x:u,y:d,width:a.width,height:a.height}}function rN(t){return ga(t).position==="static"}function KZ(t,e){if(!fo(t)||ga(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return uo(t)===r&&(r=r.ownerDocument.body),r}function JZ(t,e){let r=qi(t);if(mx(t))return r;if(!fo(t)){let i=ac(t);for(;i&&!cp(i);){if(ma(i)&&!rN(i))return i;i=ac(i)}return r}let n=KZ(t,e);for(;n&&zZ(n)&&rN(n);)n=KZ(n,e);return n&&cp(n)&&rN(n)&&!RE(n)?r:n||qZ(t)||r}function zOe(t){return ga(t).direction==="rtl"}function eJ(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function HOe(t,e){let r=null,n,i=uo(t);function s(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();let c=t.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(o||e(),!f||!p)return;let h=hx(d),m=hx(i.clientWidth-(u+f)),v=hx(i.clientHeight-(d+p)),b=hx(u),x={rootMargin:-h+"px "+-m+"px "+-v+"px "+-b+"px",threshold:sc(0,eg(1,l))||1},w=!0;function C(O){let S=O[0].intersectionRatio;if(S!==l){if(!w)return a();S?a(!1,S):n=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!eJ(c,t.getBoundingClientRect())&&a(),w=!1}try{r=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(t)}return a(!0),s}function tJ(t,e,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=nN(t),u=i||s?[...c?rg(c):[],...rg(e)]:[];u.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),s&&b.addEventListener("resize",r)});let d=c&&o?HOe(c,r):null,f=-1,p=null;a&&(p=new ResizeObserver(b=>{let[y]=b;y&&y.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(e)})),r()}),c&&!l&&p.observe(c),p.observe(e));let h,m=l?up(t):null;l&&v();function v(){let b=up(t);m&&!eJ(m,b)&&r(),m=b,h=requestAnimationFrame(v)}return r(),()=>{var b;u.forEach(y=>{i&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),d?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var LOe,UOe,qOe,rJ,nJ,iJ,sJ=yt(()=>{jZ();AE();GZ();LOe=co(0);UOe=async function(t){let e=this.getOffsetParent||JZ,r=this.getDimensions,n=await r(t.floating);return{reference:$Oe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};qOe={convertOffsetParentRelativeRectToViewportRelativeRect:_Oe,getDocumentElement:uo,getClippingRect:VOe,getOffsetParent:JZ,getElementRects:UOe,getClientRects:OOe,getDimensions:jOe,getScale:ig,isElement:ma,isRTL:zOe};rJ=VZ,nJ=BZ,iJ=(t,e,r)=>{let n=new Map,i={platform:qOe,...r},s={...i.platform,_c:n};return FZ(t,e,{...i,platform:s})}});var aJ={};ln(aJ,{SRTParser:()=>_E,default:()=>KOe});function KOe(){return new _E}var GOe,WOe,_E,oJ=yt(()=>{yx();GOe=/,/g,WOe="-->",_E=class extends ag{parse(e,r){if(e==="")this.c&&(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null),this.e=sg.None;else if(this.e===sg.Cue)this.c.text+=(this.c.text?`
`:"")+e;else if(e.includes(WOe)){let n=this.q(e,r);n&&(this.c=new oc(n[0],n[1],n[2].join(" ")),this.c.id=this.n,this.e=sg.Cue)}this.n=e}q(e,r){return super.q(e.replace(GOe,"."),r)}}});var sN={};ln(sN,{ParseErrorBuilder:()=>YOe});var YOe,aN=yt(()=>{yx();YOe={r(){return new Hi({code:ya.BadSignature,reason:"missing WEBVTT file header",line:1})},s(t,e){return new Hi({code:ya.BadTimestamp,reason:`cue start timestamp \`${t}\` is invalid on line ${e}`,line:e})},t(t,e){return new Hi({code:ya.BadTimestamp,reason:`cue end timestamp \`${t}\` is invalid on line ${e}`,line:e})},u(t,e,r){return new Hi({code:ya.BadTimestamp,reason:`cue end timestamp \`${e}\` is greater than start \`${t}\` on line ${r}`,line:r})},y(t,e,r){return new Hi({code:ya.BadSettingValue,reason:`invalid value for cue setting \`${t}\` on line ${r} (value: ${e})`,line:r})},x(t,e,r){return new Hi({code:ya.UnknownSetting,reason:`unknown cue setting \`${t}\` on line ${r} (value: ${e})`,line:r})},w(t,e,r){return new Hi({code:ya.BadSettingValue,reason:`invalid value for region setting \`${t}\` on line ${r} (value: ${e})`,line:r})},v(t,e,r){return new Hi({code:ya.UnknownSetting,reason:`unknown region setting \`${t}\` on line ${r} (value: ${e})`,line:r})},T(t,e){return new Hi({code:ya.BadFormat,reason:`format missing for \`${t}\` block on line ${e}`,line:e})}}});var pJ={};ln(pJ,{SSAParser:()=>NE,default:()=>XOe});function lN(t){let e=parseInt(t.replace("&H",""),16);if(e>=0){let n=(e>>24&255^255)/255,i=e>>16&255,s=e>>8&255;return"rgba("+[e&255,s,i,n].join(",")+")"}return null}function cN(t,e,r){let n=Math.ceil(2*Math.PI*t),i="";for(let s=0;s<n;s++){let a=2*Math.PI*s/n;i+=t*Math.cos(a)+"px "+e*Math.sin(a)+"px 0 "+r+(s==n-1?"":",")}return i}function XOe(){return new NE}var OE,lJ,cJ,DE,uJ,dJ,fJ,oN,NE,hJ=yt(()=>{yx();OE=/^Format:[\s\t]*/,lJ=/^Style:[\s\t]*/,cJ=/^Dialogue:[\s\t]*/,DE=/[\s\t]*,[\s\t]*/,uJ=/\{[^}]+\}/g,dJ=/\\N/g,fJ=/^\[(.*)[\s\t]?Styles\]$/,oN=/^\[(.*)[\s\t]?Events\]$/,NE=class{h;O=0;c=null;l=[];m=[];N=null;f;P={};async init(e){this.h=e,e.errors&&(this.f=(await Promise.resolve().then(()=>(aN(),sN))).ParseErrorBuilder)}parse(e,r){if(this.O)switch(this.O){case 1:if(e==="")this.O=0;else if(lJ.test(e))if(this.N){let n=e.replace(lJ,"").split(DE);this.S(n)}else this.g(this.f?.T("Style",r));else OE.test(e)?this.N=e.replace(OE,"").split(DE):oN.test(e)&&(this.N=null,this.O=2);break;case 2:if(e==="")this.Q();else if(cJ.test(e))if(this.Q(),this.N){let n=e.replace(cJ,"").split(DE),i=this.U(n,r);i&&(this.c=i)}else this.g(this.f?.T("Dialogue",r));else this.c?this.c.text+=`
`+e.replace(uJ,"").replace(dJ,`
`):OE.test(e)?this.N=e.replace(OE,"").split(DE):fJ.test(e)?(this.N=null,this.O=1):oN.test(e)&&(this.N=null)}else e===""||(fJ.test(e)?(this.N=null,this.O=1):oN.test(e)&&(this.N=null,this.O=2))}done(){return{metadata:{},cues:this.l,regions:[],errors:this.m}}Q(){this.c&&(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null)}S(e){let r="Default",n={},i,s="center",a="bottom",o,l=1.2,c,u,d=3,f=[];for(let p=0;p<this.N.length;p++){let h=this.N[p],m=e[p];switch(h){case"Name":r=m;break;case"Fontname":n["font-family"]=m;break;case"Fontsize":n["font-size"]=`calc(${m} / var(--overlay-height))`;break;case"PrimaryColour":let v=lN(m);v&&(n["--cue-color"]=v);break;case"BorderStyle":d=parseInt(m,10);break;case"BackColour":u=lN(m);break;case"OutlineColour":let b=lN(m);b&&(c=b);break;case"Bold":parseInt(m)&&(n["font-weight"]="bold");break;case"Italic":parseInt(m)&&(n["font-style"]="italic");break;case"Underline":parseInt(m)&&(n["text-decoration"]="underline");break;case"StrikeOut":parseInt(m)&&(n["text-decoration"]="line-through");break;case"Spacing":n["letter-spacing"]=m+"px";break;case"AlphaLevel":n.opacity=parseFloat(m);break;case"ScaleX":f.push(`scaleX(${parseFloat(m)/100})`);break;case"ScaleY":f.push(`scaleY(${parseFloat(m)/100})`);break;case"Angle":f.push(`rotate(${m}deg)`);break;case"Shadow":l=parseInt(m,10)*1.2;break;case"MarginL":n["--cue-width"]="auto",n["--cue-left"]=parseFloat(m)+"px";break;case"MarginR":n["--cue-width"]="auto",n["--cue-right"]=parseFloat(m)+"px";break;case"MarginV":o=parseFloat(m);break;case"Outline":i=parseInt(m,10);break;case"Alignment":let y=parseInt(m,10);switch(y>=4&&(a=y>=7?"top":"center"),y%3){case 1:s="start";break;case 2:s="center";break;case 3:s="end";break}}}if(n.R=a,n["--cue-white-space"]="normal",n["--cue-line-height"]="normal",n["--cue-text-align"]=s,a==="center"?(n["--cue-top"]="50%",f.push("translateY(-50%)")):n[`--cue-${a}`]=(o||0)+"px",d===1&&(n["--cue-padding-y"]="0"),(d===1||u)&&(n["--cue-bg-color"]=d===1?"none":u),d===3&&c&&(n["--cue-outline"]=`${i}px solid ${c}`),d===1&&typeof i=="number"){let p=u??"#000";n["--cue-text-shadow"]=[c&&cN(i*1.2,l*1.2,c),c?cN(i*(i/2),l*(i/2),p):cN(i,l,p)].filter(Boolean).join(", ")}f.length&&(n["--cue-transform"]=f.join(" ")),this.P[r]=n}U(e,r){let n=this.V(e),i=this.q(n.Start,n.End,r);if(!i)return;let s=new oc(i[0],i[1],""),a={...this.P[n.Style]||{}},o=n.Name?`<v ${n.Name}>`:"",l=a.R,c=n.MarginL&&parseFloat(n.MarginL),u=n.MarginR&&parseFloat(n.MarginR),d=n.MarginV&&parseFloat(n.MarginV);return c&&(a["--cue-width"]="auto",a["--cue-left"]=c+"px"),u&&(a["--cue-width"]="auto",a["--cue-right"]=u+"px"),d&&l!=="center"&&(a[`--cue-${l}`]=d+"px"),s.text=o+e.slice(this.N.length-1).join(", ").replace(uJ,"").replace(dJ,`
`),delete a.R,Object.keys(a).length&&(s.style=a),s}V(e){let r={};for(let n=0;n<this.N.length;n++)r[this.N[n]]=e[n];return r}q(e,r,n){let i=lc(e),s=lc(r);if(i!==null&&s!==null&&s>i)return[i,s];i===null&&this.g(this.f?.s(e,n)),s===null&&this.g(this.f?.t(r,n)),i!=null&&s!==null&&s>i&&this.g(this.f?.u(i,s,n))}g(e){if(e){if(this.m.push(e),this.h.strict)throw this.h.cancel(),e;this.h.onError?.(e)}}}});async function xJ(t,e){let r=new ReadableStream({start(n){let i=t.split(bJ);for(let s of i)n.enqueue(s);n.close()}});return jE(r,e)}async function jE(t,e){let r=e?.type??"vtt",n;if(typeof r=="string")switch(r){case"srt":n=(await Promise.resolve().then(()=>(oJ(),aJ))).default;break;case"ssa":case"ass":n=(await Promise.resolve().then(()=>(hJ(),pJ))).default;break;default:n=(await Promise.resolve().then(function(){return h6e})).default}else n=r;let i,s=t.getReader(),a=n(),o=!!e?.strict||!!e?.errors;await a.init({strict:!1,...e,errors:o,type:r,cancel(){s.cancel(),i=a.done(!0)}});let l=1;for(;;){let{value:c,done:u}=await s.read();if(u){a.parse("",l),i=a.done(!1);break}a.parse(c,l),l++}return i}async function wJ(t,e){let r=await t;if(!r.ok||!r.body)return{metadata:{},cues:[],regions:[],errors:[void 0]};let n=r.headers.get("content-type")||"",i=n.match(/text\/(.*?)(?:;|$)/)?.[1],s=n.match(/charset=(.*?)(?:;|$)/)?.[1];return pN(r.body,{type:i,encoding:s,...e})}async function pN(t,{encoding:e="utf-8",...r}={}){let n=t.pipeThrough(new dN(e));return jE(n,r)}function JOe(t){let e=parseInt(t,10);return Number.isNaN(e)?null:e}function bx(t){let e=parseInt(t.replace(ZOe,""),10);return!Number.isNaN(e)&&e>=0&&e<=100?e:null}function gJ(t){if(!t.includes(mJ))return null;let[e,r]=t.split(mJ).map(bx);return e!==null&&r!==null?[e,r]:null}function e6e(t){let e=parseFloat(t);return Number.isNaN(e)?null:e}function lc(t){let e=t.match(f6e);if(!e)return null;let r=e[1]?parseInt(e[1],10):0,n=parseInt(e[2],10),i=parseInt(e[3],10),s=e[4]?parseInt(e[4].padEnd(3,"0"),10):0,a=r*3600+n*60+i+s/1e3;return r<0||n<0||i<0||s<0||n>59||i>59?null:a}function p6e(){return new ag}function mN(t){let e="",r=1,n=[],i=[],s;for(let c=0;c<t.text.length;c++){let u=t.text[c];switch(r){case 1:u==="<"?(l(),r=2):e+=u;break;case 2:switch(u){case`
`:case" ":case" ":a(),r=4;break;case".":a(),r=3;break;case"/":r=5;break;case">":a(),r=1;break;default:!e&&m6e.test(u)&&(r=6),e+=u;break}break;case 3:switch(u){case" ":case" ":case`
`:o(),s&&s.class?.trim(),r=4;break;case".":o();break;case">":o(),s&&s.class?.trim(),r=1;break;default:e+=u}break;case 4:u===">"?(e=e.replace(g6e," "),s?.type==="v"?s.voice=uN(e):s?.type==="lang"&&(s.lang=uN(e)),e="",r=1):e+=u;break;case 5:u===">"&&(e="",s=i.pop(),r=1);break;case 6:if(u===">"){let d=lc(e);d!==null&&d>=t.startTime&&d<=t.endTime&&(e="timestamp",a(),s.time=d),e="",r=1}else e+=u;break}}function a(){if(x6e.has(e)){let c=s;s=w6e(e),c?(i[i.length-1]!==c&&i.push(c),c.children.push(s)):n.push(s)}e="",r=1}function o(){if(s&&e){let c=e.replace("bg_","");b6e.has(c)?s[e.startsWith("bg_")?"bgColor":"color"]=c:s.class=s.class?s.class+" "+e:e}e=""}function l(){if(!e)return;let c={type:"text",data:uN(e)};s?s.children.push(c):n.push(c),e=""}return r===1&&l(),n}function w6e(t){return{tagName:kJ[t],type:t,children:[]}}function uN(t){return t.replace(v6e,e=>y6e[e]||"'")}function bi(t,e,r){t.style.setProperty(`--${e}`,r+"")}function Lu(t,e,r=!0){t.setAttribute(`data-${e}`,r===!0?"":r+"")}function FE(t,e){t.setAttribute("data-part",e)}function k6e(t){return parseFloat(getComputedStyle(t).lineHeight)||0}function SJ(t){if(hN)throw Error("[media-captions] called `createVTTCueTemplate` on the server - use `renderVTTCueString`");let e=document.createElement("template");return e.innerHTML=$E(t),{cue:t,content:e.content}}function $E(t,e=0){return UE(mN(t),e)}function UE(t,e=0){let r,n="";for(let i of t)if(i.type==="text")n+=i.data;else{let s=i.type==="timestamp";r={},r.class=i.class,r.title=i.type==="v"&&i.voice,r.lang=i.type==="lang"&&i.lang,r["data-part"]=i.type==="v"&&"voice",s&&(r["data-part"]="timed",r["data-time"]=i.time,r["data-future"]=i.time>e,r["data-past"]=i.time<e),r.style=`${i.color?`color: ${i.color};`:""}${i.bgColor?`background-color: ${i.bgColor};`:""}`;let a=Object.entries(r).filter(o=>o[1]).map(o=>`${o[0]}="${o[1]===!0?"":o[1]}"`).join(" ");n+=`<${i.tagName}${a?" "+a:""}>${UE(i.children)}</${i.tagName}>`}return n}function gN(t,e){if(!hN)for(let r of t.querySelectorAll('[data-part="timed"]')){let n=Number(r.getAttribute("data-time"));Number.isNaN(n)||(n>e?Lu(r,"future"):r.removeAttribute("data-future"),n<e?Lu(r,"past"):r.removeAttribute("data-past"))}}function S6e(t,e){let r=null,n;function i(){s(),t(...n),n=void 0}function s(){clearTimeout(r),r=null}function a(){n=[].slice.call(arguments),s(),r=setTimeout(i,e)}return a}function yN(t){return t instanceof HTMLElement?{top:t.offsetTop,width:t.clientWidth,height:t.clientHeight,left:t.offsetLeft,right:t.offsetLeft+t.clientWidth,bottom:t.offsetTop+t.clientHeight}:{...t}}function BE(t,e,r){switch(e){case"+x":t.left+=r,t.right+=r;break;case"-x":t.left-=r,t.right-=r;break;case"+y":t.top+=r,t.bottom+=r;break;case"-y":t.top-=r,t.bottom-=r;break}}function C6e(t,e){return t.left<=e.right&&t.right>=e.left&&t.top<=e.bottom&&t.bottom>=e.top}function T6e(t,e){for(let r=0;r<e.length;r++)if(C6e(t,e[r]))return e[r];return null}function vJ(t,e){return e.top>=0&&e.bottom<=t.height&&e.left>=0&&e.right<=t.width}function E6e(t,e,r){switch(r){case"+x":return e.left<0;case"-x":return e.right>t.width;case"+y":return e.top<0;case"-y":return e.bottom>t.height}}function I6e(t,e){let r=Math.max(0,Math.min(t.width,e.right)-Math.max(0,e.left)),n=Math.max(0,Math.min(t.height,e.bottom)-Math.max(0,e.top));return r*n/(t.height*t.width)}function vN(t,e){return{top:e.top/t.height,left:e.left/t.width,right:(t.width-e.right)/t.width,bottom:(t.height-e.bottom)/t.height}}function CJ(t,e){return e.top=e.top*t.height,e.left=e.left*t.width,e.right=t.width-e.right*t.width,e.bottom=t.height-e.bottom*t.height,e}function EJ(t,e,r,n){let i=vN(e,r);for(let s of TJ)bi(t,`${n}-${s}`,i[s]*100+"%")}function IJ(t,e,r,n){let i=1,s,a={...e};for(let o=0;o<n.length;o++){for(;E6e(t,e,n[o])||vJ(t,e)&&T6e(e,r);)BE(e,n[o],1);if(vJ(t,e))return e;let l=I6e(t,e);i>l&&(s={...e},i=l),e={...a}}return s||a}function A6e(t,e,r,n){let i=r.firstElementChild,s=L6e(e),a,o=[];if(r[Mu]||(r[Mu]=P6e(t,r)),a=CJ(t,{...r[Mu]}),r[xx])o=[r[xx]==="top"?"+y":"-y","+x","-x"];else if(e.snapToLines){let l;switch(e.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width";break}let c=k6e(i),u=c*Math.round(s),d=t[l]+c,f=o[0];Math.abs(u)>d&&(u=u<0?-1:1,u*=Math.ceil(d/c)*c),s<0&&(u+=e.vertical===""?t.height:t.width,o=o.reverse()),BE(a,f,u)}else{let l=e.vertical==="",c=l?"+y":"+x",u=l?a.height:a.width;BE(a,c,(l?t.height:t.width)*s/100),BE(a,c,e.lineAlign==="center"?u/2:e.lineAlign==="end"?u:0),o=l?["-y","+y","-x","+x"]:["-x","+x","-y","+y"]}return a=IJ(t,a,n,o),EJ(r,t,a,"cue"),a}function P6e(t,e){let r=yN(e),n=R6e(e);if(e[xx]=!1,n.top&&(r.top=n.top,r.bottom=n.top+r.height,e[xx]="top"),n.bottom){let i=t.height-n.bottom;r.top=i-r.height,r.bottom=i,e[xx]="bottom"}return n.left&&(r.left=n.left),n.right&&(r.right=t.width-n.right),vN(t,r)}function R6e(t){let e={};for(let r of TJ)e[r]=parseFloat(t.style.getPropertyValue(`--cue-${r}`));return e}function L6e(t){return t.line==="auto"?t.snapToLines?-1:100:t.line}function M6e(t){if(t.position==="auto")switch(t.align){case"start":case"left":return 0;case"right":case"end":return 100;default:return 50}return t.position}function _6e(t,e){if(t.positionAlign==="auto")switch(t.align){case"start":return e==="ltr"?"line-left":"line-right";case"end":return e==="ltr"?"line-right":"line-left";case"center":return"center";default:return`line-${t.align}`}return t.positionAlign}function D6e(t,e,r,n){let i=Array.from(r.querySelectorAll('[data-part="cue-display"]')),s=0,a=Math.max(0,i.length-e.lines);for(let l=i.length-1;l>=a;l--)s+=i[l].offsetHeight;bi(r,"region-height",s+"px"),r[Mu]||(r[Mu]=vN(t,yN(r)));let o={...r[Mu]};return o=CJ(t,o),o.width=r.clientWidth,o.height=s,o.right=o.left+o.width,o.bottom=o.top+s,o=IJ(t,o,n,O6e),EJ(r,t,o,"region"),o}var ya,Hi,bJ,dN,fN,wx,hN,QOe,oc,kx,mJ,ZOe,t6e,yJ,r6e,og,n6e,i6e,s6e,a6e,vx,o6e,l6e,c6e,u6e,d6e,f6e,sg,ag,h6e,m6e,g6e,kJ,y6e,v6e,b6e,x6e,Mu,TJ,xx,O6e,VE,yx=yt(()=>{ya={LoadFail:0,BadSignature:1,BadTimestamp:2,BadSettingValue:3,BadFormat:4,UnknownSetting:5},Hi=class extends Error{code;line;constructor(e){super(e.reason),this.code=e.code,this.line=e.line}},bJ=/\r?\n|\r/gm,dN=class{writable;readable;constructor(e){let r=new fN(e);this.writable=new WritableStream({write(n){r.transform(n)},close(){r.close()}}),this.readable=new ReadableStream({start(n){r.onLine=i=>n.enqueue(i),r.onClose=()=>n.close()}})}},fN=class{a="";b;onLine;onClose;constructor(e){this.b=new TextDecoder(e)}transform(e){this.a+=this.b.decode(e,{stream:!0});let r=this.a.split(bJ);this.a=r.pop()||"";for(let n=0;n<r.length;n++)this.onLine(r[n].trim())}close(){this.a&&this.onLine(this.a.trim()),this.a="",this.onClose()}};wx=class extends EventTarget{id="";startTime;endTime;text;pauseOnExit=!1;constructor(e,r,n){super(),this.startTime=e,this.endTime=r,this.text=n}addEventListener(e,r,n){super.addEventListener(e,r,n)}removeEventListener(e,r,n){super.removeEventListener(e,r,n)}},hN=typeof document>"u",QOe=hN?wx:window.VTTCue,oc=class extends QOe{region=null;vertical="";snapToLines=!0;line="auto";lineAlign="start";position="auto";positionAlign="auto";size=100;align="center";style},kx=class{id="";width=100;lines=3;regionAnchorX=0;regionAnchorY=100;viewportAnchorX=0;viewportAnchorY=100;scroll=""},mJ=",",ZOe="%";t6e="WEBVTT",yJ=",",r6e="%",og=/[:=]/,n6e=/^[\s\t]*(region|vertical|line|position|size|align)[:=]/,i6e="NOTE",s6e="REGION",a6e=/^REGION:?[\s\t]+/,vx=/[\s\t]+/,o6e="-->",l6e=/[\s\t]*-->[\s\t]+/,c6e=/start|center|end|left|right/,u6e=/start|center|end/,d6e=/line-(?:left|right)|center|auto/,f6e=/^(?:(\d{1,2}):)?(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/,sg=(t=>(t[t.None=0]="None",t[t.Header=1]="Header",t[t.Cue=2]="Cue",t[t.Region=3]="Region",t[t.Note=4]="Note",t))(sg||{}),ag=class{h;e=0;i={};j={};l=[];c=null;d=null;m=[];f;n="";async init(e){this.h=e,e.strict&&(this.e=1),e.errors&&(this.f=(await Promise.resolve().then(()=>(aN(),sN))).ParseErrorBuilder)}parse(e,r){if(e==="")this.c?(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null):this.d?(this.j[this.d.id]=this.d,this.h.onRegion?.(this.d),this.d=null):this.e===1&&(this.k(e,r),this.h.onHeaderMetadata?.(this.i)),this.e=0;else if(this.e)switch(this.e){case 1:this.k(e,r);break;case 2:if(this.c){let n=this.c.text.length>0;!n&&n6e.test(e)?this.o(e.split(vx),r):this.c.text+=(n?`
`:"")+e}break;case 3:this.p(e.split(vx),r);break}else if(e.startsWith(i6e))this.e=4;else if(e.startsWith(s6e))this.e=3,this.d=new kx,this.p(e.replace(a6e,"").split(vx),r);else if(e.includes(o6e)){let n=this.q(e,r);n&&(this.c=new oc(n[0],n[1],""),this.c.id=this.n,this.o(n[2],r)),this.e=2}else r===1&&this.k(e,r);this.n=e}done(){return{metadata:this.i,cues:this.l,regions:Object.values(this.j),errors:this.m}}k(e,r){if(r>1){if(og.test(e)){let[n,i]=e.split(og);n&&(this.i[n]=(i||"").replace(vx,""))}}else e.startsWith(t6e)?this.e=1:this.g(this.f?.r())}q(e,r){let[n,i=""]=e.split(l6e),[s,...a]=i.split(vx),o=lc(n),l=lc(s);if(o!==null&&l!==null&&l>o)return[o,l,a];o===null&&this.g(this.f?.s(n,r)),l===null&&this.g(this.f?.t(s,r)),o!=null&&l!==null&&l>o&&this.g(this.f?.u(o,l,r))}p(e,r){let n;for(let i=0;i<e.length;i++)if(og.test(e[i])){n=!1;let[s,a]=e[i].split(og);switch(s){case"id":this.d.id=a;break;case"width":let o=bx(a);o!==null?this.d.width=o:n=!0;break;case"lines":let l=JOe(a);l!==null?this.d.lines=l:n=!0;break;case"regionanchor":let c=gJ(a);c!==null?(this.d.regionAnchorX=c[0],this.d.regionAnchorY=c[1]):n=!0;break;case"viewportanchor":let u=gJ(a);u!==null?(this.d.viewportAnchorX=u[0],this.d.viewportAnchorY=u[1]):n=!0;break;case"scroll":a==="up"?this.d.scroll="up":n=!0;break;default:this.g(this.f?.v(s,a,r))}n&&this.g(this.f?.w(s,a,r))}}o(e,r){let n;for(let i=0;i<e.length;i++)if(n=!1,og.test(e[i])){let[s,a]=e[i].split(og);switch(s){case"region":let o=this.j[a];o&&(this.c.region=o);break;case"vertical":a==="lr"||a==="rl"?(this.c.vertical=a,this.c.region=null):n=!0;break;case"line":let[l,c]=a.split(yJ);if(l.includes(r6e)){let h=bx(l);h!==null?(this.c.line=h,this.c.snapToLines=!1):n=!0}else{let h=e6e(l);h!==null?this.c.line=h:n=!0}u6e.test(c)?this.c.lineAlign=c:c&&(n=!0),this.c.line!=="auto"&&(this.c.region=null);break;case"position":let[u,d]=a.split(yJ),f=bx(u);f!==null?this.c.position=f:n=!0,d&&d6e.test(d)?this.c.positionAlign=d:d&&(n=!0);break;case"size":let p=bx(a);p!==null?(this.c.size=p,p<100&&(this.c.region=null)):n=!0;break;case"align":c6e.test(a)?this.c.align=a:n=!0;break;default:this.g(this.f?.x(s,a,r))}n&&this.g(this.f?.y(s,a,r))}}g(e){if(e){if(this.m.push(e),this.h.strict)throw this.h.cancel(),e;this.h.onError?.(e)}}};h6e=Object.freeze({__proto__:null,VTTBlock:sg,VTTParser:ag,default:p6e,parseVTTTimestamp:lc}),m6e=/[0-9]/,g6e=/[\s\t]+/,kJ={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span",timestamp:"span"},y6e={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&nbsp;":"\xA0","&lrm;":"\u200E","&rlm;":"\u200F"},v6e=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,b6e=new Set(["white","lime","cyan","red","yellow","magenta","blue","black"]),x6e=new Set(Object.keys(kJ));Mu=Symbol(0);TJ=["top","left","right","bottom"];xx=Symbol(0);O6e=["-y","+y","-x","+x"];VE=class{overlay;z;A=0;C="ltr";B=[];D=!1;E;j=new Map;l=new Map;get dir(){return this.C}set dir(e){this.C=e,Lu(this.overlay,"dir",e)}get currentTime(){return this.A}set currentTime(e){this.A=e,this.update()}constructor(e,r){this.overlay=e,this.dir=r?.dir??"ltr",e.setAttribute("translate","yes"),e.setAttribute("aria-live","off"),e.setAttribute("aria-atomic","true"),FE(e,"captions"),this.G(),this.E=new ResizeObserver(this.I.bind(this)),this.E.observe(e)}changeTrack({regions:e,cues:r}){this.reset(),this.J(e);for(let n of r)this.l.set(n,null);this.update()}addCue(e){this.l.set(e,null),this.update()}removeCue(e){this.l.delete(e),this.update()}update(e=!1){this.H(e)}reset(){this.l.clear(),this.j.clear(),this.B=[],this.overlay.textContent=""}destroy(){this.reset(),this.E.disconnect()}I(){this.D=!0,this.K()}K=S6e(()=>{this.D=!1,this.G();for(let e of this.j.values())e[Mu]=null;for(let e of this.l.values())e&&(e[Mu]=null);this.H(!0)},50);G(){this.z=yN(this.overlay),bi(this.overlay,"overlay-width",this.z.width+"px"),bi(this.overlay,"overlay-height",this.z.height+"px")}H(e=!1){if(!this.l.size||this.D)return;let r,n=[...this.l.keys()].filter(s=>this.A>=s.startTime&&this.A<=s.endTime).sort((s,a)=>s.startTime!==a.startTime?s.startTime-a.startTime:s.endTime-a.endTime),i=n.map(s=>s.region);for(let s=0;s<this.B.length;s++){if(r=this.B[s],n[s]===r)continue;if(r.region&&!i.includes(r.region)){let o=this.j.get(r.region.id);o&&(o.removeAttribute("data-active"),e=!0)}let a=this.l.get(r);a&&(a.remove(),e=!0)}for(let s=0;s<n.length;s++){r=n[s];let a=this.l.get(r);a||this.l.set(r,a=this.L(r));let o=this.F(r)&&this.j.get(r.region.id);o&&!o.hasAttribute("data-active")&&(requestAnimationFrame(()=>Lu(o,"active")),e=!0),a.isConnected||((o||this.overlay).append(a),e=!0)}if(e){let s=[],a=new Set;for(let o=n.length-1;o>=0;o--){if(r=n[o],a.has(r.region||r))continue;let l=this.F(r),c=l?this.j.get(r.region.id):this.l.get(r);l?s.push(D6e(this.z,r.region,c,s)):s.push(A6e(this.z,r,c,s)),a.add(l?r.region:r)}}gN(this.overlay,this.A),this.B=n}J(e){if(e)for(let r of e){let n=this.M(r);this.j.set(r.id,n),this.overlay.append(n)}}M(e){let r=document.createElement("div");return FE(r,"region"),Lu(r,"id",e.id),Lu(r,"scroll",e.scroll),bi(r,"region-width",e.width+"%"),bi(r,"region-anchor-x",e.regionAnchorX),bi(r,"region-anchor-y",e.regionAnchorY),bi(r,"region-viewport-anchor-x",e.viewportAnchorX),bi(r,"region-viewport-anchor-y",e.viewportAnchorY),bi(r,"region-lines",e.lines),r}L(e){let r=document.createElement("div"),n=M6e(e),i=_6e(e,this.C);if(FE(r,"cue-display"),e.vertical!==""&&Lu(r,"vertical"),bi(r,"cue-text-align",e.align),e.style)for(let a of Object.keys(e.style))r.style.setProperty(a,e.style[a]);if(this.F(e))bi(r,"cue-offset",`${n-(i==="line-right"?100:i==="center"?50:0)}%`);else if(bi(r,"cue-writing-mode",e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl"),!e.style?.["--cue-width"]){let a=n;i==="line-left"?a=100-n:i==="center"&&n<=50?a=n*2:i==="center"&&n>50&&(a=(100-n)*2);let o=e.size<a?e.size:a;e.vertical===""?bi(r,"cue-width",o+"%"):bi(r,"cue-height",o+"%")}let s=document.createElement("div");return FE(s,"cue"),e.id&&Lu(s,"id",e.id),s.innerHTML=$E(e),r.append(s),r}F(e){return e.region&&e.size===100&&e.vertical===""&&e.line==="auto"}}});var Sx={};ln(Sx,{CaptionsRenderer:()=>VE,ParseError:()=>Hi,ParseErrorCode:()=>ya,TextCue:()=>wx,VTTCue:()=>oc,VTTRegion:()=>kx,createVTTCueTemplate:()=>SJ,parseByteStream:()=>pN,parseResponse:()=>wJ,parseText:()=>xJ,parseTextStream:()=>jE,parseVTTTimestamp:()=>lc,renderVTTCueString:()=>$E,renderVTTTokensString:()=>UE,tokenizeVTTCue:()=>mN,updateTimedVTTCueNodes:()=>gN});var Cx=yt(()=>{yx()});var AJ={};ln(AJ,{AudioProvider:()=>bN});var zyt,bN,PJ=yt(()=>{"use client";oo();va();zyt=Z(Te(),1),bN=class extends Tx{$$PROVIDER_TYPE="AUDIO";get type(){return"audio"}airPlay;constructor(e,r){super(e,r),pn(()=>{this.airPlay=new Ex(this.media,r)},this.scope)}setup(){super.setup(),this.type==="audio"&&this.ctx.notify("provider-setup",this)}get audio(){return this.media}}});var RJ={};ln(RJ,{HLSProvider:()=>kN});async function F6e(t,e={}){if(!Jt(t)){if(e.onLoadStart?.(),t.prototype&&t.prototype!==Function)return e.onLoaded?.(t),t;try{let r=(await t())?.default;if(r&&r.isSupported)e.onLoaded?.(r);else throw Error("");return r}catch(r){e.onLoadError?.(r)}}}async function B6e(t,e={}){if(me(t)){e.onLoadStart?.();try{if(await Ax(t),!hn(window.Hls))throw Error("");let r=window.Hls;return e.onLoaded?.(r),r}catch(r){e.onLoadError?.(r)}}}var Wyt,N6e,xN,wN,V6e,kN,LJ=yt(()=>{"use client";oo();lo();va();Wyt=Z(Te(),1),N6e=t=>Ru(t),xN=class{#e;#t;#r=null;#n=null;config={};#i=new Set;get instance(){return this.#r}constructor(e,r){this.#e=e,this.#t=r}setup(e){let{streamType:r}=this.#t.$state,n=te(r).includes("live"),i=te(r).includes("ll-");this.#r=new e({lowLatencyMode:i,backBufferLength:i?4:n?8:void 0,renderTextTracksNatively:!1,...this.config});let s=this.#l.bind(this);for(let a of Object.values(e.Events))this.#r.on(a,s);this.#r.on(e.Events.ERROR,this.#m.bind(this));for(let a of this.#i)a(this.#r);this.#t.player.dispatch("hls-instance",{detail:this.#r}),this.#r.attachMedia(this.#e),this.#r.on(e.Events.AUDIO_TRACK_SWITCHED,this.#f.bind(this)),this.#r.on(e.Events.LEVEL_SWITCHED,this.#d.bind(this)),this.#r.on(e.Events.LEVEL_LOADED,this.#g.bind(this)),this.#r.on(e.Events.LEVEL_UPDATED,this.#p.bind(this)),this.#r.on(e.Events.NON_NATIVE_TEXT_TRACKS_FOUND,this.#u.bind(this)),this.#r.on(e.Events.CUES_PARSED,this.#c.bind(this)),this.#t.qualities[Qr.enableAuto]=this.#w.bind(this),We(this.#t.qualities,"change",this.#h.bind(this)),We(this.#t.audioTracks,"change",this.#x.bind(this)),this.#n=U(this.#a.bind(this))}#s(e,r){return new Ie(N6e(e),{detail:r})}#a(){if(!this.#t.$state.live())return;let e=new nl(this.#o.bind(this));return e.start(),e.stop.bind(e)}#o(){this.#t.$state.liveSyncPosition.set(this.#r?.liveSyncPosition??1/0)}#l(e,r){this.#t.player?.dispatch(this.#s(e,r))}#u(e,r){let n=this.#s(e,r),i=-1;for(let s=0;s<r.tracks.length;s++){let a=r.tracks[s],o=a.subtitleTrack??a.closedCaptions,l=new Kn({id:`hls-${a.kind}-${s}`,src:o?.url,label:a.label,language:o?.lang,kind:a.kind,default:a.default});l[Re.readyState]=2,l[Re.onModeChange]=()=>{l.mode==="showing"?(this.#r.subtitleTrack=s,i=s):i===s&&(this.#r.subtitleTrack=-1,i=-1)},this.#t.textTracks.add(l,n)}}#c(e,r){let n=this.#r?.subtitleTrack,i=this.#t.textTracks.getById(`hls-${r.type}-${n}`);if(!i)return;let s=this.#s(e,r);for(let a of r.cues)a.positionAlign="auto",i.addCue(a,s)}#f(e,r){let n=this.#t.audioTracks[r.id];if(n){let i=this.#s(e,r);this.#t.audioTracks[Se.select](n,!0,i)}}#d(e,r){let n=this.#t.qualities[r.level];if(n){let i=this.#s(e,r);this.#t.qualities[Se.select](n,!0,i)}}#p(e,r){r.details.totalduration>0&&this.#t.$state.inferredLiveDVRWindow.set(r.details.totalduration)}#g(e,r){if(this.#t.$state.canPlay())return;let{type:n,live:i,totalduration:s,targetduration:a}=r.details,o=this.#s(e,r);this.#t.notify("stream-type-change",i?n==="EVENT"&&Number.isFinite(s)&&a>=10?"live:dvr":"live":"on-demand",o),this.#t.notify("duration-change",s,o);let l=this.#r.media;this.#r.currentLevel===-1&&this.#t.qualities[Qr.setAuto](!0,o);for(let c of this.#r.audioTracks){let u={id:c.id.toString(),label:c.name,language:c.lang||"",kind:"main"};this.#t.audioTracks[Se.add](u,o)}for(let c of this.#r.levels){let u={id:c.id?.toString()??c.height+"p",width:c.width,height:c.height,codec:c.codecSet,bitrate:c.bitrate};this.#t.qualities[Se.add](u,o)}l.dispatchEvent(new Ie("canplay",{trigger:o}))}#m(e,r){if(r.fatal)switch(r.type){case"mediaError":this.#r?.recoverMediaError();break;default:this.#y(r.error);break}}#y(e){this.#t.notify("error",{message:e.message,code:1,error:e})}#w(){this.#r&&(this.#r.currentLevel=-1)}#h(){let{qualities:e}=this.#t;!this.#r||e.auto||(this.#r[e.switch+"Level"]=e.selectedIndex,lg&&(this.#e.currentTime=this.#e.currentTime))}#x(){let{audioTracks:e}=this.#t;this.#r&&this.#r.audioTrack!==e.selectedIndex&&(this.#r.audioTrack=e.selectedIndex)}onInstance(e){return this.#i.add(e),()=>this.#i.delete(e)}loadSource(e){me(e.src)&&this.#r?.loadSource(e.src)}destroy(){this.#r?.destroy(),this.#r=null,this.#n?.(),this.#n=null}},wN=class{#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n,this.#n()}async#n(){let e={onLoadStart:this.#i.bind(this),onLoaded:this.#s.bind(this),onLoadError:this.#a.bind(this)},r=await B6e(this.#e,e);if(Jt(r)&&!me(this.#e)&&(r=await F6e(this.#e,e)),!r)return null;if(!r.isSupported()){let n="[vidstack] `hls.js` is not supported in this environment";return this.#t.player.dispatch(new Ie("hls-unsupported")),this.#t.notify("error",{message:n,code:4}),null}return r}#i(){this.#t.player.dispatch(new Ie("hls-lib-load-start"))}#s(e){this.#t.player.dispatch(new Ie("hls-lib-loaded",{detail:e})),this.#r(e)}#a(e){let r=ug(e);this.#t.player.dispatch(new Ie("hls-lib-load-error",{detail:r})),this.#t.notify("error",{message:r.message,code:4,error:r})}};V6e="https://cdn.jsdelivr.net",kN=class extends cg{$$PROVIDER_TYPE="HLS";#e=null;#t=new xN(this.video,this.ctx);get ctor(){return this.#e}get instance(){return this.#t.instance}static supported=Ix();get type(){return"hls"}get canLiveSync(){return!0}#r=`${V6e}/npm/hls.js@^1.5.0/dist/hls.min.js`;get config(){return this.#t.config}set config(e){this.#t.config=e}get library(){return this.#r}set library(e){this.#r=e}preconnect(){me(this.#r)&&ba(this.#r)}setup(){super.setup(),new wN(this.#r,this.ctx,e=>{this.#e=e,this.#t.setup(e),this.ctx.notify("provider-setup",this);let r=te(this.ctx.$state.source);r&&this.loadSource(r)})}async loadSource(e,r){if(!me(e.src)){this.removeSource();return}this.media.preload=r||"",this.appendSource(e,"application/x-mpegurl"),this.#t.loadSource(e),this.currentSrc=e}onInstance(e){let r=this.#t.instance;return r&&e(r),this.#t.onInstance(e)}destroy(){this.#t.destroy()}}});var dg,SN=yt(()=>{"use client";va();oo();lo();dg=class{#e;src=be("");referrerPolicy=null;get iframe(){return this.#e}constructor(e){this.#e=e,e.setAttribute("frameBorder","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("allow","autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"),this.referrerPolicy!==null&&e.setAttribute("referrerpolicy",this.referrerPolicy)}setup(){We(window,"message",this.#r.bind(this)),We(this.#e,"load",this.onLoad.bind(this)),U(this.#t.bind(this))}#t(){let e=this.src();if(!e.length){this.#e.setAttribute("src","");return}let r=te(()=>this.buildParams());this.#e.setAttribute("src",MJ(e,r))}postMessage(e,r){le||this.#e.contentWindow?.postMessage(JSON.stringify(e),r??"*")}#r(e){let r=this.getOrigin();if((e.source===null||e.source===this.#e?.contentWindow)&&(!me(r)||r===e.origin)){try{let i=JSON.parse(e.data);i&&this.onMessage(i,e);return}catch{}e.data&&this.onMessage(e.data,e)}}}});var _J={};ln(_J,{getVimeoVideoInfo:()=>EN,resolveVimeoVideoId:()=>TN});function TN(t){let e=t.match(j6e);return{videoId:e?.[1],hash:e?.[2]}}async function EN(t,e,r){if(CN.has(t))return CN.get(t);if(zE.has(t))return zE.get(t);let n=`https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/${t}`;r&&(n=n.concat(`?h=${r}`));let i=window.fetch(n,{mode:"cors",signal:e.signal}).then(s=>s.json()).then(s=>{let a=/vimeocdn.com\/video\/(.*)?_/,o=s?.thumbnail_url?.match(a)?.[1],l=o?`https://i.vimeocdn.com/video/${o}_1920x1080.webp`:"",c={title:s?.title??"",duration:s?.duration??0,poster:l,pro:s.account_type!=="basic"};return CN.set(t,c),c}).finally(()=>zE.delete(t));return zE.set(t,i),i}var j6e,CN,zE,IN=yt(()=>{"use client";j6e=/(?:https:\/\/)?(?:player\.)?vimeo(?:\.com)?\/(?:video\/)?(\d+)(?:(?:\?hash=|\?h=|\/)(.*))?/,CN=new Map,zE=new Map});var OJ={};ln(OJ,{VimeoProvider:()=>AN});var nvt,$6e,AN,DJ=yt(()=>{"use client";oo();lo();va();SN();IN();nvt=Z(Te(),1),$6e=["bufferend","bufferstart","durationchange","ended","enterpictureinpicture","error","fullscreenchange","leavepictureinpicture","loaded","playProgress","loadProgress","pause","play","playbackratechange","qualitychange","seeked","seeking","timeupdate","volumechange","waiting"],AN=class extends dg{$$PROVIDER_TYPE="VIMEO";scope=yi();fullscreen;#e;#t=be("");#r=be(!1);#n=null;#i=null;#s=!1;#a=new Yt(0,0);#o=new nl(this.#m.bind(this));#l=null;#u=null;#c=new Map;#f=null;constructor(e,r){super(e),this.#e=r;let n=this;this.fullscreen={get active(){return n.#s},supported:!0,enter:()=>this.#I("requestFullscreen"),exit:()=>this.#I("exitFullscreen")}}cookies=!1;title=!0;byline=!0;portrait=!0;color="00ADEF";get type(){return"vimeo"}get currentSrc(){return this.#i}get videoId(){return this.#t()}get hash(){return this.#n}get isPro(){return this.#r()}preconnect(){ba(this.getOrigin())}setup(){super.setup(),U(this.#d.bind(this)),U(this.#p.bind(this)),U(this.#g.bind(this)),this.#e.notify("provider-setup",this)}destroy(){this.#B(),this.fullscreen=void 0;let e="provider destroyed";for(let r of this.#c.values())for(let{reject:n}of r)n(e);this.#c.clear(),this.#I("destroy")}async play(){return this.#I("play")}async pause(){return this.#I("pause")}setMuted(e){this.#I("setMuted",e)}setCurrentTime(e){this.#I("seekTo",e),this.#e.notify("seeking",e)}setVolume(e){this.#I("setVolume",e),this.#I("setMuted",te(this.#e.$state.muted))}setPlaybackRate(e){this.#I("setPlaybackRate",e)}async loadSource(e){if(!me(e.src)){this.#i=null,this.#n=null,this.#t.set("");return}let{videoId:r,hash:n}=TN(e.src);this.#t.set(r??""),this.#n=n??null,this.#i=e}#d(){this.#B();let e=this.#t();if(!e){this.src.set("");return}this.src.set(`${this.getOrigin()}/video/${e}`),this.#e.notify("load-start")}#p(){let e=this.#t();if(!e)return;let r=rc(),n=new AbortController;return this.#f=r,EN(e,n,this.#n).then(i=>{r.resolve(i)}).catch(i=>{r.reject()}),()=>{r.reject(),n.abort()}}#g(){let e=this.#r(),{$state:r,qualities:n}=this.#e;if(r.canSetPlaybackRate.set(e),n[Se.setReadonly](!e),e)return We(n,"change",()=>{if(n.auto)return;let i=n.selected?.id;i&&this.#I("setQuality",i)})}getOrigin(){return"https://player.vimeo.com"}buildParams(){let{keyDisabled:e}=this.#e.$props,{playsInline:r,nativeControls:n}=this.#e.$state,i=n();return{title:this.title,byline:this.byline,color:this.color,portrait:this.portrait,controls:i,h:this.hash,keyboard:i&&!e(),transparent:!0,playsinline:r(),dnt:!this.cookies}}#m(){this.#I("getCurrentTime")}#y=!1;#w(e,r){if(this.#y&&e===0)return;let{realCurrentTime:n,paused:i,bufferedEnd:s,seekableEnd:a,live:o}=this.#e.$state;if(n()===e)return;let l=n();this.#e.notify("time-change",e,r),Math.abs(l-e)>1.5&&(this.#e.notify("seeking",e,r),!i()&&s()<e&&this.#e.notify("waiting",void 0,r)),!o()&&a()-e<.01&&(this.#e.notify("end",void 0,r),this.#y=!0,setTimeout(()=>{this.#y=!1},500))}#h(e,r){this.#e.notify("seeked",e,r)}#x(e){let r=this.#t();this.#f?.promise.then(n=>{if(!n)return;let{title:i,poster:s,duration:a,pro:o}=n;this.#r.set(o),this.#e.notify("title-change",i,e),this.#e.notify("poster-change",s,e),this.#e.notify("duration-change",a,e),this.#b(a,e)}).catch(()=>{r===this.#t()&&(this.#I("getVideoTitle"),this.#I("getDuration"))})}#b(e,r){let{nativeControls:n}=this.#e.$state,i=n();this.#a=new Yt(0,e);let s={buffered:new Yt(0,0),seekable:this.#a,duration:e};this.#e.delegate.ready(s,r),i||this.#I("_hideOverlay"),this.#I("getQualities"),this.#I("getChapters")}#S(e,r,n){switch(e){case"getVideoTitle":let i=r;this.#e.notify("title-change",i,n);break;case"getDuration":let s=r;this.#e.$state.canPlay()?this.#e.notify("duration-change",s,n):this.#b(s,n);break;case"getCurrentTime":this.#w(r,n);break;case"getBuffered":Lr(r)&&r.length&&this.#E(r[r.length-1][1],n);break;case"setMuted":this.#M(te(this.#e.$state.volume),r,n);break;case"getChapters":this.#O(r);break;case"getQualities":this.#D(r,n);break}this.#V(e)?.resolve()}#v(){for(let e of $6e)this.#I("addEventListener",e)}#k(e){this.#o.stop(),this.#e.notify("pause",void 0,e)}#C(e){this.#o.start(),this.#e.notify("play",void 0,e)}#T(e){let{paused:r}=this.#e.$state;!r()&&!this.#y&&this.#e.notify("playing",void 0,e)}#E(e,r){let n={buffered:new Yt(0,e),seekable:this.#a};this.#e.notify("progress",n,r)}#P(e){this.#e.notify("waiting",void 0,e)}#A(e){let{paused:r}=this.#e.$state;r()||this.#e.notify("playing",void 0,e)}#L(e){let{paused:r}=this.#e.$state;r()&&this.#e.notify("play",void 0,e),this.#e.notify("waiting",void 0,e)}#M(e,r,n){let i={volume:e,muted:r};this.#e.notify("volume-change",i,n)}#O(e){if(this.#R(),!e.length)return;let r=new Kn({kind:"chapters",default:!0}),{seekableEnd:n}=this.#e.$state;for(let i=0;i<e.length;i++){let s=e[i],a=e[i+1];r.addCue(new window.VTTCue(s.startTime,a?.startTime??n(),s.title))}this.#u=r,this.#e.textTracks.add(r)}#R(){this.#u&&(this.#e.textTracks.remove(this.#u),this.#u=null)}#D(e,r){this.#e.qualities[Qr.enableAuto]=e.some(n=>n.id==="auto")?()=>this.#I("setQuality","auto"):void 0;for(let n of e){if(n.id==="auto")continue;let i=+n.id.slice(0,-1);isNaN(i)||this.#e.qualities[Se.add]({id:n.id,width:i*(16/9),height:i,codec:"avc1,h.264",bitrate:-1},r)}this.#N(e.find(n=>n.active),r)}#N({id:e}={},r){if(!e)return;let n=e==="auto",i=this.#e.qualities.getById(e);n?(this.#e.qualities[Qr.setAuto](n,r),this.#e.qualities[Se.select](void 0,!0,r)):this.#e.qualities[Se.select](i??void 0,!0,r)}#_(e,r,n){switch(e){case"ready":this.#v();break;case"loaded":this.#x(n);break;case"play":this.#C(n);break;case"playProgress":this.#T(n);break;case"pause":this.#k(n);break;case"loadProgress":this.#E(r.seconds,n);break;case"waiting":this.#L(n);break;case"bufferstart":this.#P(n);break;case"bufferend":this.#A(n);break;case"volumechange":this.#M(r.volume,te(this.#e.$state.muted),n);break;case"durationchange":this.#a=new Yt(0,r.duration),this.#e.notify("duration-change",r.duration,n);break;case"playbackratechange":this.#e.notify("rate-change",r.playbackRate,n);break;case"qualitychange":this.#N(r,n);break;case"fullscreenchange":this.#s=r.fullscreen,this.#e.notify("fullscreen-change",r.fullscreen,n);break;case"enterpictureinpicture":this.#e.notify("picture-in-picture-change",!0,n);break;case"leavepictureinpicture":this.#e.notify("picture-in-picture-change",!1,n);break;case"ended":this.#e.notify("end",void 0,n);break;case"error":this.#F(r,n);break;case"seek":case"seeked":this.#h(r.seconds,n);break}}#F(e,r){let{message:n,method:i}=e;i==="setPlaybackRate"&&this.#r.set(!1),i&&this.#V(i)?.reject(n)}onMessage(e,r){e.event?this.#_(e.event,e.data,r):e.method&&this.#S(e.method,e.value,r)}onLoad(){}async#I(e,r){let n=rc(),i=this.#c.get(e);return i||this.#c.set(e,i=[]),i.push(n),this.postMessage({method:e,value:r}),n.promise}#B(){this.#o.stop(),this.#a=new Yt(0,0),this.#f=null,this.#l=null,this.#r.set(!1),this.#R()}#V(e){return this.#c.get(e)?.shift()}}});var NJ={};ln(NJ,{findYouTubePoster:()=>z6e,resolveYouTubeVideoId:()=>RN});function RN(t){return t.match(U6e)?.[1]}async function z6e(t,e){if(PN.has(t))return PN.get(t);if(qE.has(t))return qE.get(t);let r=new Promise(async n=>{let i=["maxresdefault","sddefault","hqdefault"];for(let s of i)for(let a of[!0,!1]){let o=q6e(t,s,a);if((await fetch(o,{mode:"no-cors",signal:e.signal})).status<400){PN.set(t,o),n(o);return}}}).catch(()=>"").finally(()=>qE.delete(t));return qE.set(t,r),r}function q6e(t,e,r){return`https://i.ytimg.com/${r?"vi_webp":"vi"}/${t}/${e}.${r?"webp":"jpg"}`}var U6e,PN,qE,LN=yt(()=>{"use client";U6e=/(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)(?:\/shorts)?\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/,PN=new Map,qE=new Map});var FJ={};ln(FJ,{YouTubeProvider:()=>MN});var cvt,dp,MN,BJ=yt(()=>{"use client";oo();lo();va();SN();LN();cvt=Z(Te(),1),dp={Ended:0,Playing:1,Paused:2,Buffering:3,Cued:5},MN=class extends dg{$$PROVIDER_TYPE="YOUTUBE";scope=yi();#e;#t=be("");#r=-1;#n=null;#i=-1;#s=!1;#a=new Map;constructor(e,r){super(e),this.#e=r}language="en";color="red";cookies=!1;get currentSrc(){return this.#n}get type(){return"youtube"}get videoId(){return this.#t()}preconnect(){ba(this.getOrigin())}setup(){super.setup(),U(this.#u.bind(this)),this.#e.notify("provider-setup",this)}destroy(){this.#h();let e="provider destroyed";for(let r of this.#a.values())for(let{reject:n}of r)n(e);this.#a.clear()}async play(){return this.#c("playVideo")}#o(e){this.#x("playVideo")?.reject(e)}async pause(){return this.#c("pauseVideo")}#l(e){this.#x("pauseVideo")?.reject(e)}setMuted(e){e?this.#c("mute"):this.#c("unMute")}setCurrentTime(e){this.#c("seekTo",e),this.#e.notify("seeking",e)}setVolume(e){this.#c("setVolume",e*100)}setPlaybackRate(e){this.#c("setPlaybackRate",e)}async loadSource(e){if(!me(e.src)){this.#n=null,this.#t.set("");return}let r=RN(e.src);this.#t.set(r??""),this.#n=e}getOrigin(){return this.cookies?"https://www.youtube.com":"https://www.youtube-nocookie.com"}#u(){this.#h();let e=this.#t();if(!e){this.src.set("");return}this.src.set(`${this.getOrigin()}/embed/${e}`),this.#e.notify("load-start")}buildParams(){let{keyDisabled:e}=this.#e.$props,{muted:r,playsInline:n,nativeControls:i}=this.#e.$state,s=i();return{rel:0,autoplay:0,cc_lang_pref:this.language,cc_load_policy:s?1:void 0,color:this.color,controls:s?1:0,disablekb:!s||e()?1:0,enablejsapi:1,fs:1,hl:this.language,iv_load_policy:s?1:3,mute:r()?1:0,playsinline:n()?1:0}}#c(e,r){let n=rc(),i=this.#a.get(e);return i||this.#a.set(e,i=[]),i.push(n),this.postMessage({event:"command",func:e,args:r?[r]:void 0}),n.promise}onLoad(){window.setTimeout(()=>this.postMessage({event:"listening"}),100)}#f(e){this.#e.notify("loaded-metadata"),this.#e.notify("loaded-data"),this.#e.delegate.ready(void 0,e)}#d(e){this.#x("pauseVideo")?.resolve(),this.#e.notify("pause",void 0,e)}#p(e,r){let{duration:n,realCurrentTime:i}=this.#e.$state,s=this.#r===dp.Ended,a=s?n():e;this.#e.notify("time-change",a,r),!s&&Math.abs(a-i())>1&&this.#e.notify("seeking",a,r)}#g(e,r,n){let i={buffered:new Yt(0,e),seekable:r};this.#e.notify("progress",i,n);let{seeking:s,realCurrentTime:a}=this.#e.$state;s()&&e>a()&&this.#m(n)}#m(e){let{paused:r,realCurrentTime:n}=this.#e.$state;window.clearTimeout(this.#i),this.#i=window.setTimeout(()=>{this.#e.notify("seeked",n(),e),this.#i=-1},r()?100:0)}#y(e){let{seeking:r}=this.#e.$state;r()&&this.#m(e),this.#e.notify("pause",void 0,e),this.#e.notify("end",void 0,e)}#w(e,r){let{paused:n,seeking:i}=this.#e.$state,s=e===dp.Playing,a=e===dp.Buffering,o=this.#b("playVideo"),l=n()&&(a||s);if(a&&this.#e.notify("waiting",void 0,r),i()&&s&&this.#m(r),this.#s&&s){this.pause(),this.#s=!1,this.setMuted(this.#e.$state.muted());return}if(!o&&l){this.#s=!0,this.setMuted(!0);return}switch(l&&(this.#x("playVideo")?.resolve(),this.#e.notify("play",void 0,r)),e){case dp.Cued:this.#f(r);break;case dp.Playing:this.#e.notify("playing",void 0,r);break;case dp.Paused:this.#d(r);break;case dp.Ended:this.#y(r);break}this.#r=e}onMessage({info:e},r){if(!e)return;let{title:n,intrinsicDuration:i,playbackRate:s}=this.#e.$state;if(ax(e.videoData)&&e.videoData.title!==n()&&this.#e.notify("title-change",e.videoData.title,r),Rr(e.duration)&&e.duration!==i()){if(Rr(e.videoLoadedFraction)){let a=e.progressState?.loaded??e.videoLoadedFraction*e.duration,o=new Yt(0,e.duration);this.#g(a,o,r)}this.#e.notify("duration-change",e.duration,r)}if(Rr(e.playbackRate)&&e.playbackRate!==s()&&this.#e.notify("rate-change",e.playbackRate,r),e.progressState){let{current:a,seekableStart:o,seekableEnd:l,loaded:c,duration:u}=e.progressState;this.#p(a,r),this.#g(c,new Yt(o,l),r),u!==i()&&this.#e.notify("duration-change",u,r)}if(Rr(e.volume)&&pE(e.muted)&&!this.#s){let a={muted:e.muted,volume:e.volume/100};this.#e.notify("volume-change",a,r)}Rr(e.playerState)&&e.playerState!==this.#r&&this.#w(e.playerState,r)}#h(){this.#r=-1,this.#i=-1,this.#s=!1}#x(e){return this.#a.get(e)?.shift()}#b(e){return!!this.#a.get(e)?.length}}});var VJ={};ln(VJ,{GoogleCastProvider:()=>DN});var hvt,_N,ON,DN,jJ=yt(()=>{"use client";oo();lo();va();FN();hvt=Z(Te(),1),_N=class{#e;constructor(e){this.#e=new chrome.cast.media.MediaInfo(e.src,e.type)}build(){return this.#e}setStreamType(e){return e.includes("live")?this.#e.streamType=chrome.cast.media.StreamType.LIVE:this.#e.streamType=chrome.cast.media.StreamType.BUFFERED,this}setTracks(e){return this.#e.tracks=e.map(this.#t),this}setMetadata(e,r){return this.#e.metadata=new chrome.cast.media.GenericMediaMetadata,this.#e.metadata.title=e,this.#e.metadata.images=[{url:r}],this}#t(e,r){let n=new chrome.cast.media.Track(r,chrome.cast.media.TrackType.TEXT);return n.name=e.label,n.trackContentId=e.src,n.trackContentType="text/vtt",n.language=e.language,n.subtype=e.kind.toUpperCase(),n}},ON=class{#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}setup(){let e=this.syncRemoteActiveIds.bind(this);We(this.#t.audioTracks,"change",e),We(this.#t.textTracks,"mode-change",e),U(this.#a.bind(this))}getLocalTextTracks(){return this.#t.$state.textTracks().filter(e=>e.src&&e.type==="vtt")}#n(){return this.#t.$state.audioTracks()}#i(e){let r=this.#e.mediaInfo?.tracks??[];return e?r.filter(n=>n.type===e):r}#s(){let e=[],r=this.#n().find(i=>i.selected),n=this.getLocalTextTracks().filter(i=>i.mode==="showing");if(r){let i=this.#i(chrome.cast.media.TrackType.AUDIO),s=this.#u(i,r);s&&e.push(s.trackId)}if(n?.length){let i=this.#i(chrome.cast.media.TrackType.TEXT);if(i.length)for(let s of n){let a=this.#u(i,s);a&&e.push(a.trackId)}}return e}#a(){let e=this.getLocalTextTracks();if(!this.#e.isMediaLoaded)return;let r=this.#i(chrome.cast.media.TrackType.TEXT);for(let n of e)if(!this.#u(r,n)){tl(()=>this.#r?.());break}}syncRemoteTracks(e){if(!this.#e.isMediaLoaded)return;let r=this.#n(),n=this.getLocalTextTracks(),i=this.#i(chrome.cast.media.TrackType.AUDIO),s=this.#i(chrome.cast.media.TrackType.TEXT);for(let a of i){if(this.#l(r,a))continue;let l={id:a.trackId.toString(),label:a.name,language:a.language,kind:a.subtype??"main",selected:!1};this.#t.audioTracks[Se.add](l,e)}for(let a of s){if(this.#l(n,a))continue;let l={id:a.trackId.toString(),src:a.trackContentId,label:a.name,language:a.language,kind:a.subtype.toLowerCase()};this.#t.textTracks.add(l,e)}}syncRemoteActiveIds(e){if(!this.#e.isMediaLoaded)return;let r=this.#s(),n=new chrome.cast.media.EditTracksInfoRequest(r);this.#o(n).catch(i=>{})}#o(e){let r=Rx();return new Promise((n,i)=>r?.editTracksInfo(e,n,i))}#l(e,r){return e.find(n=>this.#c(n,r))}#u(e,r){return e.find(n=>this.#c(r,n))}#c(e,r){return r.name===e.label&&r.language===e.language&&r.subtype.toLowerCase()===e.kind.toLowerCase()}},DN=class{$$PROVIDER_TYPE="GOOGLE_CAST";scope=yi();#e;#t;#r;#n=null;#i="disconnected";#s=0;#a=0;#o=new Yt(0,0);#l=new nl(this.#h.bind(this));#u;#c=null;#f=!1;constructor(e,r){this.#e=e,this.#t=r,this.#r=new ON(e,r,this.#F.bind(this))}get type(){return"google-cast"}get currentSrc(){return this.#n}get player(){return this.#e}get cast(){return fp()}get session(){return Px()}get media(){return Rx()}get hasActiveSession(){return HE(this.#n)}setup(){this.#d(),this.#p(),this.#r.setup(),this.#t.notify("provider-setup",this)}#d(){NN(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.#b.bind(this))}#p(){let e=cast.framework.RemotePlayerEventType,r={[e.IS_CONNECTED_CHANGED]:this.#b,[e.IS_MEDIA_LOADED_CHANGED]:this.#S,[e.CAN_CONTROL_VOLUME_CHANGED]:this.#v,[e.CAN_SEEK_CHANGED]:this.#k,[e.DURATION_CHANGED]:this.#E,[e.IS_MUTED_CHANGED]:this.#P,[e.VOLUME_LEVEL_CHANGED]:this.#P,[e.IS_PAUSED_CHANGED]:this.#A,[e.LIVE_SEEKABLE_RANGE_CHANGED]:this.#L,[e.PLAYER_STATE_CHANGED]:this.#M};this.#u=r;let n=this.#x.bind(this);for(let i of KD(r))this.#e.controller.addEventListener(i,n);Ne(()=>{for(let i of KD(r))this.#e.controller.removeEventListener(i,n)})}async play(){if(!(!this.#e.isPaused&&!this.#f)){if(this.#f){await this.#_(!1,0);return}this.#e.controller?.playOrPause()}}async pause(){this.#e.isPaused||this.#e.controller?.playOrPause()}getMediaStatus(e){return new Promise((r,n)=>{this.media?.getStatus(e,r,n)})}setMuted(e){(e&&!this.#e.isMuted||!e&&this.#e.isMuted)&&this.#e.controller?.muteOrUnmute()}setCurrentTime(e){this.#e.currentTime=e,this.#t.notify("seeking",e),this.#e.controller?.seek()}setVolume(e){this.#e.volumeLevel=e,this.#e.controller?.setVolumeLevel()}async loadSource(e){if(this.#c?.src!==e&&(this.#c=null),HE(e)){this.#m(),this.#n=e;return}this.#t.notify("load-start");let r=this.#N(e),n=await this.session.loadMedia(r);if(n){this.#n=null,this.#t.notify("error",Error(GE(n)));return}this.#n=e}destroy(){this.#g(),this.#y()}#g(){this.#c||(this.#a=0,this.#o=new Yt(0,0)),this.#l.stop(),this.#s=0,this.#c=null}#m(){let e=new Ie("resume-session",{detail:this.session});this.#S(e);let{muted:r,volume:n,savedState:i}=this.#t.$state,s=i();this.setCurrentTime(Math.max(this.#e.currentTime,s?.currentTime??0)),this.setMuted(r()),this.setVolume(n()),s?.paused===!1&&this.play()}#y(){this.cast.endCurrentSession(!0);let{remotePlaybackLoader:e}=this.#t.$state;e.set(null)}#w(){let{savedState:e}=this.#t.$state;e.set({paused:this.#e.isPaused,currentTime:this.#e.currentTime}),this.#y()}#h(){this.#T()}#x(e){this.#u[e.type].call(this,e)}#b(e){let r=this.cast.getCastState(),n=r===cast.framework.CastState.CONNECTED?"connected":r===cast.framework.CastState.CONNECTING?"connecting":"disconnected";if(this.#i===n)return;let i={type:"google-cast",state:n},s=this.#R(e);this.#i=n,this.#t.notify("remote-playback-change",i,s),n==="disconnected"&&this.#w()}#S(e){if(!!!this.#e.isMediaLoaded)return;let n=te(this.#t.$state.source);Promise.resolve().then(()=>{if(n!==te(this.#t.$state.source)||!this.#e.isMediaLoaded)return;this.#g();let i=this.#e.duration;this.#o=new Yt(0,i);let s={provider:this,duration:i,buffered:new Yt(0,0),seekable:this.#O()},a=this.#R(e);this.#t.notify("loaded-metadata",void 0,a),this.#t.notify("loaded-data",void 0,a),this.#t.notify("can-play",s,a),this.#v(),this.#k(e);let{volume:o,muted:l}=this.#t.$state;this.setVolume(o()),this.setMuted(l()),this.#l.start(),this.#r.syncRemoteTracks(a),this.#r.syncRemoteActiveIds(a)})}#v(){this.#t.$state.canSetVolume.set(this.#e.canControlVolume)}#k(e){let r=this.#R(e);this.#t.notify("stream-type-change",this.#C(),r)}#C(){return this.#e.mediaInfo?.streamType===chrome.cast.media.StreamType.LIVE?this.#e.canSeek?"live:dvr":"live":"on-demand"}#T(){if(this.#c)return;let e=this.#e.currentTime;e!==this.#s&&(this.#t.notify("time-change",e),e>this.#a&&(this.#a=e,this.#L()),this.#t.$state.seeking()&&this.#t.notify("seeked",e),this.#s=e)}#E(e){if(!this.#e.isMediaLoaded||this.#c)return;let r=this.#e.duration,n=this.#R(e);this.#o=new Yt(0,r),this.#t.notify("duration-change",r,n)}#P(e){if(!this.#e.isMediaLoaded)return;let r={muted:this.#e.isMuted,volume:this.#e.volumeLevel},n=this.#R(e);this.#t.notify("volume-change",r,n)}#A(e){let r=this.#R(e);this.#e.isPaused?this.#t.notify("pause",void 0,r):this.#t.notify("play",void 0,r)}#L(e){let r={seekable:this.#O(),buffered:new Yt(0,this.#a)},n=e?this.#R(e):void 0;this.#t.notify("progress",r,n)}#M(e){let r=this.#e.playerState,n=chrome.cast.media.PlayerState;if(this.#f=r===n.IDLE,r===n.PAUSED)return;let i=this.#R(e);switch(r){case n.PLAYING:this.#t.notify("playing",void 0,i);break;case n.BUFFERING:this.#t.notify("waiting",void 0,i);break;case n.IDLE:this.#l.stop(),this.#t.notify("pause"),this.#t.notify("end");break}}#O(){return this.#e.liveSeekableRange?new Yt(this.#e.liveSeekableRange.start,this.#e.liveSeekableRange.end):this.#o}#R(e){return e instanceof Event?e:new Ie(e.type,{detail:e})}#D(e){let{streamType:r,title:n,poster:i}=this.#t.$state;return new _N(e).setMetadata(n(),i()).setStreamType(r()).setTracks(this.#r.getLocalTextTracks()).build()}#N(e){let r=this.#D(e),n=new chrome.cast.media.LoadRequest(r),i=this.#t.$state.savedState();return n.autoplay=(this.#c?.paused??i?.paused)===!1,n.currentTime=this.#c?.time??i?.currentTime??0,n}async#_(e,r){let n=te(this.#t.$state.source);this.#c={src:n,paused:e,time:r},await this.loadSource(n)}#F(){this.#_(this.#e.isPaused,this.#e.currentTime).catch(e=>{})}}});var UJ={};ln(UJ,{getCastContext:()=>fp,getCastErrorMessage:()=>GE,getCastSession:()=>Px,getCastSessionMedia:()=>Rx,hasActiveCastSession:()=>HE,listenCastContextEvent:()=>NN,loader:()=>Y6e});function H6e(){return"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"}function G6e(){return!!window.cast?.framework}function W6e(){return!!window.chrome?.cast?.isAvailable}function $J(){return fp().getCastState()===cast.framework.CastState.CONNECTED}function fp(){return window.cast.framework.CastContext.getInstance()}function Px(){return fp().getCurrentSession()}function Rx(){return Px()?.getSessionObj().media[0]}function HE(t){return Rx()?.media.contentId===t?.src}function K6e(){return{language:"en-US",autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,resumeSavedSession:!0,androidReceiverCompatible:!0}}function GE(t){return`Google Cast Error Code: ${t}`}function NN(t,e){return We(fp(),t,e)}var BN,Y6e,FN=yt(()=>{"use client";va();oo();lo();BN=class{name="google-cast";target;#e;get cast(){return fp()}mediaType(){return"video"}canPlay(e){return lg&&!Lx&&WE(e)}async prompt(e){let r,n,i;try{r=await this.#t(e),this.#e||(this.#e=new cast.framework.RemotePlayer,new cast.framework.RemotePlayerController(this.#e)),n=e.player.createEvent("google-cast-prompt-open",{trigger:r}),e.player.dispatchEvent(n),this.#i(e,"connecting",n),await this.#r(te(e.$props.googleCast)),e.$state.remotePlaybackInfo.set({deviceName:Px()?.getCastDevice().friendlyName}),$J()&&this.#i(e,"connected",n)}catch(s){let a=s instanceof Error?s:this.#s((s+"").toUpperCase(),"Prompt failed.");throw i=e.player.createEvent("google-cast-prompt-error",{detail:a,trigger:n??r,cancelable:!0}),e.player.dispatch(i),this.#i(e,$J()?"connected":"disconnected",i),a}finally{e.player.dispatch("google-cast-prompt-close",{trigger:i??n??r})}}async load(e){if(le)throw Error("[vidstack] can not load google cast provider server-side");if(!this.#e)throw Error("[vidstack] google cast player was not initialized");return new(await Promise.resolve().then(()=>(jJ(),VJ))).GoogleCastProvider(this.#e,e)}async#t(e){if(G6e())return;let r=e.player.createEvent("google-cast-load-start");e.player.dispatch(r),await Ax(H6e()),await customElements.whenDefined("google-cast-launcher");let n=e.player.createEvent("google-cast-loaded",{trigger:r});if(e.player.dispatch(n),!W6e())throw this.#s("CAST_NOT_AVAILABLE","Google Cast not available on this platform.");return n}async#r(e){this.#n(e);let r=await this.cast.requestSession();if(r)throw this.#s(r.toUpperCase(),GE(r))}#n(e){this.cast?.setOptions({...K6e(),...e})}#i(e,r,n){let i={type:"google-cast",state:r};e.notify("remote-playback-change",i,n)}#s(e,r){let n=Error(r);return n.code=e,n}},Y6e=Object.freeze({__proto__:null,GoogleCastLoader:BN})});function QE(t){return!me(t)&&"width"in t&&"height"in t&&Rr(t.width)&&Rr(t.height)}function eF(){return see()&&hn(screen.orientation.unlock)}function see(){return!le&&!Jt(window.screen.orientation)&&!Jt(window.screen.orientation.lock)}function aee(t,e){return le?!1:(t||(t=document.createElement("audio")),t.canPlayType(e).length>0)}function oee(t,e){return le?!1:(t||(t=document.createElement("video")),t.canPlayType(e).length>0)}function tF(t){return le?!1:(t||(t=document.createElement("video")),t.canPlayType("application/vnd.apple.mpegurl").length>0)}function rF(t){return le?!1:!!document.pictureInPictureEnabled&&!t?.disablePictureInPicture}function nF(t){return le?!1:hn(t?.webkitSupportsPresentationMode)&&hn(t?.webkitSetPresentationMode)}async function lee(){let t=document.createElement("video");return t.volume=.5,await SZ(0),t.volume===.5}function Q6e(){return le?void 0:window?.ManagedMediaSource??window?.MediaSource??window?.WebKitMediaSource}function Z6e(){return le?void 0:window?.SourceBuffer??window?.WebKitSourceBuffer}function Ix(){if(le)return!1;let t=Q6e();if(Jt(t))return!1;let e=t&&hn(t.isTypeSupported)&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=Z6e(),n=Jt(r)||!Jt(r.prototype)&&hn(r.prototype.appendBuffer)&&hn(r.prototype.remove);return!!e&&!!n}function cee(){return Ix()}function HN(t){if(!t.length)return null;let e=t.start(0);for(let r=1;r<t.length;r++){let n=t.start(r);n<e&&(e=n)}return e}function _u(t){if(!t.length)return null;let e=t.end(0);for(let r=1;r<t.length;r++){let n=t.end(r);n>e&&(e=n)}return e}function uee(t){if(t.length<=1)return t;t.sort((n,i)=>n[0]-i[0]);let e=[],r=t[0];for(let n=1;n<t.length;n++){let i=t[n];r[1]>=i[0]-1?r=[r[0],Math.max(r[1],i[1])]:(e.push(r),r=i)}return e.push(r),e}function dee(t,e,r){let n=e[0],i=e[1];return r<n?[r,-1]:r===n?e:n===-1?(e[0]=r,e):(r>n&&(e[1]=r,i===-1&&t.push(e)),uee(t),e)}function iF({src:t,type:e}){return me(t)?fee.test(t)||pee.has(e)||t.startsWith("blob:")&&e==="audio/object":e==="audio/object"}function sF(t){return me(t.src)?hee.test(t.src)||mee.has(t.type)||t.src.startsWith("blob:")&&t.type==="video/object"||yp(t)&&(le||tF()):t.type==="video/object"}function yp({src:t,type:e}){return me(t)&&gee.test(t)||vee.has(e)}function D2({src:t,type:e}){return me(t)&&yee.test(t)||bee.has(e)}function WE(t){return me(t.src)&&(iF(t)||sF(t)||yp(t))}function xee(t){return!le&&typeof window.MediaStream<"u"&&t instanceof window.MediaStream}function MJ(t,e){let r=new URL(t);for(let n of Object.keys(e))r.searchParams.set(n,e[n]+"");return r.toString()}function ba(t,e="preconnect"){if(le)return!1;let r=document.querySelector(`link[href="${t}"]`);if(!pa(r))return!0;let n=document.createElement("link");return n.rel=e,n.href=t,n.crossOrigin="true",document.head.append(n),!0}function Ax(t){if(Mx[t])return Mx[t].promise;let e=rc(),r=document.querySelector(`script[src="${t}"]`);if(!pa(r))return e.resolve(),e.promise;Mx[t]=e;let n=document.createElement("script");return n.src=t,n.onload=()=>{e.resolve(),delete Mx[t]},n.onerror=()=>{e.reject(),delete Mx[t]},setTimeout(()=>document.head.append(n),0),e.promise}function Dx(t){return t==="use-credentials"?"include":me(t)?"same-origin":void 0}function GN(t,e){return e>=t.startTime&&e<t.endTime}function kw(t,e,r){let n=null,i=rp();function s(){let a=me(e)?[e]:e,o=t.toArray().find(l=>a.includes(l.kind)&&l.mode==="showing");if(o!==n){if(!o){r(null),n=null;return}o.readyState==2?r(o):(r(null),pn(()=>{let l=We(o,"load",()=>{r(o),l()},{once:!0})},i)),n=o}}return s(),We(t,"mode-change",s)}function xi(t){return aDe.test(t.kind)}function wee(t,e,r){let n=me(t)?JSON.parse(t):t,i=[],s=[];return n.regions&&r&&(i=n.regions.map(a=>Object.assign(new r,a))),(n.cues||Lr(n))&&(s=(Lr(n)?n:n.cues).filter(a=>Rr(a.startTime)&&Rr(a.endTime)).map(a=>Object.assign(new e(0,0,""),a))),{regions:i,cues:s}}function WN(t,e=!1){let r=e?kee:oDe;Nu.reset(t,n=>r.has(n)),Cs()}function aF(t,e){let r=t+e.clipStartTime(),n=Math.floor(t)===Math.floor(e.seekableStart()),i=Math.floor(r)===Math.floor(e.seekableEnd());return n?e.seekableStart():i?e.seekableEnd():e.isLiveDVR()&&e.liveDVRWindow()>0&&r<e.seekableEnd()-e.liveDVRWindow()?e.bufferedStart():Math.min(Math.max(e.seekableStart()+.1,r),e.seekableEnd()-.1)}function Et(){return mr(Sw)}function Rn(t,e=2){return Number(t.toFixed(e))}function KN(t){return String(t).split(".")[1]?.length??0}function oF(t,e,r){return Math.max(t,Math.min(r,e))}function zJ(t,e){let r=e.composedPath()[0];return FD(r)&&t.contains(r)}function yDe(t){return YN.add(t),()=>YN.delete(t)}function vt(t,e,r){t.hasAttribute(e)||t.setAttribute(e,r)}function Fu(t,e){if(t.hasAttribute("aria-label")||t.hasAttribute("data-no-label"))return;if(!hn(e)){Ae(t,"aria-label",e);return}function r(){Ae(t,"aria-label",e())}le?r():U(r)}function See(t){let e=getComputedStyle(t);return e.display!=="none"&&parseInt(e.opacity)>0}function vDe(t){return!!t&&("checkVisibility"in t?t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):See(t))}function Cee(t,e){return yDe(()=>e(vDe(t)))}function Tee(t,e,r){for(;e;){if(e===t)return!0;if(r?.(e))break;e=e.parentElement}return!1}function Ou(t,e){return new it(t).add("pointerup",r=>{r.button===0&&!r.defaultPrevented&&e(r)}).add("keydown",r=>{mE(r)&&e(r)})}function lF(t){return Qm(t)&&(t.touches.length>1||t.changedTouches.length>1)}function Eee(t){if(le)return t();let e=rp(),r=window.requestAnimationFrame(()=>{pn(t,e),r=-1});return()=>void window.cancelAnimationFrame(r)}function Iee(t,e,r,{offsetVarName:n,xOffset:i,yOffset:s,...a}){if(!t)return;let o=r.replace(" ","-").replace("-center","");if(Gn(t,"visibility",e?null:"hidden"),!e)return;let l=r.includes("top"),c=d=>r.includes("left")?`calc(-1 * ${d})`:d,u=d=>l?`calc(-1 * ${d})`:d;return tJ(e,t,()=>{iJ(e,t,{placement:o,middleware:[...a.middleware??[],nJ({fallbackAxisSideDirection:"start",crossAxis:!1}),rJ()],...a}).then(({x:d,y:f,middlewareData:p})=>{let h=!!p.flip?.index;l=r.includes(h?"bottom":"top"),t.setAttribute("data-placement",h?r.startsWith("top")?r.replace("top","bottom"):r.replace("bottom","top"):r),Object.assign(t.style,{top:`calc(${f+"px"} + ${u(s?s+"px":`var(--${n}-y-offset, 0px)`)})`,left:`calc(${d+"px"} + ${c(i?i+"px":`var(--${n}-x-offset, 0px)`)})`})})})}function bDe(t){return getComputedStyle(t).animationName!=="none"}function r2(t){return t instanceof HTMLElement}function Aee(t,e){return[...t].sort(e?SDe:kDe)}function kDe(t,e){return t.height===e.height?(t.bitrate??0)-(e.bitrate??0):t.height-e.height}function SDe(t,e){return e.height===t.height?(e.bitrate??0)-(t.bitrate??0):e.height-t.height}function po(t){return t?.$$PROVIDER_TYPE==="AUDIO"}function ho(t){return t?.$$PROVIDER_TYPE==="VIDEO"}function Bu(t){return t?.$$PROVIDER_TYPE==="YOUTUBE"}function Pee(t){return!le&&t instanceof HTMLAudioElement}function Ree(t){return!le&&t instanceof HTMLVideoElement}function Lee(t){return Pee(t)||Ree(t)}function EDe(t){return t.replace(/Shift\+(\d)/g,(e,r)=>TDe[r-1])}function IDe(t){for(let e of Ox)if(t[e.toLowerCase()+"Key"])return!0;return!1}function VN(t){if(nc.fullscreenElement===t)return!0;try{return t.matches(nc.fullscreenPseudoClass)}catch{return!1}}function HJ(){if(!ZN)throw Error("[vidstack] no fullscreen API")}function cF(){return XE??=new AudioContext}function ADe(){let t=cF(),e=t.createGain();return e.connect(t.destination),d2.push(e),e}function PDe(t,e){let r=cF(),n=r.createMediaElementSource(t);return e&&n.connect(e),f2.push(n),n}function RDe(t){let e=d2.indexOf(t);e!==-1&&(d2.splice(e,1),t.disconnect(),_ee())}function LDe(t){let e=f2.indexOf(t);e!==-1&&(f2.splice(e,1),t.disconnect(),_ee())}function _ee(){XE&&d2.length===0&&f2.length===0&&XE.close().then(()=>{XE=null})}function GJ(t){return le||t?.type==="blur"||document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function _De(t,e){return Array.from(t.children).find(r=>r.track===e)}function WJ(t){try{return new Intl.DisplayNames(navigator.languages,{type:"language"}).of(t)??null}catch{return null}}function ug(t){return t instanceof Error?t:Error(typeof t=="string"?t:JSON.stringify(t))}function cc(t,e){if(!t)throw Error("Assertion failed.")}async function NDe(t,e={}){if(!Jt(t)){if(e.onLoadStart?.(),BDe(t))return e.onLoaded?.(t),t;if(KJ(t)){let r=t.MediaPlayer;return e.onLoaded?.(r),r}try{let r=(await t())?.default;if(KJ(r))return e.onLoaded?.(r.MediaPlayer),r.MediaPlayer;if(r)e.onLoaded?.(r);else throw Error("");return r}catch(r){e.onLoadError?.(r)}}}async function FDe(t,e={}){if(me(t)){e.onLoadStart?.();try{if(await Ax(t),!hn(window.dashjs.MediaPlayer))throw Error("");let r=window.dashjs.MediaPlayer;return e.onLoaded?.(r),r}catch(r){e.onLoadError?.(r)}}}function BDe(t){return t&&t.prototype&&t.prototype!==Function}function KJ(t){return t&&"MediaPlayer"in t}function jN(t,e){let r=String(t),n=r.length;if(n<e){let s=e-n;return`${"0".repeat(s)}${t}`}return r}function Oee(t){let e=Math.trunc(t/3600),r=Math.trunc(t%3600/60),n=Math.trunc(t%60),i=Number((t-Math.trunc(t)).toPrecision(3));return{hours:e,minutes:r,seconds:n,fraction:i}}function fc(t,{padHrs:e=null,padMins:r=null,showHrs:n=!1,showMs:i=!1}={}){let{hours:s,minutes:a,seconds:o,fraction:l}=Oee(t),c=e?jN(s,2):s,u=r||pa(r)&&t>=3600?jN(a,2):a,d=jN(o,2),f=i&&l>0?`.${String(l).replace(/^0?\./,"")}`:"",p=`${u}:${d}${f}`;return s>0||n?`${c}:${p}`:p}function Vx(t){let e=[],{hours:r,minutes:n,seconds:i}=Oee(t);return r>0&&e.push(`${r} hour`),n>0&&e.push(`${n} min`),(i>0||e.length===0)&&e.push(`${i} sec`),e.join(" ")}function zDe(t){return t?"true":"false"}function Ln(t){return()=>zDe(t())}function qDe(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function UN(t,e){if(!(t&&e))throw Error("[vidstack] media not ready")}function YJ(t,e){if(!e?.supported)throw Error("[vidstack] no fullscreen support")}function HDe(t){if(!(!qDe()||!t))throw Error("[vidstack] autoplay blocked")}function KE(t,e){Ae(t,"data-focus",e),Ae(t,"data-hocus",e)}function QJ(t,e){Ae(t,"data-hocus",e),Ae(t,"data-hover",e)}function WDe(t,e){return fetch(t,e).then(r=>r.text()).then(r=>/type="static"/.test(r)?"on-demand":"live")}function Dee(t,e){return fetch(t,e).then(r=>r.text()).then(r=>{let n=KDe(r);if(n)return Dee(/^https?:/.test(n)?n:new URL(n,t).href,e);let i=/EXT-X-PLAYLIST-TYPE:\s*VOD/.test(r)?"on-demand":"live";return i==="live"&&YDe(r)>=10&&(/#EXT-X-DVR-ENABLED:\s*true/.test(r)||r.includes("#EXT-X-DISCONTINUITY"))?"live:dvr":i})}function KDe(t){let e=t.match(/#EXT-X-STREAM-INF:[^\n]+(\n[^\n]+)*/g);return e?e[0].split(`
`)[1].trim():null}function YDe(t){let e=t.split(`
`);for(let r of e)if(r.startsWith("#EXT-X-TARGETDURATION")){let n=parseFloat(r.split(":")[1]);if(!isNaN(n))return n}return-1}function ZJ(t){return(Lr(t)?t:[t]).map(e=>me(e)?{src:e,type:JJ(e)}:{...e,type:JJ(e.src,e.type)})}function JJ(t,e){return me(e)&&e.length?e:me(t)&&b4.has(t)?b4.get(t):!e&&yp({src:t,type:""})?"application/x-mpegurl":!e&&D2({src:t,type:""})?"application/dash+xml":!me(t)||t.startsWith("blob:")?"video/object":t.includes("youtube")||t.includes("youtu.be")?"video/youtube":t.includes("vimeo")&&!t.includes("progressive_redirect")&&!t.includes(".m3u8")?"video/vimeo":"?"}function eee(t,e){return t?.src===e?.src&&t?.type===e?.type}function tee(t,e,r){let n=e-t,i=r-t;return n>0?i/n:0}function JDe(t,e,r,n){return oF(t,Rn(r,KN(n)),e)}function eNe(t,e,r,n){let i=oF(0,r,1),s=e-t,a=s*i,o=a/n,l=n*Math.round(o);return t+l}function Nee(t,{clamp:e,offset:r,orientation:n}){let i=getComputedStyle(t),s=parseFloat(i.width),a=parseFloat(i.height),o={top:null,right:null,bottom:null,left:null};if(o[n==="horizontal"?"bottom":"left"]=`calc(100% + var(--media-slider-preview-offset, ${r}px))`,n==="horizontal"){let l=s/2;if(!e)o.left=`calc(var(--slider-pointer) - ${l}px)`;else{let c=`max(0px, calc(var(--slider-pointer) - ${l}px))`,u=`calc(100% - ${s}px)`;o.left=`min(${c}, ${u})`}}else{let l=a/2;if(!e)o.bottom=`calc(var(--slider-pointer) - ${l}px)`;else{let c=`max(${l}px, calc(var(--slider-pointer) - ${l}px))`,u=`calc(100% - ${a}px)`;o.bottom=`min(${c}, ${u})`}}Object.assign(t.style,o)}function nNe(t,e){let r=YD(t,e);for(let{el:n,top:i,left:s}of r)n.scroll({top:i,left:s,behavior:e.behavior})}function iNe(t,e={}){nNe(t,{scrollMode:"if-needed",block:"center",inline:"center",...e})}function pNe(t){return er.isValidElement(t)&&t.type===fNe}function hNe(t,e){let r={...e};for(let n in e){let i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...o)=>{s(...o),i(...o)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function Vee(t){return t?.$$PROVIDER_TYPE==="REMOTION"}function Tw(t,e){let r=tc(Vu);return Ut((e?.current?.$state||r||gNe)[t])}function Wi(t,e){let r=tc(Nu);return Ut((e?.current?.$state||r||jee)[t])}function F2(t){let e=tc(Nu);return WD(t?.current?t.current.$state:e||jee)}var er,le,X6e,Lx,iee,lg,ZE,Yt,fee,pee,hee,mee,gee,yee,vee,bee,Mx,J6e,eDe,tDe,rDe,nDe,iDe,sDe,Re,Kn,aDe,Nu,kee,oDe,Sw,hp,JE,lDe,cDe,uDe,dDe,fDe,pDe,hDe,mDe,gDe,Se,Fx,_x,e2,t2,YN,XN,n2,i2,xDe,wDe,Qr,s2,dc,Mee,Ox,CDe,qJ,QN,TDe,a2,o2,ZN,l2,Bx,c2,fg,u2,XE,d2,f2,JN,MDe,e4,nl,t4,r4,Tx,n4,Ex,i4,s4,a4,o4,l4,cg,ODe,DDe,c4,u4,VDe,d4,jDe,p2,h2,m2,$N,$De,UDe,g2,f4,p4,y2,h4,m4,GDe,g4,y4,XJ,v4,v2,Es,b2,Dt,b4,x4,w4,x2,XDe,k4,S4,C4,w2,pp,QDe,T4,E4,I4,Mn,k2,ZDe,A4,P4,R4,L4,M4,_4,O4,D4,N4,Vu,S2,uF,Nx,zN,F4,pg,Gi,mp,uc,YE,C2,T2,B4,E2,tNe,I2,rNe,V4,j4,$4,U4,z4,A2,P2,N2,il,sNe,aNe,q4,oNe,lNe,Cw,cNe,Du,jx,uNe,H4,qN,G4,W4,$x,R2,Fee,L2,dNe,K4,Y4,X4,Q4,Z4,gp,M2,Ux,zx,qx,_2,Hx,Gx,Wx,Kx,Yx,Xx,Qx,Zx,Jx,ew,tw,rw,hg,nw,iw,sw,aw,ow,lw,cw,uw,dw,fw,pw,hw,mw,gw,yw,vw,bw,xw,O2,mg,ww,Bee,J4,fNe,mNe,we,ree,gNe,nee,jee,va=yt(()=>{"use client";er=Z(Te(),1);cx();oo();lo();XD();sJ();le=typeof document>"u",X6e=le?"":navigator?.userAgent.toLowerCase()||"",Lx=!le&&/iphone|ipad|ipod|ios|crios|fxios/i.test(X6e),iee=!le&&/(iphone|ipod)/gi.test(navigator?.platform||""),lg=!le&&!!window.chrome,ZE=!le&&(!!window.safari||Lx);Yt=class{#e;get length(){return this.#e.length}constructor(e,r){Lr(e)?this.#e=e:!Jt(e)&&!Jt(r)?this.#e=[[e,r]]:this.#e=[]}start(e){return this.#e[e][0]??1/0}end(e){return this.#e[e][1]??1/0}};fee=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,pee=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac","audio/m4a","audio/m4b","audio/mp4a","audio/mp4"]),hee=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,mee=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),gee=/\.(m3u8)($|\?)/i,yee=/\.(mpd)($|\?)/i,vee=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),bee=new Set(["application/dash+xml"]);Mx={};J6e=Symbol(0),eDe=Symbol(0),tDe=Symbol(0),rDe=Symbol(0),nDe=Symbol(0),iDe=Symbol(0),sDe=Symbol(0),Re={crossOrigin:J6e,readyState:eDe,updateActiveCues:tDe,canLoad:rDe,onModeChange:nDe,native:iDe,nativeHLS:sDe};Kn=class extends Ym{static createId(e){return`vds-${e.type}-${e.kind}-${e.src??e.label??"?"}`}src;content;type;encoding;id="";label="";language="";kind;default=!1;#e=!1;#t=0;#r="disabled";#n={};#i=[];#s=[];#a=[];[Re.readyState]=0;[Re.crossOrigin];[Re.onModeChange]=null;[Re.native]=null;get metadata(){return this.#n}get regions(){return this.#i}get cues(){return this.#s}get activeCues(){return this.#a}get readyState(){return this[Re.readyState]}get mode(){return this.#r}set mode(e){this.setMode(e)}#o;constructor(e){super(),this.#o=e.fetch??fetch;for(let r of Object.keys(e))this[r]=e[r];this.type||(this.type="vtt"),!le&&e.content?this.#l(e):e.src||(this[Re.readyState]=2)}addCue(e,r){let n=0,i=this.#s.length;for(n=0;n<i&&!(e.endTime<=this.#s[n].startTime);n++);n===i?this.#s.push(e):this.#s.splice(n,0,e),e instanceof TextTrackCue||this[Re.native]?.track.addCue(e),this.dispatchEvent(new Ie("add-cue",{detail:e,trigger:r})),GN(e,this.#t)&&this[Re.updateActiveCues](this.#t,r)}removeCue(e,r){let n=this.#s.indexOf(e);if(n>=0){let i=this.#a.includes(e);this.#s.splice(n,1),this[Re.native]?.track.removeCue(e),this.dispatchEvent(new Ie("remove-cue",{detail:e,trigger:r})),i&&this[Re.updateActiveCues](this.#t,r)}}setMode(e,r){this.#r!==e&&(this.#r=e,e==="disabled"?(this.#a=[],this.#p()):this.readyState===2?this[Re.updateActiveCues](this.#t,r):this.#u(),this.dispatchEvent(new Ie("mode-change",{detail:this,trigger:r})),this[Re.onModeChange]?.())}[Re.updateActiveCues](e,r){if(this.#t=e,this.mode==="disabled"||!this.#s.length)return;let n=[];for(let s=0,a=this.#s.length;s<a;s++){let o=this.#s[s];GN(o,e)&&n.push(o)}let i=n.length!==this.#a.length;if(!i){for(let s=0;s<n.length;s++)if(!this.#a.includes(n[s])){i=!0;break}}this.#a=n,i&&this.#p(r)}[Re.canLoad](){this.#e=!0,this.#r!=="disabled"&&this.#u()}#l(e){Promise.resolve().then(()=>(Cx(),Sx)).then(({parseText:r,VTTCue:n,VTTRegion:i})=>{!me(e.content)||e.type==="json"?(this.#d(e.content,n,i),this.readyState!==3&&this.#c()):r(e.content,{type:e.type}).then(({cues:s,regions:a})=>{this.#s=s,this.#i=a,this.#c()})})}async#u(){if(!(!this.#e||this[Re.readyState]>0)){if(this[Re.readyState]=1,this.dispatchEvent(new Ie("load-start")),!this.src){this.#c();return}try{let{parseResponse:e,VTTCue:r,VTTRegion:n}=await Promise.resolve().then(()=>(Cx(),Sx)),i=this[Re.crossOrigin]?.(),s=this.#o(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:Dx(i)});if(this.type==="json")this.#d(await(await s).text(),r,n);else{let{errors:a,metadata:o,regions:l,cues:c}=await e(s,{type:this.type,encoding:this.encoding});if(a[0]?.code===0)throw a[0];this.#n=o,this.#i=l,this.#s=c}this.#c()}catch(e){this.#f(e)}}}#c(){if(this[Re.readyState]=2,!this.src||this.type!=="vtt"){let r=this[Re.native];if(r&&!r.managed)for(let n of this.#s)r.track.addCue(n)}let e=new Ie("load");this[Re.updateActiveCues](this.#t,e),this.dispatchEvent(e)}#f(e){this[Re.readyState]=3,this.dispatchEvent(new Ie("error",{detail:e}))}#d(e,r,n){try{let{regions:i,cues:s}=wee(e,r,n);this.#i=i,this.#s=s}catch(i){this.#f(i)}}#p(e){this.dispatchEvent(new Ie("cue-change",{trigger:e}))}},aDe=/captions|subtitles/;Nu=new ao({artist:"",artwork:null,audioTrack:null,audioTracks:[],autoPlay:!1,autoPlayError:null,audioGain:null,buffered:new Yt,canLoad:!1,canLoadPoster:!1,canFullscreen:!1,canOrientScreen:eF(),canPictureInPicture:!1,canPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,get iOSControls(){return iee&&this.mediaType==="video"&&(!this.playsInline||!nc.fullscreenEnabled&&this.fullscreen)},get nativeControls(){return this.controls||this.iOSControls},controlsVisible:!1,get controlsHidden(){return!this.controlsVisible},crossOrigin:null,ended:!1,error:null,fullscreen:!1,get loop(){return this.providedLoop||this.userPrefersLoop},logLevel:"silent",mediaType:"unknown",muted:!1,paused:!0,played:new Yt,playing:!1,playsInline:!1,pictureInPicture:!1,preload:"metadata",playbackRate:1,qualities:[],quality:null,autoQuality:!1,canSetQuality:!0,canSetPlaybackRate:!0,canSetVolume:!1,canSetAudioGain:!1,seekable:new Yt,seeking:!1,source:{src:"",type:""},sources:[],started:!1,textTracks:[],textTrack:null,get hasCaptions(){return this.textTracks.filter(xi).length>0},volume:1,waiting:!1,realCurrentTime:0,get currentTime(){return this.ended?this.duration:this.clipStartTime>0?Math.max(0,Math.min(this.realCurrentTime-this.clipStartTime,this.duration)):this.realCurrentTime},providedDuration:-1,intrinsicDuration:0,get duration(){return this.seekableWindow},get title(){return this.providedTitle||this.inferredTitle},get poster(){return this.providedPoster||this.inferredPoster},get viewType(){return this.providedViewType!=="unknown"?this.providedViewType:this.inferredViewType},get streamType(){return this.providedStreamType!=="unknown"?this.providedStreamType:this.inferredStreamType},get currentSrc(){return this.source},get bufferedStart(){let t=HN(this.buffered)??0;return Math.max(t,this.clipStartTime)},get bufferedEnd(){let t=_u(this.buffered)??0;return Math.min(this.seekableEnd,Math.max(0,t-this.clipStartTime))},get bufferedWindow(){return Math.max(0,this.bufferedEnd-this.bufferedStart)},get seekableStart(){if(this.isLiveDVR&&this.liveDVRWindow>0)return Math.max(0,this.seekableEnd-this.liveDVRWindow);let t=HN(this.seekable)??0;return Math.max(t,this.clipStartTime)},get seekableEnd(){if(this.providedDuration>0)return this.providedDuration;let t=this.liveSyncPosition>0?this.liveSyncPosition:this.canPlay?_u(this.seekable)??1/0:0;return this.clipEndTime>0?Math.min(this.clipEndTime,t):t},get seekableWindow(){let t=this.seekableEnd-this.seekableStart;return isNaN(t)?1/0:Math.max(0,t)},canAirPlay:!1,canGoogleCast:!1,remotePlaybackState:"disconnected",remotePlaybackType:"none",remotePlaybackLoader:null,remotePlaybackInfo:null,get isAirPlayConnected(){return this.remotePlaybackType==="airplay"&&this.remotePlaybackState==="connected"},get isGoogleCastConnected(){return this.remotePlaybackType==="google-cast"&&this.remotePlaybackState==="connected"},pointer:"fine",orientation:"landscape",width:0,height:0,mediaWidth:0,mediaHeight:0,lastKeyboardAction:null,userBehindLiveEdge:!1,liveEdgeTolerance:10,minLiveDVRWindow:60,get canSeek(){return/unknown|on-demand|:dvr/.test(this.streamType)&&Number.isFinite(this.duration)&&(!this.isLiveDVR||this.duration>=this.liveDVRWindow)},get live(){return this.streamType.includes("live")||!Number.isFinite(this.duration)},get liveEdgeStart(){return this.live&&Number.isFinite(this.seekableEnd)?Math.max(0,this.seekableEnd-this.liveEdgeTolerance):0},get liveEdge(){return this.live&&(!this.canSeek||!this.userBehindLiveEdge&&this.currentTime>=this.liveEdgeStart)},get liveEdgeWindow(){return this.live&&Number.isFinite(this.seekableEnd)?this.seekableEnd-this.liveEdgeStart:0},get isLiveDVR(){return/:dvr/.test(this.streamType)},get liveDVRWindow(){return Math.max(this.inferredLiveDVRWindow,this.minLiveDVRWindow)},autoPlaying:!1,providedTitle:"",inferredTitle:"",providedLoop:!1,userPrefersLoop:!1,providedPoster:"",inferredPoster:"",inferredViewType:"unknown",providedViewType:"unknown",providedStreamType:"unknown",inferredStreamType:"unknown",liveSyncPosition:null,inferredLiveDVRWindow:0,savedState:null}),kee=new Set(["autoPlayError","autoPlaying","buffered","canPlay","error","paused","played","playing","seekable","seeking","waiting"]),oDe=new Set([...kee,"ended","inferredPoster","inferredStreamType","inferredTitle","intrinsicDuration","inferredLiveDVRWindow","liveSyncPosition","realCurrentTime","savedState","started","userBehindLiveEdge"]);Sw=rl();hp=class{#e=null;#t=null;#r=-1;#n;constructor(e=void 0){this.#n=e}setTarget(e){this.#e=e}getPlayer(e){return this.#t?this.#t:((e??this.#e)?.dispatchEvent(new Ie("find-media-player",{detail:r=>void(this.#t=r),bubbles:!0,composed:!0})),this.#t)}setPlayer(e){this.#t=e}startLoading(e){this.#i("media-start-loading",e)}startLoadingPoster(e){this.#i("media-poster-start-loading",e)}requestAirPlay(e){this.#i("media-airplay-request",e)}requestGoogleCast(e){this.#i("media-google-cast-request",e)}play(e){this.#i("media-play-request",e)}pause(e){this.#i("media-pause-request",e)}mute(e){this.#i("media-mute-request",e)}unmute(e){this.#i("media-unmute-request",e)}enterFullscreen(e,r){this.#i("media-enter-fullscreen-request",r,e)}exitFullscreen(e,r){this.#i("media-exit-fullscreen-request",r,e)}lockScreenOrientation(e,r){this.#i("media-orientation-lock-request",r,e)}unlockScreenOrientation(e){this.#i("media-orientation-unlock-request",e)}enterPictureInPicture(e){this.#i("media-enter-pip-request",e)}exitPictureInPicture(e){this.#i("media-exit-pip-request",e)}seeking(e,r){this.#i("media-seeking-request",r,e)}seek(e,r){this.#i("media-seek-request",r,e)}seekToLiveEdge(e){this.#i("media-live-edge-request",e)}changeDuration(e,r){this.#i("media-duration-change-request",r,e)}changeClipStart(e,r){this.#i("media-clip-start-change-request",r,e)}changeClipEnd(e,r){this.#i("media-clip-end-change-request",r,e)}changeVolume(e,r){this.#i("media-volume-change-request",r,Math.max(0,Math.min(1,e)))}changeAudioTrack(e,r){this.#i("media-audio-track-change-request",r,e)}changeQuality(e,r){this.#i("media-quality-change-request",r,e)}requestAutoQuality(e){this.changeQuality(-1,e)}changeTextTrackMode(e,r,n){this.#i("media-text-track-change-request",n,{index:e,mode:r})}changePlaybackRate(e,r){this.#i("media-rate-change-request",r,e)}changeAudioGain(e,r){this.#i("media-audio-gain-change-request",r,e)}resumeControls(e){this.#i("media-resume-controls-request",e)}pauseControls(e){this.#i("media-pause-controls-request",e)}togglePaused(e){let r=this.getPlayer(e?.target);r&&(r.state.paused?this.play(e):this.pause(e))}toggleControls(e){let r=this.getPlayer(e?.target);r&&(r.controls.showing?r.controls.hide(0,e):r.controls.show(0,e))}toggleMuted(e){let r=this.getPlayer(e?.target);r&&(r.state.muted?this.unmute(e):this.mute(e))}toggleFullscreen(e,r){let n=this.getPlayer(r?.target);n&&(n.state.fullscreen?this.exitFullscreen(e,r):this.enterFullscreen(e,r))}togglePictureInPicture(e){let r=this.getPlayer(e?.target);r&&(r.state.pictureInPicture?this.exitPictureInPicture(e):this.enterPictureInPicture(e))}showCaptions(e){let r=this.getPlayer(e?.target);if(!r)return;let n=r.state.textTracks,i=this.#r;(!n[i]||!xi(n[i]))&&(i=-1),i===-1&&(i=n.findIndex(s=>xi(s)&&s.default)),i===-1&&(i=n.findIndex(s=>xi(s))),i>=0&&this.changeTextTrackMode(i,"showing",e),this.#r=-1}disableCaptions(e){let r=this.getPlayer(e?.target);if(!r)return;let n=r.state.textTracks,i=r.state.textTrack;if(i){let s=n.indexOf(i);this.changeTextTrackMode(s,"disabled",e),this.#r=s}}toggleCaptions(e){let r=this.getPlayer(e?.target);r&&(r.state.textTrack?this.disableCaptions():this.showCaptions())}userPrefersLoopChange(e,r){this.#i("media-user-loop-change-request",r,e)}#i(e,r,n){let i=new Ie(e,{bubbles:!0,composed:!0,cancelable:!0,detail:n,trigger:r}),s=r?.target||null;s&&s instanceof je&&(s=s.el),s=!s||s===document||s===window||s===document.body||this.#t?.el&&s instanceof Node&&!this.#t.el.contains(s)?this.#e??this.getPlayer()?.el:s??this.#e,this.#t?e==="media-play-request"&&!this.#t.state.canLoad?s?.dispatchEvent(i):this.#t.canPlayQueue.enqueue(e,()=>s?.dispatchEvent(i)):s?.dispatchEvent(i)}#s(e){}},JE=class{playerId="vds-player";mediaId=null;#e={volume:null,muted:null,audioGain:null,time:null,lang:null,captions:null,rate:null,quality:null};async getVolume(){return this.#e.volume}async setVolume(e){this.#e.volume=e,this.save()}async getMuted(){return this.#e.muted}async setMuted(e){this.#e.muted=e,this.save()}async getTime(){return this.#e.time}async setTime(e,r){let n=e<0;this.#e.time=n?null:e,n||r?this.saveTime():this.saveTimeThrottled()}async getLang(){return this.#e.lang}async setLang(e){this.#e.lang=e,this.save()}async getCaptions(){return this.#e.captions}async setCaptions(e){this.#e.captions=e,this.save()}async getPlaybackRate(){return this.#e.rate}async setPlaybackRate(e){this.#e.rate=e,this.save()}async getAudioGain(){return this.#e.audioGain}async setAudioGain(e){this.#e.audioGain=e,this.save()}async getVideoQuality(){return this.#e.quality}async setVideoQuality(e){this.#e.quality=e,this.save()}onChange(e,r,n="vds-player"){let i=n?localStorage.getItem(n):null,s=r?localStorage.getItem(r):null;this.playerId=n,this.mediaId=r,this.#e={volume:null,muted:null,audioGain:null,lang:null,captions:null,rate:null,quality:null,...i?JSON.parse(i):{},time:s?+s:null}}save(){if(le||!this.playerId)return;let e=JSON.stringify({...this.#e,time:void 0});localStorage.setItem(this.playerId,e)}saveTimeThrottled=ic(this.saveTime.bind(this),1e3);saveTime(){if(le||!this.mediaId)return;let e=(this.#e.time??0).toString();localStorage.setItem(this.mediaId,e)}},lDe=Symbol(0),cDe=Symbol(0),uDe=Symbol(0),dDe=Symbol(0),fDe=Symbol(0),pDe=Symbol(0),hDe=Symbol(0),mDe=Symbol(0),gDe=Symbol(0),Se={add:lDe,remove:cDe,reset:uDe,select:dDe,readonly:fDe,setReadonly:pDe,onReset:hDe,onRemove:mDe,onUserSelect:gDe},Fx=class extends Ym{items=[];[Se.readonly]=!1;get length(){return this.items.length}get readonly(){return this[Se.readonly]}indexOf(e){return this.items.indexOf(e)}getById(e){return e===""?null:this.items.find(r=>r.id===e)??null}toArray(){return[...this.items]}[Symbol.iterator](){return this.items.values()}[Se.add](e,r){let n=this.items.length;""+n in this||Object.defineProperty(this,n,{get(){return this.items[n]}}),!this.items.includes(e)&&(this.items.push(e),this.dispatchEvent(new Ie("add",{detail:e,trigger:r})))}[Se.remove](e,r){let n=this.items.indexOf(e);n>=0&&(this[Se.onRemove]?.(e,r),this.items.splice(n,1),this.dispatchEvent(new Ie("remove",{detail:e,trigger:r})))}[Se.reset](e){for(let r of[...this.items])this[Se.remove](r,e);this.items=[],this[Se.setReadonly](!1,e),this[Se.onReset]?.()}[Se.setReadonly](e,r){this[Se.readonly]!==e&&(this[Se.readonly]=e,this.dispatchEvent(new Ie("readonly-change",{detail:e,trigger:r})))}},_x=Symbol(0),e2=class extends Fx{get selected(){return this.items.find(e=>e.selected)??null}get selectedIndex(){return this.items.findIndex(e=>e.selected)}[Se.onRemove](e,r){this[Se.select](e,!1,r)}[Se.add](e,r){e[_x]=!1,Object.defineProperty(e,"selected",{get(){return this[_x]},set:n=>{this.readonly||(this[Se.onUserSelect]?.(),this[Se.select](e,n))}}),super[Se.add](e,r)}[Se.select](e,r,n){if(r===e?.[_x])return;let i=this.selected;e&&(e[_x]=r),(r?i!==e:i===e)&&(i&&(i[_x]=!1),this.dispatchEvent(new Ie("change",{detail:{prev:i,current:this.selected},trigger:n})))}},t2=class extends e2{};YN=new Set;if(!le){let t=function(){for(let e of YN)try{e()}catch{}window.requestAnimationFrame(t)};t()}XN=class{priority=0;#e=!0;#t=null;#r=null;#n=new Set;canRender(e,r){return!!r}attach(e){this.#t=e,e&&(e.textTracks.onchange=this.#o.bind(this))}addTrack(e){this.#n.add(e),this.#i(e)}removeTrack(e){e[Re.native]?.remove?.(),e[Re.native]=null,this.#n.delete(e)}changeTrack(e){let r=e?.[Re.native];r&&r.track.mode!=="showing"&&(r.track.mode="showing"),this.#r=e}setDisplay(e){this.#e=e,this.#o()}detach(){this.#t&&(this.#t.textTracks.onchange=null);for(let e of this.#n)this.removeTrack(e);this.#n.clear(),this.#t=null,this.#r=null}#i(e){if(!this.#t)return;let r=e[Re.native]??=this.#s(e);r2(r)&&(this.#t.append(r),r.track.mode=r.default?"showing":"disabled")}#s(e){let r=document.createElement("track"),n=e.default||e.mode==="showing",i=e.src&&e.type==="vtt";return r.id=e.id,r.src=i?e.src:"",r.label=e.label,r.kind=e.kind,r.default=n,e.language&&(r.srclang=e.language),n&&!i&&this.#a(e,r.track),r}#a(e,r){if(!(e.src&&e.type==="vtt"||r.cues?.length))for(let n of e.cues)r.addCue(n)}#o(e){for(let r of this.#n){let n=r[Re.native];if(!n)continue;if(!this.#e){n.track.mode=n.managed?"hidden":"disabled";continue}let i=n.track.mode==="showing";i&&this.#a(r,n.track),r.setMode(i?"showing":"disabled",e)}}},n2=class{#e=null;#t;#r=[];#n;#i=!1;#s=null;#a=null;constructor(e){this.#n=e;let r=e.textTracks;this.#t=r,U(this.#o.bind(this)),Ne(this.#p.bind(this)),new it(r).add("add",this.#c.bind(this)).add("remove",this.#f.bind(this)).add("mode-change",this.#d.bind(this))}#o(){let{nativeControls:e}=this.#n.$state;this.#i=e(),this.#d()}add(e){this.#r.push(e),tl(this.#d.bind(this))}remove(e){e.detach(),this.#r.splice(this.#r.indexOf(e),1),tl(this.#d.bind(this))}attachVideo(e){requestAnimationFrame(()=>{if(this.#e=e,e){this.#s=new XN,this.#s.attach(e);for(let r of this.#t)this.#l(r)}this.#d()})}#l(e){xi(e)&&this.#s?.addTrack(e)}#u(e){xi(e)&&this.#s?.removeTrack(e)}#c(e){this.#l(e.detail)}#f(e){this.#u(e.detail)}#d(){let e=this.#t.selected;if(this.#e&&(this.#i||e?.[Re.nativeHLS])){this.#a?.changeTrack(null),this.#s?.setDisplay(!0),this.#s?.changeTrack(e);return}if(this.#s?.setDisplay(!1),this.#s?.changeTrack(null),!e){this.#a?.changeTrack(null);return}let r=this.#r.sort((n,i)=>n.priority-i.priority).find(n=>n.canRender(e,this.#e));this.#a!==r&&(this.#a?.detach(),r?.attach(this.#e),this.#a=r??null),r?.changeTrack(e)}#p(){this.#s?.detach(),this.#s=null,this.#a?.detach(),this.#a=null}},i2=class extends Fx{#e=!1;#t={};#r=null;#n=null;[Re.crossOrigin];constructor(){super()}get selected(){return this.items.find(r=>r.mode==="showing"&&xi(r))??null}get selectedIndex(){let e=this.selected;return e?this.indexOf(e):-1}get preferredLang(){return this.#n}set preferredLang(e){this.#n=e,this.#u(e)}add(e,r){let n=e instanceof Kn,i=n?e:new Kn(e),s=e.kind==="captions"||e.kind==="subtitles"?"captions":e.kind;return this.#t[s]&&e.default&&delete e.default,i.addEventListener("mode-change",this.#a),this[Se.add](i,r),i[Re.crossOrigin]=this[Re.crossOrigin],this.#e&&i[Re.canLoad](),e.default&&(this.#t[s]=i),this.#i(),this}remove(e,r){if(this.#s=e,!!this.items.includes(e))return e===this.#t[e.kind]&&delete this.#t[e.kind],e.mode="disabled",e[Re.onModeChange]=null,e.removeEventListener("mode-change",this.#a),this[Se.remove](e,r),this.#s=null,this}clear(e){for(let r of[...this.items])this.remove(r,e);return this}getByKind(e){let r=Array.isArray(e)?e:[e];return this.items.filter(n=>r.includes(n.kind))}[Re.canLoad](){if(!this.#e){for(let e of this.items)e[Re.canLoad]();this.#e=!0,this.#i()}}#i=dx(async()=>{if(!this.#e)return;!this.#n&&this.#r&&(this.#n=await this.#r.getLang());let e=await this.#r?.getCaptions(),r=[["captions","subtitles"],"chapters","descriptions","metadata"];for(let n of r){let i=this.getByKind(n);if(i.find(c=>c.mode==="showing"))continue;let s=this.#n?i.find(c=>c.language===this.#n):null,a=Lr(n)?this.#t[n.find(c=>this.#t[c])||""]:this.#t[n],o=s??a,l=o&&xi(o);o&&(!l||e!==!1)&&(o.mode="showing",l&&this.#l(o))}},300);#s=null;#a=this.#o.bind(this);#o(e){let r=e.detail;if(this.#r&&xi(r)&&r!==this.#s&&this.#l(r),r.mode==="showing"){let n=xi(r)?["captions","subtitles"]:[r.kind];for(let i of this.items)i.mode==="showing"&&i!=r&&n.includes(i.kind)&&(i.mode="disabled")}this.dispatchEvent(new Ie("mode-change",{detail:e.detail,trigger:e}))}#l(e){e.mode!=="disabled"&&this.#u(e.language),this.#r?.setCaptions?.(e.mode==="showing")}#u(e){this.#r?.setLang?.(this.#n=e)}setStorage(e){this.#r=e}},xDe=Symbol(0),wDe=Symbol(0),Qr={setAuto:xDe,enableAuto:wDe},s2=class extends e2{#e=!1;switch="current";get auto(){return this.#e||this.readonly}[Qr.enableAuto];[Se.onUserSelect](){this[Qr.setAuto](!1)}[Se.onReset](e){this[Qr.enableAuto]=void 0,this[Qr.setAuto](!1,e)}autoSelect(e){this.readonly||this.#e||!this[Qr.enableAuto]||(this[Qr.enableAuto]?.(e),this[Qr.setAuto](!0,e))}getBySrc(e){return this.items.find(r=>r.src===e)}[Qr.setAuto](e,r){this.#e!==e&&(this.#e=e,this.dispatchEvent(new Ie("auto-change",{detail:e,trigger:r})))}};dc=class extends Wn{},Mee={togglePaused:"k Space",toggleMuted:"m",toggleFullscreen:"f",togglePictureInPicture:"i",toggleCaptions:"c",seekBackward:"j J ArrowLeft",seekForward:"l L ArrowRight",volumeUp:"ArrowUp",volumeDown:"ArrowDown",speedUp:">",slowDown:"<"},Ox=new Set(["Shift","Alt","Meta","Ctrl"]),CDe='button, [role="button"]',qJ='input, textarea, select, [contenteditable], [role^="menuitem"], [role="timer"]',QN=class extends dc{#e;constructor(e){super(),this.#e=e}onConnect(){U(this.#t.bind(this))}#t(){let{keyDisabled:e,keyTarget:r}=this.$props;if(e())return;let n=r()==="player"?this.el:document,i=be(!1);n===this.el?new it(this.el).add("focusin",()=>i.set(!0)).add("focusout",s=>{this.el.contains(s.target)||i.set(!1)}):(te(i)||i.set(document.querySelector("[data-media-player]")===this.el),We(document,"focusin",s=>{let a=s.composedPath().find(o=>o instanceof Element&&o.localName==="media-player");a!==void 0&&i.set(this.el===a)})),U(()=>{i()&&new it(n).add("keyup",this.#r.bind(this)).add("keydown",this.#n.bind(this)).add("keydown",this.#i.bind(this),{capture:!0})})}#r(e){let r=document.activeElement;if(!e.key||!this.$state.canSeek()||r?.matches(qJ))return;let{method:n,value:i}=this.#s(e);if(!me(i)&&!Lr(i)){i?.onKeyUp?.({event:e,player:this.#e.player,remote:this.#e.remote}),i?.callback?.(e,this.#e.remote);return}n?.startsWith("seek")&&(e.preventDefault(),e.stopPropagation(),this.#l?(this.#u(e,n==="seekForward"),this.#l=null):(this.#e.remote.seek(this.#a,e),this.#a=void 0)),n?.startsWith("volume")&&this.el.querySelector("[data-media-volume-slider]")?.dispatchEvent(new KeyboardEvent("keyup",{key:n==="volumeUp"?"Up":"Down",shiftKey:e.shiftKey,trigger:e}))}#n(e){if(!e.key||Ox.has(e.key))return;let r=document.activeElement;if(r?.matches(qJ)||mE(e)&&r?.matches(CDe))return;let{method:n,value:i}=this.#s(e),s=!e.metaKey&&/^[0-9]$/.test(e.key);if(!me(i)&&!Lr(i)&&!s){i?.onKeyDown?.({event:e,player:this.#e.player,remote:this.#e.remote}),i?.callback?.(e,this.#e.remote);return}if(!n&&s&&!IDe(e)){e.preventDefault(),e.stopPropagation(),this.#e.remote.seek(this.$state.duration()/10*Number(e.key),e);return}if(n){switch(e.preventDefault(),e.stopPropagation(),n){case"seekForward":case"seekBackward":this.#c(e,n,n==="seekForward");break;case"volumeUp":case"volumeDown":let a=this.el.querySelector("[data-media-volume-slider]");if(a)a.dispatchEvent(new KeyboardEvent("keydown",{key:n==="volumeUp"?"Up":"Down",shiftKey:e.shiftKey,trigger:e}));else{let l=e.shiftKey?.1:.05;this.#e.remote.changeVolume(this.$state.volume()+(n==="volumeUp"?+l:-l),e)}break;case"toggleFullscreen":this.#e.remote.toggleFullscreen("prefer-media",e);break;case"speedUp":case"slowDown":let o=this.$state.playbackRate();this.#e.remote.changePlaybackRate(Math.max(.25,Math.min(2,o+(n==="speedUp"?.25:-.25))),e);break;default:this.#e.remote[n]?.(e)}this.$state.lastKeyboardAction.set({action:n,event:e})}}#i(e){Lee(e.target)&&this.#s(e).method&&e.preventDefault()}#s(e){let r={...this.$props.keyShortcuts(),...this.#e.ariaKeys},n=Object.keys(r).find(i=>{let s=r[i],a=Lr(s)?s.join(" "):me(s)?s:s?.keys;return(Lr(a)?a:a?.split(" "))?.map(l=>EDe(l).replace(/Control/g,"Ctrl").split("+"))?.some(l=>{let c=new Set(l.filter(u=>Ox.has(u)));for(let u of Ox){let d=u.toLowerCase()+"Key";if(!c.has(u)&&e[d])return!1}return l.every(u=>Ox.has(u)?e[u.toLowerCase()+"Key"]:e.key===u.replace("Space"," "))})});return{method:n,value:n?r[n]:null}}#a;#o(e,r){let n=e.shiftKey?10:5;return this.#a=Math.max(0,Math.min((this.#a??this.$state.currentTime())+(r==="seekForward"?+n:-n),this.$state.duration()))}#l=null;#u(e,r){this.#l?.dispatchEvent(new KeyboardEvent(e.type,{key:r?"Right":"Left",shiftKey:e.shiftKey,trigger:e}))}#c(e,r,n){this.$state.canSeek()&&(this.#l||(this.#l=this.el.querySelector("[data-media-time-slider]")),this.#l?this.#u(e,n):this.#e.remote.seeking(this.#o(e,r),e))}},TDe=["!","@","#","$","%","^","&","*","(",")"];a2=class extends Wn{#e;constructor(e){super(),this.#e=e}onAttach(e){let{$props:r,ariaKeys:n}=Et(),i=e.getAttribute("aria-keyshortcuts");if(i){n[this.#e]=i,le||Ne(()=>{delete n[this.#e]});return}let s=r.keyShortcuts()[this.#e];if(s){let a=Lr(s)?s.join(" "):me(s)?s:s?.keys;e.setAttribute("aria-keyshortcuts",Lr(a)?a.join(" "):a)}}},o2=class extends dc{#e=-2;#t=!1;#r=be(!1);#n=be(!1);#i=null;#s=be(!0);defaultDelay=2e3;get canIdle(){return this.#s()}set canIdle(e){this.#s.set(e)}get hideOnMouseLeave(){let{hideControlsOnMouseLeave:e}=this.$props;return this.#r()||e()}set hideOnMouseLeave(e){this.#r.set(e)}get showing(){return this.$state.controlsVisible()}show(e=0,r){this.#g(),this.#t||this.#y(!0,e,r)}hide(e=this.defaultDelay,r){this.#g(),this.#t||this.#y(!1,e,r)}pause(e){this.#t=!0,this.#g(),this.#y(!0,0,e)}resume(e){this.#t=!1,!this.$state.paused()&&this.#y(!1,this.defaultDelay,e)}onConnect(){U(this.#a.bind(this))}#a(){let{viewType:e}=this.$state;if(!this.el||!this.#s())return;if(e()==="audio"){this.show();return}U(this.#o.bind(this)),U(this.#l.bind(this));let r=this.#u.bind(this),n=this.#c.bind(this),i=this.#f.bind(this);new it(this.el).add("can-play",s=>this.show(0,s)).add("play",r).add("pause",n).add("end",i).add("auto-play-fail",n)}#o(){if(!this.el)return;let{started:e,pointer:r,paused:n}=this.$state;if(!e()||r()!=="fine")return;let i=new it(this.el),s=this.hideOnMouseLeave;(!s||!this.#n())&&U(()=>{n()||i.add("pointermove",this.#m.bind(this))}),s&&i.add("mouseenter",this.#d.bind(this)).add("mouseleave",this.#p.bind(this))}#l(){let{paused:e,started:r,autoPlayError:n}=this.$state;if(e()||n()&&!r())return;let i=this.#m.bind(this);U(()=>{if(!this.el)return;let s=this.$state.pointer(),a=s==="coarse",o=new it(this.el),l=[a?"touchend":"pointerup","keydown"];for(let c of l)o.add(c,i,{passive:!1})})}#u(e){e.triggers.hasType("ended")||(this.show(0,e),this.hide(void 0,e))}#c(e){this.show(0,e)}#f(e){let{loop:r}=this.$state;r()&&this.hide(0,e)}#d(e){this.#n.set(!1),this.show(0,e),this.hide(void 0,e)}#p(e){this.#n.set(!0),this.hide(0,e)}#g(){window.clearTimeout(this.#e),this.#e=-1}#m(e){e.MEDIA_GESTURE||this.#t||lF(e)||(Zm(e)&&(e.key==="Escape"?(this.el?.focus(),this.#i=null):this.#i&&(e.preventDefault(),requestAnimationFrame(()=>{this.#i?.focus(),this.#i=null}))),this.show(0,e),this.hide(this.defaultDelay,e))}#y(e,r,n){if(r===0){this.#w(e,n);return}this.#e=window.setTimeout(()=>{this.scope&&this.#w(e&&!this.#t,n)},r)}#w(e,r){this.$state.controlsVisible()!==e&&(this.$state.controlsVisible.set(e),!e&&document.activeElement&&this.el?.contains(document.activeElement)&&(this.#i=document.activeElement,requestAnimationFrame(()=>{this.el?.focus({preventScroll:!0})})),this.dispatch("controls-change",{detail:e,trigger:r}))}},ZN=nc.fullscreenEnabled,l2=class extends Wn{#e=!1;#t=!1;get active(){return this.#t}get supported(){return ZN}onConnect(){new it(nc).add("fullscreenchange",this.#n.bind(this)).add("fullscreenerror",this.#i.bind(this)),Ne(this.#r.bind(this))}async#r(){ZN&&await this.exit()}#n(e){let r=VN(this.el);r!==this.#t&&(r||(this.#e=!1),this.#t=r,this.dispatch("fullscreen-change",{detail:r,trigger:e}))}#i(e){this.#e&&(this.dispatch("fullscreen-error",{detail:null,trigger:e}),this.#e=!1)}async enter(){try{return this.#e=!0,!this.el||VN(this.el)?void 0:(HJ(),nc.requestFullscreen(this.el))}catch(e){throw this.#e=!1,e}}async exit(){if(!(!this.el||!VN(this.el)))return HJ(),nc.exitFullscreen()}};Bx=class t extends Wn{#e=be(this.#a());#t=be(!1);#r;get type(){return this.#e()}get locked(){return this.#t()}get portrait(){return this.#e().startsWith("portrait")}get landscape(){return this.#e().startsWith("landscape")}static supported=eF();get supported(){return t.supported}onConnect(){if(this.supported)We(screen.orientation,"change",this.#i.bind(this));else{let e=window.matchMedia("(orientation: landscape)");e.onchange=this.#i.bind(this),Ne(()=>e.onchange=null)}Ne(this.#n.bind(this))}async#n(){this.supported&&this.#t()&&await this.unlock()}#i(e){this.#e.set(this.#a()),this.dispatch("orientation-change",{detail:{orientation:te(this.#e),lock:this.#r},trigger:e})}async lock(e){te(this.#t)||this.#r===e||(this.#s(),await screen.orientation.lock(e),this.#t.set(!0),this.#r=e)}async unlock(){te(this.#t)&&(this.#s(),this.#r=void 0,await screen.orientation.unlock(),this.#t.set(!1))}#s(){if(!this.supported)throw Error("[vidstack] no orientation API")}#a(){return le?"portrait-primary":this.supported?window.screen.orientation.type:window.innerWidth>=window.innerHeight?"landscape-primary":"portrait-primary"}},c2=class{name="audio";target;canPlay(e){return iF(e)?le||!me(e.src)||e.type==="?"||aee(this.target,e.type):!1}mediaType(){return"audio"}async load(e){if(le)throw Error("[vidstack] can not load audio provider server-side");return new(await Promise.resolve().then(()=>(PJ(),AJ))).AudioProvider(this.target,e)}},fg=class{name="video";target;canPlay(e){return sF(e)?le||!me(e.src)||e.type==="?"||oee(this.target,e.type):!1}mediaType(){return"video"}async load(e){if(le)throw Error("[vidstack] can not load video provider server-side");return new(await Promise.resolve().then(function(){return ODe})).VideoProvider(this.target,e)}},u2=class t extends fg{static supported=Ix();name="hls";canPlay(e){return t.supported&&yp(e)}async load(e){if(le)throw Error("[vidstack] can not load hls provider server-side");return new(await Promise.resolve().then(()=>(LJ(),RJ))).HLSProvider(this.target,e)}},XE=null,d2=[],f2=[];JN=class{#e;#t;#r=null;#n=null;get currentGain(){return this.#r?.gain?.value??null}get supported(){return!0}constructor(e,r){this.#e=e,this.#t=r}setGain(e){let r=this.currentGain;if(e!==this.currentGain){if(e===1&&r!==1){this.removeGain();return}this.#r||(this.#r=ADe(),this.#n&&this.#n.connect(this.#r)),this.#n||(this.#n=PDe(this.#e,this.#r)),this.#r.gain.value=e,this.#t(e)}}removeGain(){this.#r&&(this.#n&&this.#n.connect(cF().destination),this.#s(),this.#t(null))}destroy(){this.#i(),this.#s()}#i(){if(this.#n)try{LDe(this.#n)}catch{}finally{this.#n=null}}#s(){if(this.#r)try{RDe(this.#r)}catch{}finally{this.#r=null}}},MDe=["focus","blur","visibilitychange","pageshow","pagehide"],e4=class{#e=be(GJ());#t=be(le?"visible":document.visibilityState);#r;connect(){let e=new it(window),r=this.#n.bind(this);for(let n of MDe)e.add(n,r);ZE&&e.add("beforeunload",n=>{this.#r=setTimeout(()=>{n.defaultPrevented||n.returnValue.length>0||(this.#e.set("hidden"),this.#t.set("hidden"))},0)})}get pageState(){return this.#e()}get visibility(){return this.#t()}#n(e){ZE&&window.clearTimeout(this.#r),(e.type!=="blur"||this.#e()==="active")&&(this.#e.set(GJ(e)),this.#t.set(document.visibilityState=="hidden"?"hidden":"visible"))}};nl=class{#e;#t;constructor(e){this.#t=e}start(){Jt(this.#e)&&this.#r()}stop(){Rr(this.#e)&&window.cancelAnimationFrame(this.#e),this.#e=void 0}#r(){this.#e=window.requestAnimationFrame(()=>{Jt(this.#e)||(this.#t(),this.#r())})}},t4=class{#e;#t;#r=!1;#n=!1;#i=!1;#s=new nl(this.#d.bind(this));#a=new e4;#o;get#l(){return this.#e.media}constructor(e,r){this.#e=e,this.#t=r,this.#o=new it(e.media),this.#p(),this.#a.connect(),U(this.#_.bind(this)),Ne(this.#u.bind(this))}#u(){this.#n=!1,this.#i=!1,this.#s.stop(),this.#o.abort(),this.#y?.clear()}#c=0;#f=-1;#d(){let e=this.#l.currentTime;!(ZE&&e-this.#f<.35)&&this.#c!==e&&(this.#b(e),this.#c=e)}#p(){this.#h("loadstart",this.#S),this.#h("abort",this.#v),this.#h("emptied",this.#k),this.#h("error",this.#q),this.#h("volumechange",this.#B)}#g(){this.#n||(this.#h("loadeddata",this.#C),this.#h("loadedmetadata",this.#T),this.#h("canplay",this.#L),this.#h("canplaythrough",this.#M),this.#h("durationchange",this.#I),this.#h("play",this.#P),this.#h("progress",this.#$),this.#h("stalled",this.#R),this.#h("suspend",this.#U),this.#h("ratechange",this.#z),this.#n=!0)}#m(){this.#i||(this.#h("pause",this.#A),this.#h("playing",this.#O),this.#h("seeked",this.#V),this.#h("seeking",this.#j),this.#h("ended",this.#N),this.#h("waiting",this.#D),this.#i=!0)}#y=void 0;#w=void 0;#h(e,r){this.#o.add(e,r.bind(this))}#x(e){}#b(e,r){let n=Math.min(e,this.#t.$state.seekableEnd());this.#t.notify("time-change",n,r)}#S(e){if(this.#l.networkState===3){this.#v(e);return}this.#g(),this.#t.notify("load-start",void 0,e)}#v(e){this.#t.notify("abort",void 0,e)}#k(){this.#t.notify("emptied",void 0,event)}#C(e){this.#t.notify("loaded-data",void 0,e)}#T(e){this.#c=0,this.#f=-1,this.#m(),this.#t.notify("loaded-metadata",void 0,e),(Lx||ZE&&yp(this.#t.$state.source()))&&this.#t.delegate.ready(this.#E(),e)}#E(){return{provider:te(this.#t.$provider),duration:this.#l.duration,buffered:this.#l.buffered,seekable:this.#l.seekable}}#P(e){this.#t.$state.canPlay&&this.#t.notify("play",void 0,e)}#A(e){this.#l.readyState===1&&!this.#r||(this.#r=!1,this.#s.stop(),this.#t.notify("pause",void 0,e))}#L(e){this.#t.delegate.ready(this.#E(),e)}#M(e){this.#t.$state.started()||this.#t.notify("can-play-through",this.#E(),e)}#O(e){this.#l.paused||(this.#r=!1,this.#t.notify("playing",void 0,e),this.#s.start())}#R(e){this.#t.notify("stalled",void 0,e),this.#l.readyState<3&&(this.#r=!0,this.#t.notify("waiting",void 0,e))}#D(e){this.#l.readyState<3&&(this.#r=!0,this.#t.notify("waiting",void 0,e))}#N(e){this.#s.stop(),this.#b(this.#l.duration,e),this.#t.notify("end",void 0,e),this.#t.$state.loop()&&OD(this.#l.controls)&&(this.#l.controls=!1)}#_(){let e=this.#t.$state.paused(),r=this.#a.visibility==="hidden";(e||r)&&We(this.#l,"timeupdate",this.#F.bind(this))}#F(e){this.#b(this.#l.currentTime,e)}#I(e){this.#t.$state.ended()&&this.#b(this.#l.duration,e),this.#t.notify("duration-change",this.#l.duration,e)}#B(e){let r={volume:this.#l.volume,muted:this.#l.muted};this.#t.notify("volume-change",r,e)}#V(e){this.#f=this.#l.currentTime,this.#b(this.#l.currentTime,e),this.#t.notify("seeked",this.#l.currentTime,e),Math.trunc(this.#l.currentTime)===Math.trunc(this.#l.duration)&&KN(this.#l.duration)>KN(this.#l.currentTime)&&(this.#b(this.#l.duration,e),this.#l.ended||this.#t.player.dispatch(new Ie("media-play-request",{trigger:e})))}#j(e){this.#t.notify("seeking",this.#l.currentTime,e)}#$(e){let r={buffered:this.#l.buffered,seekable:this.#l.seekable};this.#t.notify("progress",r,e)}#U(e){this.#t.notify("suspend",void 0,e)}#z(e){this.#t.notify("rate-change",this.#l.playbackRate,e)}#q(e){let r=this.#l.error;if(!r)return;let n={message:r.message,code:r.code,mediaError:r};this.#t.notify("error",n,e)}},r4=class{#e;#t;get#r(){return this.#e.media.audioTracks}constructor(e,r){this.#e=e,this.#t=r,this.#r.onaddtrack=this.#n.bind(this),this.#r.onremovetrack=this.#i.bind(this),this.#r.onchange=this.#s.bind(this),We(this.#t.audioTracks,"change",this.#o.bind(this))}#n(e){let r=e.track;if(r.label==="")return;let n=r.id.toString()||`native-audio-${this.#t.audioTracks.length}`,i={id:n,label:r.label,language:r.language,kind:r.kind,selected:!1};this.#t.audioTracks[Se.add](i,e),r.enabled&&(i.selected=!0)}#i(e){let r=this.#t.audioTracks.getById(e.track.id);r&&this.#t.audioTracks[Se.remove](r,e)}#s(e){let r=this.#a();if(!r)return;let n=this.#t.audioTracks.getById(r.id);n&&this.#t.audioTracks[Se.select](n,!0,e)}#a(){return Array.from(this.#r).find(e=>e.enabled)}#o(e){let{current:r}=e.detail;if(!r)return;let n=this.#r.getTrackById(r.id);if(n){let i=this.#a();i&&(i.enabled=!1),n.enabled=!0}}},Tx=class{constructor(e,r){this.media=e,this.ctx=r,this.audioGain=new JN(e,n=>{this.ctx.notify("audio-gain-change",n)})}scope=yi();currentSrc=null;audioGain;setup(){new t4(this,this.ctx),"audioTracks"in this.media&&new r4(this,this.ctx),Ne(()=>{this.audioGain.destroy(),this.media.srcObject=null,this.media.removeAttribute("src");for(let e of this.media.querySelectorAll("source"))e.remove();this.media.load()})}get type(){return""}setPlaybackRate(e){this.media.playbackRate=e}async play(){return this.media.play()}async pause(){return this.media.pause()}setMuted(e){this.media.muted=e}setVolume(e){this.media.volume=e}setCurrentTime(e){this.media.currentTime=e}setPlaysInline(e){Ae(this.media,"playsinline",e)}async loadSource({src:e,type:r},n){this.media.preload=n||"",xee(e)?(this.removeSource(),this.media.srcObject=e):(this.media.srcObject=null,me(e)?r!=="?"?this.appendSource({src:e,type:r}):(this.removeSource(),this.media.src=this.#e(e)):(this.removeSource(),this.media.src=window.URL.createObjectURL(e))),this.media.load(),this.currentSrc={src:e,type:r}}appendSource(e,r){let n=this.media.querySelector("source[data-vds]"),i=n??document.createElement("source");Ae(i,"src",this.#e(e.src)),Ae(i,"type",e.type!=="?"?e.type:r),Ae(i,"data-vds",""),n||this.media.append(i)}removeSource(){this.media.querySelector("source[data-vds]")?.remove()}#e(e){let{clipStartTime:r,clipEndTime:n}=this.ctx.$state,i=r(),s=n();return i>0&&s>0?`${e}#t=${i},${s}`:i>0?`${e}#t=${i}`:s>0?`${e}#t=0,${s}`:e}},n4=class{#e;#t;#r;#n=be(!1);get supported(){return this.#n()}constructor(e,r){this.#e=e,this.#t=r,this.#i()}#i(){le||!this.#e?.remote||!this.canPrompt||(this.#e.remote.watchAvailability(e=>{this.#n.set(e)}).catch(()=>{this.#n.set(!1)}),U(this.#s.bind(this)))}#s(){if(!this.#n())return;let e=["connecting","connect","disconnect"],r=this.#a.bind(this);r(),We(this.#e,"playing",r);let n=new it(this.#e.remote);for(let i of e)n.add(i,r)}async prompt(){if(!this.supported)throw Error("Not supported on this platform.");return this.type==="airplay"&&this.#e.webkitShowPlaybackTargetPicker?this.#e.webkitShowPlaybackTargetPicker():this.#e.remote.prompt()}#a(e){let r=this.#e.remote.state;if(r===this.#r)return;let n={type:this.type,state:r};this.#t.notify("remote-playback-change",n,e),this.#r=r}},Ex=class extends n4{type="airplay";get canPrompt(){return"WebKitPlaybackTargetAvailabilityEvent"in window}},i4=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r,e.textTracks.onaddtrack=this.#r.bind(this),Ne(this.#n.bind(this))}#r(e){let r=e.track;if(!r||_De(this.#e,r))return;let n=new Kn({id:r.id,kind:r.kind,label:r.label??"",language:r.language,type:"vtt"});n[Re.native]={track:r},n[Re.readyState]=2,n[Re.nativeHLS]=!0;let i=0,s=a=>{if(r.cues)for(let o=i;o<r.cues.length;o++)n.addCue(r.cues[o],a),i++};s(e),r.oncuechange=s,this.#t.textTracks.add(n,e),n.setMode(r.mode,e)}#n(){this.#e.textTracks.onaddtrack=null;for(let e of this.#t.textTracks){let r=e[Re.native]?.track;r?.oncuechange&&(r.oncuechange=null)}}};s4=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r,new it(e).add("enterpictureinpicture",this.#r.bind(this)).add("leavepictureinpicture",this.#n.bind(this))}get active(){return document.pictureInPictureElement===this.#e}get supported(){return rF(this.#e)}async enter(){return this.#e.requestPictureInPicture()}exit(){return document.exitPictureInPicture()}#r(e){this.#i(!0,e)}#n(e){this.#i(!1,e)}#i=(e,r)=>{this.#t.notify("picture-in-picture-change",e,r)}},a4=class{#e;#t;#r="inline";get mode(){return this.#r}constructor(e,r){this.#e=e,this.#t=r,We(e,"webkitpresentationmodechanged",this.#n.bind(this))}get supported(){return nF(this.#e)}async setPresentationMode(e){this.#r!==e&&this.#e.webkitSetPresentationMode(e)}#n(e){let r=this.#r;this.#r=this.#e.webkitPresentationMode,this.#t.player?.dispatch(new Ie("video-presentation-change",{detail:this.#r,trigger:e})),["fullscreen","picture-in-picture"].forEach(n=>{(this.#r===n||r===n)&&this.#t.notify(`${n}-change`,this.#r===n,e)})}},o4=class{#e;get active(){return this.#e.mode==="fullscreen"}get supported(){return this.#e.supported}constructor(e){this.#e=e}async enter(){this.#e.setPresentationMode("fullscreen")}async exit(){this.#e.setPresentationMode("inline")}},l4=class{#e;get active(){return this.#e.mode==="picture-in-picture"}get supported(){return this.#e.supported}constructor(e){this.#e=e}async enter(){this.#e.setPresentationMode("picture-in-picture")}async exit(){this.#e.setPresentationMode("inline")}},cg=class extends Tx{$$PROVIDER_TYPE="VIDEO";get type(){return"video"}airPlay;fullscreen;pictureInPicture;constructor(e,r){super(e,r),pn(()=>{if(this.airPlay=new Ex(e,r),nF(e)){let n=new a4(e,r);this.fullscreen=new o4(n),this.pictureInPicture=new l4(n)}else rF(e)&&(this.pictureInPicture=new s4(e,r))},this.scope)}setup(){super.setup(),tF(this.video)&&new i4(this.video,this.ctx),this.ctx.textRenderers.attachVideo(this.video),Ne(()=>{this.ctx.textRenderers.attachVideo(null)}),this.type==="video"&&this.ctx.notify("provider-setup",this)}get video(){return this.media}},ODe=Object.freeze({__proto__:null,VideoProvider:cg});DDe=t=>`dash-${Ru(t)}`,c4=class{#e;#t;#r=null;#n=new Set;#i=null;config={};get instance(){return this.#r}constructor(e,r){this.#e=e,this.#t=r}setup(e){this.#r=e().create();let r=this.#l.bind(this);for(let n of Object.values(e.events))this.#r.on(n,r);this.#r.on(e.events.ERROR,this.#y.bind(this));for(let n of this.#n)n(this.#r);this.#t.player.dispatch("dash-instance",{detail:this.#r}),this.#r.initialize(this.#e,void 0,!1),this.#r.updateSettings({streaming:{text:{defaultEnabled:!1,dispatchForManualRendering:!0},buffer:{fastSwitchEnabled:!0}},...this.config}),this.#r.on(e.events.FRAGMENT_LOADING_STARTED,this.#w.bind(this)),this.#r.on(e.events.FRAGMENT_LOADING_COMPLETED,this.#h.bind(this)),this.#r.on(e.events.MANIFEST_LOADED,this.#m.bind(this)),this.#r.on(e.events.QUALITY_CHANGE_RENDERED,this.#g.bind(this)),this.#r.on(e.events.TEXT_TRACKS_ADDED,this.#d.bind(this)),this.#r.on(e.events.TRACK_CHANGE_RENDERED,this.#p.bind(this)),this.#t.qualities[Qr.enableAuto]=this.#k.bind(this),We(this.#t.qualities,"change",this.#T.bind(this)),We(this.#t.audioTracks,"change",this.#E.bind(this)),this.#i=U(this.#a.bind(this))}#s(e){return new Ie(DDe(e.type),{detail:e})}#a(){if(!this.#t.$state.live())return;let e=new nl(this.#o.bind(this));return e.start(),e.stop.bind(e)}#o(){if(!this.#r)return;let e=this.#r.duration()-this.#r.time();this.#t.$state.liveSyncPosition.set(isNaN(e)?1/0:e)}#l(e){this.#t.player?.dispatch(this.#s(e))}#u=null;#c={};#f(e){let r=this.#u?.[Re.native],n=(r?.track).cues;if(!r||!n)return;let i=this.#u.id,s=this.#c[i]??0,a=this.#s(e);for(let o=s;o<n.length;o++){let l=n[o];l.positionAlign||(l.positionAlign="auto"),this.#u.addCue(l,a)}this.#c[i]=n.length}#d(e){if(!this.#r)return;let r=e.tracks,n=[...this.#e.textTracks].filter(s=>"manualMode"in s),i=this.#s(e);for(let s=0;s<n.length;s++){let a=r[s],o=n[s],l=`dash-${a.kind}-${s}`,c=new Kn({id:l,label:a?.label??a.labels.find(u=>u.text)?.text??(a?.lang&&WJ(a.lang))??a?.lang??void 0,language:a.lang??void 0,kind:a.kind,default:a.defaultTrack});c[Re.native]={managed:!0,track:o},c[Re.readyState]=2,c[Re.onModeChange]=()=>{this.#r&&(c.mode==="showing"?(this.#r.setTextTrack(s),this.#u=c):(this.#r.setTextTrack(-1),this.#u=null))},this.#t.textTracks.add(c,i)}}#p(e){let{mediaType:r,newMediaInfo:n}=e;if(r==="audio"){let i=this.#t.audioTracks.getById(`dash-audio-${n.index}`);if(i){let s=this.#s(e);this.#t.audioTracks[Se.select](i,!0,s)}}}#g(e){if(e.mediaType!=="video")return;let r=this.#t.qualities[e.newQuality];if(r){let n=this.#s(e);this.#t.qualities[Se.select](r,!0,n)}}#m(e){if(this.#t.$state.canPlay()||!this.#r)return;let{type:r,mediaPresentationDuration:n}=e.data,i=this.#s(e);this.#t.notify("stream-type-change",r!=="static"?"live":"on-demand",i),this.#t.notify("duration-change",n,i),this.#t.qualities[Qr.setAuto](!0,i);let s=this.#r.getVideoElement(),a=this.#r.getTracksForTypeFromManifest("video",e.data),o=[...new Set(a.map(d=>d.mimeType))].find(d=>d&&oee(s,d)),l=a.filter(d=>o===d.mimeType)[0],c=this.#r.getTracksForTypeFromManifest("audio",e.data),u=[...new Set(c.map(d=>d.mimeType))].find(d=>d&&aee(s,d));if(c=c.filter(d=>u===d.mimeType),l.bitrateList.forEach((d,f)=>{let p={id:d.id?.toString()??`dash-bitrate-${f}`,width:d.width??0,height:d.height??0,bitrate:d.bandwidth??0,codec:l.codec,index:f};this.#t.qualities[Se.add](p,i)}),Rr(l.index)){let d=this.#t.qualities[l.index];d&&this.#t.qualities[Se.select](d,!0,i)}c.forEach((d,f)=>{let h=d.labels.find(v=>navigator.languages.some(b=>v.lang&&b.toLowerCase().startsWith(v.lang.toLowerCase())))||d.labels[0],m={id:`dash-audio-${d?.index}`,label:h?.text??(d.lang&&WJ(d.lang))??d.lang??"",language:d.lang??"",kind:"main",mimeType:d.mimeType,codec:d.codec,index:f};this.#t.audioTracks[Se.add](m,i)}),s.dispatchEvent(new Ie("canplay",{trigger:i}))}#y(e){let{type:r,error:n}=e;switch(n.code){case 27:this.#b(n);break;default:this.#v(n);break}}#w(){this.#x>=0&&this.#S()}#h(e){e.mediaType==="text"&&requestAnimationFrame(this.#f.bind(this,e))}#x=-1;#b(e){this.#S(),this.#r?.play(),this.#x=window.setTimeout(()=>{this.#x=-1,this.#v(e)},5e3)}#S(){clearTimeout(this.#x),this.#x=-1}#v(e){this.#t.notify("error",{message:e.message??"",code:1,error:e})}#k(){this.#C("video",!0);let{qualities:e}=this.#t;this.#r?.setQualityFor("video",e.selectedIndex,!0)}#C(e,r){this.#r?.updateSettings({streaming:{abr:{autoSwitchBitrate:{[e]:r}}}})}#T(){let{qualities:e}=this.#t;!this.#r||e.auto||!e.selected||(this.#C("video",!1),this.#r.setQualityFor("video",e.selectedIndex,e.switch==="current"),lg&&(this.#e.currentTime=this.#e.currentTime))}#E(){if(!this.#r)return;let{audioTracks:e}=this.#t,r=this.#r.getTracksFor("audio").find(n=>e.selected&&e.selected.id===`dash-audio-${n.index}`);r&&this.#r.setCurrentTrack(r)}#P(){this.#S(),this.#u=null,this.#c={}}onInstance(e){return this.#n.add(e),()=>this.#n.delete(e)}loadSource(e){this.#P(),me(e.src)&&this.#r?.attachSource(e.src)}destroy(){this.#P(),this.#r?.destroy(),this.#r=null,this.#i?.(),this.#i=null}};u4=class{#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n,this.#n()}async#n(){let e={onLoadStart:this.#i.bind(this),onLoaded:this.#s.bind(this),onLoadError:this.#a.bind(this)},r=await FDe(this.#e,e);if(Jt(r)&&!me(this.#e)&&(r=await NDe(this.#e,e)),!r)return null;if(!window.dashjs.supportsMediaSource()){let n="[vidstack] `dash.js` is not supported in this environment";return this.#t.player.dispatch(new Ie("dash-unsupported")),this.#t.notify("error",{message:n,code:4}),null}return r}#i(){this.#t.player.dispatch(new Ie("dash-lib-load-start"))}#s(e){this.#t.player.dispatch(new Ie("dash-lib-loaded",{detail:e})),this.#r(e)}#a(e){let r=ug(e);this.#t.player.dispatch(new Ie("dash-lib-load-error",{detail:r})),this.#t.notify("error",{message:r.message,code:4,error:r})}};VDe="https://cdn.jsdelivr.net",d4=class extends cg{$$PROVIDER_TYPE="DASH";#e=null;#t=new c4(this.video,this.ctx);get ctor(){return this.#e}get instance(){return this.#t.instance}static supported=cee();get type(){return"dash"}get canLiveSync(){return!0}#r=`${VDe}/npm/dashjs@4.7.4/dist/dash.all.min.js`;get config(){return this.#t.config}set config(e){this.#t.config=e}get library(){return this.#r}set library(e){this.#r=e}preconnect(){me(this.#r)&&ba(this.#r)}setup(){super.setup(),new u4(this.#r,this.ctx,e=>{this.#e=e,this.#t.setup(e),this.ctx.notify("provider-setup",this);let r=te(this.ctx.$state.source);r&&this.loadSource(r)})}async loadSource(e,r){if(!me(e.src)){this.removeSource();return}this.media.preload=r||"",this.appendSource(e,"application/x-mpegurl"),this.#t.loadSource(e),this.currentSrc=e}onInstance(e){let r=this.#t.instance;return r&&e(r),this.#t.onInstance(e)}destroy(){this.#t.destroy()}},jDe=Object.freeze({__proto__:null,DASHProvider:d4}),p2=class t extends fg{static supported=cee();name="dash";canPlay(e){return t.supported&&D2(e)}async load(e){if(le)throw Error("[vidstack] can not load dash provider server-side");return new(await Promise.resolve().then(function(){return jDe})).DASHProvider(this.target,e)}},h2=class{name="vimeo";target;preconnect(){let e=["https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"];for(let r of e)ba(r)}canPlay(e){return me(e.src)&&e.type==="video/vimeo"}mediaType(){return"video"}async load(e){if(le)throw Error("[vidstack] can not load vimeo provider server-side");return new(await Promise.resolve().then(()=>(DJ(),OJ))).VimeoProvider(this.target,e)}async loadPoster(e,r,n){let{resolveVimeoVideoId:i,getVimeoVideoInfo:s}=await Promise.resolve().then(()=>(IN(),_J));if(!me(e.src))return null;let{videoId:a,hash:o}=i(e.src);return a?s(a,n,o).then(l=>l?l.poster:null):null}},m2=class{name="youtube";target;preconnect(){let e=["https://www.google.com","https://i.ytimg.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net"];for(let r of e)ba(r)}canPlay(e){return me(e.src)&&e.type==="video/youtube"}mediaType(){return"video"}async load(e){if(le)throw Error("[vidstack] can not load youtube provider server-side");return new(await Promise.resolve().then(()=>(BJ(),FJ))).YouTubeProvider(this.target,e)}async loadPoster(e,r,n){let{findYouTubePoster:i,resolveYouTubeVideoId:s}=await Promise.resolve().then(()=>(LN(),NJ)),a=me(e.src)&&s(e.src);return a?i(a,n):null}};$N=Symbol(0),$De=["autoPlay","canAirPlay","canFullscreen","canGoogleCast","canLoad","canLoadPoster","canPictureInPicture","canPlay","canSeek","ended","fullscreen","isAirPlayConnected","isGoogleCastConnected","live","liveEdge","loop","mediaType","muted","paused","pictureInPicture","playing","playsInline","remotePlaybackState","remotePlaybackType","seeking","started","streamType","viewType","waiting"],UDe={artist:"",artwork:null,autoplay:!1,autoPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,currentTime:0,crossorigin:null,crossOrigin:null,duration:-1,fullscreenOrientation:"landscape",googleCast:{},load:"visible",posterLoad:"visible",logLevel:"silent",loop:!1,muted:!1,paused:!0,playsinline:!1,playsInline:!1,playbackRate:1,poster:"",preload:"metadata",preferNativeHLS:!1,src:"",title:"",controlsDelay:2e3,hideControlsOnMouseLeave:!1,viewType:"unknown",streamType:"unknown",volume:1,liveEdgeTolerance:10,minLiveDVRWindow:60,keyDisabled:!1,keyTarget:"player",keyShortcuts:Mee,storage:null},g2=class extends dc{#e;#t;constructor(e,r){super(),this.#e=e,this.#t=r}async onAttach(e){if(le)return;let r=this.$props[this.#e]();if(r==="eager")requestAnimationFrame(this.#t);else if(r==="idle")CZ(this.#t);else if(r==="visible"){let n,i=new IntersectionObserver(s=>{this.scope&&s[0].isIntersecting&&(n?.(),n=void 0,this.#t())});i.observe(e),n=Ne(()=>i.disconnect())}}},f4=class{#e;#t;constructor(e,r){this.#e=e,this.#t=r}notify(e,...r){le||this.#e(new Ie(e,{detail:r?.[0],trigger:r?.[1]}))}async ready(e,r){if(!le)return tl(async()=>{let{logger:n}=this.#t,{autoPlay:i,canPlay:s,started:a,duration:o,seekable:l,buffered:c,remotePlaybackInfo:u,playsInline:d,savedState:f,source:p}=this.#t.$state;if(s())return;let h={duration:e?.duration??o(),seekable:e?.seekable??l(),buffered:e?.buffered??c(),provider:this.#t.$provider()};this.notify("can-play",h,r),Cs();let m=this.#t.$provider(),{storage:v,qualities:b}=this.#t,{muted:y,volume:x,clipStartTime:w,playbackRate:C}=this.#t.$props;await v?.onLoad?.(p());let O=f()?.currentTime,S=f()?.paused,T=await v?.getTime(),E=O??T??w(),P=S===!1||S!==!0&&!a()&&i();if(m){m.setVolume(await v?.getVolume()??x()),m.setMuted(y()||!!await v?.getMuted());let I=await v?.getAudioGain()??1;I>1&&m.audioGain?.setGain?.(I),m.setPlaybackRate?.(await v?.getPlaybackRate()??C()),m.setPlaysInline?.(d()),E>0&&m.setCurrentTime(E)}let R=await v?.getVideoQuality();if(R&&b.length){let I=null,B=1/0;for(let M of b){let z=Math.abs(R.width-M.width)+Math.abs(R.height-M.height)+(R.bitrate?Math.abs(R.bitrate-(M.bitrate??0)):0);z<B&&(I=M,B=z)}I&&(I.selected=!0)}s()&&P?await this.#r(r):T&&T>0&&this.notify("started",void 0,r),u.set(null)})}async#r(e){let{player:r,$state:{autoPlaying:n,muted:i}}=this.#t;n.set(!0);let s=new Ie("auto-play-attempt",{trigger:e});try{await r.play(s)}catch{}}},p4=class{#e=new Map;enqueue(e,r){this.#e.set(e,r)}serve(e){let r=this.peek(e);return this.#e.delete(e),r}peek(e){return this.#e.get(e)}delete(e){this.#e.delete(e)}clear(){this.#e.clear()}},y2=class{#e=!1;#t=rc();#r=new Map;get size(){return this.#r.size}get isServing(){return this.#e}async waitForFlush(){this.#e||await this.#t.promise}enqueue(e,r){if(this.#e){r();return}this.#r.delete(e),this.#r.set(e,r)}serve(e){this.#r.get(e)?.(),this.#r.delete(e)}start(){this.#n(),this.#e=!0,this.#r.size>0&&this.#n()}stop(){this.#e=!1}reset(){this.stop(),this.#r.clear(),this.#i()}#n(){for(let e of this.#r.keys())this.serve(e);this.#i()}#i(){this.#t.resolve(),this.#t=rc()}};h4=class extends dc{#e;#t;#r;controls;#n;#i;#s;#a=new y2;constructor(e,r,n){super(),this.#e=e,this.#t=r,this.#r=n,this.#s=n.$provider,this.controls=new o2,this.#n=new l2,this.#i=new Bx}onAttach(){this.listen("fullscreen-change",this.#S.bind(this))}onConnect(e){let r=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),n=new it(e),i=this.#u.bind(this);for(let s of r)s.startsWith("media-")&&n.add(s,i);this.#o(),U(this.#l.bind(this)),U(this.#g.bind(this)),U(this.#m.bind(this)),U(this.#y.bind(this)),U(this.#w.bind(this)),U(this.#h.bind(this)),U(this.#x.bind(this))}onDestroy(){try{let e=this.createEvent("destroy"),{pictureInPicture:r,fullscreen:n}=this.$state;n()&&this.exitFullscreen("prefer-media",e),r()&&this.exitPictureInPicture(e)}catch{}this.#a.reset()}#o(){let{load:e}=this.$props,{canLoad:r}=this.$state;if(e()!=="play"||r())return;let n=this.listen("media-play-request",i=>{this.#c(i),n()})}#l(){let e=this.#s(),r=this.$state.canPlay();return e&&r&&this.#a.start(),()=>{this.#a.stop()}}#u(e){e.stopPropagation(),!e.defaultPrevented&&this[e.type]&&(te(this.#s)?this[e.type](e):this.#a.enqueue(e.type,()=>{te(this.#s)&&this[e.type](e)}))}async play(e){if(le)return;let{canPlay:r,paused:n,autoPlaying:i}=this.$state;if(this.#c(e)||!te(n))return;e&&this.#t.queue.enqueue("media-play-request",e);let s=te(i);try{let a=te(this.#s);return UN(a,te(r)),HDe(s),await a.play()}catch(a){let o=this.createEvent("play-fail",{detail:ug(a),trigger:e});throw o.autoPlay=s,this.#e.handle(o),a}}#c(e){let{load:r}=this.$props,{canLoad:n}=this.$state;if(r()==="play"&&!n()){let i=this.createEvent("media-start-loading",{trigger:e});return this.dispatchEvent(i),this.#a.enqueue("media-play-request",async()=>{try{await this.play(i)}catch{}}),!0}return!1}async pause(e){if(le)return;let{canPlay:r,paused:n}=this.$state;if(!te(n)){e&&this.#t.queue.enqueue("media-pause-request",e);try{let i=te(this.#s);return UN(i,te(r)),await i.pause()}catch(i){throw this.#t.queue.delete("media-pause-request"),i}}}setAudioGain(e,r){let{audioGain:n,canSetAudioGain:i}=this.$state;if(n()===e)return;let s=this.#s();if(!s?.audioGain||!i())throw Error("[vidstack] audio gain api not available");r&&this.#t.queue.enqueue("media-audio-gain-change-request",r),s.audioGain.setGain(e)}seekToLiveEdge(e){if(le)return;let{canPlay:r,live:n,liveEdge:i,canSeek:s,liveSyncPosition:a,seekableEnd:o,userBehindLiveEdge:l}=this.$state;if(l.set(!1),te(()=>!n()||i()||!s()))return;let c=te(this.#s);UN(c,te(r)),e&&this.#t.queue.enqueue("media-seek-request",e);let u=o()-2;c.setCurrentTime(Math.min(u,a()??u))}#f=!1;async enterFullscreen(e="prefer-media",r){if(le)return;let n=this.#d(e);if(YJ(e,n),!n.active)return te(this.$state.pictureInPicture)&&(this.#f=!0,await this.exitPictureInPicture(r)),r&&this.#t.queue.enqueue("media-enter-fullscreen-request",r),n.enter()}async exitFullscreen(e="prefer-media",r){if(le)return;let n=this.#d(e);if(YJ(e,n),!!n.active){r&&this.#t.queue.enqueue("media-exit-fullscreen-request",r);try{let i=await n.exit();return this.#f&&te(this.$state.canPictureInPicture)&&await this.enterPictureInPicture(),i}finally{this.#f=!1}}}#d(e){let r=te(this.#s);return e==="prefer-media"&&this.#n.supported||e==="media"?this.#n:r?.fullscreen}async enterPictureInPicture(e){if(!le&&(this.#p(),!this.$state.pictureInPicture()))return e&&this.#t.queue.enqueue("media-enter-pip-request",e),await this.#s().pictureInPicture.enter()}async exitPictureInPicture(e){if(!le&&(this.#p(),!!this.$state.pictureInPicture()))return e&&this.#t.queue.enqueue("media-exit-pip-request",e),await this.#s().pictureInPicture.exit()}#p(){if(!this.$state.canPictureInPicture())throw Error("[vidstack] no pip support")}#g(){this.controls.defaultDelay=this.$props.controlsDelay()}#m(){let{canSetAudioGain:e}=this.$state,r=!!this.#s()?.audioGain?.supported;e.set(r)}#y(){let{canAirPlay:e}=this.$state,r=!!this.#s()?.airPlay?.supported;e.set(r)}#w(){let{canGoogleCast:e,source:r}=this.$state,n=lg&&!Lx&&WE(r());e.set(n)}#h(){let{canFullscreen:e}=this.$state,r=this.#n.supported||!!this.#s()?.fullscreen?.supported;e.set(r)}#x(){let{canPictureInPicture:e}=this.$state,r=!!this.#s()?.pictureInPicture?.supported;e.set(r)}async"media-airplay-request"(e){try{await this.requestAirPlay(e)}catch{}}async requestAirPlay(e){try{let r=this.#s()?.airPlay;if(!r?.supported)throw Error("No AirPlay adapter.");return e&&this.#t.queue.enqueue("media-airplay-request",e),await r.prompt()}catch(r){throw this.#t.queue.delete("media-airplay-request"),r}}async"media-google-cast-request"(e){try{await this.requestGoogleCast(e)}catch{}}#b;async requestGoogleCast(e){try{let{canGoogleCast:r}=this.$state;if(!te(r)){let i=Error("Cast not available.");throw i.code="CAST_NOT_AVAILABLE",i}if(ba("https://www.gstatic.com"),!this.#b){let i=await Promise.resolve().then(()=>(FN(),UJ)).then(function(s){return s.loader});this.#b=new i.GoogleCastLoader}await this.#b.prompt(this.#r),e&&this.#t.queue.enqueue("media-google-cast-request",e);let n=te(this.$state.remotePlaybackState)!=="disconnected";n&&this.$state.savedState.set({paused:te(this.$state.paused),currentTime:te(this.$state.currentTime)}),this.$state.remotePlaybackLoader.set(n?this.#b:null)}catch(r){throw this.#t.queue.delete("media-google-cast-request"),r}}"media-clip-start-change-request"(e){let{clipStartTime:r}=this.$state;r.set(e.detail)}"media-clip-end-change-request"(e){let{clipEndTime:r}=this.$state;r.set(e.detail),this.dispatch("duration-change",{detail:e.detail,trigger:e})}"media-duration-change-request"(e){let{providedDuration:r,clipEndTime:n}=this.$state;r.set(e.detail),n()<=0&&this.dispatch("duration-change",{detail:e.detail,trigger:e})}"media-audio-track-change-request"(e){let{logger:r,audioTracks:n}=this.#r;if(n.readonly)return;let i=e.detail,s=n[i];if(s){let a=e.type;this.#t.queue.enqueue(a,e),s.selected=!0}}async"media-enter-fullscreen-request"(e){try{await this.enterFullscreen(e.detail,e)}catch(r){this.#v(r,e)}}async"media-exit-fullscreen-request"(e){try{await this.exitFullscreen(e.detail,e)}catch(r){this.#v(r,e)}}async#S(e){let r=te(this.$props.fullscreenOrientation),n=e.detail;if(!(Jt(r)||r==="none"||!this.#i.supported))if(n){if(this.#i.locked)return;this.dispatch("media-orientation-lock-request",{detail:r,trigger:e})}else this.#i.locked&&this.dispatch("media-orientation-unlock-request",{trigger:e})}#v(e,r){this.#e.handle(this.createEvent("fullscreen-error",{detail:ug(e)}))}async"media-orientation-lock-request"(e){let r=e.type;try{this.#t.queue.enqueue(r,e),await this.#i.lock(e.detail)}catch{this.#t.queue.delete(r)}}async"media-orientation-unlock-request"(e){let r=e.type;try{this.#t.queue.enqueue(r,e),await this.#i.unlock()}catch{this.#t.queue.delete(r)}}async"media-enter-pip-request"(e){try{await this.enterPictureInPicture(e)}catch(r){this.#k(r,e)}}async"media-exit-pip-request"(e){try{await this.exitPictureInPicture(e)}catch(r){this.#k(r,e)}}#k(e,r){this.#e.handle(this.createEvent("picture-in-picture-error",{detail:ug(e)}))}"media-live-edge-request"(e){let{live:r,liveEdge:n,canSeek:i}=this.$state;if(!(!r()||n()||!i())){this.#t.queue.enqueue("media-seek-request",e);try{this.seekToLiveEdge()}catch{this.#t.queue.delete("media-seek-request")}}}async"media-loop-request"(e){try{this.#t.looping=!0,this.#t.replaying=!0,await this.play(e)}catch{this.#t.looping=!1}}"media-user-loop-change-request"(e){this.$state.userPrefersLoop.set(e.detail)}async"media-pause-request"(e){if(!this.$state.paused())try{await this.pause(e)}catch{}}async"media-play-request"(e){if(this.$state.paused())try{await this.play(e)}catch{}}"media-rate-change-request"(e){let{playbackRate:r,canSetPlaybackRate:n}=this.$state;if(r()===e.detail||!n())return;let i=this.#s();i?.setPlaybackRate&&(this.#t.queue.enqueue("media-rate-change-request",e),i.setPlaybackRate(e.detail))}"media-audio-gain-change-request"(e){try{this.setAudioGain(e.detail,e)}catch{}}"media-quality-change-request"(e){let{qualities:r,storage:n,logger:i}=this.#r;if(r.readonly)return;this.#t.queue.enqueue("media-quality-change-request",e);let s=e.detail;if(s<0)r.autoSelect(e),e.isOriginTrusted&&n?.setVideoQuality?.(null);else{let a=r[s];a&&(a.selected=!0,e.isOriginTrusted&&n?.setVideoQuality?.({id:a.id,width:a.width,height:a.height,bitrate:a.bitrate}))}}"media-pause-controls-request"(e){let r=e.type;this.#t.queue.enqueue(r,e),this.controls.pause(e)}"media-resume-controls-request"(e){let r=e.type;this.#t.queue.enqueue(r,e),this.controls.resume(e)}"media-seek-request"(e){let{canSeek:r,ended:n,live:i,seekableEnd:s,userBehindLiveEdge:a}=this.$state,o=e.detail;n()&&(this.#t.replaying=!0);let l=e.type;this.#t.seeking=!1,this.#t.queue.delete(l);let c=aF(o,this.$state);!Number.isFinite(c)||!r()||(this.#t.queue.enqueue(l,e),this.#s().setCurrentTime(c),i()&&e.isOriginTrusted&&Math.abs(s()-c)>=2&&a.set(!0))}"media-seeking-request"(e){let r=e.type;this.#t.queue.enqueue(r,e),this.$state.seeking.set(!0),this.#t.seeking=!0}"media-start-loading"(e){if(this.$state.canLoad())return;let r=e.type;this.#t.queue.enqueue(r,e),this.#e.handle(this.createEvent("can-load"))}"media-poster-start-loading"(e){if(this.$state.canLoadPoster())return;let r=e.type;this.#t.queue.enqueue(r,e),this.#e.handle(this.createEvent("can-load-poster"))}"media-text-track-change-request"(e){let{index:r,mode:n}=e.detail,i=this.#r.textTracks[r];if(i){let s=e.type;this.#t.queue.enqueue(s,e),i.setMode(n,e)}}"media-mute-request"(e){if(this.$state.muted())return;let r=e.type;this.#t.queue.enqueue(r,e),this.#s().setMuted(!0)}"media-unmute-request"(e){let{muted:r,volume:n}=this.$state;if(!r())return;let i=e.type;this.#t.queue.enqueue(i,e),this.#r.$provider().setMuted(!1),n()===0&&(this.#t.queue.enqueue(i,e),this.#s().setVolume(.25))}"media-volume-change-request"(e){let{muted:r,volume:n}=this.$state,i=e.detail;if(n()===i)return;let s=e.type;this.#t.queue.enqueue(s,e),this.#s().setVolume(i),i>0&&r()&&(this.#t.queue.enqueue(s,e),this.#s().setMuted(!1))}#C(e,r,n){}};m4=class{seeking=!1;looping=!1;replaying=!1;queue=new p4},GDe=new Set(["auto-play","auto-play-fail","can-load","sources-change","source-change","load-start","abort","error","loaded-metadata","loaded-data","can-play","play","play-fail","pause","playing","seeking","seeked","waiting"]),g4=class extends dc{#e;#t;#r=new Map;#n=!1;#i=[];#s=[-1,-1];#a=!1;#o;constructor(e,r){super(),this.#e=e,this.#t=r}onAttach(e){e.setAttribute("aria-busy","true"),new it(this).add("fullscreen-change",this["fullscreen-change"].bind(this)).add("fullscreen-error",this["fullscreen-error"].bind(this)).add("orientation-change",this["orientation-change"].bind(this))}onConnect(e){U(this.#P.bind(this)),this.#p(),this.#g(),this.#m(),this.#u(),Ne(this.#c.bind(this))}onDestroy(){let{audioTracks:e,qualities:r,textTracks:n}=this.#t;e[Se.reset](),r[Se.reset](),n[Se.reset](),this.#T()}handle(e){if(!this.scope)return;let r=e.type;tl(()=>this[e.type]?.(e)),le||(GDe.has(r)&&this.#r.set(r,e),this.dispatch(e))}#l=!1;#u(){this.#l&&(requestAnimationFrame(()=>{this.scope&&this.#t.remote.play(new Ie("dom-connect"))}),this.#l=!1)}#c(){this.#l||(this.#l=!this.$state.paused(),this.#t.$provider()?.pause())}#f(){this.#I(),this.#n=!1,this.#e.replaying=!1,this.#e.looping=!1,this.#a=!1,this.#o=void 0,this.#r.clear()}#d(e,r){let n=this.#e.queue.serve(e);n&&(r.request=n,r.triggers.add(n))}#p(){this.#y(),this.#w();let e=this.#t.textTracks;new it(e).add("add",this.#y.bind(this)).add("remove",this.#y.bind(this)).add("mode-change",this.#w.bind(this))}#g(){let e=this.#t.qualities;new it(e).add("add",this.#b.bind(this)).add("remove",this.#b.bind(this)).add("change",this.#S.bind(this)).add("auto-change",this.#v.bind(this)).add("readonly-change",this.#E.bind(this))}#m(){let e=this.#t.audioTracks;new it(e).add("add",this.#h.bind(this)).add("remove",this.#h.bind(this)).add("change",this.#x.bind(this))}#y(e){let{textTracks:r}=this.$state;r.set(this.#t.textTracks.toArray()),this.dispatch("text-tracks-change",{detail:r(),trigger:e})}#w(e){e&&this.#d("media-text-track-change-request",e);let r=this.#t.textTracks.selected,{textTrack:n}=this.$state;n()!==r&&(n.set(r),this.dispatch("text-track-change",{detail:r,trigger:e}))}#h(e){let{audioTracks:r}=this.$state;r.set(this.#t.audioTracks.toArray()),this.dispatch("audio-tracks-change",{detail:r(),trigger:e})}#x(e){let{audioTrack:r}=this.$state;r.set(this.#t.audioTracks.selected),e&&this.#d("media-audio-track-change-request",e),this.dispatch("audio-track-change",{detail:r(),trigger:e})}#b(e){let{qualities:r}=this.$state;r.set(this.#t.qualities.toArray()),this.dispatch("qualities-change",{detail:r(),trigger:e})}#S(e){let{quality:r}=this.$state;r.set(this.#t.qualities.selected),e&&this.#d("media-quality-change-request",e),this.dispatch("quality-change",{detail:r(),trigger:e})}#v(){let{qualities:e}=this.#t,r=e.auto;this.$state.autoQuality.set(r),r||this.#T()}#k=null;#C(){this.#T(),this.#k=U(()=>{let{qualities:e}=this.#t,{mediaWidth:r,mediaHeight:n}=this.$state,i=r(),s=n();if(i===0||s===0)return;let a=null,o=1/0;for(let l of e){let c=Math.abs(l.width-i)+Math.abs(l.height-s);c<o&&(o=c,a=l)}a&&e[Se.select](a,!0,new Ie("resize",{detail:{width:i,height:s}}))})}#T(){this.#k?.(),this.#k=null}#E(){this.$state.canSetQuality.set(!this.#t.qualities.readonly)}#P(){let{canSetVolume:e,isGoogleCastConnected:r}=this.$state;if(r()){e.set(!1);return}lee().then(e.set)}"provider-change"(e){let r=this.#t.$provider(),n=e.detail;r?.type!==n?.type&&(r?.destroy?.(),r?.scope?.dispose(),this.#t.$provider.set(e.detail),r&&e.detail===null&&this.#L(e))}"provider-loader-change"(e){}"auto-play"(e){this.$state.autoPlayError.set(null)}"auto-play-fail"(e){this.$state.autoPlayError.set(e.detail),this.#f()}"can-load"(e){this.$state.canLoad.set(!0),this.#r.set("can-load",e),this.#t.textTracks[Re.canLoad](),this.#d("media-start-loading",e)}"can-load-poster"(e){this.$state.canLoadPoster.set(!0),this.#r.set("can-load-poster",e),this.#d("media-poster-start-loading",e)}"media-type-change"(e){let r=this.#r.get("source-change");r&&e.triggers.add(r);let n=this.$state.viewType();this.$state.mediaType.set(e.detail);let i=this.$state.providedViewType(),s=i==="unknown"?e.detail:i;n!==s&&(le?this.$state.inferredViewType.set(s):setTimeout(()=>{requestAnimationFrame(()=>{this.scope&&(this.$state.inferredViewType.set(e.detail),this.dispatch("view-type-change",{detail:s,trigger:e}))})},0))}"stream-type-change"(e){let r=this.#r.get("source-change");r&&e.triggers.add(r);let{streamType:n,inferredStreamType:i}=this.$state;i.set(e.detail),e.detail=n()}"rate-change"(e){let{storage:r}=this.#t,{canPlay:n}=this.$state;this.$state.playbackRate.set(e.detail),this.#d("media-rate-change-request",e),n()&&r?.setPlaybackRate?.(e.detail)}"remote-playback-change"(e){let{remotePlaybackState:r,remotePlaybackType:n}=this.$state,{type:i,state:s}=e.detail,a=s==="connected";n.set(i),r.set(s);let o=i==="airplay"?"media-airplay-request":"media-google-cast-request";if(a)this.#d(o,e);else{let l=this.#e.queue.peek(o);l&&(e.request=l,e.triggers.add(l))}}"sources-change"(e){let r=this.$state.sources(),n=e.detail;this.$state.sources.set(n),this.#A(r,n,e)}#A(e,r,n){let{qualities:i}=this.#t,s=!1,a=!1;for(let o of e){if(!QE(o))continue;if(!r.some(c=>c.src===o.src)){let c=i.getBySrc(o.src);c&&(i[Se.remove](c,n),a=!0)}}a&&!i.length&&(this.$state.savedState.set(null),i[Se.reset](n));for(let o of r){if(!QE(o)||i.getBySrc(o.src))continue;let l={id:o.id??o.height+"p",bitrate:null,codec:null,...o,selected:!1};i[Se.add](l,n),s=!0}s&&!i[Qr.enableAuto]&&(this.#C(),i[Qr.enableAuto]=this.#C.bind(this),i[Qr.setAuto](!0,n))}"source-change"(e){e.isQualityChange=e.originEvent?.type==="quality-change";let r=e.detail;this.#L(e,e.isQualityChange),this.#r.set(e.type,e),this.$state.source.set(r),this.el?.setAttribute("aria-busy","true")}#L(e,r=!1){let{audioTracks:n,qualities:i}=this.#t;if(!r){this.#i=[],this.#s=[-1,-1],n[Se.reset](e),i[Se.reset](e),WN(this.$state,r),this.#f();return}WN(this.$state,r),this.#f()}abort(e){let r=this.#r.get("source-change");r&&e.triggers.add(r);let n=this.#r.get("can-load");n&&!e.triggers.hasType("can-load")&&e.triggers.add(n)}"load-start"(e){let r=this.#r.get("source-change");r&&e.triggers.add(r)}error(e){this.$state.error.set(e.detail);let r=this.#r.get("abort");r&&e.triggers.add(r)}"loaded-metadata"(e){let r=this.#r.get("load-start");r&&e.triggers.add(r)}"loaded-data"(e){let r=this.#r.get("load-start");r&&e.triggers.add(r)}"can-play"(e){let r=this.#r.get("loaded-metadata");r&&e.triggers.add(r),this.#M(e.detail),this.el?.setAttribute("aria-busy","false")}"can-play-through"(e){this.#M(e.detail);let r=this.#r.get("can-play");r&&e.triggers.add(r)}#M(e){let{seekable:r,buffered:n,intrinsicDuration:i,canPlay:s}=this.$state;s.set(!0),n.set(e.buffered),r.set(e.seekable);let a=_u(e.seekable)??1/0;i.set(a)}"duration-change"(e){let{live:r,intrinsicDuration:n,providedDuration:i,clipEndTime:s,ended:a}=this.$state,o=e.detail;if(!r()){let l=Number.isNaN(o)?0:o;n.set(l),a()&&this.#D(e)}(i()>0||s()>0)&&e.stopImmediatePropagation()}progress(e){let{buffered:r,seekable:n}=this.$state,{buffered:i,seekable:s}=e.detail,a=_u(i),o=i.length!==r().length,l=a!==_u(r()),c=_u(s),u=s.length!==n().length,d=c!==_u(n());(o||l)&&r.set(i),(u||d)&&n.set(s)}play(e){let{paused:r,autoPlayError:n,ended:i,autoPlaying:s,playsInline:a,pointer:o,muted:l,viewType:c,live:u,userBehindLiveEdge:d}=this.$state;if(this.#O(),!r()){e.stopImmediatePropagation();return}e.autoPlay=s();let f=this.#r.get("waiting");f&&e.triggers.add(f),this.#d("media-play-request",e),this.#r.set("play",e),r.set(!1),n.set(null),e.autoPlay&&(this.handle(this.createEvent("auto-play",{detail:{muted:l()},trigger:e})),s.set(!1)),(i()||this.#e.replaying)&&(this.#e.replaying=!1,i.set(!1),this.handle(this.createEvent("replay",{trigger:e}))),!a()&&c()==="video"&&o()==="coarse"&&this.#t.remote.enterFullscreen("prefer-media",e),u()&&!d()&&this.#t.remote.seekToLiveEdge(e)}#O(e){if(!te(this.#t.$provider))return;let{ended:n,seekableStart:i,clipEndTime:s,currentTime:a,realCurrentTime:o,duration:l}=this.$state,c=n()||o()<i()||s()>0&&o()>=s()||Math.abs(a()-l())<.1;return c&&this.dispatch("media-seek-request",{detail:i(),trigger:e}),c}"play-fail"(e){let{muted:r,autoPlaying:n}=this.$state,i=this.#r.get("play");i&&e.triggers.add(i),this.#d("media-play-request",e);let{paused:s,playing:a}=this.$state;s.set(!0),a.set(!1),this.#f(),this.#r.set("play-fail",e),e.autoPlay&&(this.handle(this.createEvent("auto-play-fail",{detail:{muted:r(),error:e.detail},trigger:e})),n.set(!1))}playing(e){let r=this.#r.get("play"),n=this.#r.get("seeked");r?e.triggers.add(r):n&&e.triggers.add(n),setTimeout(()=>this.#f(),0);let{paused:i,playing:s,live:a,liveSyncPosition:o,seekableEnd:l,started:c,currentTime:u,seeking:d,ended:f}=this.$state;if(i.set(!1),s.set(!0),d.set(!1),f.set(!1),this.#e.looping){this.#e.looping=!1;return}if(a()&&!c()&&u()===0){let p=o()??l()-2;Number.isFinite(p)&&this.#t.$provider().setCurrentTime(p)}this.started(e)}started(e){let{started:r}=this.$state;r()||(r.set(!0),this.handle(this.createEvent("started",{trigger:e})))}pause(e){this.el?.isConnected||(this.#l=!0),this.#d("media-pause-request",e);let r=this.#r.get("seeked");r&&e.triggers.add(r);let{paused:n,playing:i}=this.$state;n.set(!0),i.set(!1),this.#n&&setTimeout(()=>{this.handle(this.createEvent("end",{trigger:e})),this.#n=!1},0),this.#f()}"time-change"(e){if(this.#e.looping){e.stopImmediatePropagation();return}let{waiting:r,played:n,clipEndTime:i,realCurrentTime:s,currentTime:a}=this.$state,o=e.detail,l=i();s.set(o),this.#R(),r.set(!1);for(let c of this.#t.textTracks)c[Re.updateActiveCues](o,e);l>0&&o>=l&&(this.#n=!0,this.dispatch("media-pause-request",{trigger:e})),this.#N(),this.dispatch("time-update",{detail:{currentTime:a(),played:n()},trigger:e})}#R(){let{currentTime:e,played:r,paused:n}=this.$state;n()||(this.#s=dee(this.#i,this.#s,e()),r.set(new Yt(this.#i)))}#D(e){let{clipStartTime:r,clipEndTime:n,duration:i}=this.$state;r()>0||n()>0||this.handle(this.createEvent("time-change",{detail:i(),trigger:e}))}#N(){let{storage:e}=this.#t,{canPlay:r,realCurrentTime:n}=this.$state;r()&&e?.setTime?.(n())}"audio-gain-change"(e){let{storage:r}=this.#t,{canPlay:n,audioGain:i}=this.$state;i.set(e.detail),this.#d("media-audio-gain-change-request",e),n()&&r?.setAudioGain?.(i())}"volume-change"(e){let{storage:r}=this.#t,{volume:n,muted:i,canPlay:s}=this.$state,a=e.detail;n.set(a.volume),i.set(a.muted||a.volume===0),this.#d("media-volume-change-request",e),this.#d(a.muted?"media-mute-request":"media-unmute-request",e),s()&&(r?.setVolume?.(n()),r?.setMuted?.(i()))}seeking=ic(e=>{let{seeking:r,realCurrentTime:n,paused:i}=this.$state;r.set(!0),n.set(e.detail),this.#d("media-seeking-request",e),i()&&(this.#o=e,this.#_()),this.#s=[-1,-1]},150,{leading:!0});seeked(e){let{seeking:r,currentTime:n,realCurrentTime:i,paused:s,seekableEnd:a,ended:o,live:l}=this.$state;if(this.#e.seeking)r.set(!0),e.stopImmediatePropagation();else if(r()){let c=this.#r.get("waiting");c&&e.triggers.add(c);let u=this.#r.get("seeking");u&&!e.triggers.has(u)&&e.triggers.add(u),s()&&this.#I(),r.set(!1),i.set(e.detail),this.#d("media-seek-request",e);let d=e?.originEvent;d?.isTrusted&&!(d instanceof MessageEvent)&&!/seek/.test(d.type)&&this.started(e)}l()||(Math.floor(n())!==Math.floor(a())?o.set(!1):this.end(e))}waiting(e){this.#a||this.#e.seeking||(e.stopImmediatePropagation(),this.#o=e,this.#_())}#_=dx(()=>{if(!this.#o)return;this.#a=!0;let{waiting:e,playing:r}=this.$state;e.set(!0),r.set(!1);let n=this.createEvent("waiting",{trigger:this.#o});this.#r.set("waiting",n),this.dispatch(n),this.#o=void 0,this.#a=!1},300);end(e){let{loop:r,ended:n}=this.$state;if(!(!r()&&n())){if(r()){setTimeout(()=>{requestAnimationFrame(()=>{this.#O(e),this.dispatch("media-loop-request",{trigger:e})})},10);return}setTimeout(()=>this.#F(e),0)}}#F(e){let{storage:r}=this.#t,{paused:n,seeking:i,ended:s,duration:a}=this.$state;this.#D(e),n()||this.dispatch("pause",{trigger:e}),i()&&this.dispatch("seeked",{detail:a(),trigger:e}),s.set(!0),this.#f(),r?.setTime?.(a(),!0),this.dispatch("ended",{trigger:e})}#I(){this.#_.cancel(),this.$state.waiting.set(!1)}"fullscreen-change"(e){let r=e.detail;this.$state.fullscreen.set(r),this.#d(r?"media-enter-fullscreen-request":"media-exit-fullscreen-request",e)}"fullscreen-error"(e){this.#d("media-enter-fullscreen-request",e),this.#d("media-exit-fullscreen-request",e)}"orientation-change"(e){let r=e.detail.lock;this.#d(r?"media-orientation-lock-request":"media-orientation-unlock-request",e)}"picture-in-picture-change"(e){let r=e.detail;this.$state.pictureInPicture.set(r),this.#d(r?"media-enter-pip-request":"media-exit-pip-request",e)}"picture-in-picture-error"(e){this.#d("media-enter-pip-request",e),this.#d("media-exit-pip-request",e)}"title-change"(e){e.trigger&&(e.stopImmediatePropagation(),this.$state.inferredTitle.set(e.detail))}"poster-change"(e){e.trigger&&(e.stopImmediatePropagation(),this.$state.inferredPoster.set(e.detail))}},y4=class extends dc{onSetup(){if(this.#e(),le)return;let e=[this.#n,this.#s,this.#d,this.#p,this.#o,this.#u,this.#c,this.#g,this.#y,this.#m,this.#a,this.#f,this.#l,this.#t,this.#i];for(let r of e)U(r.bind(this))}#e(){let e={duration:"providedDuration",loop:"providedLoop",poster:"providedPoster",streamType:"providedStreamType",title:"providedTitle",viewType:"providedViewType"},r=new Set(["currentTime","paused","playbackRate","volume"]);for(let n of Object.keys(this.$props))r.has(n)||this.$state[e[n]??n]?.set(this.$props[n]());this.$state.muted.set(this.$props.muted()||this.$props.volume()===0)}#t(){let{viewType:e,streamType:r,title:n,poster:i,loop:s}=this.$props,a=this.$state;a.providedPoster.set(i()),a.providedStreamType.set(r()),a.providedViewType.set(e()),a.providedTitle.set(n()),a.providedLoop.set(s())}#r(){}#n(){let{artist:e,artwork:r}=this.$props;this.$state.artist.set(e()),this.$state.artwork.set(r())}#i(){let{title:e}=this.$state;this.dispatch("title-change",{detail:e()})}#s(){let e=this.$props.autoPlay()||this.$props.autoplay();this.$state.autoPlay.set(e),this.dispatch("auto-play-change",{detail:e})}#a(){let e=this.$state.loop();this.dispatch("loop-change",{detail:e})}#o(){let e=this.$props.controls();this.$state.controls.set(e)}#l(){let{poster:e}=this.$state;this.dispatch("poster-change",{detail:e()})}#u(){let e=this.$props.crossOrigin()??this.$props.crossorigin(),r=e===!0?"":e;this.$state.crossOrigin.set(r)}#c(){let{duration:e}=this.$props;this.dispatch("media-duration-change-request",{detail:e()})}#f(){let e=this.$props.playsInline()||this.$props.playsinline();this.$state.playsInline.set(e),this.dispatch("plays-inline-change",{detail:e})}#d(){let{clipStartTime:e}=this.$props;this.dispatch("media-clip-start-change-request",{detail:e()})}#p(){let{clipEndTime:e}=this.$props;this.dispatch("media-clip-end-change-request",{detail:e()})}#g(){this.dispatch("live-change",{detail:this.$state.live()})}#m(){this.$state.liveEdgeTolerance.set(this.$props.liveEdgeTolerance()),this.$state.minLiveDVRWindow.set(this.$props.minLiveDVRWindow())}#y(){this.dispatch("live-edge-change",{detail:this.$state.liveEdge()})}},XJ=["play","pause","seekforward","seekbackward","seekto"],v4=class extends dc{onConnect(){U(this.#t.bind(this)),U(this.#r.bind(this));let e=this.#n.bind(this);for(let r of XJ)navigator.mediaSession.setActionHandler(r,e);Ne(this.#e.bind(this))}#e(){for(let e of XJ)navigator.mediaSession.setActionHandler(e,null)}#t(){let{title:e,artist:r,artwork:n,poster:i}=this.$state;navigator.mediaSession.metadata=new MediaMetadata({title:e(),artist:r(),artwork:n()??[{src:i()}]})}#r(){let{canPlay:e,paused:r}=this.$state;navigator.mediaSession.playbackState=e()?r()?"paused":"playing":"none"}#n(e){let r=new Ie("media-session-action",{detail:e});switch(e.action){case"play":this.dispatch("media-play-request",{trigger:r});break;case"pause":this.dispatch("media-pause-request",{trigger:r});break;case"seekto":case"seekforward":case"seekbackward":this.dispatch("media-seek-request",{detail:Rr(e.seekTime)?e.seekTime:this.$state.currentTime()+(e.seekOffset??(e.action==="seekforward"?10:-10)),trigger:r});break}}},v2=be(!1);le||(We(document,"pointerdown",()=>{v2.set(!1)}),We(document,"keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||v2.set(!0)}));Es=class extends Wn{#e=be(!1);onConnect(e){U(()=>{let r=new it(e);if(!v2()){this.#e.set(!1),KE(e,!1),r.add("pointerenter",this.#n.bind(this)).add("pointerleave",this.#i.bind(this));return}let n=document.activeElement===e;this.#e.set(n),KE(e,n),r.add("focus",this.#t.bind(this)).add("blur",this.#r.bind(this))})}focused(){return this.#e()}#t(){this.#e.set(!0),KE(this.el,!0)}#r(){this.#e.set(!1),KE(this.el,!1)}#n(){QJ(this.el,!0)}#i(){QJ(this.el,!1)}};b2=class t extends je{static props=UDe;static state=Nu;#e;#t;#r;canPlayQueue=new y2;remoteControl;get#n(){return this.#e.$provider()}get#i(){return this.$props}constructor(){super(),new y4;let e={player:this,qualities:new s2,audioTracks:new t2,storage:null,$provider:be(null),$providerSetup:be(!1),$props:this.$props,$state:this.$state};e.remote=this.remoteControl=new hp(void 0),e.remote.setPlayer(this),e.textTracks=new i2,e.textTracks[Re.crossOrigin]=this.$state.crossOrigin,e.textRenderers=new n2(e),e.ariaKeys={},this.#e=e,vi(Sw,e),this.orientation=new Bx,new Es,new QN(e);let r=new m4;this.#t=new g4(r,e),this.#r=new h4(this.#t,r,e),e.delegate=new f4(this.#t.handle.bind(this.#t),e),e.notify=e.delegate.notify.bind(e.delegate),typeof navigator<"u"&&"mediaSession"in navigator&&new v4,new g2("load",this.startLoading.bind(this)),new g2("posterLoad",this.startLoadingPoster.bind(this))}onSetup(){this.#u(),U(this.#l.bind(this)),U(this.#m.bind(this)),U(this.#p.bind(this)),U(this.#x.bind(this)),U(this.#w.bind(this)),U(this.#k.bind(this)),U(this.#S.bind(this))}onAttach(e){e.setAttribute("data-media-player",""),vt(e,"tabindex","0"),vt(e,"role","region"),U(this.#T.bind(this)),le?this.#a():U(this.#a.bind(this)),le?this.#o():U(this.#o.bind(this)),We(e,"find-media-player",this.#c.bind(this))}onConnect(e){iee&&Ae(e,"data-iphone","");let r=window.matchMedia("(pointer: coarse)");this.#d(r),r.onchange=this.#d.bind(this);let n=new ResizeObserver(sp(this.#f.bind(this)));n.observe(e),U(this.#f.bind(this)),this.dispatch("media-player-connect",{detail:this,bubbles:!0,composed:!0}),Ne(()=>{n.disconnect(),r.onchange=null})}onDestroy(){this.#e.player=null,this.canPlayQueue.reset()}#s=!1;#a(){let e=this.$el,{title:r,live:n,viewType:i,providedTitle:s}=this.$state,a=n(),o=xE(i()),l=o!=="Unknown"?`${a?"Live ":""}${o}`:a?"Live":"Media",c=r();Ae(this.el,"aria-label",`${l} Player`+(c?` - ${c}`:"")),!le&&e?.hasAttribute("title")&&(this.#s=!0,e?.removeAttribute("title"))}#o(){let e=this.orientation.landscape?"landscape":"portrait";this.$state.orientation.set(e),Ae(this.el,"data-orientation",e),this.#f()}#l(){this.$state.canPlay()&&this.#n?this.canPlayQueue.start():this.canPlayQueue.stop()}#u(){if(t[$N]){this.setAttributes(t[$N]);return}let e={"data-load":function(){return this.$props.load()},"data-captions":function(){let n=this.$state.textTrack();return!!n&&xi(n)},"data-ios-controls":function(){return this.$state.iOSControls()},"data-controls":function(){return this.controls.showing},"data-buffering":function(){let{canLoad:n,canPlay:i,waiting:s}=this.$state;return n()&&(!i()||s())},"data-error":function(){let{error:n}=this.$state;return!!n()},"data-autoplay-error":function(){let{autoPlayError:n}=this.$state;return!!n()}},r={autoPlay:"autoplay",canAirPlay:"can-airplay",canPictureInPicture:"can-pip",pictureInPicture:"pip",playsInline:"playsinline",remotePlaybackState:"remote-state",remotePlaybackType:"remote-type",isAirPlayConnected:"airplay",isGoogleCastConnected:"google-cast"};for(let n of $De){let i="data-"+(r[n]??Ru(n));e[i]=function(){return this.$state[n]()}}delete e.title,t[$N]=e,this.setAttributes(e)}#c(e){e.detail(this)}#f(){if(le||!this.el)return;let e=this.el.clientWidth,r=this.el.clientHeight;this.$state.width.set(e),this.$state.height.set(r),Gn(this.el,"--player-width",e+"px"),Gn(this.el,"--player-height",r+"px")}#d(e){if(le)return;let r=e.matches?"coarse":"fine";Ae(this.el,"data-pointer",r),this.$state.pointer.set(r),this.#f()}get provider(){return this.#n}get controls(){return this.#r.controls}set controls(e){this.#i.controls.set(e)}orientation;get title(){return te(this.$state.title)}set title(e){if(this.#s){this.#s=!1;return}this.#i.title.set(e)}get qualities(){return this.#e.qualities}get audioTracks(){return this.#e.audioTracks}get textTracks(){return this.#e.textTracks}get textRenderers(){return this.#e.textRenderers}get duration(){return this.$state.duration()}set duration(e){this.#i.duration.set(e)}get paused(){return te(this.$state.paused)}set paused(e){this.#g(e)}#p(){this.#g(this.$props.paused())}#g(e){e?this.canPlayQueue.enqueue("paused",()=>this.#r.pause()):this.canPlayQueue.enqueue("paused",()=>this.#r.play())}get muted(){return te(this.$state.muted)}set muted(e){this.#y(e)}#m(){this.#y(this.$props.muted())}#y(e){this.canPlayQueue.enqueue("muted",()=>{this.#n&&this.#n.setMuted(e)})}get currentTime(){return te(this.$state.currentTime)}set currentTime(e){this.#h(e)}#w(){this.#h(this.$props.currentTime())}#h(e){this.canPlayQueue.enqueue("currentTime",()=>{let{currentTime:r}=this.$state;e!==te(r)&&te(()=>{if(!this.#n)return;let n=aF(e,this.$state);Number.isFinite(n)&&this.#n.setCurrentTime(n)})})}get volume(){return te(this.$state.volume)}set volume(e){this.#b(e)}#x(){this.#b(this.$props.volume())}#b(e){let r=oF(0,e,1);this.canPlayQueue.enqueue("volume",()=>{this.#n&&this.#n.setVolume(r)})}get playbackRate(){return te(this.$state.playbackRate)}set playbackRate(e){this.#v(e)}#S(){this.#v(this.$props.playbackRate())}#v(e){this.canPlayQueue.enqueue("rate",()=>{this.#n&&this.#n.setPlaybackRate?.(e)})}#k(){this.#C(this.$props.playsInline())}#C(e){this.canPlayQueue.enqueue("playsinline",()=>{this.#n&&this.#n.setPlaysInline?.(e)})}#T(){let e=this.$props.storage(),r=me(e)?new JE:e;if(r?.onChange){let{source:n}=this.$state,i=me(e)?e:this.el?.id,s=ec(this.#E.bind(this));U(()=>r.onChange(n(),s(),i||void 0))}this.#e.storage=r,this.#e.textTracks.setStorage(r),Ne(()=>{r?.onDestroy?.(),this.#e.storage=null,this.#e.textTracks.setStorage(null)})}#E(){let{clipStartTime:e,clipEndTime:r}=this.$props,{source:n}=this.$state,i=n();return i.src?`${i.src}:${e()}:${r()}`:null}async play(e){return this.#r.play(e)}async pause(e){return this.#r.pause(e)}async enterFullscreen(e,r){return this.#r.enterFullscreen(e,r)}async exitFullscreen(e,r){return this.#r.exitFullscreen(e,r)}enterPictureInPicture(e){return this.#r.enterPictureInPicture(e)}exitPictureInPicture(e){return this.#r.exitPictureInPicture(e)}seekToLiveEdge(e){this.#r.seekToLiveEdge(e)}startLoading(e){this.#e.notify("can-load",void 0,e)}startLoadingPoster(e){this.#e.notify("can-load-poster",void 0,e)}requestAirPlay(e){return this.#r.requestAirPlay(e)}requestGoogleCast(e){return this.#r.requestGoogleCast(e)}setAudioGain(e,r){return this.#r.setAudioGain(e,r)}destroy(){super.destroy(),this.#e.remote.setPlayer(null),this.dispatch("destroy")}},Dt=b2.prototype;ht(Dt,"canPlayQueue");ht(Dt,"remoteControl");ht(Dt,"provider");ht(Dt,"controls");ht(Dt,"orientation");ht(Dt,"title");ht(Dt,"qualities");ht(Dt,"audioTracks");ht(Dt,"textTracks");ht(Dt,"textRenderers");ht(Dt,"duration");ht(Dt,"paused");ht(Dt,"muted");ht(Dt,"currentTime");ht(Dt,"volume");ht(Dt,"playbackRate");$r(Dt,"play");$r(Dt,"pause");$r(Dt,"enterFullscreen");$r(Dt,"exitFullscreen");$r(Dt,"enterPictureInPicture");$r(Dt,"exitPictureInPicture");$r(Dt,"seekToLiveEdge");$r(Dt,"startLoading");$r(Dt,"startLoadingPoster");$r(Dt,"requestAirPlay");$r(Dt,"requestGoogleCast");$r(Dt,"setAudioGain");b4=new Map,x4=class{#e=!1;#t;#r;#n;#i;constructor(e,r,n,i=[]){this.#r=e,this.#n=r,this.#i=n;let s=new p2,a=new u2,o=new fg,l=new c2,c=new m2,u=new h2,d=[c,u];this.#t=ec(()=>{let p=r.$state.remotePlaybackLoader(),h=r.$props.preferNativeHLS()?[o,l,s,a,...d,...i]:[a,o,l,s,...d,...i];return p?[p,...h]:h});let{$state:f}=r;f.sources.set(ZJ(r.$props.src()));for(let p of f.sources()){let h=this.#t().find(v=>v.canPlay(p));if(!h)continue;let m=h.mediaType(p);r.$state.source.set(p),r.$state.mediaType.set(m),r.$state.inferredViewType.set(m),this.#i.set(h),this.#e=!0;break}}connect(){let e=this.#i();this.#e&&(this.#l(this.#n.$state.source(),e),this.#u(e),this.#e=!1),U(this.#s.bind(this)),U(this.#a.bind(this)),U(this.#c.bind(this)),U(this.#f.bind(this)),U(this.#d.bind(this))}#s(){this.#n.notify("sources-change",[...ZJ(this.#n.$props.src()),...this.#r()])}#a(){let{$state:e}=this.#n,r=e.sources(),n=te(e.source),i=this.#o(n,r);if(r[0]?.src&&!i.src&&!i.type){let{crossOrigin:a}=e,o=Dx(a()),l=new AbortController;return Promise.all(r.map(c=>me(c.src)&&c.type==="?"?fetch(c.src,{method:"HEAD",credentials:o,signal:l.signal}).then(u=>(c.type=u.headers.get("content-type")||"??",b4.set(c.src,c.type),c)).catch(()=>c):c)).then(c=>{if(l.signal.aborted)return;let u=this.#o(te(e.source),c);Cs(),u.src||this.#n.notify("error",{message:"Failed to load resource.",code:4})}),()=>l.abort()}Cs()}#o(e,r){let n={src:"",type:""},i=null,s=new Ie("sources-change",{detail:{sources:r}}),a=this.#t(),{started:o,paused:l,currentTime:c,quality:u,savedState:d}=this.#n.$state;for(let f of r){let p=a.find(h=>h.canPlay(f));if(p){n=f,i=p;break}}if(QE(n)){let f=u(),p=r.find(h=>h.src===f?.src);te(o)?d.set({paused:te(l),currentTime:te(c)}):d.set(null),p&&(n=p,s=new Ie("quality-change",{detail:{quality:f}}))}return eee(e,n)||this.#l(n,i,s),i!==te(this.#i)&&this.#u(i,s),n}#l(e,r,n){this.#n.notify("source-change",e,n),this.#n.notify("media-type-change",r?.mediaType(e)||"unknown",n)}#u(e,r){this.#n.$providerSetup.set(!1),this.#n.notify("provider-change",null,r),e&&te(()=>e.preconnect?.(this.#n)),this.#i.set(e),this.#n.notify("provider-loader-change",e,r)}#c(){let e=this.#n.$provider();if(!(!e||te(this.#n.$providerSetup))){if(this.#n.$state.canLoad()){pn(()=>e.setup(),e.scope),this.#n.$providerSetup.set(!0);return}te(()=>e.preconnect?.())}}#f(){if(!this.#n.$providerSetup())return;let e=this.#n.$provider(),r=this.#n.$state.source(),n=te(this.#n.$state.crossOrigin),i=te(this.#n.$props.preferNativeHLS);if(!eee(e?.currentSrc,r)){if(this.#n.$state.canLoad()){let s=new AbortController;return yp(r)?(i||!Ix())&&Dee(r.src,{credentials:Dx(n),signal:s.signal}).then(a=>{this.#n.notify("stream-type-change",a)}).catch(io):D2(r)?WDe(r.src,{credentials:Dx(n),signal:s.signal}).then(a=>{this.#n.notify("stream-type-change",a)}).catch(io):this.#n.notify("stream-type-change","on-demand"),te(()=>{let a=te(this.#n.$state.preload);return e?.loadSource(r,a).catch(o=>{})}),()=>s.abort()}try{me(r.src)&&ba(new URL(r.src).origin)}catch{}}}#d(){let e=this.#i(),{providedPoster:r,source:n,canLoadPoster:i}=this.#n.$state;if(!e||!e.loadPoster||!n()||!i()||r())return;let s=new AbortController,a=new Ie("source-change",{detail:n});return e.loadPoster(n(),this.#n,s).then(o=>{this.#n.notify("poster-change",o||"",a)}).catch(()=>{this.#n.notify("poster-change","",a)}),()=>{s.abort()}}};w4=class{#e;#t;#r=[];constructor(e,r){this.#e=e,this.#t=r,U(this.#n.bind(this))}#n(){let e=this.#e();for(let r of this.#r)if(!e.some(n=>n.id===r.id)){let n=r.id&&this.#t.textTracks.getById(r.id);n&&this.#t.textTracks.remove(n)}for(let r of e){let n=r.id||Kn.createId(r);this.#t.textTracks.getById(n)||(r.id=n,this.#t.textTracks.add(r))}this.#r=e}},x2=class extends je{static props={loaders:[]};static state=new ao({loader:null});#e;#t;#r=be([]);#n=be([]);#i=null;onSetup(){this.#e=Et(),this.#t=new x4(this.#r,this.#e,this.$state.loader,this.$props.loaders())}onAttach(e){e.setAttribute("data-media-provider","")}onConnect(e){this.#t.connect(),new w4(this.#n,this.#e);let r=new ResizeObserver(sp(this.#l.bind(this)));r.observe(e);let n=new MutationObserver(this.#u.bind(this));n.observe(e,{attributes:!0,childList:!0}),this.#l(),this.#u(),Ne(()=>{r.disconnect(),n.disconnect()})}#s=-1;load(e){e?.setAttribute("aria-hidden","true"),window.cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>this.#a(e)),Ne(()=>{window.cancelAnimationFrame(this.#s)})}#a(e){if(!this.scope)return;let r=this.$state.loader(),{$provider:n}=this.#e;this.#i===r&&r?.target===e&&te(n)||(this.#o(),this.#i=r,r&&(r.target=e||null),!(!r||!e)&&r.load(this.#e).then(i=>{this.scope&&te(this.$state.loader)===r&&this.#e.notify("provider-change",i)}))}onDestroy(){this.#i=null,this.#o()}#o(){this.#e?.notify("provider-change",null)}#l(){if(!this.el)return;let{player:e,$state:r}=this.#e,n=this.el.offsetWidth,i=this.el.offsetHeight;e&&(r.mediaWidth.set(n),r.mediaHeight.set(i),e.el&&(Gn(e.el,"--media-width",n+"px"),Gn(e.el,"--media-height",i+"px")))}#u(){let e=[],r=[],n=this.el.children;for(let i of n)if(!i.hasAttribute("data-vds")){if(i instanceof HTMLSourceElement){let s={id:i.id,src:i.src,type:i.type};for(let a of["id","src","width","height","bitrate","codec"]){let o=i.getAttribute(`data-${a}`);me(o)&&(s[a]=/id|src|codec/.test(a)?o:Number(o))}e.push(s)}else if(i instanceof HTMLTrackElement){let s={src:i.src,kind:i.track.kind,language:i.srclang,label:i.label,default:i.default,type:i.getAttribute("data-type")};r.push({id:i.id||Kn.createId(s),...s})}}this.#r.set(e),this.#n.set(r),Cs()}},XDe=x2.prototype;$r(XDe,"load");k4=class extends je{static props={translations:null};static state=new ao({label:null,busy:!1});#e;#t=!1;onSetup(){this.#e=Et()}onAttach(e){e.style.display="contents"}onConnect(e){e.setAttribute("data-media-announcer",""),vt(e,"role","status"),vt(e,"aria-live","polite");let{busy:r}=this.$state;this.setAttributes({"aria-busy":()=>r()?"true":null}),this.#t=!0,U(this.#r.bind(this)),U(this.#a.bind(this)),U(this.#s.bind(this)),U(this.#n.bind(this)),U(this.#i.bind(this)),U(this.#u.bind(this)),U(this.#f.bind(this)),Cs(),this.#t=!1}#r(){let{paused:e}=this.#e.$state;this.#d(e()?"Pause":"Play")}#n(){let{fullscreen:e}=this.#e.$state;this.#d(e()?"Enter Fullscreen":"Exit Fullscreen")}#i(){let{pictureInPicture:e}=this.#e.$state;this.#d(e()?"Enter PiP":"Exit PiP")}#s(){let{textTrack:e}=this.#e.$state;this.#d(e()?"Closed-Captions On":"Closed-Captions Off")}#a(){let{muted:e,volume:r,audioGain:n}=this.#e.$state;this.#d(e()||r()===0?"Mute":`${Math.round(r()*(n()??1)*100)}% ${this.#c("Volume")}`)}#o=-1;#l=-1;#u(){let{seeking:e,currentTime:r}=this.#e.$state,n=e();this.#o>0?(window.clearTimeout(this.#l),this.#l=window.setTimeout(()=>{if(!this.scope)return;let i=te(r),s=Math.abs(i-this.#o);if(s>=1){let a=i>=this.#o,o=Vx(s);this.#d(`${this.#c(a?"Seek Forward":"Seek Backward")} ${o}`)}this.#o=-1,this.#l=-1},300)):n&&(this.#o=te(r))}#c(e){let{translations:r}=this.$props;return r?.()?.[e||""]??e}#f(){let{label:e,busy:r}=this.$state,n=this.#c(e());if(this.#t)return;r.set(!0);let i=window.setTimeout(()=>void r.set(!1),150);return this.el&&Ae(this.el,"aria-label",n),me(n)&&this.dispatch("change",{detail:n}),()=>window.clearTimeout(i)}#d(e){let{label:r}=this.$state;r.set(e)}},S4=class extends je{static props={hideDelay:2e3,hideOnMouseLeave:!1};#e;onSetup(){this.#e=Et(),U(this.#r.bind(this))}onAttach(e){let{pictureInPicture:r,fullscreen:n}=this.#e.$state;Gn(e,"pointer-events","none"),vt(e,"role","group"),this.setAttributes({"data-visible":this.#n.bind(this),"data-fullscreen":n,"data-pip":r}),U(()=>{this.dispatch("change",{detail:this.#n()})}),U(this.#t.bind(this)),U(()=>{let i=n();for(let s of["top","right","bottom","left"])Gn(e,`padding-${s}`,i&&`env(safe-area-inset-${s})`)})}#t(){if(!this.el)return;let{nativeControls:e}=this.#e.$state,r=e();Ae(this.el,"aria-hidden",r?"true":null),Gn(this.el,"display",r?"none":null)}#r(){let{controls:e}=this.#e.player,{hideDelay:r,hideOnMouseLeave:n}=this.$props;e.defaultDelay=r()===2e3?this.#e.$props.controlsDelay():r(),e.hideOnMouseLeave=n()}#n(){let{controlsVisible:e}=this.#e.$state;return e()}},C4=class extends je{onAttach(e){e.style.pointerEvents||Gn(e,"pointer-events","auto")}},w2=class extends Wn{#e;constructor(e){super(),this.#e=e,U(this.#t.bind(this))}onDestroy(){this.#i?.(),this.#i=null}#t(){let e=this.#e.trigger();if(!e){this.hide();return}let r=this.show.bind(this),n=this.hide.bind(this);this.#e.listen(e,r,n)}#r=-1;#n=-1;#i=null;show(e){this.#s(),window.cancelAnimationFrame(this.#n),this.#n=-1,this.#i?.(),this.#i=null,this.#r=window.setTimeout(()=>{this.#r=-1;let r=this.#e.content();r&&r.style.removeProperty("display"),te(()=>this.#e.onChange(!0,e))},this.#e.showDelay?.()??0)}hide(e){this.#s(),te(()=>this.#e.onChange(!1,e)),this.#n=requestAnimationFrame(()=>{this.#s(),this.#n=-1;let r=this.#e.content();if(r){let n=()=>{r.style.display="none",this.#i=null};if(bDe(r)){this.#i?.();let s=We(r,"animationend",n,{once:!0});this.#i=s}else n()}})}#s(){window.clearTimeout(this.#r),this.#r=-1}},pp=rl(),QDe=0,T4=class extends je{static props={showDelay:700};#e=`media-tooltip-${++QDe}`;#t=be(null);#r=be(null);#n=be(!1);constructor(){super(),new Es;let{showDelay:e}=this.$props;new w2({trigger:this.#t,content:this.#r,showDelay:e,listen(r,n,i){U(()=>{v2()&&We(r,"focus",n),We(r,"blur",i)}),new it(r).add("touchstart",s=>s.preventDefault(),{passive:!1}).add("mouseenter",n).add("mouseleave",i)},onChange:this.#l.bind(this)})}onAttach(e){e.style.setProperty("display","contents")}onSetup(){vi(pp,{trigger:this.#t,content:this.#r,showing:this.#n,attachTrigger:this.#i.bind(this),detachTrigger:this.#s.bind(this),attachContent:this.#a.bind(this),detachContent:this.#o.bind(this)})}#i(e){this.#t.set(e);let r=e.getAttribute("data-media-tooltip");r&&this.el?.setAttribute(`data-media-${r}-tooltip`,""),Ae(e,"data-describedby",this.#e)}#s(e){e.removeAttribute("data-describedby"),e.removeAttribute("aria-describedby"),this.#t.set(null)}#a(e){e.setAttribute("id",this.#e),e.style.display="none",vt(e,"role","tooltip"),this.#r.set(e)}#o(e){e.removeAttribute("id"),e.removeAttribute("role"),this.#r.set(null)}#l(e){let r=this.#t(),n=this.#r();r&&Ae(r,"aria-describedby",e?this.#e:null);for(let i of[this.el,r,n])i&&Ae(i,"data-visible",e);this.#n.set(e)}},E4=class extends je{constructor(){super(),new Es}onConnect(e){Ne(Eee(()=>{if(!this.connectScope)return;this.#e();let r=mr(pp);Ne(()=>{let n=this.#t();n&&r.detachTrigger(n)})}))}#e(){let e=this.#t(),r=mr(pp);e&&r.attachTrigger(e)}#t(){let e=this.el.firstElementChild;return e?.localName==="button"||e?.getAttribute("role")==="button"?e:this.el}},I4=class extends je{static props={placement:"top center",offset:0,alignOffset:0};constructor(){super(),new Es;let{placement:e}=this.$props;this.setAttributes({"data-placement":e})}onAttach(e){this.#e(e),Object.assign(e.style,{position:"absolute",top:0,left:0,width:"max-content"})}onConnect(e){this.#e(e);let r=mr(pp);Ne(()=>r.detachContent(e)),Ne(Eee(()=>{this.connectScope&&U(this.#t.bind(this))}))}#e(e){mr(pp).attachContent(e)}#t(){let{showing:e}=mr(pp);if(!e())return;let{placement:r,offset:n,alignOffset:i}=this.$props;return Iee(this.el,this.#r(),r(),{offsetVarName:"media-tooltip",xOffset:i(),yOffset:n()})}#r(){return mr(pp).trigger()}},Mn=class extends Wn{static props={disabled:!1};#e;constructor(e){super(),this.#e=e,new Es,e.keyShortcut&&new a2(e.keyShortcut)}onSetup(){let{disabled:e}=this.$props;this.setAttributes({"data-pressed":this.#e.isPresssed,"aria-pressed":this.#t.bind(this),"aria-disabled":()=>e()?"true":null})}onAttach(e){vt(e,"tabindex","0"),vt(e,"role","button"),vt(e,"type","button")}onConnect(e){let r=Ou(e,this.#n.bind(this));for(let n of["click","touchstart"])r.add(n,this.#i.bind(this),{passive:!0})}#t(){return ux(this.#e.isPresssed())}#r(e){jD(this.#e.isPresssed)&&this.#e.isPresssed.set(r=>!r)}#n(e){if(this.$props.disabled()||this.el.hasAttribute("data-disabled")){e.preventDefault(),e.stopImmediatePropagation();return}e.preventDefault(),(this.#e.onPress??this.#r).call(this,e)}#i(e){this.$props.disabled()&&(e.preventDefault(),e.stopImmediatePropagation())}},k2=class extends je{static props={disabled:!1,defaultPressed:!1};#e=be(!1);get pressed(){return this.#e()}constructor(){super(),new Mn({isPresssed:this.#e})}},ZDe=k2.prototype;ht(ZDe,"pressed");A4=class extends je{static props=Mn.props;#e;constructor(){super(),new Mn({isPresssed:this.#r.bind(this),onPress:this.#t.bind(this)})}onSetup(){this.#e=Et();let{canAirPlay:e,isAirPlayConnected:r}=this.#e.$state;this.setAttributes({"data-active":r,"data-supported":e,"data-state":this.#n.bind(this),"aria-hidden":Ln(()=>!e())})}onAttach(e){e.setAttribute("data-media-tooltip","airplay"),Fu(e,this.#i.bind(this))}#t(e){this.#e.remote.requestAirPlay(e)}#r(){let{remotePlaybackType:e,remotePlaybackState:r}=this.#e.$state;return e()==="airplay"&&r()!=="disconnected"}#n(){let{remotePlaybackType:e,remotePlaybackState:r}=this.#e.$state;return e()==="airplay"&&r()}#i(){let{remotePlaybackState:e}=this.#e.$state;return`AirPlay ${e()}`}},P4=class extends je{static props=Mn.props;#e;constructor(){super(),new Mn({isPresssed:this.#r.bind(this),onPress:this.#t.bind(this)})}onSetup(){this.#e=Et();let{canGoogleCast:e,isGoogleCastConnected:r}=this.#e.$state;this.setAttributes({"data-active":r,"data-supported":e,"data-state":this.#n.bind(this),"aria-hidden":Ln(()=>!e())})}onAttach(e){e.setAttribute("data-media-tooltip","google-cast"),Fu(e,this.#i.bind(this))}#t(e){this.#e.remote.requestGoogleCast(e)}#r(){let{remotePlaybackType:e,remotePlaybackState:r}=this.#e.$state;return e()==="google-cast"&&r()!=="disconnected"}#n(){let{remotePlaybackType:e,remotePlaybackState:r}=this.#e.$state;return e()==="google-cast"&&r()}#i(){let{remotePlaybackState:e}=this.#e.$state;return`Google Cast ${e()}`}},R4=class extends je{static props=Mn.props;#e;constructor(){super(),new Mn({isPresssed:this.#r.bind(this),keyShortcut:"togglePaused",onPress:this.#t.bind(this)})}onSetup(){this.#e=Et();let{paused:e,ended:r}=this.#e.$state;this.setAttributes({"data-paused":e,"data-ended":r})}onAttach(e){e.setAttribute("data-media-tooltip","play"),Fu(e,"Play")}#t(e){let r=this.#e.remote;this.#r()?r.pause(e):r.play(e)}#r(){let{paused:e}=this.#e.$state;return!e()}},L4=class extends je{static props=Mn.props;#e;constructor(){super(),new Mn({isPresssed:this.#r.bind(this),keyShortcut:"toggleCaptions",onPress:this.#t.bind(this)})}onSetup(){this.#e=Et(),this.setAttributes({"data-active":this.#r.bind(this),"data-supported":()=>!this.#n(),"aria-hidden":Ln(this.#n.bind(this))})}onAttach(e){e.setAttribute("data-media-tooltip","caption"),Fu(e,"Captions")}#t(e){this.#e.remote.toggleCaptions(e)}#r(){let{textTrack:e}=this.#e.$state,r=e();return!!r&&xi(r)}#n(){let{hasCaptions:e}=this.#e.$state;return!e()}},M4=class extends je{static props={...Mn.props,target:"prefer-media"};#e;constructor(){super(),new Mn({isPresssed:this.#r.bind(this),keyShortcut:"toggleFullscreen",onPress:this.#t.bind(this)})}onSetup(){this.#e=Et();let{fullscreen:e}=this.#e.$state,r=this.#n.bind(this);this.setAttributes({"data-active":e,"data-supported":r,"aria-hidden":Ln(()=>!r())})}onAttach(e){e.setAttribute("data-media-tooltip","fullscreen"),Fu(e,"Fullscreen")}#t(e){let r=this.#e.remote,n=this.$props.target();this.#r()?r.exitFullscreen(n,e):r.enterFullscreen(n,e)}#r(){let{fullscreen:e}=this.#e.$state;return e()}#n(){let{canFullscreen:e}=this.#e.$state;return e()}},_4=class extends je{static props=Mn.props;#e;constructor(){super(),new Mn({isPresssed:this.#r.bind(this),keyShortcut:"toggleMuted",onPress:this.#t.bind(this)})}onSetup(){this.#e=Et(),this.setAttributes({"data-muted":this.#r.bind(this),"data-state":this.#n.bind(this)})}onAttach(e){e.setAttribute("data-media-mute-button",""),e.setAttribute("data-media-tooltip","mute"),Fu(e,"Mute")}#t(e){let r=this.#e.remote;this.#r()?r.unmute(e):r.mute(e)}#r(){let{muted:e,volume:r}=this.#e.$state;return e()||r()===0}#n(){let{muted:e,volume:r}=this.#e.$state,n=r();if(e()||n===0)return"muted";if(n>=.5)return"high";if(n<.5)return"low"}},O4=class extends je{static props=Mn.props;#e;constructor(){super(),new Mn({isPresssed:this.#r.bind(this),keyShortcut:"togglePictureInPicture",onPress:this.#t.bind(this)})}onSetup(){this.#e=Et();let{pictureInPicture:e}=this.#e.$state,r=this.#n.bind(this);this.setAttributes({"data-active":e,"data-supported":r,"aria-hidden":Ln(()=>!r())})}onAttach(e){e.setAttribute("data-media-tooltip","pip"),Fu(e,"PiP")}#t(e){let r=this.#e.remote;this.#r()?r.exitPictureInPicture(e):r.enterPictureInPicture(e)}#r(){let{pictureInPicture:e}=this.#e.$state;return e()}#n(){let{canPictureInPicture:e}=this.#e.$state;return e()}},D4=class extends je{static props={disabled:!1,seconds:30};#e;constructor(){super(),new Es}onSetup(){this.#e=Et();let{seeking:e}=this.#e.$state,{seconds:r}=this.$props,n=this.#t.bind(this);this.setAttributes({seconds:r,"data-seeking":e,"data-supported":n,"aria-hidden":Ln(()=>!n())})}onAttach(e){vt(e,"tabindex","0"),vt(e,"role","button"),vt(e,"type","button"),e.setAttribute("data-media-tooltip","seek"),Fu(e,this.#r.bind(this))}onConnect(e){Ou(e,this.#n.bind(this))}#t(){let{canSeek:e}=this.#e.$state;return e()}#r(){let{seconds:e}=this.$props;return`Seek ${e()>0?"forward":"backward"} ${e()} seconds`}#n(e){let{seconds:r,disabled:n}=this.$props;if(n())return;let{currentTime:i}=this.#e.$state,s=i()+r();this.#e.remote.seek(s,e)}},N4=class extends je{static props={disabled:!1};#e;constructor(){super(),new Es}onSetup(){this.#e=Et();let{disabled:e}=this.$props,{live:r,liveEdge:n}=this.#e.$state,i=()=>!r();this.setAttributes({"data-edge":n,"data-hidden":i,"aria-disabled":Ln(()=>e()||n()),"aria-hidden":Ln(i)})}onAttach(e){vt(e,"tabindex","0"),vt(e,"role","button"),vt(e,"type","button"),e.setAttribute("data-media-tooltip","live")}onConnect(e){Ou(e,this.#t.bind(this))}#t(e){let{disabled:r}=this.$props,{liveEdge:n}=this.#e.$state;r()||n()||this.#e.remote.seekToLiveEdge(e)}},Vu=new ao({min:0,max:100,value:0,step:1,pointerValue:0,focused:!1,dragging:!1,pointing:!1,hidden:!1,get active(){return this.dragging||this.focused||this.pointing},get fillRate(){return tee(this.min,this.max,this.value)},get fillPercent(){return this.fillRate*100},get pointerRate(){return tee(this.min,this.max,this.pointerValue)},get pointerPercent(){return this.pointerRate*100}});S2=class extends Wn{#e;#t;constructor(e){super(),this.#e=e}onConnect(e){this.#t=new IntersectionObserver(r=>{this.#e.callback?.(r,this.#t)},this.#e),this.#t.observe(e),Ne(this.#r.bind(this))}#r(){this.#t?.disconnect(),this.#t=void 0}},uF=rl(),Nx=rl();zN={Left:-1,ArrowLeft:-1,Up:1,ArrowUp:1,Right:1,ArrowRight:1,Down:-1,ArrowDown:-1},F4=class extends Wn{#e;#t;#r;constructor(e,r){super(),this.#e=e,this.#t=r}onSetup(){so(Nx)&&(this.#r=mr(Nx))}onConnect(e){U(this.#u.bind(this,e)),U(this.#c.bind(this,e)),this.#e.swipeGesture&&U(this.#n.bind(this))}#n(){let{pointer:e}=this.#t.$state;if(e()!=="coarse"||!this.#e.swipeGesture()){this.#i=null;return}this.#i=this.#t.player.el?.querySelector("media-provider,[data-media-provider]"),this.#i&&new it(this.#i).add("touchstart",this.#o.bind(this),{passive:!0}).add("touchmove",this.#l.bind(this),{passive:!1})}#i=null;#s=null;#a=null;#o(e){this.#s=e.touches[0]}#l(e){if(pa(this.#s)||lF(e))return;let r=e.touches[0],n=r.clientX-this.#s.clientX,i=r.clientY-this.#s.clientY,s=this.$state.dragging();!s&&Math.abs(i)>5||s||(e.preventDefault(),Math.abs(n)>20&&(this.#s=r,this.#a=this.$state.value(),this.#x(this.#a,e)))}#u(e){let{hidden:r}=this.$props;We(e,"focus",this.#f.bind(this)),!(r()||this.#e.isDisabled())&&new it(e).add("keyup",this.#C.bind(this)).add("keydown",this.#k.bind(this)).add("pointerenter",this.#m.bind(this)).add("pointermove",this.#y.bind(this)).add("pointerleave",this.#w.bind(this)).add("pointerdown",this.#h.bind(this))}#c(e){this.#e.isDisabled()||!this.$state.dragging()||new it(document).add("pointerup",this.#P.bind(this),{capture:!0}).add("pointermove",this.#L.bind(this)).add("touchmove",this.#A.bind(this),{passive:!1})}#f(){this.#p(this.$state.value())}#d(e,r){let{value:n,min:i,max:s,dragging:a}=this.$state,o=Math.max(i(),Math.min(e,s()));n.set(o);let l=this.createEvent("value-change",{detail:o,trigger:r});if(this.dispatch(l),this.#e.onValueChange?.(l),a()){let c=this.createEvent("drag-value-change",{detail:o,trigger:r});this.dispatch(c),this.#e.onDragValueChange?.(c)}}#p(e,r){let{pointerValue:n,dragging:i}=this.$state;n.set(e),this.dispatch("pointer-value-change",{detail:e,trigger:r}),i()&&this.#d(e,r)}#g(e){let r,n=this.el.getBoundingClientRect(),{min:i,max:s}=this.$state;if(this.$props.orientation()==="vertical"){let{bottom:a,height:o}=n;r=(a-e.clientY)/o}else if(this.#s&&Rr(this.#a)){let{width:a}=this.#i.getBoundingClientRect(),o=(e.clientX-this.#s.clientX)/a,l=s()-i(),c=l*Math.abs(o);r=(o<0?this.#a-c:this.#a+c)/l}else{let{left:a,width:o}=n;r=(e.clientX-a)/o}return Math.max(i(),Math.min(s(),this.#e.roundValue(eNe(i(),s(),r,this.#e.getStep()))))}#m(e){this.$state.pointing.set(!0)}#y(e){let{dragging:r}=this.$state;r()||this.#p(this.#g(e),e)}#w(e){this.$state.pointing.set(!1)}#h(e){if(e.button!==0)return;let r=this.#g(e);this.#x(r,e),this.#p(r,e)}#x(e,r){let{dragging:n}=this.$state;if(n())return;n.set(!0),this.#t.remote.pauseControls(r);let i=this.createEvent("drag-start",{detail:e,trigger:r});this.dispatch(i),this.#e.onDragStart?.(i),this.#r?.onDragStart?.()}#b(e,r){let{dragging:n}=this.$state;if(!n())return;n.set(!1),this.#t.remote.resumeControls(r);let i=this.createEvent("drag-end",{detail:e,trigger:r});this.dispatch(i),this.#e.onDragEnd?.(i),this.#s=null,this.#a=null,this.#r?.onDragEnd?.()}#S;#v=!1;#k(e){if(!Object.keys(zN).includes(e.key))return;let{key:n}=e,i=this.#T(e);if(!pa(i)){this.#p(i,e),this.#d(i,e);return}let s=this.#E(e);this.#v||(this.#v=n===this.#S,!this.$state.dragging()&&this.#v&&this.#x(s,e)),this.#p(s,e),this.#S=n}#C(e){if(!Object.keys(zN).includes(e.key)||!pa(this.#T(e)))return;let n=this.#v?this.$state.pointerValue():this.#E(e);this.#d(n,e),this.#b(n,e),this.#S="",this.#v=!1}#T(e){let r=e.key,{min:n,max:i}=this.$state;return r==="Home"||r==="PageUp"?n():r==="End"||r==="PageDown"?i():!e.metaKey&&/^[0-9]$/.test(r)?(i()-n())/10*Number(r):null}#E(e){let{key:r,shiftKey:n}=e;e.preventDefault(),e.stopPropagation();let{shiftKeyMultiplier:i}=this.$props,{min:s,max:a,value:o,pointerValue:l}=this.$state,c=this.#e.getStep(),u=this.#e.getKeyStep(),d=n?u*i():u,f=Number(zN[r]),p=d*f,h=this.#v?l():this.#e.getValue?.()??o(),m=(h+p)/c;return Math.max(s(),Math.min(a(),Number((c*m).toFixed(3))))}#P(e){if(e.button!==0)return;e.preventDefault(),e.stopImmediatePropagation();let r=this.#g(e);this.#p(r,e),this.#b(r,e)}#A(e){e.preventDefault()}#L=ic(e=>{this.#p(this.#g(e),e)},20,{leading:!0})},pg=rl(()=>({})),Gi=class extends Wn{static props={hidden:!1,disabled:!1,step:1,keyStep:1,orientation:"horizontal",shiftKeyMultiplier:5};#e;#t;#r=be(!0);#n=be(!0);constructor(e){super(),this.#t=e}onSetup(){this.#e=Et();let e=new Es;e.attach(this),this.$state.focused=e.focused.bind(e),so(pg)||vi(pg,{default:"value"}),vi(uF,{orientation:this.$props.orientation,disabled:this.#t.isDisabled,preview:be(null)}),U(this.#a.bind(this)),U(this.#o.bind(this)),U(this.#l.bind(this)),this.#c(),new F4(this.#t,this.#e).attach(this),new S2({callback:this.#i.bind(this)}).attach(this)}onAttach(e){vt(e,"role","slider"),vt(e,"tabindex","0"),vt(e,"autocomplete","off"),le?this.#f():U(this.#f.bind(this))}onConnect(e){Ne(Cee(e,this.#r.set)),U(this.#s.bind(this))}#i(e){this.#n.set(e[0].isIntersecting)}#s(){let{hidden:e}=this.$props;this.$state.hidden.set(e()||!this.#r()||!this.#n.bind(this))}#a(){let{dragging:e,value:r,min:n,max:i}=this.$state;te(e)||r.set(JDe(n(),i(),r(),this.#t.getStep()))}#o(){this.$state.step.set(this.#t.getStep())}#l(){if(!this.#t.isDisabled())return;let{dragging:e,pointing:r}=this.$state;e.set(!1),r.set(!1)}#u(){return ux(this.#t.isDisabled())}#c(){let{orientation:e}=this.$props,{dragging:r,active:n,pointing:i}=this.$state;this.setAttributes({"data-dragging":r,"data-pointing":i,"data-active":n,"aria-disabled":this.#u.bind(this),"aria-valuemin":this.#t.aria.valueMin??this.$state.min,"aria-valuemax":this.#t.aria.valueMax??this.$state.max,"aria-valuenow":this.#t.aria.valueNow,"aria-valuetext":this.#t.aria.valueText,"aria-orientation":e})}#f(){let{fillPercent:e,pointerPercent:r}=this.$state;this.#d(Rn(e(),3),Rn(r(),3))}#d=sp((e,r)=>{this.el?.style.setProperty("--slider-fill",e+"%"),this.el?.style.setProperty("--slider-pointer",r+"%")})},mp=class extends je{static props={...Gi.props,min:0,max:100,value:0};static state=Vu;constructor(){super(),new Gi({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:this.$props.disabled,aria:{valueNow:this.#e.bind(this),valueText:this.#t.bind(this)}})}onSetup(){U(this.#r.bind(this)),U(this.#n.bind(this))}#e(){let{value:e}=this.$state;return Math.round(e())}#t(){let{value:e,max:r}=this.$state;return Rn(e()/r()*100,2)+"%"}#r(){let{value:e}=this.$props;this.$state.value.set(e())}#n(){let{min:e,max:r}=this.$props;this.$state.min.set(e()),this.$state.max.set(r())}},uc=new Map,YE=new Map,C2=class t{#e;#t;#r;$images=be([]);static create(e,r){let n=Et();return new t(e,r,n)}constructor(e,r,n){this.#t=e,this.#r=r,this.#e=n,U(this.#n.bind(this))}#n(){let{canLoad:e}=this.#e.$state;if(!e())return;let r=this.#t();if(r){if(me(r)&&uc.has(r)){let n=uc.get(r);if(uc.delete(r),uc.set(r,n),uc.size>99){let i=uc.keys().next().value;uc.delete(i)}this.$images.set(uc.get(r))}else if(me(r)){let n=this.#r(),i=r+"::"+n;if(!YE.has(i)){let s=new Promise(async(a,o)=>{try{let l=await fetch(r,{credentials:Dx(n)});if(l.headers.get("content-type")==="application/json"){let u=await l.json();if(Lr(u))if(u[0]&&"text"in u[0])a(this.#a(u));else{for(let d=0;d<u.length;d++){let f=u[d];cc(ax(f),!1),cc("url"in f&&me(f.url),!1),cc("startTime"in f&&Rr(f.startTime),!1)}a(u)}else a(this.#s(u));return}Promise.resolve().then(()=>(Cx(),Sx)).then(async({parseResponse:u})=>{try{let{cues:d}=await u(l);a(this.#a(d))}catch(d){o(d)}})}catch(l){o(l)}}).then(a=>(uc.set(i,a),a)).catch(a=>{this.#c(r,a)}).finally(()=>{me(i)&&YE.delete(i)});YE.set(i,s)}YE.get(i)?.then(s=>{this.$images.set(s||[])})}else if(Lr(r))try{this.$images.set(this.#i(r))}catch(n){this.#c(r,n)}else try{this.$images.set(this.#s(r))}catch(n){this.#c(r,n)}return()=>{this.$images.set([])}}}#i(e){let r=this.#o();return e.map((n,i)=>(cc(n.url&&me(n.url)),cc("startTime"in n&&Rr(n.startTime)),{...n,url:me(n.url)?this.#l(n.url,r):n.url}))}#s(e){cc(me(e.url)),cc(Lr(e.tiles)&&e.tiles?.length);let r=new URL(e.url),n=[],i="tile_width"in e?e.tile_width:e.tileWidth,s="tile_height"in e?e.tile_height:e.tileHeight;for(let a of e.tiles)n.push({url:r,startTime:"start"in a?a.start:a.startTime,width:i,height:s,coords:{x:a.x,y:a.y}});return n}#a(e){for(let i=0;i<e.length;i++){let s=e[i];cc("startTime"in s&&Rr(s.startTime)),cc("text"in s&&me(s.text))}let r=[],n=this.#o();for(let i of e){let[s,a]=i.text.split("#"),o=this.#u(a);r.push({url:this.#l(s,n),startTime:i.startTime,endTime:i.endTime,width:o?.w,height:o?.h,coords:o&&Rr(o.x)&&Rr(o.y)?{x:o.x,y:o.y}:void 0})}return r}#o(){let e=te(this.#t);return!me(e)||!/^https?:/.test(e)?location.href:e}#l(e,r){return/^https?:/.test(e)?new URL(e):new URL(e,r)}#u(e){if(!e)return{};let[r,n]=e.split("="),i=n?.split(","),s={};if(!r||!i)return null;for(let a=0;a<r.length;a++){let o=+i[a];isNaN(o)||(s[r[a]]=o)}return s}#c(e,r){}},T2=class extends je{static props={src:null,time:0,crossOrigin:null};static state=new ao({src:"",img:null,thumbnails:[],activeThumbnail:null,crossOrigin:null,loading:!1,error:null,hidden:!1});media;#e;#t=[];onSetup(){this.media=Et(),this.#e=C2.create(this.$props.src,this.$state.crossOrigin),this.#n(),this.setAttributes({"data-loading":this.#o.bind(this),"data-error":this.#l.bind(this),"data-hidden":this.$state.hidden,"aria-hidden":Ln(this.$state.hidden)})}onConnect(e){U(this.#r.bind(this)),U(this.#u.bind(this)),U(this.#n.bind(this)),U(this.#i.bind(this)),U(this.#c.bind(this)),U(this.#f.bind(this))}#r(){let e=this.$state.img();e&&new it(e).add("load",this.#s.bind(this)).add("error",this.#a.bind(this))}#n(){let{crossOrigin:e}=this.$props,{crossOrigin:r}=this.$state,{crossOrigin:n}=this.media.$state,i=e()!==null?e():n();r.set(i===!0?"anonymous":i)}#i(){let{src:e,loading:r,error:n}=this.$state;return e()&&(r.set(!0),n.set(null)),()=>{this.#p(),r.set(!1),n.set(null)}}#s(){let{loading:e,error:r}=this.$state;this.#f(),e.set(!1),r.set(null)}#a(e){let{loading:r,error:n}=this.$state;r.set(!1),n.set(e)}#o(){let{loading:e,hidden:r}=this.$state;return!r()&&e()}#l(){let{error:e}=this.$state;return!pa(e())}#u(){let{hidden:e}=this.$state,{duration:r}=this.media.$state,n=this.#e.$images();e.set(this.#l()||!Number.isFinite(r())||n.length===0)}getTime(){return this.$props.time()}#c(){let e=this.#e.$images();if(!e.length)return;let r=this.getTime(),{src:n,activeThumbnail:i}=this.$state,s=-1,a=null;for(let o=e.length-1;o>=0;o--){let l=e[o];if(r>=l.startTime&&(!l.endTime||r<l.endTime)){s=o;break}}e[s]&&(a=e[s]),i.set(a),n.set(a?.url.href||"")}#f(){if(!this.scope||this.$state.hidden())return;let e=this.el,r=this.$state.img(),n=this.$state.activeThumbnail();if(!r||!n||!e)return;let i=n.width??r.naturalWidth,s=n?.height??r.naturalHeight,{maxWidth:a,maxHeight:o,minWidth:l,minHeight:c,width:u,height:d}=getComputedStyle(this.el);l==="100%"&&(l=parseFloat(u)+""),c==="100%"&&(c=parseFloat(d)+"");let f=Math.max(parseInt(l)/i,parseInt(c)/s),p=Math.min(Math.max(parseInt(l),parseInt(a))/i,Math.max(parseInt(c),parseInt(o))/s),h=!isNaN(p)&&p<1?p:f>1?f:1;this.#d(e,"--thumbnail-width",`${i*h}px`),this.#d(e,"--thumbnail-height",`${s*h}px`),this.#d(e,"--thumbnail-aspect-ratio",String(Rn(i/s,5))),this.#d(r,"width",`${r.naturalWidth*h}px`),this.#d(r,"height",`${r.naturalHeight*h}px`),this.#d(r,"transform",n.coords?`translate(-${n.coords.x*h}px, -${n.coords.y*h}px)`:""),this.#d(r,"max-width","none")}#d(e,r,n){e.style.setProperty(r,n),this.#t.push(()=>e.style.removeProperty(r))}#p(){for(let e of this.#t)e();this.#t=[]}},B4=class extends T2{#e;onAttach(e){this.#e=Jm(mp.state)}getTime(){let{duration:e,clipStartTime:r}=this.media.$state;return r()+this.#e.pointerRate()*e()}},E2=class extends je{static props={src:null,crossOrigin:null};static state=new ao({video:null,src:null,crossOrigin:null,canPlay:!1,error:null,hidden:!1});#e;#t;get video(){return this.$state.video()}onSetup(){this.#e=Et(),this.#t=Jm(mp.state),this.#i(),this.setAttributes({"data-loading":this.#s.bind(this),"data-hidden":this.$state.hidden,"data-error":this.#a.bind(this),"aria-hidden":Ln(this.$state.hidden)})}onAttach(e){U(this.#r.bind(this)),U(this.#n.bind(this)),U(this.#i.bind(this)),U(this.#o.bind(this)),U(this.#l.bind(this)),U(this.#f.bind(this))}#r(){let e=this.$state.video();e&&(e.readyState>=2&&this.#u(),new it(e).add("canplay",this.#u.bind(this)).add("error",this.#c.bind(this)))}#n(){let{src:e}=this.$state,{canLoad:r}=this.#e.$state;e.set(r()?this.$props.src():null)}#i(){let{crossOrigin:e}=this.$props,{crossOrigin:r}=this.$state,{crossOrigin:n}=this.#e.$state,i=e()!==null?e():n();r.set(i===!0?"anonymous":i)}#s(){let{canPlay:e,hidden:r}=this.$state;return!e()&&!r()}#a(){let{error:e}=this.$state;return!pa(e)}#o(){let{src:e,hidden:r}=this.$state,{canLoad:n,duration:i}=this.#e.$state;r.set(n()&&(!e()||this.#a()||!Number.isFinite(i())))}#l(){let{src:e,canPlay:r,error:n}=this.$state;e(),r.set(!1),n.set(null)}#u(e){let{canPlay:r,error:n}=this.$state;r.set(!0),n.set(null),this.dispatch("can-play",{trigger:e})}#c(e){let{canPlay:r,error:n}=this.$state;r.set(!1),n.set(e),this.dispatch("error",{trigger:e})}#f(){let{video:e,canPlay:r}=this.$state,{duration:n}=this.#e.$state,{pointerRate:i}=this.#t,s=e();r()&&s&&Number.isFinite(n())&&Number.isFinite(i())&&(s.currentTime=i()*n())}},tNe=E2.prototype;ht(tNe,"video");I2=class extends je{static props={type:"pointer",format:null,showHours:!1,showMs:!1,padHours:null,padMinutes:null,decimalPlaces:2};#e;#t;#r;onSetup(){this.#r=Jm(mp.state),this.#e=mr(pg),this.#t=ec(this.getValueText.bind(this))}getValueText(){let{type:e,format:r,decimalPlaces:n,padHours:i,padMinutes:s,showHours:a,showMs:o}=this.$props,{value:l,pointerValue:c,min:u,max:d}=this.#r,f=r?.()??this.#e.default,p=e()==="current"?l():c();if(f==="percent"){let h=d()-u(),m=p/h*100;return(this.#e.percent??Rn)(m,n())+"%"}else return f==="time"?(this.#e.time??fc)(p,{padHrs:i(),padMins:s(),showHrs:a(),showMs:o()}):(this.#e.value?.(p)??p.toFixed(2))+""}},rNe=I2.prototype;$r(rNe,"getValueText");V4=class extends je{static props={offset:0,noClamp:!1};#e;onSetup(){this.#e=mr(uF);let{active:e}=Jm(mp.state);this.setAttributes({"data-visible":e})}onAttach(e){Object.assign(e.style,{position:"absolute",top:0,left:0,width:"max-content"})}onConnect(e){let{preview:r}=this.#e;r.set(e),Ne(()=>r.set(null)),U(this.#t.bind(this));let n=new ResizeObserver(this.#t.bind(this));n.observe(e),Ne(()=>n.disconnect())}#t=sp(()=>{let{disabled:e,orientation:r}=this.#e;if(e())return;let n=this.el,{offset:i,noClamp:s}=this.$props;n&&Nee(n,{clamp:!s(),offset:i(),orientation:r()})})};j4=class extends je{static props={...Gi.props,keyStep:5,shiftKeyMultiplier:2};static state=Vu;#e;onSetup(){this.#e=Et();let{audioGain:e}=this.#e.$state;vi(pg,{default:"percent",value(r){return(r*(e()??1)).toFixed(2)},percent(r){return Math.round(r*(e()??1))}}),new Gi({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:this.#i.bind(this),aria:{valueMax:this.#n.bind(this),valueNow:this.#t.bind(this),valueText:this.#r.bind(this)},onDragValueChange:this.#u.bind(this),onValueChange:this.#l.bind(this)}).attach(this),U(this.#s.bind(this))}onAttach(e){e.setAttribute("data-media-volume-slider",""),vt(e,"aria-label","Volume");let{canSetVolume:r}=this.#e.$state;this.setAttributes({"data-supported":r,"aria-hidden":Ln(()=>!r())})}#t(){let{value:e}=this.$state,{audioGain:r}=this.#e.$state;return Math.round(e()*(r()??1))}#r(){let{value:e,max:r}=this.$state,{audioGain:n}=this.#e.$state;return Rn(e()/r()*(n()??1)*100,2)+"%"}#n(){let{audioGain:e}=this.#e.$state;return this.$state.max()*(e()??1)}#i(){let{disabled:e}=this.$props,{canSetVolume:r}=this.#e.$state;return e()||!r()}#s(){let{muted:e,volume:r}=this.#e.$state,n=e()?0:r()*100;this.$state.value.set(n),this.dispatch("value-change",{detail:n})}#a=ic(this.#o.bind(this),25);#o(e){if(!e.trigger)return;let r=Rn(e.detail/100,3);this.#e.remote.changeVolume(r,e)}#l(e){this.#a(e)}#u(e){this.#a(e)}},$4=class extends je{static props={...Gi.props,step:25,keyStep:25,shiftKeyMultiplier:2,min:0,max:300};static state=Vu;#e;onSetup(){this.#e=Et(),vi(pg,{default:"percent",percent:(e,r)=>Rn(this.$state.value(),r)+"%"}),new Gi({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:this.#s.bind(this),aria:{valueNow:this.#t.bind(this),valueText:this.#r.bind(this)},onDragValueChange:this.#l.bind(this),onValueChange:this.#o.bind(this)}).attach(this),U(this.#n.bind(this)),U(this.#i.bind(this))}onAttach(e){e.setAttribute("data-media-audio-gain-slider",""),vt(e,"aria-label","Audio Boost");let{canSetAudioGain:r}=this.#e.$state;this.setAttributes({"data-supported":r,"aria-hidden":Ln(()=>!r())})}#t(){let{value:e}=this.$state;return Math.round(e())}#r(){let{value:e}=this.$state;return e()+"%"}#n(){let{min:e,max:r}=this.$props;this.$state.min.set(e()),this.$state.max.set(r())}#i(){let{audioGain:e}=this.#e.$state,r=((e()??1)-1)*100;this.$state.value.set(r),this.dispatch("value-change",{detail:r})}#s(){let{disabled:e}=this.$props,{canSetAudioGain:r}=this.#e.$state;return e()||!r()}#a(e){if(!e.trigger)return;let r=Rn(1+e.detail/100,2);this.#e.remote.changeAudioGain(r,e)}#o(e){this.#a(e)}#l(e){this.#a(e)}},U4=class extends je{static props={...Gi.props,step:.25,keyStep:.25,shiftKeyMultiplier:2,min:0,max:2};static state=Vu;#e;onSetup(){this.#e=Et(),new Gi({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:this.#s,isDisabled:this.#a.bind(this),aria:{valueNow:this.#t.bind(this),valueText:this.#r.bind(this)},onDragValueChange:this.#c.bind(this),onValueChange:this.#u.bind(this)}).attach(this),U(this.#n.bind(this)),U(this.#i.bind(this))}onAttach(e){e.setAttribute("data-media-speed-slider",""),vt(e,"aria-label","Speed");let{canSetPlaybackRate:r}=this.#e.$state;this.setAttributes({"data-supported":r,"aria-hidden":Ln(()=>!r())})}#t(){let{value:e}=this.$state;return e()}#r(){let{value:e}=this.$state;return e()+"x"}#n(){let{min:e,max:r}=this.$props;this.$state.min.set(e()),this.$state.max.set(r())}#i(){let{playbackRate:e}=this.#e.$state,r=e();this.$state.value.set(r),this.dispatch("value-change",{detail:r})}#s(e){return Rn(e,2)}#a(){let{disabled:e}=this.$props,{canSetPlaybackRate:r}=this.#e.$state;return e()||!r()}#o=ic(this.#l.bind(this),25);#l(e){if(!e.trigger)return;let r=e.detail;this.#e.remote.changePlaybackRate(r,e)}#u(e){this.#o(e)}#c(e){this.#o(e)}},z4=class extends je{static props={...Gi.props,step:1,keyStep:1,shiftKeyMultiplier:1};static state=Vu;#e;#t=ec(()=>{let{qualities:e}=this.#e.$state;return Aee(e())});onSetup(){this.#e=Et(),new Gi({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:this.#a.bind(this),aria:{valueNow:this.#r.bind(this),valueText:this.#n.bind(this)},onDragValueChange:this.#c.bind(this),onValueChange:this.#u.bind(this)}).attach(this),U(this.#i.bind(this)),U(this.#s.bind(this))}onAttach(e){e.setAttribute("data-media-quality-slider",""),vt(e,"aria-label","Video Quality");let{qualities:r,canSetQuality:n}=this.#e.$state,i=ec(()=>n()&&r().length>0);this.setAttributes({"data-supported":i,"aria-hidden":Ln(()=>!i())})}#r(){let{value:e}=this.$state;return e()}#n(){let{quality:e}=this.#e.$state;if(!e())return"";let{height:r,bitrate:n}=e(),i=n&&n>0?`${(n/1e6).toFixed(2)} Mbps`:null;return r?`${r}p${i?` (${i})`:""}`:"Auto"}#i(){let e=this.#t();this.$state.max.set(Math.max(0,e.length-1))}#s(){let{quality:e}=this.#e.$state,r=this.#t(),n=Math.max(0,r.indexOf(e()));this.$state.value.set(n),this.dispatch("value-change",{detail:n})}#a(){let{disabled:e}=this.$props,{canSetQuality:r,qualities:n}=this.#e.$state;return e()||n().length<=1||!r()}#o=ic(this.#l.bind(this),25);#l(e){if(!e.trigger)return;let{qualities:r}=this.#e,n=te(this.#t)[e.detail];this.#e.remote.changeQuality(r.indexOf(n),e)}#u(e){this.#o(e)}#c(e){this.#o(e)}},A2=class extends je{static props={...Gi.props,step:.1,keyStep:5,shiftKeyMultiplier:2,pauseWhileDragging:!1,noSwipeGesture:!1,seekingRequestThrottle:100};static state=Vu;#e;#t;#r=be(null);constructor(){super();let{noSwipeGesture:e}=this.$props;new Gi({swipeGesture:()=>!e(),getValue:this.#m.bind(this),getStep:this.#y.bind(this),getKeyStep:this.#w.bind(this),roundValue:this.#h,isDisabled:this.#x.bind(this),aria:{valueNow:this.#b.bind(this),valueText:this.#S.bind(this)},onDragStart:this.#f.bind(this),onDragValueChange:this.#d.bind(this),onDragEnd:this.#p.bind(this),onValueChange:this.#g.bind(this)})}onSetup(){this.#e=Et(),vi(pg,{default:"time",value:this.#C.bind(this),time:this.#T.bind(this)}),this.setAttributes({"data-chapters":this.#i.bind(this)}),this.setStyles({"--slider-progress":this.#n.bind(this)}),U(this.#a.bind(this)),U(this.#s.bind(this))}onAttach(e){e.setAttribute("data-media-time-slider",""),vt(e,"aria-label","Seek")}onConnect(e){U(this.#o.bind(this)),kw(this.#e.textTracks,"chapters",this.#r.set)}#n(){let{bufferedEnd:e,duration:r}=this.#e.$state;return Rn(Math.min(e()/Math.max(r(),1),1)*100,3)+"%"}#i(){let{duration:e}=this.#e.$state;return this.#r()?.cues.length&&Number.isFinite(e())&&e()>0}#s(){this.#t=ic(this.#l.bind(this),this.$props.seekingRequestThrottle())}#a(){if(this.$state.hidden())return;let{value:e,dragging:r}=this.$state,n=this.#m();te(r)||(e.set(n),this.dispatch("value-change",{detail:n}))}#o(){let e=this.#e.player.el,{preview:r}=mr(uF);e&&r()&&Ae(e,"data-preview",this.$state.active())}#l(e,r){this.#e.remote.seeking(e,r)}#u(e,r,n){this.#t.cancel();let{live:i}=this.#e.$state;if(i()&&r>=99){this.#e.remote.seekToLiveEdge(n);return}this.#e.remote.seek(e,n)}#c=!1;#f(e){let{pauseWhileDragging:r}=this.$props;if(r()){let{paused:n}=this.#e.$state;this.#c=!n(),this.#e.remote.pause(e)}}#d(e){this.#t(this.#v(e.detail),e)}#p(e){let{seeking:r}=this.#e.$state;te(r)||this.#l(this.#v(e.detail),e);let n=e.detail;this.#u(this.#v(n),n,e);let{pauseWhileDragging:i}=this.$props;i()&&this.#c&&(this.#e.remote.play(e),this.#c=!1)}#g(e){let{dragging:r}=this.$state;r()||!e.trigger||this.#p(e)}#m(){let{currentTime:e}=this.#e.$state;return this.#k(e())}#y(){let e=this.$props.step()/this.#e.$state.duration()*100;return Number.isFinite(e)?e:1}#w(){let e=this.$props.keyStep()/this.#e.$state.duration()*100;return Number.isFinite(e)?e:1}#h(e){return Rn(e,3)}#x(){let{disabled:e}=this.$props,{canSeek:r}=this.#e.$state;return e()||!r()}#b(){let{value:e}=this.$state;return Math.round(e())}#S(){let e=this.#v(this.$state.value()),{duration:r}=this.#e.$state;return Number.isFinite(e)?`${Vx(e)} out of ${Vx(r())}`:"live"}#v(e){let{duration:r}=this.#e.$state;return Rn(e/100*r(),5)}#k(e){let{liveEdge:r,duration:n}=this.#e.$state,i=Math.max(0,Math.min(1,r()?1:Math.min(e,n())/n()));return Number.isNaN(i)?0:Number.isFinite(i)?i*100:100}#C(e){let r=this.#v(e),{live:n,duration:i}=this.#e.$state;return Number.isFinite(r)?(n()?r-i():r).toFixed(0):"LIVE"}#T(e,r){let n=this.#v(e),{live:i,duration:s}=this.#e.$state,a=i()?n-s():n;return Number.isFinite(n)?`${a<0?"-":""}${fc(Math.abs(a),r)}`:"LIVE"}},P2=class extends je{static props={disabled:!1};#e;#t;#r;#n=null;#i=[];#s=be(null);#a=be([]);#o=be(-1);#l=be(-1);#u=0;get cues(){return this.#a()}get activeCue(){return this.#a()[this.#o()]||null}get activePointerCue(){return this.#a()[this.#l()]||null}onSetup(){this.#e=Et(),this.#t=Jm(A2.state)}onAttach(e){kw(this.#e.textTracks,"chapters",this.#c.bind(this)),U(this.#P.bind(this))}onConnect(){Ne(()=>this.#f.bind(this))}onDestroy(){this.#c(null)}setRefs(e){if(this.#i=e,this.#r?.dispose(),this.#i.length===1){let r=this.#i[0];r.style.width="100%",r.style.setProperty("--chapter-fill","var(--slider-fill)"),r.style.setProperty("--chapter-progress","var(--slider-progress)")}else this.#i.length>0&&pn(()=>this.#d(),this.#r=yi())}#c(e){te(this.#s)!==e&&(this.#f(),this.#s.set(e))}#f(){this.#i=[],this.#a.set([]),this.#o.set(-1),this.#l.set(-1),this.#u=0,this.#r?.dispose()}#d(){this.#i.length&&U(this.#p.bind(this))}#p(){let{hidden:e}=this.#t;e()||(U(this.#g.bind(this)),U(this.#m.bind(this)),U(this.#y.bind(this)),U(this.#b.bind(this)))}#g(){let e=this.#a();if(!e.length)return;let r,{seekableStart:n,seekableEnd:i}=this.#e.$state,s=n(),a=i()||e[e.length-1].endTime,o=a-s,l=100;for(let c=0;c<e.length;c++)if(r=e[c],this.#i[c]){let u=c===e.length-1?l:Rn((r.endTime-Math.max(s,r.startTime))/o*100,3);this.#i[c].style.width=u+"%",l-=u}}#m(){let{liveEdge:e,seekableStart:r,seekableEnd:n}=this.#e.$state,{fillPercent:i,value:s}=this.#t,a=this.#a(),o=e(),l=te(this.#o),c=a[l],u=o?this.#a.length-1:this.#x(c&&c.startTime/n()*100<=te(s)?l:0,i());o||!c?this.#w(0,a.length,100):u>l?this.#w(l,u,100):u<l&&this.#w(u+1,l+1,0);let d=o?100:this.#T(a[u],i(),r(),this.#C(a));this.#h(this.#i[u],d),this.#o.set(u)}#y(){let{hidden:e,pointerPercent:r}=this.#t;if(e()){this.#l.set(-1);return}let n=this.#x(0,r());this.#l.set(n)}#w(e,r,n){for(let i=e;i<r;i++)this.#h(this.#i[i],n)}#h(e,r){e&&(e.style.setProperty("--chapter-fill",r+"%"),Ae(e,"data-active",r>0&&r<100),Ae(e,"data-ended",r===100))}#x(e,r){let n=0,i=this.#a();if(r===0)return 0;if(r===100)return i.length-1;let{seekableStart:s}=this.#e.$state,a=s(),o=this.#C(i);for(let l=e;l<i.length;l++)if(n=this.#T(i[l],r,a,o),n>=0&&n<100)return l;return 0}#b(){this.#S(this.#v())}#S=sp(e=>{let r,n=this.#a(),{seekableStart:i}=this.#e.$state,s=i(),a=this.#C(n);for(let o=this.#u;o<this.#i.length;o++)if(r=this.#T(n[o],e,s,a),this.#i[o]?.style.setProperty("--chapter-progress",r+"%"),r<100){this.#u=o;break}});#v=ec(this.#k.bind(this));#k(){let{bufferedEnd:e,duration:r}=this.#e.$state;return Rn(Math.min(e()/Math.max(r(),1),1),3)*100}#C(e){let{seekableEnd:r}=this.#e.$state,n=r();return Number.isFinite(n)?n:e[e.length-1]?.endTime||0}#T(e,r,n,i){if(!e||this.#a().length===0)return 0;let a=i-n,o=Math.max(0,e.startTime-n),l=Math.min(i,e.endTime)-n,c=o/a,u=c*100,d=Math.min(1,c+(l-o)/a)*100;return Math.max(0,Rn(r>=d?100:(r-u)/(d-u)*100,3))}#E(e){let r=[],{seekableStart:n,seekableEnd:i,duration:s}=this.#e.$state,a=n(),o=i();e=e.filter(u=>u.startTime<=o&&u.endTime>=a);let l=e[0];l&&l.startTime>a&&r.push(new window.VTTCue(a,l.startTime,""));for(let u=0;u<e.length-1;u++){let d=e[u],f=e[u+1];if(r.push(d),f){let p=f.startTime-d.endTime;p>0&&r.push(new window.VTTCue(d.endTime,d.endTime+p,""))}}let c=e[e.length-1];if(c){r.push(c);let u=s();u>=0&&u-c.endTime>1&&r.push(new window.VTTCue(c.endTime,s(),""))}return r}#P(){let{source:e}=this.#e.$state;e(),this.#A()}#A(){if(!this.scope)return;let{disabled:e}=this.$props;if(e()){this.#a.set([]),this.#o.set(0),this.#u=0;return}let r=this.#s();if(r){let n=this.#M.bind(this);n(),new it(r).add("add-cue",n).add("remove-cue",n),U(this.#L.bind(this))}return this.#n=this.#D(),this.#n&&U(this.#O.bind(this)),()=>{this.#n&&(this.#n.textContent="",this.#n=null)}}#L(){this.#e.$state.duration(),this.#M()}#M=dx(()=>{let e=te(this.#s);!this.scope||!e||!e.cues.length||(this.#a.set(this.#E(e.cues)),this.#o.set(0),this.#u=0)},150,!0);#O(){let e=this.activePointerCue||this.activeCue;this.#n&&(this.#n.textContent=e?.text||"")}#R(){let e=this.el;for(;e&&e.getAttribute("role")!=="slider";)e=e.parentElement;return e}#D(){let e=this.#R();return e?e.querySelector('[data-part="chapter-title"]'):null}},N2=P2.prototype;ht(N2,"cues");ht(N2,"activeCue");ht(N2,"activePointerCue");$r(N2,"setRefs");il=rl();sNe=["a[href]","[tabindex]","input","select","button"].map(t=>`${t}:not([aria-hidden='true'])`).join(","),aNe=new Set(["Escape","Tab","ArrowUp","ArrowDown","Home","PageUp","End","PageDown","Enter"," "]),q4=class{#e=-1;#t=null;#r=[];#n;get items(){return this.#r}constructor(e){this.#n=e}attachMenu(e){We(e,"focus",this.#a.bind(this)),this.#t=e,Ne(()=>{this.#t=null})}listen(){this.#t&&(this.update(),new it(this.#t).add("keyup",this.#l.bind(this)).add("keydown",this.#u.bind(this)),Ne(()=>{this.#e=-1,this.#r=[]}))}update(){this.#e=0,this.#r=this.#f()}scroll(e=this.#s()){let r=this.#r[e];r&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{iNe(r,{behavior:"smooth",boundary:n=>!n.hasAttribute("data-root")})})})}focusActive(e=!0){let r=this.#s();this.#i(r>=0?r:0,e)}#i(e,r=!0){this.#e=e,this.#r[e]?(this.#r[e].focus({preventScroll:!0}),r&&this.scroll(e)):this.#t?.focus({preventScroll:!0})}#s(){return this.#r.findIndex(e=>document.activeElement===e||e.getAttribute("role")==="menuitemradio"&&e.getAttribute("aria-checked")==="true")}#a(){this.#e>=0||(this.update(),this.focusActive())}#o(e){let r=e.target;if(ND(e)&&r instanceof Element){let n=r.getAttribute("role");return!/a|input|select|button/.test(r.localName)&&!n}return aNe.has(e.key)}#l(e){this.#o(e)&&(e.stopPropagation(),e.preventDefault())}#u(e){if(this.#o(e))switch(e.stopPropagation(),e.preventDefault(),e.key){case"Escape":this.#n.closeMenu(e);break;case"Tab":this.#i(this.#c(e.shiftKey?-1:1));break;case"ArrowUp":this.#i(this.#c(-1));break;case"ArrowDown":this.#i(this.#c(1));break;case"Home":case"PageUp":this.#i(0);break;case"End":case"PageDown":this.#i(this.#r.length-1);break}}#c(e){let r=this.#e;do r=(r+e+this.#r.length)%this.#r.length;while(this.#r[r]?.offsetParent===null);return r}#f(){if(!this.#t)return[];let e=this.#t.querySelectorAll(sNe),r=[],n=i=>i.getAttribute("role")==="menu";for(let i of e)r2(i)&&i.offsetParent!==null&&Tee(this.#t,i,n)&&r.push(i);return r}},oNe=Object.defineProperty,lNe=Object.getOwnPropertyDescriptor,Cw=(t,e,r,n)=>{for(var i=lNe(e,r),s=t.length-1,a;s>=0;s--)(a=t[s])&&(i=a(e,r,i)||i);return i&&oNe(e,r,i),i},cNe=0,Du=class extends je{static props={showDelay:0};#e;#t;#r;#n=be(!1);#i=be(!1);#s=be(null);#a=be(null);#o;#l=new Set;#u=null;#c;#f;#d=!1;#p=be(!1);#g=new Set;get triggerElement(){return this.#s()}get contentElement(){return this.#a()}get isSubmenu(){return!!this.#o}constructor(){super();let{showDelay:e}=this.$props;this.#c=new w2({trigger:this.#s,content:this.#a,showDelay:e,listen:(r,n,i)=>{Ou(r,a=>{this.#n()?i(a):n(a)});let s=this.#M();s&&Ou(s,a=>{a.stopPropagation(),i(a)})},onChange:this.#k.bind(this)})}onSetup(){this.#e=Et();let e=++cNe;this.#t=`media-menu-${e}`,this.#r=`media-menu-button-${e}`,this.#f=new q4({closeMenu:this.close.bind(this)}),so(il)&&(this.#o=mr(il)),this.#m(),this.setAttributes({"data-open":this.#n,"data-root":!this.isSubmenu,"data-submenu":this.isSubmenu,"data-disabled":this.#E.bind(this)}),vi(il,{button:this.#s,content:this.#a,expanded:this.#n,hint:be(""),submenu:!!this.#o,disable:this.#P.bind(this),attachMenuButton:this.#w.bind(this),attachMenuItems:this.#h.bind(this),attachObserver:this.#x.bind(this),disableMenuButton:this.#S.bind(this),addSubmenu:this.#R.bind(this),onTransitionEvent:r=>{this.#g.add(r),Ne(()=>{this.#g.delete(r)})}})}onAttach(e){e.style.setProperty("display","contents")}onConnect(e){U(this.#y.bind(this)),this.isSubmenu&&this.#o?.addSubmenu(this)}onDestroy(){this.#s.set(null),this.#a.set(null),this.#u=null,this.#g.clear()}#m(){let e=-1,r=so(Nx)?mr(Nx):null;vi(Nx,{onDragStart:()=>{r?.onDragStart?.(),window.clearTimeout(e),e=-1,this.#d=!0},onDragEnd:()=>{r?.onDragEnd?.(),e=window.setTimeout(()=>{this.#d=!1,e=-1},300)}})}#y(){let e=this.#T();this.isSubmenu||this.#j(),this.#b(e),e&&(U(()=>{let{height:r}=this.#e.$state,n=this.#a();n&&Gn(n,"--player-height",r()+"px")}),this.#f.listen(),this.listen("pointerup",this.#A.bind(this)),We(window,"pointerup",this.#L.bind(this)))}#w(e){let r=e.el,n=this.isSubmenu,i=Ln(this.#E.bind(this));vt(r,"tabindex",n?"-1":"0"),vt(r,"role",n?"menuitem":"button"),Ae(r,"id",this.#r),Ae(r,"aria-haspopup","menu"),Ae(r,"aria-expanded","false"),Ae(r,"data-root",!this.isSubmenu),Ae(r,"data-submenu",this.isSubmenu);let s=()=>{Ae(r,"data-open",this.#n()),Ae(r,"aria-disabled",i())};le?s():U(s),this.#s.set(r),Ne(()=>{this.#s.set(null)})}#h(e){let r=e.el;r.style.setProperty("display","none"),Ae(r,"id",this.#t),vt(r,"role","menu"),vt(r,"tabindex","-1"),Ae(r,"data-root",!this.isSubmenu),Ae(r,"data-submenu",this.isSubmenu),this.#a.set(r),Ne(()=>this.#a.set(null));let n=()=>Ae(r,"data-open",this.#n());le?n():U(n),this.#f.attachMenu(r),this.#b(!1);let i=this.#U.bind(this);this.isSubmenu?this.#o?.onTransitionEvent(i):(e.listen("transitionstart",i),e.listen("transitionend",i),e.listen("animationend",this.#j),e.listen("vds-menu-resize",this.#j))}#x(e){this.#u=e}#b(e){let r=te(this.#a);r&&Ae(r,"aria-hidden",ux(!e))}#S(e){this.#p.set(e)}#v=!1;#k(e,r){if(this.#v=Zm(r),r?.stopPropagation(),this.#n()===e)return;if(this.#E()){e&&this.#c.hide(r);return}this.el?.dispatchEvent(new Event("vds-menu-resize",{bubbles:!0,composed:!0}));let n=this.#s(),i=this.#a();if(n&&(Ae(n,"aria-controls",e&&this.#t),Ae(n,"aria-expanded",ux(e))),i&&Ae(i,"aria-labelledby",e&&this.#r),this.#n.set(e),this.#O(r),Cs(),this.#v){e?i?.focus():n?.focus();for(let s of[this.el,i])s&&s.setAttribute("data-keyboard","")}else for(let s of[this.el,i])s&&s.removeAttribute("data-keyboard");if(this.dispatch(e?"open":"close",{trigger:r}),e)!this.isSubmenu&&this.#e.activeMenu!==this&&(this.#e.activeMenu?.close(r),this.#e.activeMenu=this),this.#u?.onOpen?.(r);else{if(this.isSubmenu)for(let s of this.#l)s.close(r);else this.#e.activeMenu=null;this.#u?.onClose?.(r)}e&&requestAnimationFrame(this.#C.bind(this))}#C(){this.#$||this.#_||(this.#f.update(),requestAnimationFrame(()=>{this.#v?this.#f.focusActive():this.#f.scroll()}))}#T(){return!this.#E()&&this.#n()}#E(){return this.#i()||this.#p()}#P(e){this.#i.set(e)}#A(e){let r=this.#a();this.#d||r&&zJ(r,e)||e.stopPropagation()}#L(e){let r=this.#a();this.#d||r&&zJ(r,e)||this.close(e)}#M(){let e=this.el?.querySelector('[data-part="close-target"]');return this.el&&e&&Tee(this.el,e,r=>r.getAttribute("role")==="menu")?e:null}#O(e){this.isSubmenu||(this.#n()?this.#e.remote.pauseControls(e):this.#e.remote.resumeControls(e))}#R(e){this.#l.add(e),new it(e).add("open",this.#F).add("close",this.#B),Ne(this.#D)}#D=this.#N.bind(this);#N(e){this.#l.delete(e)}#_=!1;#F=this.#I.bind(this);#I(e){this.#_=!0;let r=this.#a();this.isSubmenu&&this.triggerElement?.setAttribute("aria-hidden","true");for(let n of this.#l)if(n!==e.target)for(let i of[n.el,n.triggerElement])i?.setAttribute("aria-hidden","true");if(r){let n=e.target.el;for(let i of r.children)i.contains(n)?i.setAttribute("data-open",""):i!==n&&i.setAttribute("data-hidden","")}}#B=this.#V.bind(this);#V(e){this.#_=!1;let r=this.#a();this.isSubmenu&&this.triggerElement?.setAttribute("aria-hidden","false");for(let n of this.#l)for(let i of[n.el,n.triggerElement])i?.setAttribute("aria-hidden","false");if(r)for(let n of r.children)n.removeAttribute("data-open"),n.removeAttribute("data-hidden")}#j=sp(()=>{let e=te(this.#a);if(!e||le)return;let r=0,n=getComputedStyle(e),i=[...e.children];for(let s of["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"])r+=parseFloat(n[s])||0;for(let s of i)if(r2(s)&&s.style.display==="contents")i.push(...s.children);else if(s.nodeType===3)r+=parseFloat(getComputedStyle(s).fontSize);else if(r2(s)){if(!See(s))continue;let a=getComputedStyle(s);r+=s.offsetHeight+(parseFloat(a.marginTop)||0)+(parseFloat(a.marginBottom)||0)}Gn(e,"--menu-height",r+"px")});#$=!1;#U(e){let r=this.#a();r&&e.propertyName==="height"&&(this.#$=e.type==="transitionstart",Ae(r,"data-transition",this.#$?"height":null),this.#n()&&this.#C());for(let n of this.#g)n(e)}open(e){te(this.#n)||(this.#c.show(e),Cs())}close(e){te(this.#n)&&(this.#c.hide(e),Cs())}};Cw([ht],Du.prototype,"triggerElement");Cw([ht],Du.prototype,"contentElement");Cw([ht],Du.prototype,"isSubmenu");Cw([$r],Du.prototype,"open");Cw([$r],Du.prototype,"close");jx=class extends je{static props={disabled:!1};#e;#t=be(null);get expanded(){return this.#e?.expanded()??!1}constructor(){super(),new Es}onSetup(){this.#e=mr(il)}onAttach(e){this.#e.attachMenuButton(this),U(this.#r.bind(this)),vt(e,"type","button")}onConnect(e){U(this.#n.bind(this)),this.#i();let r=new MutationObserver(this.#i.bind(this));r.observe(e,{attributeFilter:["data-part"],childList:!0,subtree:!0}),Ne(()=>r.disconnect()),Ou(e,n=>{this.dispatch("select",{trigger:n})})}#r(){this.#e.disableMenuButton(this.$props.disabled())}#n(){let e=this.#t();e&&U(()=>{let r=this.#e.hint();r&&(e.textContent=r)})}#i(){let e=this.el?.querySelector('[data-part="hint"]');this.#t.set(e??null)}},uNe=jx.prototype;ht(uNe,"expanded");H4=class extends jx{},qN=rl(),G4=class extends je{static props={placement:null,offset:0,alignOffset:0};#e;constructor(){super(),new Es;let{placement:e}=this.$props;this.setAttributes({"data-placement":e})}onAttach(e){if(this.#e=mr(il),this.#e.attachMenuItems(this),so(qN)){let r=mr(qN);r&&(vi(qN,null),r.attach(e),Ne(()=>r.attach(null)))}}onConnect(e){U(this.#t.bind(this))}#t(){let{expanded:e}=this.#e;if(!this.el||!e())return;let r=this.$props.placement();if(!r)return;Object.assign(this.el.style,{position:"absolute",top:0,left:0,width:"max-content"});let{offset:n,alignOffset:i}=this.$props;Ne(Iee(this.el,this.#n(),r,{offsetVarName:"media-menu",xOffset:i(),yOffset:n()})),Ne(this.#r.bind(this))}#r(){this.el&&(this.el.removeAttribute("style"),this.el.style.display="none")}#n(){return this.#e.button()}},W4=rl(),$x=class extends Wn{#e=new Set;#t=be("");#r=null;onValueChange;get values(){return Array.from(this.#e).map(e=>e.value())}get value(){return this.#t()}set value(e){this.#a(e)}onSetup(){vi(W4,{add:this.#n.bind(this),remove:this.#i.bind(this)})}onAttach(e){so(il)||vt(e,"role","radiogroup"),this.setAttributes({value:this.#t})}onDestroy(){this.#e.clear()}#n(e){this.#e.has(e)||(this.#e.add(e),e.onCheck=this.#s,e.check(e.value()===this.#t()))}#i(e){e.onCheck=null,this.#e.delete(e)}#s=this.#a.bind(this);#a(e,r){let n=te(this.#t);if(!e||e===n)return;let i=this.#o(n),s=this.#o(e);i?.check(!1,r),s?.check(!0,r),this.#t.set(e),this.onValueChange?.(e,r)}#o(e){for(let r of this.#e)if(e===te(r.value))return r;return null}},R2=class extends je{static props={value:""};#e;get values(){return this.#e.values}get value(){return this.#e.value}set value(e){this.#e.value=e}constructor(){super(),this.#e=new $x,this.#e.onValueChange=this.#r.bind(this)}onSetup(){le?this.#t():U(this.#t.bind(this))}#t(){this.#e.value=this.$props.value()}#r(e,r){let n=this.createEvent("change",{detail:e,trigger:r});this.dispatch(n)}},Fee=R2.prototype;ht(Fee,"values");ht(Fee,"value");L2=class extends je{static props={value:""};#e=be(!1);#t={value:this.$props.value,check:this.#a.bind(this),onCheck:null};get checked(){return this.#e()}constructor(){super(),new Es}onSetup(){this.setAttributes({value:this.$props.value,"data-checked":this.#e,"aria-checked":Ln(this.#e)})}onAttach(e){let r=so(il);vt(e,"tabindex",r?"-1":"0"),vt(e,"role",r?"menuitemradio":"radio"),U(this.#i.bind(this))}onConnect(e){this.#n(),Ou(e,this.#s.bind(this)),Ne(this.#r.bind(this))}#r(){pn(()=>{mr(W4).remove(this.#t)},this.connectScope)}#n(){mr(W4).add(this.#t)}#i(){let{value:e}=this.$props,r=e();te(this.#e)&&this.#t.onCheck?.(r)}#s(e){te(this.#e)||(this.#o(!0,e),this.#l(e),this.#t.onCheck?.(te(this.$props.value),e))}#a(e,r){te(this.#e)!==e&&this.#o(e,r)}#o(e,r){this.#e.set(e),this.dispatch("change",{detail:e,trigger:r})}#l(e){this.dispatch("select",{trigger:e})}},dNe=L2.prototype;ht(dNe,"checked");K4=class extends je{static props={disabled:!1,event:void 0,action:void 0};#e;#t=null;onSetup(){this.#e=Et();let{event:e,action:r}=this.$props;this.setAttributes({event:e,action:r})}onAttach(e){e.setAttribute("data-media-gesture",""),e.style.setProperty("pointer-events","none")}onConnect(e){this.#t=this.#e.player.el?.querySelector("[data-media-provider]"),U(this.#r.bind(this))}#r(){let e=this.$props.event(),r=this.$props.disabled();!this.#t||!e||r||(/^dbl/.test(e)&&(e=e.split(/^dbl/)[1]),(e==="pointerup"||e==="pointerdown")&&this.#e.$state.pointer()==="coarse"&&(e=e==="pointerup"?"touchend":"touchstart"),We(this.#t,e,this.#s.bind(this),{passive:!1}))}#n=0;#i=-1;#s(e){if(this.$props.disabled()||hE(e)&&(e.button!==0||this.#e.activeMenu)||Qm(e)&&this.#e.activeMenu||lF(e)||!this.#o(e))return;if(e.MEDIA_GESTURE=!0,e.preventDefault(),!te(this.$props.event)?.startsWith("dbl"))this.#n===0&&setTimeout(()=>{this.#n===1&&this.#a(e)},250);else if(this.#n===1){queueMicrotask(()=>this.#a(e)),clearTimeout(this.#i),this.#n=0;return}this.#n===0&&(this.#i=window.setTimeout(()=>{this.#n=0},275)),this.#n++}#a(e){this.el.setAttribute("data-triggered",""),requestAnimationFrame(()=>{this.#l()&&this.#u(te(this.$props.action),e),requestAnimationFrame(()=>{this.el.removeAttribute("data-triggered")})})}#o(e){if(!this.el)return!1;if(hE(e)||DD(e)||Qm(e)){let r=Qm(e)?e.changedTouches[0]??e.touches[0]:void 0,n=r?.clientX??e.clientX,i=r?.clientY??e.clientY,s=this.el.getBoundingClientRect(),a=i>=s.top&&i<=s.bottom&&n>=s.left&&n<=s.right;return e.type.includes("leave")?!a:a}return!0}#l(){let e=this.#e.player.el.querySelectorAll("[data-media-gesture][data-triggered]");return Array.from(e).sort((r,n)=>+getComputedStyle(n).zIndex-+getComputedStyle(r).zIndex)[0]===this.el}#u(e,r){if(!e)return;let n=new Ie("will-trigger",{detail:e,cancelable:!0,trigger:r});if(this.dispatchEvent(n),n.defaultPrevented)return;let[i,s]=e.replace(/:([a-z])/,"-$1").split(":");e.includes(":fullscreen")?this.#e.remote.toggleFullscreen("prefer-media",r):e.includes("seek:")?this.#e.remote.seek(te(this.#e.$state.currentTime)+(+s||0),r):this.#e.remote[UD(i)](r),this.dispatch("trigger",{detail:e,trigger:r})}},Y4=class{priority=10;#e=null;#t;#r;constructor(e){this.#t=e}attach(){}canRender(){return!0}detach(){this.#r?.abort(),this.#r=void 0,this.#t.reset(),this.#e=null}changeTrack(e){!e||this.#e===e||(this.#r?.abort(),this.#r=new it(e),e.readyState<2?(this.#t.reset(),this.#r.add("load",()=>this.#n(e),{once:!0})):this.#n(e),this.#r.add("add-cue",r=>{this.#t.addCue(r.detail)}).add("remove-cue",r=>{this.#t.removeCue(r.detail)}),this.#e=e)}#n(e){this.#t.changeTrack({cues:[...e.cues],regions:[...e.regions]})}},X4=class t extends je{static props={textDir:"ltr",exampleText:"Captions look like this."};#e;static lib=be(null);onSetup(){this.#e=Et(),this.setAttributes({"aria-hidden":Ln(this.#t.bind(this))})}onAttach(e){e.style.setProperty("pointer-events","none")}onConnect(e){t.lib()||Promise.resolve().then(()=>(Cx(),Sx)).then(r=>t.lib.set(r)),U(this.#r.bind(this))}#t(){let{textTrack:e,remotePlaybackState:r,iOSControls:n}=this.#e.$state,i=e();return n()||r()==="connected"||!i||!xi(i)}#r(){if(!t.lib())return;let{viewType:e}=this.#e.$state;return e()==="audio"?this.#n():this.#o()}#n(){return U(this.#i.bind(this)),this.#c(null),()=>{this.el.textContent=""}}#i(){if(this.#t())return;this.#s();let{textTrack:e}=this.#e.$state;We(e(),"cue-change",this.#s.bind(this)),U(this.#a.bind(this))}#s(){this.el.textContent="",this.#p>=0&&this.#m();let{realCurrentTime:e,textTrack:r}=this.#e.$state,{renderVTTCueString:n}=t.lib(),i=te(e),s=te(r).activeCues;for(let a of s){let o=this.#y(),l=this.#w();l.innerHTML=n(a,i),o.append(l),this.el.append(l)}}#a(){let{realCurrentTime:e}=this.#e.$state,{updateTimedVTTCueNodes:r}=t.lib();r(this.el,e())}#o(){let{CaptionsRenderer:e}=t.lib(),r=new e(this.el),n=new Y4(r);return this.#e.textRenderers.add(n),U(this.#l.bind(this,r)),U(this.#u.bind(this,r)),this.#c(r),()=>{this.el.textContent="",this.#e.textRenderers.remove(n),r.destroy()}}#l(e){e.dir=this.$props.textDir()}#u(e){if(this.#t())return;let{realCurrentTime:r,textTrack:n}=this.#e.$state;e.currentTime=r(),this.#p>=0&&n()?.activeCues[0]&&this.#m()}#c(e){let r=this.#e.player;if(!r)return;let n=this.#f.bind(this,e);We(r,"vds-font-change",n)}#f(e){if(this.#p>=0){this.#g();return}let{textTrack:r}=this.#e.$state;r()?.activeCues[0]?e?.update(!0):this.#d()}#d(){let e=this.#y();Ae(e,"data-example","");let r=this.#w();Ae(r,"data-example",""),r.textContent=this.$props.exampleText(),e?.append(r),this.el?.append(e),this.el?.setAttribute("data-example",""),this.#g()}#p=-1;#g(){window.clearTimeout(this.#p),this.#p=window.setTimeout(this.#m.bind(this),2500)}#m(){this.el?.removeAttribute("data-example"),this.el?.querySelector("[data-example]")&&(this.el.textContent=""),this.#p=-1}#y(){let e=document.createElement("div");return Ae(e,"data-part","cue-display"),e}#w(){let e=document.createElement("div");return Ae(e,"data-part","cue"),e}},Q4=class extends je{static props={src:null,alt:null,crossOrigin:null};static state=new ao({img:null,src:null,alt:null,crossOrigin:null,loading:!0,error:null,hidden:!1});#e;onSetup(){this.#e=Et(),this.#o(),this.#l(),this.#u(),this.#n()}onAttach(e){e.style.setProperty("pointer-events","none"),U(this.#s.bind(this)),U(this.#o.bind(this)),U(this.#l.bind(this)),U(this.#u.bind(this)),U(this.#n.bind(this));let{started:r}=this.#e.$state;this.setAttributes({"data-visible":()=>!r()&&!this.$state.hidden(),"data-loading":this.#i.bind(this),"data-error":this.#t.bind(this),"data-hidden":this.$state.hidden})}onConnect(e){U(this.#r.bind(this)),U(this.#c.bind(this))}#t(){let{error:e}=this.$state;return!pa(e())}#r(){let{canLoadPoster:e,poster:r}=this.#e.$state;!e()&&r()&&ba(r(),"preconnect")}#n(){let{src:e}=this.$props,{poster:r,nativeControls:n}=this.#e.$state;this.el&&Ae(this.el,"display",n()?"none":null),this.$state.hidden.set(this.#t()||!(e()||r())||n())}#i(){let{loading:e,hidden:r}=this.$state;return!r()&&e()}#s(){let e=this.$state.img();e&&(new it(e).add("load",this.#f.bind(this)).add("error",this.#d.bind(this)),e.complete&&this.#f())}#a="";#o(){let{poster:e}=this.#e.$props,{canLoadPoster:r,providedPoster:n,inferredPoster:i}=this.#e.$state,s=this.$props.src()||"",a=s||e()||i();this.#a===n()&&n.set(s),this.$state.src.set(r()&&a.length?a:null),this.#a=s}#l(){let{src:e}=this.$props,{alt:r}=this.$state,{poster:n}=this.#e.$state;r.set(e()||n()?this.$props.alt():null)}#u(){let{crossOrigin:e}=this.$props,{crossOrigin:r}=this.$state,{crossOrigin:n,poster:i}=this.#e.$state,s=e()!==null?e():n();r.set(/ytimg\.com|vimeo/.test(i()||"")?null:s===!0?"anonymous":s)}#c(){let{loading:e,error:r}=this.$state,{canLoadPoster:n,poster:i}=this.#e.$state;e.set(n()&&!!i()),r.set(null)}#f(){let{loading:e,error:r}=this.$state;e.set(!1),r.set(null)}#d(e){let{loading:r,error:n}=this.$state;r.set(!1),n.set(e)}},Z4=class extends je{static props={type:"current",showHours:!1,padHours:null,padMinutes:null,remainder:!1,toggle:!1,hidden:!1};static state=new ao({timeText:"",hidden:!1});#e;#t=be(null);#r=be(!0);#n=be(!0);onSetup(){this.#e=Et(),this.#o();let{type:e}=this.$props;this.setAttributes({"data-type":e,"data-remainder":this.#c.bind(this)}),new S2({callback:this.#i.bind(this)}).attach(this)}onAttach(e){e.hasAttribute("role")||U(this.#l.bind(this)),U(this.#o.bind(this))}onConnect(e){Ne(Cee(e,this.#r.set)),U(this.#s.bind(this)),U(this.#a.bind(this))}#i(e){this.#n.set(e[0].isIntersecting)}#s(){let{hidden:e}=this.$props;this.$state.hidden.set(e()||!this.#r()||!this.#n())}#a(){if(!this.$props.toggle()){this.#t.set(null);return}this.el&&Ou(this.el,this.#f.bind(this))}#o(){let{hidden:e,timeText:r}=this.$state,{duration:n}=this.#e.$state;if(e())return;let{type:i,padHours:s,padMinutes:a,showHours:o}=this.$props,l=this.#u(i()),c=n(),u=this.#c();if(!Number.isFinite(l+c)){r.set("LIVE");return}let d=u?Math.max(0,c-l):l,f=fc(d,{padHrs:s(),padMins:a(),showHrs:o()});r.set((u?"-":"")+f)}#l(){if(!this.el)return;let{toggle:e}=this.$props;Ae(this.el,"role",e()?"timer":null),Ae(this.el,"tabindex",e()?0:null)}#u(e){let{bufferedEnd:r,duration:n,currentTime:i}=this.#e.$state;switch(e){case"buffered":return r();case"duration":return n();default:return i()}}#c(){return this.$props.remainder()&&this.#t()!==!1}#f(e){if(e.preventDefault(),this.#t()===null){this.#t.set(!this.$props.remainder());return}this.#t.set(r=>!r)}},gp=class extends b2{},M2=class extends x2{},Ux=class extends k4{},zx=class extends S4{},qx=class extends C4{},_2=class extends k2{},Hx=class extends L4{},Gx=class extends M4{},Wx=class extends N4{},Kx=class extends _4{},Yx=class extends O4{},Xx=class extends R4{},Qx=class extends A4{},Zx=class extends P4{},Jx=class extends D4{},ew=class extends T4{},tw=class extends E4{},rw=class extends I4{},hg=class extends mp{},nw=class extends A2{},iw=class extends j4{},sw=class extends $4{},aw=class extends U4{},ow=class extends z4{},lw=class extends B4{},cw=class extends I2{},uw=class extends E2{},dw=class extends V4{},fw=class extends P2{},pw=class extends Du{},hw=class extends jx{},mw=class extends G4{},gw=class extends H4{},yw=class extends R2{},vw=class extends L2{},bw=class extends X4{},xw=class extends K4{},O2=class extends Q4{},mg=class extends T2{},ww=class extends Z4{},Bee=er.forwardRef((t,e)=>{let{children:r,...n}=t,i=er.Children.toArray(r),s=i.find(pNe);if(s){let a=s.props.children,o=i.map(l=>l===s?er.Children.count(a)>1?er.Children.only(null):er.isValidElement(a)?a.props.children:null:l);return er.createElement(J4,{...n,ref:e},er.isValidElement(a)?er.cloneElement(a,void 0,o):null)}return er.createElement(J4,{...n,ref:e},r)});Bee.displayName="Slot";J4=er.forwardRef((t,e)=>{let{children:r,...n}=t;return er.isValidElement(r)?er.cloneElement(r,{...hNe(n,r.props),ref:e?st(e,r.ref):r.ref}):er.Children.count(r)>1?er.Children.only(null):null});J4.displayName="SlotClone";fNe=({children:t})=>er.createElement(er.Fragment,null,t);mNe=["button","div","span","img","video","audio"],we=mNe.reduce((t,e)=>{let r=er.forwardRef((n,i)=>{let{asChild:s,...a}=n;return er.createElement(s?Bee:e,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});ree=hg.state.record,gNe=Object.keys(ree).reduce((t,e)=>({...t,[e](){return ree[e]}}),{});nee=gp.state.record,jee=Object.keys(nee).reduce((t,e)=>({...t,[e](){return nee[e]}}),{})});var Ase={};ln(Ase,{SRTParser:()=>tA,default:()=>I7e});function I7e(){return new tA}var T7e,E7e,tA,Pse=yt(()=>{v1();T7e=/,/g,E7e="-->",tA=class extends Dg{parse(e,r){if(e==="")this.a&&(this.j.push(this.a),this.f.onCue?.(this.a),this.a=null),this.c=Og.None;else if(this.c===Og.Cue)this.a.text+=(this.a.text?`
`:"")+e;else if(e.includes(E7e)){let n=this.o(e,r);n&&(this.a=new Ku(n[0],n[1],n[2].join(" ")),this.a.id=this.l,this.c=Og.Cue)}this.l=e}o(e,r){return super.o(e.replace(T7e,"."),r)}}});var t8={};ln(t8,{ParseErrorBuilder:()=>A7e});var A7e,r8=yt(()=>{v1();A7e={p(){return new Ns({code:go.BadSignature,reason:"missing WEBVTT file header",line:1})},q(t,e){return new Ns({code:go.BadTimestamp,reason:`cue start timestamp \`${t}\` is invalid on line ${e}`,line:e})},r(t,e){return new Ns({code:go.BadTimestamp,reason:`cue end timestamp \`${t}\` is invalid on line ${e}`,line:e})},s(t,e,r){return new Ns({code:go.BadTimestamp,reason:`cue end timestamp \`${e}\` is greater than start \`${t}\` on line ${r}`,line:r})},w(t,e,r){return new Ns({code:go.BadSettingValue,reason:`invalid value for cue setting \`${t}\` on line ${r} (value: ${e})`,line:r})},v(t,e,r){return new Ns({code:go.UnknownSetting,reason:`unknown cue setting \`${t}\` on line ${r} (value: ${e})`,line:r})},u(t,e,r){return new Ns({code:go.BadSettingValue,reason:`invalid value for region setting \`${t}\` on line ${r} (value: ${e})`,line:r})},t(t,e,r){return new Ns({code:go.UnknownSetting,reason:`unknown region setting \`${t}\` on line ${r} (value: ${e})`,line:r})},T(t,e){return new Ns({code:go.BadFormat,reason:`format missing for \`${t}\` block on line ${e}`,line:e})}}});var Dse={};ln(Dse,{SSAParser:()=>iA,default:()=>P7e});function i8(t){let e=parseInt(t.replace("&H",""),16);if(e>=0){let n=(e>>24&255^255)/255,i=e>>16&255,s=e>>8&255;return"rgba("+[e&255,s,i,n].join(",")+")"}return null}function s8(t,e,r){let n=Math.ceil(2*Math.PI*t),i="";for(let s=0;s<n;s++){let a=2*Math.PI*s/n;i+=t*Math.cos(a)+"px "+e*Math.sin(a)+"px 0 "+r+(s==n-1?"":",")}return i}function P7e(){return new iA}var rA,Rse,Lse,nA,Mse,_se,Ose,n8,iA,Nse=yt(()=>{v1();rA=/^Format:[\s\t]*/,Rse=/^Style:[\s\t]*/,Lse=/^Dialogue:[\s\t]*/,nA=/[\s\t]*,[\s\t]*/,Mse=/\{[^}]+\}/g,_se=/\\N/g,Ose=/^\[(.*)[\s\t]?Styles\]$/,n8=/^\[(.*)[\s\t]?Events\]$/,iA=class{f;O=0;a=null;j=[];k=[];N=null;d;P={};async init(e){this.f=e,e.errors&&(this.d=(await Promise.resolve().then(()=>(r8(),t8))).ParseErrorBuilder)}parse(e,r){if(this.O)switch(this.O){case 1:if(e==="")this.O=0;else if(Rse.test(e))if(this.N){let n=e.replace(Rse,"").split(nA);this.S(n)}else this.e(this.d?.T("Style",r));else rA.test(e)?this.N=e.replace(rA,"").split(nA):n8.test(e)&&(this.N=null,this.O=2);break;case 2:if(e==="")this.Q();else if(Lse.test(e))if(this.Q(),this.N){let n=e.replace(Lse,"").split(nA),i=this.U(n,r);i&&(this.a=i)}else this.e(this.d?.T("Dialogue",r));else this.a?this.a.text+=`
`+e.replace(Mse,"").replace(_se,`
`):rA.test(e)?this.N=e.replace(rA,"").split(nA):Ose.test(e)?(this.N=null,this.O=1):n8.test(e)&&(this.N=null)}else e===""||(Ose.test(e)?(this.N=null,this.O=1):n8.test(e)&&(this.N=null,this.O=2))}done(){return{metadata:{},cues:this.j,regions:[],errors:this.k}}Q(){this.a&&(this.j.push(this.a),this.f.onCue?.(this.a),this.a=null)}S(e){let r="Default",n={},i,s="center",a="bottom",o,l=1.2,c,u,d=3,f=[];for(let p=0;p<this.N.length;p++){let h=this.N[p],m=e[p];switch(h){case"Name":r=m;break;case"Fontname":n["font-family"]=m;break;case"Fontsize":n["font-size"]=`calc(${m} / var(--overlay-height))`;break;case"PrimaryColour":let v=i8(m);v&&(n["--cue-color"]=v);break;case"BorderStyle":d=parseInt(m,10);break;case"BackColour":u=i8(m);break;case"OutlineColour":let b=i8(m);b&&(c=b);break;case"Bold":parseInt(m)&&(n["font-weight"]="bold");break;case"Italic":parseInt(m)&&(n["font-style"]="italic");break;case"Underline":parseInt(m)&&(n["text-decoration"]="underline");break;case"StrikeOut":parseInt(m)&&(n["text-decoration"]="line-through");break;case"Spacing":n["letter-spacing"]=m+"px";break;case"AlphaLevel":n.opacity=parseFloat(m);break;case"ScaleX":f.push(`scaleX(${parseFloat(m)/100})`);break;case"ScaleY":f.push(`scaleY(${parseFloat(m)/100})`);break;case"Angle":f.push(`rotate(${m}deg)`);break;case"Shadow":l=parseInt(m,10)*1.2;break;case"MarginL":n["--cue-width"]="auto",n["--cue-left"]=parseFloat(m)+"px";break;case"MarginR":n["--cue-width"]="auto",n["--cue-right"]=parseFloat(m)+"px";break;case"MarginV":o=parseFloat(m);break;case"Outline":i=parseInt(m,10);break;case"Alignment":let y=parseInt(m,10);switch(y>=4&&(a=y>=7?"top":"center"),y%3){case 1:s="start";break;case 2:s="center";break;case 3:s="end";break}}}if(n.R=a,n["--cue-white-space"]="normal",n["--cue-line-height"]="normal",n["--cue-text-align"]=s,a==="center"?(n["--cue-top"]="50%",f.push("translateY(-50%)")):n[`--cue-${a}`]=(o||0)+"px",d===1&&(n["--cue-padding-y"]="0"),(d===1||u)&&(n["--cue-bg-color"]=d===1?"none":u),d===3&&c&&(n["--cue-outline"]=`${i}px solid ${c}`),d===1&&typeof i=="number"){let p=u??"#000";n["--cue-text-shadow"]=[c&&s8(i*1.2,l*1.2,c),c?s8(i*(i/2),l*(i/2),p):s8(i,l,p)].filter(Boolean).join(", ")}f.length&&(n["--cue-transform"]=f.join(" ")),this.P[r]=n}U(e,r){let n=this.V(e),i=this.o(n.Start,n.End,r);if(!i)return;let s=new Ku(i[0],i[1],""),a={...this.P[n.Style]||{}},o=n.Name?`<v ${n.Name}>`:"",l=a.R,c=n.MarginL&&parseFloat(n.MarginL),u=n.MarginR&&parseFloat(n.MarginR),d=n.MarginV&&parseFloat(n.MarginV);return c&&(a["--cue-width"]="auto",a["--cue-left"]=c+"px"),u&&(a["--cue-width"]="auto",a["--cue-right"]=u+"px"),d&&l!=="center"&&(a[`--cue-${l}`]=d+"px"),s.text=o+e.slice(this.N.length-1).join(", ").replace(Mse,"").replace(_se,`
`),delete a.R,Object.keys(a).length&&(s.style=a),s}V(e){let r={};for(let n=0;n<this.N.length;n++)r[this.N[n]]=e[n];return r}o(e,r,n){let i=Yu(e),s=Yu(r);if(i!==null&&s!==null&&s>i)return[i,s];i===null&&this.e(this.d?.q(e,n)),s===null&&this.e(this.d?.r(r,n)),i!=null&&s!==null&&s>i&&this.e(this.d?.s(i,s,n))}e(e){if(e){if(this.k.push(e),this.f.strict)throw this.f.cancel(),e;this.f.onError?.(e)}}}});async function o8(t,e){let r=new ReadableStream({start(n){let i=t.split(R7e);for(let s of i)n.enqueue(s);n.close()}});return jse(r,e)}async function jse(t,e){let r=e?.type??"vtt",n;if(typeof r=="string")switch(r){case"srt":n=(await Promise.resolve().then(()=>(Pse(),Ase))).default;break;case"ssa":case"ass":n=(await Promise.resolve().then(()=>(Nse(),Dse))).default;break;default:n=(await Promise.resolve().then(function(){return K7e})).default}else n=r;let i,s=t.getReader(),a=n(),o=!!e?.strict||!!e?.errors;await a.init({strict:!1,...e,errors:o,type:r,cancel(){s.cancel(),i=a.done(!0)}});let l=1;for(;;){let{value:c,done:u}=await s.read();if(u){a.parse("",l),i=a.done(!1);break}a.parse(c,l),l++}return i}function _7e(t){let e=parseInt(t,10);return Number.isNaN(e)?null:e}function x1(t){let e=parseInt(t.replace(M7e,""),10);return!Number.isNaN(e)&&e>=0&&e<=100?e:null}function Bse(t){if(!t.includes(Fse))return null;let[e,r]=t.split(Fse).map(x1);return e!==null&&r!==null?[e,r]:null}function O7e(t){let e=parseFloat(t);return Number.isNaN(e)?null:e}function Yu(t){let e=t.match(G7e);if(!e)return null;let r=e[1]?parseInt(e[1],10):0,n=parseInt(e[2],10),i=parseInt(e[3],10),s=e[4]?parseInt(e[4].padEnd(3,"0"),10):0,a=r*3600+n*60+i+s/1e3;return r<0||n<0||i<0||s<0||n>59||i>59?null:a}function W7e(){return new Dg}function l8(t){let e="",r=1,n=[],i=[],s;for(let c=0;c<t.text.length;c++){let u=t.text[c];switch(r){case 1:u==="<"?(l(),r=2):e+=u;break;case 2:switch(u){case`
`:case" ":case" ":a(),r=4;break;case".":a(),r=3;break;case"/":r=5;break;case">":a(),r=1;break;default:!e&&Y7e.test(u)&&(r=6),e+=u;break}break;case 3:switch(u){case" ":case" ":case`
`:o(),s&&s.class?.trim(),r=4;break;case".":o();break;case">":o(),s&&s.class?.trim(),r=1;break;default:e+=u}break;case 4:u===">"?(e=e.replace(X7e," "),s?.type==="v"?s.voice=a8(e):s?.type==="lang"&&(s.lang=a8(e)),e="",r=1):e+=u;break;case 5:u===">"&&(e="",s=i.pop(),r=1);break;case 6:if(u===">"){let d=Yu(e);d!==null&&d>=t.startTime&&d<=t.endTime&&(e="timestamp",a(),s.time=d),e="",r=1}else e+=u;break}}function a(){if(eBe.has(e)){let c=s;s=tBe(e),c?(i[i.length-1]!==c&&i.push(c),c.children.push(s)):n.push(s)}e="",r=1}function o(){if(s&&e){let c=e.replace("bg_","");J7e.has(c)?s[e.startsWith("bg_")?"bgColor":"color"]=c:s.class=s.class?s.class+" "+e:e}e=""}function l(){if(!e)return;let c={type:"text",data:a8(e)};s?s.children.push(c):n.push(c),e=""}return r===1&&l(),n}function tBe(t){return{tagName:$se[t],type:t,children:[]}}function a8(t){return t.replace(Z7e,e=>Q7e[e]||"'")}var go,Ns,R7e,L7e,Ku,sA,Fse,M7e,D7e,Vse,N7e,Ng,F7e,B7e,V7e,j7e,b1,$7e,U7e,z7e,q7e,H7e,G7e,Og,Dg,K7e,Y7e,X7e,$se,Q7e,Z7e,J7e,eBe,kkt,Skt,v1=yt(()=>{go={LoadFail:0,BadSignature:1,BadTimestamp:2,BadSettingValue:3,BadFormat:4,UnknownSetting:5},Ns=class extends Error{code;line;constructor(e){super(e.reason),this.code=e.code,this.line=e.line}},R7e=/\r?\n|\r/gm;L7e=window.VTTCue,Ku=class extends L7e{region=null;vertical="";snapToLines=!0;line="auto";lineAlign="start";position="auto";positionAlign="auto";size=100;align="center";style},sA=class{id="";width=100;lines=3;regionAnchorX=0;regionAnchorY=100;viewportAnchorX=0;viewportAnchorY=100;scroll=""},Fse=",",M7e="%";D7e="WEBVTT",Vse=",",N7e="%",Ng=/[:=]/,F7e=/^[\s\t]*(region|vertical|line|position|size|align)[:=]/,B7e="NOTE",V7e="REGION",j7e=/^REGION:?[\s\t]+/,b1=/[\s\t]+/,$7e="-->",U7e=/[\s\t]*-->[\s\t]+/,z7e=/start|center|end|left|right/,q7e=/start|center|end/,H7e=/line-(?:left|right)|center|auto/,G7e=/^(?:(\d{1,2}):)?(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/,Og=(t=>(t[t.None=0]="None",t[t.Header=1]="Header",t[t.Cue=2]="Cue",t[t.Region=3]="Region",t[t.Note=4]="Note",t))(Og||{}),Dg=class{f;c=0;g={};h={};j=[];a=null;b=null;k=[];d;l="";async init(e){this.f=e,e.strict&&(this.c=1),e.errors&&(this.d=(await Promise.resolve().then(()=>(r8(),t8))).ParseErrorBuilder)}parse(e,r){if(e==="")this.a?(this.j.push(this.a),this.f.onCue?.(this.a),this.a=null):this.b?(this.h[this.b.id]=this.b,this.f.onRegion?.(this.b),this.b=null):this.c===1&&(this.i(e,r),this.f.onHeaderMetadata?.(this.g)),this.c=0;else if(this.c)switch(this.c){case 1:this.i(e,r);break;case 2:if(this.a){let n=this.a.text.length>0;!n&&F7e.test(e)?this.m(e.split(b1),r):this.a.text+=(n?`
`:"")+e}break;case 3:this.n(e.split(b1),r);break}else if(e.startsWith(B7e))this.c=4;else if(e.startsWith(V7e))this.c=3,this.b=new sA,this.n(e.replace(j7e,"").split(b1),r);else if(e.includes($7e)){let n=this.o(e,r);n&&(this.a=new Ku(n[0],n[1],""),this.a.id=this.l,this.m(n[2],r)),this.c=2}else r===1&&this.i(e,r);this.l=e}done(){return{metadata:this.g,cues:this.j,regions:Object.values(this.h),errors:this.k}}i(e,r){if(r>1){if(Ng.test(e)){let[n,i]=e.split(Ng);n&&(this.g[n]=(i||"").replace(b1,""))}}else e.startsWith(D7e)?this.c=1:this.e(this.d?.p())}o(e,r){let[n,i=""]=e.split(U7e),[s,...a]=i.split(b1),o=Yu(n),l=Yu(s);if(o!==null&&l!==null&&l>o)return[o,l,a];o===null&&this.e(this.d?.q(n,r)),l===null&&this.e(this.d?.r(s,r)),o!=null&&l!==null&&l>o&&this.e(this.d?.s(o,l,r))}n(e,r){let n;for(let i=0;i<e.length;i++)if(Ng.test(e[i])){n=!1;let[s,a]=e[i].split(Ng);switch(s){case"id":this.b.id=a;break;case"width":let o=x1(a);o!==null?this.b.width=o:n=!0;break;case"lines":let l=_7e(a);l!==null?this.b.lines=l:n=!0;break;case"regionanchor":let c=Bse(a);c!==null?(this.b.regionAnchorX=c[0],this.b.regionAnchorY=c[1]):n=!0;break;case"viewportanchor":let u=Bse(a);u!==null?(this.b.viewportAnchorX=u[0],this.b.viewportAnchorY=u[1]):n=!0;break;case"scroll":a==="up"?this.b.scroll="up":n=!0;break;default:this.e(this.d?.t(s,a,r))}n&&this.e(this.d?.u(s,a,r))}}m(e,r){let n;for(let i=0;i<e.length;i++)if(n=!1,Ng.test(e[i])){let[s,a]=e[i].split(Ng);switch(s){case"region":let o=this.h[a];o&&(this.a.region=o);break;case"vertical":a==="lr"||a==="rl"?(this.a.vertical=a,this.a.region=null):n=!0;break;case"line":let[l,c]=a.split(Vse);if(l.includes(N7e)){let h=x1(l);h!==null?(this.a.line=h,this.a.snapToLines=!1):n=!0}else{let h=O7e(l);h!==null?this.a.line=h:n=!0}q7e.test(c)?this.a.lineAlign=c:c&&(n=!0),this.a.line!=="auto"&&(this.a.region=null);break;case"position":let[u,d]=a.split(Vse),f=x1(u);f!==null?this.a.position=f:n=!0,d&&H7e.test(d)?this.a.positionAlign=d:d&&(n=!0);break;case"size":let p=x1(a);p!==null?(this.a.size=p,p<100&&(this.a.region=null)):n=!0;break;case"align":z7e.test(a)?this.a.align=a:n=!0;break;default:this.e(this.d?.v(s,a,r))}n&&this.e(this.d?.w(s,a,r))}}e(e){if(e){if(this.k.push(e),this.f.strict)throw this.f.cancel(),e;this.f.onError?.(e)}}};K7e=Object.freeze({__proto__:null,VTTBlock:Og,VTTParser:Dg,default:W7e,parseVTTTimestamp:Yu}),Y7e=/[0-9]/,X7e=/[\s\t]+/,$se={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span",timestamp:"span"},Q7e={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&nbsp;":"\xA0","&lrm;":"\u200E","&rlm;":"\u200F"},Z7e=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,J7e=new Set(["white","lime","cyan","red","yellow","magenta","blue","black"]),eBe=new Set(Object.keys($se));kkt=Symbol(0),Skt=Symbol(0)});var Oue=L(cr=>{"use strict";function K9(t,e){var r=t.length;t.push(e);e:for(;0<r;){var n=r-1>>>1,i=t[n];if(0<vP(i,e))t[n]=e,t[r]=i,r=n;else break e}}function xl(t){return t.length===0?null:t[0]}function xP(t){if(t.length===0)return null;var e=t[0],r=t.pop();if(r!==e){t[0]=r;e:for(var n=0,i=t.length,s=i>>>1;n<s;){var a=2*(n+1)-1,o=t[a],l=a+1,c=t[l];if(0>vP(o,r))l<i&&0>vP(c,o)?(t[n]=c,t[l]=r,n=l):(t[n]=o,t[a]=r,n=a);else if(l<i&&0>vP(c,r))t[n]=c,t[l]=r,n=l;else break e}}return e}function vP(t,e){var r=t.sortIndex-e.sortIndex;return r!==0?r:t.id-e.id}cr.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Tue=performance,cr.unstable_now=function(){return Tue.now()}):(H9=Date,Eue=H9.now(),cr.unstable_now=function(){return H9.now()-Eue});var Tue,H9,Eue,Pc=[],hd=[],eHe=1,Aa=null,ri=3,Y9=!1,Y1=!1,X1=!1,X9=!1,Pue=typeof setTimeout=="function"?setTimeout:null,Rue=typeof clearTimeout=="function"?clearTimeout:null,Iue=typeof setImmediate<"u"?setImmediate:null;function bP(t){for(var e=xl(hd);e!==null;){if(e.callback===null)xP(hd);else if(e.startTime<=t)xP(hd),e.sortIndex=e.expirationTime,K9(Pc,e);else break;e=xl(hd)}}function Q9(t){if(X1=!1,bP(t),!Y1)if(xl(Pc)!==null)Y1=!0,dy||(dy=!0,uy());else{var e=xl(hd);e!==null&&Z9(Q9,e.startTime-t)}}var dy=!1,Q1=-1,Lue=5,Mue=-1;function _ue(){return X9?!0:!(cr.unstable_now()-Mue<Lue)}function G9(){if(X9=!1,dy){var t=cr.unstable_now();Mue=t;var e=!0;try{e:{Y1=!1,X1&&(X1=!1,Rue(Q1),Q1=-1),Y9=!0;var r=ri;try{t:{for(bP(t),Aa=xl(Pc);Aa!==null&&!(Aa.expirationTime>t&&_ue());){var n=Aa.callback;if(typeof n=="function"){Aa.callback=null,ri=Aa.priorityLevel;var i=n(Aa.expirationTime<=t);if(t=cr.unstable_now(),typeof i=="function"){Aa.callback=i,bP(t),e=!0;break t}Aa===xl(Pc)&&xP(Pc),bP(t)}else xP(Pc);Aa=xl(Pc)}if(Aa!==null)e=!0;else{var s=xl(hd);s!==null&&Z9(Q9,s.startTime-t),e=!1}}break e}finally{Aa=null,ri=r,Y9=!1}e=void 0}}finally{e?uy():dy=!1}}}var uy;typeof Iue=="function"?uy=function(){Iue(G9)}:typeof MessageChannel<"u"?(W9=new MessageChannel,Aue=W9.port2,W9.port1.onmessage=G9,uy=function(){Aue.postMessage(null)}):uy=function(){Pue(G9,0)};var W9,Aue;function Z9(t,e){Q1=Pue(function(){t(cr.unstable_now())},e)}cr.unstable_IdlePriority=5;cr.unstable_ImmediatePriority=1;cr.unstable_LowPriority=4;cr.unstable_NormalPriority=3;cr.unstable_Profiling=null;cr.unstable_UserBlockingPriority=2;cr.unstable_cancelCallback=function(t){t.callback=null};cr.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Lue=0<t?Math.floor(1e3/t):5};cr.unstable_getCurrentPriorityLevel=function(){return ri};cr.unstable_next=function(t){switch(ri){case 1:case 2:case 3:var e=3;break;default:e=ri}var r=ri;ri=e;try{return t()}finally{ri=r}};cr.unstable_requestPaint=function(){X9=!0};cr.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var r=ri;ri=t;try{return e()}finally{ri=r}};cr.unstable_scheduleCallback=function(t,e,r){var n=cr.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?n+r:n):r=n,t){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=r+i,t={id:eHe++,callback:e,priorityLevel:t,startTime:r,expirationTime:i,sortIndex:-1},r>n?(t.sortIndex=r,K9(hd,t),xl(Pc)===null&&t===xl(hd)&&(X1?(Rue(Q1),Q1=-1):X1=!0,Z9(Q9,r-n))):(t.sortIndex=i,K9(Pc,t),Y1||Y9||(Y1=!0,dy||(dy=!0,uy()))),t};cr.unstable_shouldYield=_ue;cr.unstable_wrapCallback=function(t){var e=ri;return function(){var r=ri;ri=e;try{return t.apply(this,arguments)}finally{ri=r}}}});var Nue=L((AEt,Due)=>{"use strict";Due.exports=Oue()});var Bhe=L(UR=>{"use strict";var sn=Nue(),ife=Te(),tHe=Af();function X(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function sfe(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Bk(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function afe(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Fue(t){if(Bk(t)!==t)throw Error(X(188))}function rHe(t){var e=t.alternate;if(!e){if(e=Bk(t),e===null)throw Error(X(188));return e!==t?null:t}for(var r=t,n=e;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return Fue(i),t;if(s===n)return Fue(i),e;s=s.sibling}throw Error(X(188))}if(r.return!==n.return)r=i,n=s;else{for(var a=!1,o=i.child;o;){if(o===r){a=!0,r=i,n=s;break}if(o===n){a=!0,n=i,r=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===r){a=!0,r=s,n=i;break}if(o===n){a=!0,n=s,r=i;break}o=o.sibling}if(!a)throw Error(X(189))}}if(r.alternate!==n)throw Error(X(190))}if(r.tag!==3)throw Error(X(188));return r.stateNode.current===r?t:e}function ofe(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=ofe(t),e!==null)return e;t=t.sibling}return null}var rr=Object.assign,nHe=Symbol.for("react.element"),wP=Symbol.for("react.transitional.element"),ak=Symbol.for("react.portal"),vy=Symbol.for("react.fragment"),lfe=Symbol.for("react.strict_mode"),R7=Symbol.for("react.profiler"),iHe=Symbol.for("react.provider"),cfe=Symbol.for("react.consumer"),Oc=Symbol.for("react.context"),TB=Symbol.for("react.forward_ref"),L7=Symbol.for("react.suspense"),M7=Symbol.for("react.suspense_list"),EB=Symbol.for("react.memo"),yd=Symbol.for("react.lazy");Symbol.for("react.scope");var _7=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var sHe=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var Bue=Symbol.iterator;function Z1(t){return t===null||typeof t!="object"?null:(t=Bue&&t[Bue]||t["@@iterator"],typeof t=="function"?t:null)}var aHe=Symbol.for("react.client.reference");function O7(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===aHe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case vy:return"Fragment";case R7:return"Profiler";case lfe:return"StrictMode";case L7:return"Suspense";case M7:return"SuspenseList";case _7:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case ak:return"Portal";case Oc:return(t.displayName||"Context")+".Provider";case cfe:return(t._context.displayName||"Context")+".Consumer";case TB:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case EB:return e=t.displayName||null,e!==null?e:O7(t.type)||"Memo";case yd:e=t._payload,t=t._init;try{return O7(t(e))}catch{}}return null}var ok=Array.isArray,De=ife.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xt=tHe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ah={pending:!1,data:null,method:null,action:null},D7=[],by=-1;function Il(t){return{current:t}}function wn(t){0>by||(t.current=D7[by],D7[by]=null,by--)}function dr(t,e){by++,D7[by]=t.current,t.current=e}var Cl=Il(null),Ck=Il(null),Id=Il(null),QP=Il(null);function ZP(t,e){switch(dr(Id,e),dr(Ck,t),dr(Cl,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?qde(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=qde(e),t=Ehe(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}wn(Cl),dr(Cl,t)}function By(){wn(Cl),wn(Ck),wn(Id)}function N7(t){t.memoizedState!==null&&dr(QP,t);var e=Cl.current,r=Ehe(e,t.type);e!==r&&(dr(Ck,t),dr(Cl,r))}function JP(t){Ck.current===t&&(wn(Cl),wn(Ck)),QP.current===t&&(wn(QP),Ok._currentValue=ah)}var F7=Object.prototype.hasOwnProperty,IB=sn.unstable_scheduleCallback,J9=sn.unstable_cancelCallback,oHe=sn.unstable_shouldYield,lHe=sn.unstable_requestPaint,Tl=sn.unstable_now,cHe=sn.unstable_getCurrentPriorityLevel,ufe=sn.unstable_ImmediatePriority,dfe=sn.unstable_UserBlockingPriority,eR=sn.unstable_NormalPriority,uHe=sn.unstable_LowPriority,ffe=sn.unstable_IdlePriority,dHe=sn.log,fHe=sn.unstable_setDisableYieldValue,Vk=null,Hs=null;function Sd(t){if(typeof dHe=="function"&&fHe(t),Hs&&typeof Hs.setStrictMode=="function")try{Hs.setStrictMode(Vk,t)}catch{}}var Gs=Math.clz32?Math.clz32:mHe,pHe=Math.log,hHe=Math.LN2;function mHe(t){return t>>>=0,t===0?32:31-(pHe(t)/hHe|0)|0}var kP=256,SP=4194304;function nh(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function IR(t,e,r){var n=t.pendingLanes;if(n===0)return 0;var i=0,s=t.suspendedLanes,a=t.pingedLanes;t=t.warmLanes;var o=n&134217727;return o!==0?(n=o&~s,n!==0?i=nh(n):(a&=o,a!==0?i=nh(a):r||(r=o&~t,r!==0&&(i=nh(r))))):(o=n&~s,o!==0?i=nh(o):a!==0?i=nh(a):r||(r=n&~t,r!==0&&(i=nh(r)))),i===0?0:e!==0&&e!==i&&(e&s)===0&&(s=i&-i,r=e&-e,s>=r||s===32&&(r&4194048)!==0)?e:i}function jk(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function gHe(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pfe(){var t=kP;return kP<<=1,(kP&4194048)===0&&(kP=256),t}function hfe(){var t=SP;return SP<<=1,(SP&62914560)===0&&(SP=4194304),t}function e7(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function $k(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function yHe(t,e,r,n,i,s){var a=t.pendingLanes;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=r,t.entangledLanes&=r,t.errorRecoveryDisabledLanes&=r,t.shellSuspendCounter=0;var o=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(r=a&~r;0<r;){var u=31-Gs(r),d=1<<u;o[u]=0,l[u]=-1;var f=c[u];if(f!==null)for(c[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}r&=~d}n!==0&&mfe(t,n,0),s!==0&&i===0&&t.tag!==0&&(t.suspendedLanes|=s&~(a&~e))}function mfe(t,e,r){t.pendingLanes|=e,t.suspendedLanes&=~e;var n=31-Gs(e);t.entangledLanes|=e,t.entanglements[n]=t.entanglements[n]|1073741824|r&4194090}function gfe(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Gs(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}function AB(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function PB(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function yfe(){var t=xt.p;return t!==0?t:(t=window.event,t===void 0?32:Nhe(t.type))}function vHe(t,e){var r=xt.p;try{return xt.p=t,e()}finally{xt.p=r}}var Bd=Math.random().toString(36).slice(2),ni="__reactFiber$"+Bd,is="__reactProps$"+Bd,Yy="__reactContainer$"+Bd,B7="__reactEvents$"+Bd,bHe="__reactListeners$"+Bd,xHe="__reactHandles$"+Bd,Vue="__reactResources$"+Bd,Uk="__reactMarker$"+Bd;function RB(t){delete t[ni],delete t[is],delete t[B7],delete t[bHe],delete t[xHe]}function xy(t){var e=t[ni];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Yy]||r[ni]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=Wde(t);t!==null;){if(r=t[ni])return r;t=Wde(t)}return e}t=r,r=t.parentNode}return null}function Xy(t){if(t=t[ni]||t[Yy]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function lk(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(X(33))}function Ry(t){var e=t[Vue];return e||(e=t[Vue]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function bn(t){t[Uk]=!0}var vfe=new Set,bfe={};function yh(t,e){Vy(t,e),Vy(t+"Capture",e)}function Vy(t,e){for(bfe[t]=e,t=0;t<e.length;t++)vfe.add(e[t])}var wHe=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),jue={},$ue={};function kHe(t){return F7.call($ue,t)?!0:F7.call(jue,t)?!1:wHe.test(t)?$ue[t]=!0:(jue[t]=!0,!1)}function BP(t,e,r){if(kHe(e))if(r===null)t.removeAttribute(e);else{switch(typeof r){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var n=e.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+r)}}function CP(t,e,r){if(r===null)t.removeAttribute(e);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+r)}}function Rc(t,e,r,n){if(n===null)t.removeAttribute(r);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttributeNS(e,r,""+n)}}var t7,Uue;function my(t){if(t7===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);t7=e&&e[1]||"",Uue=-1<r.stack.indexOf(`
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
`+t7+t+Uue}var r7=!1;function n7(t,e){if(!t||r7)return"";r7=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(e){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(p){var f=p}Reflect.construct(t,[],d)}else{try{d.call()}catch(p){f=p}t.call(d.prototype)}}else{try{throw Error()}catch(p){f=p}(d=t())&&typeof d.catch=="function"&&d.catch(function(){})}}catch(p){if(p&&f&&typeof p.stack=="string")return[p.stack,f.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=n.DetermineComponentFrameRoot(),a=s[0],o=s[1];if(a&&o){var l=a.split(`
`),c=o.split(`
`);for(i=n=0;n<l.length&&!l[n].includes("DetermineComponentFrameRoot");)n++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(n===l.length||i===c.length)for(n=l.length-1,i=c.length-1;1<=n&&0<=i&&l[n]!==c[i];)i--;for(;1<=n&&0<=i;n--,i--)if(l[n]!==c[i]){if(n!==1||i!==1)do if(n--,i--,0>i||l[n]!==c[i]){var u=`
`+l[n].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=n&&0<=i);break}}}finally{r7=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?my(r):""}function SHe(t){switch(t.tag){case 26:case 27:case 5:return my(t.type);case 16:return my("Lazy");case 13:return my("Suspense");case 19:return my("SuspenseList");case 0:case 15:return n7(t.type,!1);case 11:return n7(t.type.render,!1);case 1:return n7(t.type,!0);case 31:return my("Activity");default:return""}}function zue(t){try{var e="";do e+=SHe(t),t=t.return;while(t);return e}catch(r){return`
Error generating stack: `+r.message+`
`+r.stack}}function Ra(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function xfe(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function CHe(t){var e=xfe(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function tR(t){t._valueTracker||(t._valueTracker=CHe(t))}function wfe(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=xfe(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function rR(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var THe=/[\n"\\]/g;function _a(t){return t.replace(THe,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function V7(t,e,r,n,i,s,a,o){t.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?t.type=a:t.removeAttribute("type"),e!=null?a==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Ra(e)):t.value!==""+Ra(e)&&(t.value=""+Ra(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?j7(t,a,Ra(e)):r!=null?j7(t,a,Ra(r)):n!=null&&t.removeAttribute("value"),i==null&&s!=null&&(t.defaultChecked=!!s),i!=null&&(t.checked=i&&typeof i!="function"&&typeof i!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+Ra(o):t.removeAttribute("name")}function kfe(t,e,r,n,i,s,a,o){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||r!=null){if(!(s!=="submit"&&s!=="reset"||e!=null))return;r=r!=null?""+Ra(r):"",e=e!=null?""+Ra(e):r,o||e===t.value||(t.value=e),t.defaultValue=e}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=o?t.checked:!!n,t.defaultChecked=!!n,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.name=a)}function j7(t,e,r){e==="number"&&rR(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function Ly(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+Ra(r),e=null,i=0;i<t.length;i++){if(t[i].value===r){t[i].selected=!0,n&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function Sfe(t,e,r){if(e!=null&&(e=""+Ra(e),e!==t.value&&(t.value=e),r==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=r!=null?""+Ra(r):""}function Cfe(t,e,r,n){if(e==null){if(n!=null){if(r!=null)throw Error(X(92));if(ok(n)){if(1<n.length)throw Error(X(93));n=n[0]}r=n}r==null&&(r=""),e=r}r=Ra(e),t.defaultValue=r,n=t.textContent,n===r&&n!==""&&n!==null&&(t.value=n)}function jy(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var EHe=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function que(t,e,r){var n=e.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?n?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":n?t.setProperty(e,r):typeof r!="number"||r===0||EHe.has(e)?e==="float"?t.cssFloat=r:t[e]=(""+r).trim():t[e]=r+"px"}function Tfe(t,e,r){if(e!=null&&typeof e!="object")throw Error(X(62));if(t=t.style,r!=null){for(var n in r)!r.hasOwnProperty(n)||e!=null&&e.hasOwnProperty(n)||(n.indexOf("--")===0?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="");for(var i in e)n=e[i],e.hasOwnProperty(i)&&r[i]!==n&&que(t,i,n)}else for(var s in e)e.hasOwnProperty(s)&&que(t,s,e[s])}function LB(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var IHe=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),AHe=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function VP(t){return AHe.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var $7=null;function MB(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var wy=null,My=null;function Hue(t){var e=Xy(t);if(e&&(t=e.stateNode)){var r=t[is]||null;e:switch(t=e.stateNode,e.type){case"input":if(V7(t,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+_a(""+e)+'"][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=n[is]||null;if(!i)throw Error(X(90));V7(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(e=0;e<r.length;e++)n=r[e],n.form===t.form&&wfe(n)}break e;case"textarea":Sfe(t,r.value,r.defaultValue);break e;case"select":e=r.value,e!=null&&Ly(t,!!r.multiple,e,!1)}}}var i7=!1;function Efe(t,e,r){if(i7)return t(e,r);i7=!0;try{var n=t(e);return n}finally{if(i7=!1,(wy!==null||My!==null)&&(FR(),wy&&(e=wy,t=My,My=wy=null,Hue(e),t)))for(e=0;e<t.length;e++)Hue(t[e])}}function Tk(t,e){var r=t.stateNode;if(r===null)return null;var n=r[is]||null;if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(X(231,e,typeof r));return r}var $c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),U7=!1;if($c)try{fy={},Object.defineProperty(fy,"passive",{get:function(){U7=!0}}),window.addEventListener("test",fy,fy),window.removeEventListener("test",fy,fy)}catch{U7=!1}var fy,Cd=null,_B=null,jP=null;function Ife(){if(jP)return jP;var t,e=_B,r=e.length,n,i="value"in Cd?Cd.value:Cd.textContent,s=i.length;for(t=0;t<r&&e[t]===i[t];t++);var a=r-t;for(n=1;n<=a&&e[r-n]===i[s-n];n++);return jP=i.slice(t,1<n?1-n:void 0)}function $P(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function TP(){return!0}function Gue(){return!1}function ss(t){function e(r,n,i,s,a){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(r=t[o],this[o]=r?r(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?TP:Gue,this.isPropagationStopped=Gue,this}return rr(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=TP)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=TP)},persist:function(){},isPersistent:TP}),e}var vh={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},AR=ss(vh),zk=rr({},vh,{view:0,detail:0}),PHe=ss(zk),s7,a7,J1,PR=rr({},zk,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:OB,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==J1&&(J1&&t.type==="mousemove"?(s7=t.screenX-J1.screenX,a7=t.screenY-J1.screenY):a7=s7=0,J1=t),s7)},movementY:function(t){return"movementY"in t?t.movementY:a7}}),Wue=ss(PR),RHe=rr({},PR,{dataTransfer:0}),LHe=ss(RHe),MHe=rr({},zk,{relatedTarget:0}),o7=ss(MHe),_He=rr({},vh,{animationName:0,elapsedTime:0,pseudoElement:0}),OHe=ss(_He),DHe=rr({},vh,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),NHe=ss(DHe),FHe=rr({},vh,{data:0}),Kue=ss(FHe),BHe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VHe={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},jHe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $He(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=jHe[t])?!!e[t]:!1}function OB(){return $He}var UHe=rr({},zk,{key:function(t){if(t.key){var e=BHe[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=$P(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?VHe[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:OB,charCode:function(t){return t.type==="keypress"?$P(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?$P(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),zHe=ss(UHe),qHe=rr({},PR,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yue=ss(qHe),HHe=rr({},zk,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:OB}),GHe=ss(HHe),WHe=rr({},vh,{propertyName:0,elapsedTime:0,pseudoElement:0}),KHe=ss(WHe),YHe=rr({},PR,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),XHe=ss(YHe),QHe=rr({},vh,{newState:0,oldState:0}),ZHe=ss(QHe),JHe=[9,13,27,32],DB=$c&&"CompositionEvent"in window,uk=null;$c&&"documentMode"in document&&(uk=document.documentMode);var eGe=$c&&"TextEvent"in window&&!uk,Afe=$c&&(!DB||uk&&8<uk&&11>=uk),Xue=" ",Que=!1;function Pfe(t,e){switch(t){case"keyup":return JHe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rfe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ky=!1;function tGe(t,e){switch(t){case"compositionend":return Rfe(e);case"keypress":return e.which!==32?null:(Que=!0,Xue);case"textInput":return t=e.data,t===Xue&&Que?null:t;default:return null}}function rGe(t,e){if(ky)return t==="compositionend"||!DB&&Pfe(t,e)?(t=Ife(),jP=_B=Cd=null,ky=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Afe&&e.locale!=="ko"?null:e.data;default:return null}}var nGe={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Zue(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!nGe[t.type]:e==="textarea"}function Lfe(t,e,r,n){wy?My?My.push(n):My=[n]:wy=n,e=xR(e,"onChange"),0<e.length&&(r=new AR("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var dk=null,Ek=null;function iGe(t){She(t,0)}function RR(t){var e=lk(t);if(wfe(e))return t}function Jue(t,e){if(t==="change")return e}var Mfe=!1;$c&&($c?(IP="oninput"in document,IP||(l7=document.createElement("div"),l7.setAttribute("oninput","return;"),IP=typeof l7.oninput=="function"),EP=IP):EP=!1,Mfe=EP&&(!document.documentMode||9<document.documentMode));var EP,IP,l7;function ede(){dk&&(dk.detachEvent("onpropertychange",_fe),Ek=dk=null)}function _fe(t){if(t.propertyName==="value"&&RR(Ek)){var e=[];Lfe(e,Ek,t,MB(t)),Efe(iGe,e)}}function sGe(t,e,r){t==="focusin"?(ede(),dk=e,Ek=r,dk.attachEvent("onpropertychange",_fe)):t==="focusout"&&ede()}function aGe(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return RR(Ek)}function oGe(t,e){if(t==="click")return RR(e)}function lGe(t,e){if(t==="input"||t==="change")return RR(e)}function cGe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ys=typeof Object.is=="function"?Object.is:cGe;function Ik(t,e){if(Ys(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!F7.call(e,i)||!Ys(t[i],e[i]))return!1}return!0}function tde(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function rde(t,e){var r=tde(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=tde(r)}}function Ofe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ofe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Dfe(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=rR(t.document);e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=rR(t.document)}return e}function NB(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var uGe=$c&&"documentMode"in document&&11>=document.documentMode,Sy=null,z7=null,fk=null,q7=!1;function nde(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;q7||Sy==null||Sy!==rR(n)||(n=Sy,"selectionStart"in n&&NB(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),fk&&Ik(fk,n)||(fk=n,n=xR(z7,"onSelect"),0<n.length&&(e=new AR("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=Sy)))}function rh(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Cy={animationend:rh("Animation","AnimationEnd"),animationiteration:rh("Animation","AnimationIteration"),animationstart:rh("Animation","AnimationStart"),transitionrun:rh("Transition","TransitionRun"),transitionstart:rh("Transition","TransitionStart"),transitioncancel:rh("Transition","TransitionCancel"),transitionend:rh("Transition","TransitionEnd")},c7={},Nfe={};$c&&(Nfe=document.createElement("div").style,"AnimationEvent"in window||(delete Cy.animationend.animation,delete Cy.animationiteration.animation,delete Cy.animationstart.animation),"TransitionEvent"in window||delete Cy.transitionend.transition);function bh(t){if(c7[t])return c7[t];if(!Cy[t])return t;var e=Cy[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in Nfe)return c7[t]=e[r];return t}var Ffe=bh("animationend"),Bfe=bh("animationiteration"),Vfe=bh("animationstart"),dGe=bh("transitionrun"),fGe=bh("transitionstart"),pGe=bh("transitioncancel"),jfe=bh("transitionend"),$fe=new Map,H7="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");H7.push("scrollEnd");function Eo(t,e){$fe.set(t,e),yh(e,[t])}var ide=new WeakMap;function Oa(t,e){if(typeof t=="object"&&t!==null){var r=ide.get(t);return r!==void 0?r:(e={value:t,source:e,stack:zue(e)},ide.set(t,e),e)}return{value:t,source:e,stack:zue(e)}}var Pa=[],Ty=0,FB=0;function LR(){for(var t=Ty,e=FB=Ty=0;e<t;){var r=Pa[e];Pa[e++]=null;var n=Pa[e];Pa[e++]=null;var i=Pa[e];Pa[e++]=null;var s=Pa[e];if(Pa[e++]=null,n!==null&&i!==null){var a=n.pending;a===null?i.next=i:(i.next=a.next,a.next=i),n.pending=i}s!==0&&Ufe(r,i,s)}}function MR(t,e,r,n){Pa[Ty++]=t,Pa[Ty++]=e,Pa[Ty++]=r,Pa[Ty++]=n,FB|=n,t.lanes|=n,t=t.alternate,t!==null&&(t.lanes|=n)}function BB(t,e,r,n){return MR(t,e,r,n),nR(t)}function Qy(t,e){return MR(t,null,null,e),nR(t)}function Ufe(t,e,r){t.lanes|=r;var n=t.alternate;n!==null&&(n.lanes|=r);for(var i=!1,s=t.return;s!==null;)s.childLanes|=r,n=s.alternate,n!==null&&(n.childLanes|=r),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(i=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,i&&e!==null&&(i=31-Gs(r),t=s.hiddenUpdates,n=t[i],n===null?t[i]=[e]:n.push(e),e.lane=r|536870912),s):null}function nR(t){if(50<kk)throw kk=0,fB=null,Error(X(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Ey={};function hGe(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qs(t,e,r,n){return new hGe(t,e,r,n)}function VB(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Vc(t,e){var r=t.alternate;return r===null?(r=qs(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&65011712,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r.refCleanup=t.refCleanup,r}function zfe(t,e){t.flags&=65011714;var r=t.alternate;return r===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,t.type=r.type,e=r.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function UP(t,e,r,n,i,s){var a=0;if(n=t,typeof t=="function")VB(t)&&(a=1);else if(typeof t=="string")a=hWe(t,r,Cl.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case _7:return t=qs(31,r,e,i),t.elementType=_7,t.lanes=s,t;case vy:return oh(r.children,i,s,e);case lfe:a=8,i|=24;break;case R7:return t=qs(12,r,e,i|2),t.elementType=R7,t.lanes=s,t;case L7:return t=qs(13,r,e,i),t.elementType=L7,t.lanes=s,t;case M7:return t=qs(19,r,e,i),t.elementType=M7,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case iHe:case Oc:a=10;break e;case cfe:a=9;break e;case TB:a=11;break e;case EB:a=14;break e;case yd:a=16,n=null;break e}a=29,r=Error(X(130,t===null?"null":typeof t,"")),n=null}return e=qs(a,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function oh(t,e,r,n){return t=qs(7,t,n,e),t.lanes=r,t}function u7(t,e,r){return t=qs(6,t,null,e),t.lanes=r,t}function d7(t,e,r){return e=qs(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var Iy=[],Ay=0,iR=null,sR=0,La=[],Ma=0,lh=null,Dc=1,Nc="";function ih(t,e){Iy[Ay++]=sR,Iy[Ay++]=iR,iR=t,sR=e}function qfe(t,e,r){La[Ma++]=Dc,La[Ma++]=Nc,La[Ma++]=lh,lh=t;var n=Dc;t=Nc;var i=32-Gs(n)-1;n&=~(1<<i),r+=1;var s=32-Gs(e)+i;if(30<s){var a=i-i%5;s=(n&(1<<a)-1).toString(32),n>>=a,i-=a,Dc=1<<32-Gs(e)+i|r<<i|n,Nc=s+t}else Dc=1<<s|r<<i|n,Nc=t}function jB(t){t.return!==null&&(ih(t,1),qfe(t,1,0))}function $B(t){for(;t===iR;)iR=Iy[--Ay],Iy[Ay]=null,sR=Iy[--Ay],Iy[Ay]=null;for(;t===lh;)lh=La[--Ma],La[Ma]=null,Nc=La[--Ma],La[Ma]=null,Dc=La[--Ma],La[Ma]=null}var Ai=null,Tr=null,bt=!1,ch=null,kl=!1,G7=Error(X(519));function ph(t){var e=Error(X(418,""));throw Ak(Oa(e,t)),G7}function sde(t){var e=t.stateNode,r=t.type,n=t.memoizedProps;switch(e[ni]=t,e[is]=n,r){case"dialog":rt("cancel",e),rt("close",e);break;case"iframe":case"object":case"embed":rt("load",e);break;case"video":case"audio":for(r=0;r<Lk.length;r++)rt(Lk[r],e);break;case"source":rt("error",e);break;case"img":case"image":case"link":rt("error",e),rt("load",e);break;case"details":rt("toggle",e);break;case"input":rt("invalid",e),kfe(e,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),tR(e);break;case"select":rt("invalid",e);break;case"textarea":rt("invalid",e),Cfe(e,n.value,n.defaultValue,n.children),tR(e)}r=n.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||e.textContent===""+r||n.suppressHydrationWarning===!0||The(e.textContent,r)?(n.popover!=null&&(rt("beforetoggle",e),rt("toggle",e)),n.onScroll!=null&&rt("scroll",e),n.onScrollEnd!=null&&rt("scrollend",e),n.onClick!=null&&(e.onclick=jR),e=!0):e=!1,e||ph(t)}function ade(t){for(Ai=t.return;Ai;)switch(Ai.tag){case 5:case 13:kl=!1;return;case 27:case 3:kl=!0;return;default:Ai=Ai.return}}function ek(t){if(t!==Ai)return!1;if(!bt)return ade(t),bt=!0,!1;var e=t.tag,r;if((r=e!==3&&e!==27)&&((r=e===5)&&(r=t.type,r=!(r!=="form"&&r!=="button")||vB(t.type,t.memoizedProps)),r=!r),r&&Tr&&ph(t),ade(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(X(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(r=t.data,r==="/$"){if(e===0){Tr=To(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++;t=t.nextSibling}Tr=null}}else e===27?(e=Tr,Vd(t.type)?(t=wB,wB=null,Tr=t):Tr=e):Tr=Ai?To(t.stateNode.nextSibling):null;return!0}function qk(){Tr=Ai=null,bt=!1}function ode(){var t=ch;return t!==null&&(ns===null?ns=t:ns.push.apply(ns,t),ch=null),t}function Ak(t){ch===null?ch=[t]:ch.push(t)}var W7=Il(null),xh=null,Fc=null;function bd(t,e,r){dr(W7,e._currentValue),e._currentValue=r}function jc(t){t._currentValue=W7.current,wn(W7)}function K7(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Y7(t,e,r,n){var i=t.child;for(i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){var a=i.child;s=s.firstContext;e:for(;s!==null;){var o=s;s=i;for(var l=0;l<e.length;l++)if(o.context===e[l]){s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),K7(s.return,r,t),n||(a=null);break e}s=o.next}}else if(i.tag===18){if(a=i.return,a===null)throw Error(X(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),K7(a,r,t),a=null}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}}function Hk(t,e,r,n){t=null;for(var i=e,s=!1;i!==null;){if(!s){if((i.flags&524288)!==0)s=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var a=i.alternate;if(a===null)throw Error(X(387));if(a=a.memoizedProps,a!==null){var o=i.type;Ys(i.pendingProps.value,a.value)||(t!==null?t.push(o):t=[o])}}else if(i===QP.current){if(a=i.alternate,a===null)throw Error(X(387));a.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(t!==null?t.push(Ok):t=[Ok])}i=i.return}t!==null&&Y7(e,t,r,n),e.flags|=262144}function aR(t){for(t=t.firstContext;t!==null;){if(!Ys(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function hh(t){xh=t,Fc=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function ii(t){return Hfe(xh,t)}function AP(t,e){return xh===null&&hh(t),Hfe(t,e)}function Hfe(t,e){var r=e._currentValue;if(e={context:e,memoizedValue:r,next:null},Fc===null){if(t===null)throw Error(X(308));Fc=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Fc=Fc.next=e;return r}var mGe=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(r,n){t.push(n)}};this.abort=function(){e.aborted=!0,t.forEach(function(r){return r()})}},gGe=sn.unstable_scheduleCallback,yGe=sn.unstable_NormalPriority,rn={$$typeof:Oc,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function UB(){return{controller:new mGe,data:new Map,refCount:0}}function Gk(t){t.refCount--,t.refCount===0&&gGe(yGe,function(){t.controller.abort()})}var pk=null,X7=0,$y=0,_y=null;function vGe(t,e){if(pk===null){var r=pk=[];X7=0,$y=dV(),_y={status:"pending",value:void 0,then:function(n){r.push(n)}}}return X7++,e.then(lde,lde),e}function lde(){if(--X7===0&&pk!==null){_y!==null&&(_y.status="fulfilled");var t=pk;pk=null,$y=0,_y=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function bGe(t,e){var r=[],n={status:"pending",value:null,reason:null,then:function(i){r.push(i)}};return t.then(function(){n.status="fulfilled",n.value=e;for(var i=0;i<r.length;i++)(0,r[i])(e)},function(i){for(n.status="rejected",n.reason=i,i=0;i<r.length;i++)(0,r[i])(void 0)}),n}var cde=De.S;De.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&vGe(t,e),cde!==null&&cde(t,e)};var uh=Il(null);function zB(){var t=uh.current;return t!==null?t:Qt.pooledCache}function zP(t,e){e===null?dr(uh,uh.current):dr(uh,e.pool)}function Gfe(){var t=zB();return t===null?null:{parent:rn._currentValue,pool:t}}var Wk=Error(X(460)),Wfe=Error(X(474)),_R=Error(X(542)),Q7={then:function(){}};function ude(t){return t=t.status,t==="fulfilled"||t==="rejected"}function PP(){}function Kfe(t,e,r){switch(r=t[r],r===void 0?t.push(e):r!==e&&(e.then(PP,PP),e=r),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,fde(t),t;default:if(typeof e.status=="string")e.then(PP,PP);else{if(t=Qt,t!==null&&100<t.shellSuspendCounter)throw Error(X(482));t=e,t.status="pending",t.then(function(n){if(e.status==="pending"){var i=e;i.status="fulfilled",i.value=n}},function(n){if(e.status==="pending"){var i=e;i.status="rejected",i.reason=n}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,fde(t),t}throw hk=e,Wk}}var hk=null;function dde(){if(hk===null)throw Error(X(459));var t=hk;return hk=null,t}function fde(t){if(t===Wk||t===_R)throw Error(X(483))}var vd=!1;function qB(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Z7(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ad(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Pd(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(Lt&2)!==0){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,e=nR(t),Ufe(t,null,r),e}return MR(t,n,e,r),nR(t)}function mk(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,gfe(t,r)}}function f7(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var a={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};s===null?i=s=a:s=s.next=a,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,callbacks:n.callbacks},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}var J7=!1;function gk(){if(J7){var t=_y;if(t!==null)throw t}}function yk(t,e,r,n){J7=!1;var i=t.updateQueue;vd=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;a=0,u=c=l=null,o=s;do{var f=o.lane&-536870913,p=f!==o.lane;if(p?(at&f)===f:(n&f)===f){f!==0&&f===$y&&(J7=!0),u!==null&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var h=t,m=o;f=e;var v=r;switch(m.tag){case 1:if(h=m.payload,typeof h=="function"){d=h.call(v,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,f=typeof h=="function"?h.call(v,d,f):h,f==null)break e;d=rr({},d,f);break e;case 2:vd=!0}}f=o.callback,f!==null&&(t.flags|=64,p&&(t.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;p=o,o=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,s===null&&(i.shared.lanes=0),Fd|=a,t.lanes=a,t.memoizedState=d}}function Yfe(t,e){if(typeof t!="function")throw Error(X(191,t));t.call(e)}function Xfe(t,e){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)Yfe(r[t],e)}var Uy=Il(null),oR=Il(0);function pde(t,e){t=qc,dr(oR,t),dr(Uy,e),qc=t|e.baseLanes}function eB(){dr(oR,qc),dr(Uy,Uy.current)}function HB(){qc=oR.current,wn(Uy),wn(oR)}var Dd=0,et=null,Ft=null,Hr=null,lR=!1,Oy=!1,mh=!1,cR=0,Pk=0,Dy=null,xGe=0;function _r(){throw Error(X(321))}function GB(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!Ys(t[r],e[r]))return!1;return!0}function WB(t,e,r,n,i,s){return Dd=s,et=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,De.H=t===null||t.memoizedState===null?Ipe:Ape,mh=!1,s=r(n,i),mh=!1,Oy&&(s=Zfe(e,r,n,i)),Qfe(t),s}function Qfe(t){De.H=uR;var e=Ft!==null&&Ft.next!==null;if(Dd=0,Hr=Ft=et=null,lR=!1,Pk=0,Dy=null,e)throw Error(X(300));t===null||xn||(t=t.dependencies,t!==null&&aR(t)&&(xn=!0))}function Zfe(t,e,r,n){et=t;var i=0;do{if(Oy&&(Dy=null),Pk=0,Oy=!1,25<=i)throw Error(X(301));if(i+=1,Hr=Ft=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}De.H=IGe,s=e(r,n)}while(Oy);return s}function wGe(){var t=De.H,e=t.useState()[0];return e=typeof e.then=="function"?Kk(e):e,t=t.useState()[0],(Ft!==null?Ft.memoizedState:null)!==t&&(et.flags|=1024),e}function KB(){var t=cR!==0;return cR=0,t}function YB(t,e,r){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r}function XB(t){if(lR){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}lR=!1}Dd=0,Hr=Ft=et=null,Oy=!1,Pk=cR=0,Dy=null}function ts(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hr===null?et.memoizedState=Hr=t:Hr=Hr.next=t,Hr}function Gr(){if(Ft===null){var t=et.alternate;t=t!==null?t.memoizedState:null}else t=Ft.next;var e=Hr===null?et.memoizedState:Hr.next;if(e!==null)Hr=e,Ft=t;else{if(t===null)throw et.alternate===null?Error(X(467)):Error(X(310));Ft=t,t={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Hr===null?et.memoizedState=Hr=t:Hr=Hr.next=t}return Hr}function QB(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Kk(t){var e=Pk;return Pk+=1,Dy===null&&(Dy=[]),t=Kfe(Dy,t,e),e=et,(Hr===null?e.memoizedState:Hr.next)===null&&(e=e.alternate,De.H=e===null||e.memoizedState===null?Ipe:Ape),t}function OR(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Kk(t);if(t.$$typeof===Oc)return ii(t)}throw Error(X(438,String(t)))}function ZB(t){var e=null,r=et.updateQueue;if(r!==null&&(e=r.memoCache),e==null){var n=et.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(e={data:n.data.map(function(i){return i.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),r===null&&(r=QB(),et.updateQueue=r),r.memoCache=e,r=e.data[e.index],r===void 0)for(r=e.data[e.index]=Array(t),n=0;n<t;n++)r[n]=sHe;return e.index++,r}function Uc(t,e){return typeof e=="function"?e(t):e}function qP(t){var e=Gr();return JB(e,Ft,t)}function JB(t,e,r){var n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=r;var i=t.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}e.baseQueue=i=s,n.pending=null}if(s=t.baseState,i===null)t.memoizedState=s;else{e=i.next;var o=a=null,l=null,c=e,u=!1;do{var d=c.lane&-536870913;if(d!==c.lane?(at&d)===d:(Dd&d)===d){var f=c.revertLane;if(f===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),d===$y&&(u=!0);else if((Dd&f)===f){c=c.next,f===$y&&(u=!0);continue}else d={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=d,a=s):l=l.next=d,et.lanes|=f,Fd|=f;d=c.action,mh&&r(s,d),s=c.hasEagerState?c.eagerState:r(s,d)}else f={lane:d,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=f,a=s):l=l.next=f,et.lanes|=d,Fd|=d;c=c.next}while(c!==null&&c!==e);if(l===null?a=s:l.next=o,!Ys(s,t.memoizedState)&&(xn=!0,u&&(r=_y,r!==null)))throw r;t.memoizedState=s,t.baseState=a,t.baseQueue=l,n.lastRenderedState=s}return i===null&&(n.lanes=0),[t.memoizedState,n.dispatch]}function p7(t){var e=Gr(),r=e.queue;if(r===null)throw Error(X(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,s=e.memoizedState;if(i!==null){r.pending=null;var a=i=i.next;do s=t(s,a.action),a=a.next;while(a!==i);Ys(s,e.memoizedState)||(xn=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),r.lastRenderedState=s}return[s,n]}function Jfe(t,e,r){var n=et,i=Gr(),s=bt;if(s){if(r===void 0)throw Error(X(407));r=r()}else r=e();var a=!Ys((Ft||i).memoizedState,r);a&&(i.memoizedState=r,xn=!0),i=i.queue;var o=rpe.bind(null,n,i,t);if(Yk(2048,8,o,[t]),i.getSnapshot!==e||a||Hr!==null&&Hr.memoizedState.tag&1){if(n.flags|=2048,zy(9,DR(),tpe.bind(null,n,i,r,e),null),Qt===null)throw Error(X(349));s||(Dd&124)!==0||epe(n,e,r)}return r}function epe(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=et.updateQueue,e===null?(e=QB(),et.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function tpe(t,e,r,n){e.value=r,e.getSnapshot=n,npe(e)&&ipe(t)}function rpe(t,e,r){return r(function(){npe(e)&&ipe(t)})}function npe(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Ys(t,r)}catch{return!0}}function ipe(t){var e=Qy(t,2);e!==null&&Ks(e,t,2)}function tB(t){var e=ts();if(typeof t=="function"){var r=t;if(t=r(),mh){Sd(!0);try{r()}finally{Sd(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uc,lastRenderedState:t},e}function spe(t,e,r,n){return t.baseState=r,JB(t,Ft,typeof n=="function"?n:Uc)}function kGe(t,e,r,n,i){if(NR(t))throw Error(X(485));if(t=e.action,t!==null){var s={payload:i,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){s.listeners.push(a)}};De.T!==null?r(!0):s.isTransition=!1,n(s),r=e.pending,r===null?(s.next=e.pending=s,ape(e,s)):(s.next=r.next,e.pending=r.next=s)}}function ape(t,e){var r=e.action,n=e.payload,i=t.state;if(e.isTransition){var s=De.T,a={};De.T=a;try{var o=r(i,n),l=De.S;l!==null&&l(a,o),hde(t,e,o)}catch(c){rB(t,e,c)}finally{De.T=s}}else try{s=r(i,n),hde(t,e,s)}catch(c){rB(t,e,c)}}function hde(t,e,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(n){mde(t,e,n)},function(n){return rB(t,e,n)}):mde(t,e,r)}function mde(t,e,r){e.status="fulfilled",e.value=r,ope(e),t.state=r,e=t.pending,e!==null&&(r=e.next,r===e?t.pending=null:(r=r.next,e.next=r,ape(t,r)))}function rB(t,e,r){var n=t.pending;if(t.pending=null,n!==null){n=n.next;do e.status="rejected",e.reason=r,ope(e),e=e.next;while(e!==n)}t.action=null}function ope(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function lpe(t,e){return e}function gde(t,e){if(bt){var r=Qt.formState;if(r!==null){e:{var n=et;if(bt){if(Tr){t:{for(var i=Tr,s=kl;i.nodeType!==8;){if(!s){i=null;break t}if(i=To(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){Tr=To(i.nextSibling),n=i.data==="F!";break e}}ph(n)}n=!1}n&&(e=r[0])}}return r=ts(),r.memoizedState=r.baseState=e,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lpe,lastRenderedState:e},r.queue=n,r=Cpe.bind(null,et,n),n.dispatch=r,n=tB(!1),s=nV.bind(null,et,!1,n.queue),n=ts(),i={state:e,dispatch:null,action:t,pending:null},n.queue=i,r=kGe.bind(null,et,i,s,r),i.dispatch=r,n.memoizedState=t,[e,r,!1]}function yde(t){var e=Gr();return cpe(e,Ft,t)}function cpe(t,e,r){if(e=JB(t,e,lpe)[0],t=qP(Uc)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var n=Kk(e)}catch(a){throw a===Wk?_R:a}else n=e;e=Gr();var i=e.queue,s=i.dispatch;return r!==e.memoizedState&&(et.flags|=2048,zy(9,DR(),SGe.bind(null,i,r),null)),[n,s,t]}function SGe(t,e){t.action=e}function vde(t){var e=Gr(),r=Ft;if(r!==null)return cpe(e,r,t);Gr(),e=e.memoizedState,r=Gr();var n=r.queue.dispatch;return r.memoizedState=t,[e,n,!1]}function zy(t,e,r,n){return t={tag:t,create:r,deps:n,inst:e,next:null},e=et.updateQueue,e===null&&(e=QB(),et.updateQueue=e),r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t),t}function DR(){return{destroy:void 0,resource:void 0}}function upe(){return Gr().memoizedState}function HP(t,e,r,n){var i=ts();n=n===void 0?null:n,et.flags|=t,i.memoizedState=zy(1|e,DR(),r,n)}function Yk(t,e,r,n){var i=Gr();n=n===void 0?null:n;var s=i.memoizedState.inst;Ft!==null&&n!==null&&GB(n,Ft.memoizedState.deps)?i.memoizedState=zy(e,s,r,n):(et.flags|=t,i.memoizedState=zy(1|e,s,r,n))}function bde(t,e){HP(8390656,8,t,e)}function dpe(t,e){Yk(2048,8,t,e)}function fpe(t,e){return Yk(4,2,t,e)}function ppe(t,e){return Yk(4,4,t,e)}function hpe(t,e){if(typeof e=="function"){t=t();var r=e(t);return function(){typeof r=="function"?r():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function mpe(t,e,r){r=r!=null?r.concat([t]):null,Yk(4,4,hpe.bind(null,e,t),r)}function eV(){}function gpe(t,e){var r=Gr();e=e===void 0?null:e;var n=r.memoizedState;return e!==null&&GB(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function ype(t,e){var r=Gr();e=e===void 0?null:e;var n=r.memoizedState;if(e!==null&&GB(e,n[1]))return n[0];if(n=t(),mh){Sd(!0);try{t()}finally{Sd(!1)}}return r.memoizedState=[n,e],n}function tV(t,e,r){return r===void 0||(Dd&1073741824)!==0?t.memoizedState=e:(t.memoizedState=r,t=ohe(),et.lanes|=t,Fd|=t,r)}function vpe(t,e,r,n){return Ys(r,e)?r:Uy.current!==null?(t=tV(t,r,n),Ys(t,e)||(xn=!0),t):(Dd&42)===0?(xn=!0,t.memoizedState=r):(t=ohe(),et.lanes|=t,Fd|=t,e)}function bpe(t,e,r,n,i){var s=xt.p;xt.p=s!==0&&8>s?s:8;var a=De.T,o={};De.T=o,nV(t,!1,e,r);try{var l=i(),c=De.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=bGe(l,n);vk(t,e,u,Ws(t))}else vk(t,e,n,Ws(t))}catch(d){vk(t,e,{then:function(){},status:"rejected",reason:d},Ws())}finally{xt.p=s,De.T=a}}function CGe(){}function nB(t,e,r,n){if(t.tag!==5)throw Error(X(476));var i=xpe(t).queue;bpe(t,i,e,ah,r===null?CGe:function(){return wpe(t),r(n)})}function xpe(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:ah,baseState:ah,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uc,lastRenderedState:ah},next:null};var r={};return e.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uc,lastRenderedState:r},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function wpe(t){var e=xpe(t).next.queue;vk(t,e,{},Ws())}function rV(){return ii(Ok)}function kpe(){return Gr().memoizedState}function Spe(){return Gr().memoizedState}function TGe(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var r=Ws();t=Ad(r);var n=Pd(e,t,r);n!==null&&(Ks(n,e,r),mk(n,e,r)),e={cache:UB()},t.payload=e;return}e=e.return}}function EGe(t,e,r){var n=Ws();r={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},NR(t)?Tpe(e,r):(r=BB(t,e,r,n),r!==null&&(Ks(r,t,n),Epe(r,e,n)))}function Cpe(t,e,r){var n=Ws();vk(t,e,r,n)}function vk(t,e,r,n){var i={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(NR(t))Tpe(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,r);if(i.hasEagerState=!0,i.eagerState=o,Ys(o,a))return MR(t,e,i,0),Qt===null&&LR(),!1}catch{}finally{}if(r=BB(t,e,i,n),r!==null)return Ks(r,t,n),Epe(r,e,n),!0}return!1}function nV(t,e,r,n){if(n={lane:2,revertLane:dV(),action:n,hasEagerState:!1,eagerState:null,next:null},NR(t)){if(e)throw Error(X(479))}else e=BB(t,r,n,2),e!==null&&Ks(e,t,2)}function NR(t){var e=t.alternate;return t===et||e!==null&&e===et}function Tpe(t,e){Oy=lR=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function Epe(t,e,r){if((r&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,gfe(t,r)}}var uR={readContext:ii,use:OR,useCallback:_r,useContext:_r,useEffect:_r,useImperativeHandle:_r,useLayoutEffect:_r,useInsertionEffect:_r,useMemo:_r,useReducer:_r,useRef:_r,useState:_r,useDebugValue:_r,useDeferredValue:_r,useTransition:_r,useSyncExternalStore:_r,useId:_r,useHostTransitionStatus:_r,useFormState:_r,useActionState:_r,useOptimistic:_r,useMemoCache:_r,useCacheRefresh:_r},Ipe={readContext:ii,use:OR,useCallback:function(t,e){return ts().memoizedState=[t,e===void 0?null:e],t},useContext:ii,useEffect:bde,useImperativeHandle:function(t,e,r){r=r!=null?r.concat([t]):null,HP(4194308,4,hpe.bind(null,e,t),r)},useLayoutEffect:function(t,e){return HP(4194308,4,t,e)},useInsertionEffect:function(t,e){HP(4,2,t,e)},useMemo:function(t,e){var r=ts();e=e===void 0?null:e;var n=t();if(mh){Sd(!0);try{t()}finally{Sd(!1)}}return r.memoizedState=[n,e],n},useReducer:function(t,e,r){var n=ts();if(r!==void 0){var i=r(e);if(mh){Sd(!0);try{r(e)}finally{Sd(!1)}}}else i=e;return n.memoizedState=n.baseState=i,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},n.queue=t,t=t.dispatch=EGe.bind(null,et,t),[n.memoizedState,t]},useRef:function(t){var e=ts();return t={current:t},e.memoizedState=t},useState:function(t){t=tB(t);var e=t.queue,r=Cpe.bind(null,et,e);return e.dispatch=r,[t.memoizedState,r]},useDebugValue:eV,useDeferredValue:function(t,e){var r=ts();return tV(r,t,e)},useTransition:function(){var t=tB(!1);return t=bpe.bind(null,et,t.queue,!0,!1),ts().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,r){var n=et,i=ts();if(bt){if(r===void 0)throw Error(X(407));r=r()}else{if(r=e(),Qt===null)throw Error(X(349));(at&124)!==0||epe(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,bde(rpe.bind(null,n,s,t),[t]),n.flags|=2048,zy(9,DR(),tpe.bind(null,n,s,r,e),null),r},useId:function(){var t=ts(),e=Qt.identifierPrefix;if(bt){var r=Nc,n=Dc;r=(n&~(1<<32-Gs(n)-1)).toString(32)+r,e="\xAB"+e+"R"+r,r=cR++,0<r&&(e+="H"+r.toString(32)),e+="\xBB"}else r=xGe++,e="\xAB"+e+"r"+r.toString(32)+"\xBB";return t.memoizedState=e},useHostTransitionStatus:rV,useFormState:gde,useActionState:gde,useOptimistic:function(t){var e=ts();e.memoizedState=e.baseState=t;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=r,e=nV.bind(null,et,!0,r),r.dispatch=e,[t,e]},useMemoCache:ZB,useCacheRefresh:function(){return ts().memoizedState=TGe.bind(null,et)}},Ape={readContext:ii,use:OR,useCallback:gpe,useContext:ii,useEffect:dpe,useImperativeHandle:mpe,useInsertionEffect:fpe,useLayoutEffect:ppe,useMemo:ype,useReducer:qP,useRef:upe,useState:function(){return qP(Uc)},useDebugValue:eV,useDeferredValue:function(t,e){var r=Gr();return vpe(r,Ft.memoizedState,t,e)},useTransition:function(){var t=qP(Uc)[0],e=Gr().memoizedState;return[typeof t=="boolean"?t:Kk(t),e]},useSyncExternalStore:Jfe,useId:kpe,useHostTransitionStatus:rV,useFormState:yde,useActionState:yde,useOptimistic:function(t,e){var r=Gr();return spe(r,Ft,t,e)},useMemoCache:ZB,useCacheRefresh:Spe},IGe={readContext:ii,use:OR,useCallback:gpe,useContext:ii,useEffect:dpe,useImperativeHandle:mpe,useInsertionEffect:fpe,useLayoutEffect:ppe,useMemo:ype,useReducer:p7,useRef:upe,useState:function(){return p7(Uc)},useDebugValue:eV,useDeferredValue:function(t,e){var r=Gr();return Ft===null?tV(r,t,e):vpe(r,Ft.memoizedState,t,e)},useTransition:function(){var t=p7(Uc)[0],e=Gr().memoizedState;return[typeof t=="boolean"?t:Kk(t),e]},useSyncExternalStore:Jfe,useId:kpe,useHostTransitionStatus:rV,useFormState:vde,useActionState:vde,useOptimistic:function(t,e){var r=Gr();return Ft!==null?spe(r,Ft,t,e):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:ZB,useCacheRefresh:Spe},Ny=null,Rk=0;function RP(t){var e=Rk;return Rk+=1,Ny===null&&(Ny=[]),Kfe(Ny,t,e)}function tk(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function LP(t,e){throw e.$$typeof===nHe?Error(X(525)):(t=Object.prototype.toString.call(e),Error(X(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function xde(t){var e=t._init;return e(t._payload)}function Ppe(t){function e(b,y){if(t){var x=b.deletions;x===null?(b.deletions=[y],b.flags|=16):x.push(y)}}function r(b,y){if(!t)return null;for(;y!==null;)e(b,y),y=y.sibling;return null}function n(b){for(var y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function i(b,y){return b=Vc(b,y),b.index=0,b.sibling=null,b}function s(b,y,x){return b.index=x,t?(x=b.alternate,x!==null?(x=x.index,x<y?(b.flags|=67108866,y):x):(b.flags|=67108866,y)):(b.flags|=1048576,y)}function a(b){return t&&b.alternate===null&&(b.flags|=67108866),b}function o(b,y,x,w){return y===null||y.tag!==6?(y=u7(x,b.mode,w),y.return=b,y):(y=i(y,x),y.return=b,y)}function l(b,y,x,w){var C=x.type;return C===vy?u(b,y,x.props.children,w,x.key):y!==null&&(y.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===yd&&xde(C)===y.type)?(y=i(y,x.props),tk(y,x),y.return=b,y):(y=UP(x.type,x.key,x.props,null,b.mode,w),tk(y,x),y.return=b,y)}function c(b,y,x,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=d7(x,b.mode,w),y.return=b,y):(y=i(y,x.children||[]),y.return=b,y)}function u(b,y,x,w,C){return y===null||y.tag!==7?(y=oh(x,b.mode,w,C),y.return=b,y):(y=i(y,x),y.return=b,y)}function d(b,y,x){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=u7(""+y,b.mode,x),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case wP:return x=UP(y.type,y.key,y.props,null,b.mode,x),tk(x,y),x.return=b,x;case ak:return y=d7(y,b.mode,x),y.return=b,y;case yd:var w=y._init;return y=w(y._payload),d(b,y,x)}if(ok(y)||Z1(y))return y=oh(y,b.mode,x,null),y.return=b,y;if(typeof y.then=="function")return d(b,RP(y),x);if(y.$$typeof===Oc)return d(b,AP(b,y),x);LP(b,y)}return null}function f(b,y,x,w){var C=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return C!==null?null:o(b,y,""+x,w);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case wP:return x.key===C?l(b,y,x,w):null;case ak:return x.key===C?c(b,y,x,w):null;case yd:return C=x._init,x=C(x._payload),f(b,y,x,w)}if(ok(x)||Z1(x))return C!==null?null:u(b,y,x,w,null);if(typeof x.then=="function")return f(b,y,RP(x),w);if(x.$$typeof===Oc)return f(b,y,AP(b,x),w);LP(b,x)}return null}function p(b,y,x,w,C){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return b=b.get(x)||null,o(y,b,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case wP:return b=b.get(w.key===null?x:w.key)||null,l(y,b,w,C);case ak:return b=b.get(w.key===null?x:w.key)||null,c(y,b,w,C);case yd:var O=w._init;return w=O(w._payload),p(b,y,x,w,C)}if(ok(w)||Z1(w))return b=b.get(x)||null,u(y,b,w,C,null);if(typeof w.then=="function")return p(b,y,x,RP(w),C);if(w.$$typeof===Oc)return p(b,y,x,AP(y,w),C);LP(y,w)}return null}function h(b,y,x,w){for(var C=null,O=null,S=y,T=y=0,E=null;S!==null&&T<x.length;T++){S.index>T?(E=S,S=null):E=S.sibling;var P=f(b,S,x[T],w);if(P===null){S===null&&(S=E);break}t&&S&&P.alternate===null&&e(b,S),y=s(P,y,T),O===null?C=P:O.sibling=P,O=P,S=E}if(T===x.length)return r(b,S),bt&&ih(b,T),C;if(S===null){for(;T<x.length;T++)S=d(b,x[T],w),S!==null&&(y=s(S,y,T),O===null?C=S:O.sibling=S,O=S);return bt&&ih(b,T),C}for(S=n(S);T<x.length;T++)E=p(S,b,T,x[T],w),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?T:E.key),y=s(E,y,T),O===null?C=E:O.sibling=E,O=E);return t&&S.forEach(function(R){return e(b,R)}),bt&&ih(b,T),C}function m(b,y,x,w){if(x==null)throw Error(X(151));for(var C=null,O=null,S=y,T=y=0,E=null,P=x.next();S!==null&&!P.done;T++,P=x.next()){S.index>T?(E=S,S=null):E=S.sibling;var R=f(b,S,P.value,w);if(R===null){S===null&&(S=E);break}t&&S&&R.alternate===null&&e(b,S),y=s(R,y,T),O===null?C=R:O.sibling=R,O=R,S=E}if(P.done)return r(b,S),bt&&ih(b,T),C;if(S===null){for(;!P.done;T++,P=x.next())P=d(b,P.value,w),P!==null&&(y=s(P,y,T),O===null?C=P:O.sibling=P,O=P);return bt&&ih(b,T),C}for(S=n(S);!P.done;T++,P=x.next())P=p(S,b,T,P.value,w),P!==null&&(t&&P.alternate!==null&&S.delete(P.key===null?T:P.key),y=s(P,y,T),O===null?C=P:O.sibling=P,O=P);return t&&S.forEach(function(I){return e(b,I)}),bt&&ih(b,T),C}function v(b,y,x,w){if(typeof x=="object"&&x!==null&&x.type===vy&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case wP:e:{for(var C=x.key;y!==null;){if(y.key===C){if(C=x.type,C===vy){if(y.tag===7){r(b,y.sibling),w=i(y,x.props.children),w.return=b,b=w;break e}}else if(y.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===yd&&xde(C)===y.type){r(b,y.sibling),w=i(y,x.props),tk(w,x),w.return=b,b=w;break e}r(b,y);break}else e(b,y);y=y.sibling}x.type===vy?(w=oh(x.props.children,b.mode,w,x.key),w.return=b,b=w):(w=UP(x.type,x.key,x.props,null,b.mode,w),tk(w,x),w.return=b,b=w)}return a(b);case ak:e:{for(C=x.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){r(b,y.sibling),w=i(y,x.children||[]),w.return=b,b=w;break e}else{r(b,y);break}else e(b,y);y=y.sibling}w=d7(x,b.mode,w),w.return=b,b=w}return a(b);case yd:return C=x._init,x=C(x._payload),v(b,y,x,w)}if(ok(x))return h(b,y,x,w);if(Z1(x)){if(C=Z1(x),typeof C!="function")throw Error(X(150));return x=C.call(x),m(b,y,x,w)}if(typeof x.then=="function")return v(b,y,RP(x),w);if(x.$$typeof===Oc)return v(b,y,AP(b,x),w);LP(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,y!==null&&y.tag===6?(r(b,y.sibling),w=i(y,x),w.return=b,b=w):(r(b,y),w=u7(x,b.mode,w),w.return=b,b=w),a(b)):r(b,y)}return function(b,y,x,w){try{Rk=0;var C=v(b,y,x,w);return Ny=null,C}catch(S){if(S===Wk||S===_R)throw S;var O=qs(29,S,null,b.mode);return O.lanes=w,O.return=b,O}finally{}}}var qy=Ppe(!0),Rpe=Ppe(!1),Na=Il(null),El=null;function xd(t){var e=t.alternate;dr(nn,nn.current&1),dr(Na,t),El===null&&(e===null||Uy.current!==null||e.memoizedState!==null)&&(El=t)}function Lpe(t){if(t.tag===22){if(dr(nn,nn.current),dr(Na,t),El===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(El=t)}}else wd(t)}function wd(){dr(nn,nn.current),dr(Na,Na.current)}function Bc(t){wn(Na),El===t&&(El=null),wn(nn)}var nn=Il(0);function dR(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||xB(r)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function h7(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:rr({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var iB={enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Ws(),i=Ad(n);i.payload=e,r!=null&&(i.callback=r),e=Pd(t,i,n),e!==null&&(Ks(e,t,n),mk(e,t,n))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Ws(),i=Ad(n);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=Pd(t,i,n),e!==null&&(Ks(e,t,n),mk(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Ws(),n=Ad(r);n.tag=2,e!=null&&(n.callback=e),e=Pd(t,n,r),e!==null&&(Ks(e,t,r),mk(e,t,r))}};function wde(t,e,r,n,i,s,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,s,a):e.prototype&&e.prototype.isPureReactComponent?!Ik(r,n)||!Ik(i,s):!0}function kde(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&iB.enqueueReplaceState(e,e.state,null)}function gh(t,e){var r=e;if("ref"in e){r={};for(var n in e)n!=="ref"&&(r[n]=e[n])}if(t=t.defaultProps){r===e&&(r=rr({},r));for(var i in t)r[i]===void 0&&(r[i]=t[i])}return r}var fR=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Mpe(t){fR(t)}function _pe(t){console.error(t)}function Ope(t){fR(t)}function pR(t,e){try{var r=t.onUncaughtError;r(e.value,{componentStack:e.stack})}catch(n){setTimeout(function(){throw n})}}function Sde(t,e,r){try{var n=t.onCaughtError;n(r.value,{componentStack:r.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function sB(t,e,r){return r=Ad(r),r.tag=3,r.payload={element:null},r.callback=function(){pR(t,e)},r}function Dpe(t){return t=Ad(t),t.tag=3,t}function Npe(t,e,r,n){var i=r.type.getDerivedStateFromError;if(typeof i=="function"){var s=n.value;t.payload=function(){return i(s)},t.callback=function(){Sde(e,r,n)}}var a=r.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){Sde(e,r,n),typeof i!="function"&&(Rd===null?Rd=new Set([this]):Rd.add(this));var o=n.stack;this.componentDidCatch(n.value,{componentStack:o!==null?o:""})})}function AGe(t,e,r,n,i){if(r.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(e=r.alternate,e!==null&&Hk(e,r,i,!0),r=Na.current,r!==null){switch(r.tag){case 13:return El===null?pB():r.alternate===null&&Er===0&&(Er=3),r.flags&=-257,r.flags|=65536,r.lanes=i,n===Q7?r.flags|=16384:(e=r.updateQueue,e===null?r.updateQueue=new Set([n]):e.add(n),T7(t,n,i)),!1;case 22:return r.flags|=65536,n===Q7?r.flags|=16384:(e=r.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([n])},r.updateQueue=e):(r=e.retryQueue,r===null?e.retryQueue=new Set([n]):r.add(n)),T7(t,n,i)),!1}throw Error(X(435,r.tag))}return T7(t,n,i),pB(),!1}if(bt)return e=Na.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=i,n!==G7&&(t=Error(X(422),{cause:n}),Ak(Oa(t,r)))):(n!==G7&&(e=Error(X(423),{cause:n}),Ak(Oa(e,r))),t=t.current.alternate,t.flags|=65536,i&=-i,t.lanes|=i,n=Oa(n,r),i=sB(t.stateNode,n,i),f7(t,i),Er!==4&&(Er=2)),!1;var s=Error(X(520),{cause:n});if(s=Oa(s,r),wk===null?wk=[s]:wk.push(s),Er!==4&&(Er=2),e===null)return!0;n=Oa(n,r),r=e;do{switch(r.tag){case 3:return r.flags|=65536,t=i&-i,r.lanes|=t,t=sB(r.stateNode,n,t),f7(r,t),!1;case 1:if(e=r.type,s=r.stateNode,(r.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Rd===null||!Rd.has(s))))return r.flags|=65536,i&=-i,r.lanes|=i,i=Dpe(i),Npe(i,t,r,n),f7(r,i),!1}r=r.return}while(r!==null);return!1}var Fpe=Error(X(461)),xn=!1;function Vn(t,e,r,n){e.child=t===null?Rpe(e,null,r,n):qy(e,t.child,r,n)}function Cde(t,e,r,n,i){r=r.render;var s=e.ref;if("ref"in n){var a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}else a=n;return hh(e),n=WB(t,e,r,a,s,i),o=KB(),t!==null&&!xn?(YB(t,e,i),zc(t,e,i)):(bt&&o&&jB(e),e.flags|=1,Vn(t,e,n,i),e.child)}function Tde(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!VB(s)&&s.defaultProps===void 0&&r.compare===null?(e.tag=15,e.type=s,Bpe(t,e,s,n,i)):(t=UP(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!iV(t,i)){var a=s.memoizedProps;if(r=r.compare,r=r!==null?r:Ik,r(a,n)&&t.ref===e.ref)return zc(t,e,i)}return e.flags|=1,t=Vc(s,n),t.ref=e.ref,t.return=e,e.child=t}function Bpe(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(Ik(s,n)&&t.ref===e.ref)if(xn=!1,e.pendingProps=n=s,iV(t,i))(t.flags&131072)!==0&&(xn=!0);else return e.lanes=t.lanes,zc(t,e,i)}return aB(t,e,r,n,i)}function Vpe(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden"){if((e.flags&128)!==0){if(n=s!==null?s.baseLanes|r:r,t!==null){for(i=e.child=t.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;e.childLanes=s&~n}else e.childLanes=0,e.child=null;return Ede(t,e,n,r)}if((r&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&zP(e,s!==null?s.cachePool:null),s!==null?pde(e,s):eB(),Lpe(e);else return e.lanes=e.childLanes=536870912,Ede(t,e,s!==null?s.baseLanes|r:r,r)}else s!==null?(zP(e,s.cachePool),pde(e,s),wd(e),e.memoizedState=null):(t!==null&&zP(e,null),eB(),wd(e));return Vn(t,e,i,r),e.child}function Ede(t,e,r,n){var i=zB();return i=i===null?null:{parent:rn._currentValue,pool:i},e.memoizedState={baseLanes:r,cachePool:i},t!==null&&zP(e,null),eB(),Lpe(e),t!==null&&Hk(t,e,n,!0),null}function GP(t,e){var r=e.ref;if(r===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(X(284));(t===null||t.ref!==r)&&(e.flags|=4194816)}}function aB(t,e,r,n,i){return hh(e),r=WB(t,e,r,n,void 0,i),n=KB(),t!==null&&!xn?(YB(t,e,i),zc(t,e,i)):(bt&&n&&jB(e),e.flags|=1,Vn(t,e,r,i),e.child)}function Ide(t,e,r,n,i,s){return hh(e),e.updateQueue=null,r=Zfe(e,n,r,i),Qfe(t),n=KB(),t!==null&&!xn?(YB(t,e,s),zc(t,e,s)):(bt&&n&&jB(e),e.flags|=1,Vn(t,e,r,s),e.child)}function Ade(t,e,r,n,i){if(hh(e),e.stateNode===null){var s=Ey,a=r.contextType;typeof a=="object"&&a!==null&&(s=ii(a)),s=new r(n,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=iB,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=n,s.state=e.memoizedState,s.refs={},qB(e),a=r.contextType,s.context=typeof a=="object"&&a!==null?ii(a):Ey,s.state=e.memoizedState,a=r.getDerivedStateFromProps,typeof a=="function"&&(h7(e,r,a,n),s.state=e.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(a=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),a!==s.state&&iB.enqueueReplaceState(s,s.state,null),yk(e,n,s,i),gk(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!0}else if(t===null){s=e.stateNode;var o=e.memoizedProps,l=gh(r,o);s.props=l;var c=s.context,u=r.contextType;a=Ey,typeof u=="object"&&u!==null&&(a=ii(u));var d=r.getDerivedStateFromProps;u=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function",o=e.pendingProps!==o,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o||c!==a)&&kde(e,s,n,a),vd=!1;var f=e.memoizedState;s.state=f,yk(e,n,s,i),gk(),c=e.memoizedState,o||f!==c||vd?(typeof d=="function"&&(h7(e,r,d,n),c=e.memoizedState),(l=vd||wde(e,r,l,n,f,c,a))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),s.props=n,s.state=c,s.context=a,n=l):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,Z7(t,e),a=e.memoizedProps,u=gh(r,a),s.props=u,d=e.pendingProps,f=s.context,c=r.contextType,l=Ey,typeof c=="object"&&c!==null&&(l=ii(c)),o=r.getDerivedStateFromProps,(c=typeof o=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&kde(e,s,n,l),vd=!1,f=e.memoizedState,s.state=f,yk(e,n,s,i),gk();var p=e.memoizedState;a!==d||f!==p||vd||t!==null&&t.dependencies!==null&&aR(t.dependencies)?(typeof o=="function"&&(h7(e,r,o,n),p=e.memoizedState),(u=vd||wde(e,r,u,n,f,p,l)||t!==null&&t.dependencies!==null&&aR(t.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,p,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=p),s.props=n,s.state=p,s.context=l,n=u):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),n=!1)}return s=n,GP(t,e),n=(e.flags&128)!==0,s||n?(s=e.stateNode,r=n&&typeof r.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&n?(e.child=qy(e,t.child,null,i),e.child=qy(e,null,r,i)):Vn(t,e,r,i),e.memoizedState=s.state,t=e.child):t=zc(t,e,i),t}function Pde(t,e,r,n){return qk(),e.flags|=256,Vn(t,e,r,n),e.child}var m7={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function g7(t){return{baseLanes:t,cachePool:Gfe()}}function y7(t,e,r){return t=t!==null?t.childLanes&~r:0,e&&(t|=Da),t}function jpe(t,e,r){var n=e.pendingProps,i=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(nn.current&2)!==0),a&&(i=!0,e.flags&=-129),a=(e.flags&32)!==0,e.flags&=-33,t===null){if(bt){if(i?xd(e):wd(e),bt){var o=Tr,l;if(l=o){e:{for(l=o,o=kl;l.nodeType!==8;){if(!o){o=null;break e}if(l=To(l.nextSibling),l===null){o=null;break e}}o=l}o!==null?(e.memoizedState={dehydrated:o,treeContext:lh!==null?{id:Dc,overflow:Nc}:null,retryLane:536870912,hydrationErrors:null},l=qs(18,null,null,0),l.stateNode=o,l.return=e,e.child=l,Ai=e,Tr=null,l=!0):l=!1}l||ph(e)}if(o=e.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return xB(o)?e.lanes=32:e.lanes=536870912,null;Bc(e)}return o=n.children,n=n.fallback,i?(wd(e),i=e.mode,o=hR({mode:"hidden",children:o},i),n=oh(n,i,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,i=e.child,i.memoizedState=g7(r),i.childLanes=y7(t,a,r),e.memoizedState=m7,n):(xd(e),oB(e,o))}if(l=t.memoizedState,l!==null&&(o=l.dehydrated,o!==null)){if(s)e.flags&256?(xd(e),e.flags&=-257,e=v7(t,e,r)):e.memoizedState!==null?(wd(e),e.child=t.child,e.flags|=128,e=null):(wd(e),i=n.fallback,o=e.mode,n=hR({mode:"visible",children:n.children},o),i=oh(i,o,r,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,qy(e,t.child,null,r),n=e.child,n.memoizedState=g7(r),n.childLanes=y7(t,a,r),e.memoizedState=m7,e=i);else if(xd(e),xB(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var c=a.dgst;a=c,n=Error(X(419)),n.stack="",n.digest=a,Ak({value:n,source:null,stack:null}),e=v7(t,e,r)}else if(xn||Hk(t,e,r,!1),a=(r&t.childLanes)!==0,xn||a){if(a=Qt,a!==null&&(n=r&-r,n=(n&42)!==0?1:AB(n),n=(n&(a.suspendedLanes|r))!==0?0:n,n!==0&&n!==l.retryLane))throw l.retryLane=n,Qy(t,n),Ks(a,t,n),Fpe;o.data==="$?"||pB(),e=v7(t,e,r)}else o.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Tr=To(o.nextSibling),Ai=e,bt=!0,ch=null,kl=!1,t!==null&&(La[Ma++]=Dc,La[Ma++]=Nc,La[Ma++]=lh,Dc=t.id,Nc=t.overflow,lh=e),e=oB(e,n.children),e.flags|=4096);return e}return i?(wd(e),i=n.fallback,o=e.mode,l=t.child,c=l.sibling,n=Vc(l,{mode:"hidden",children:n.children}),n.subtreeFlags=l.subtreeFlags&65011712,c!==null?i=Vc(c,i):(i=oh(i,o,r,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,o=t.child.memoizedState,o===null?o=g7(r):(l=o.cachePool,l!==null?(c=rn._currentValue,l=l.parent!==c?{parent:c,pool:c}:l):l=Gfe(),o={baseLanes:o.baseLanes|r,cachePool:l}),i.memoizedState=o,i.childLanes=y7(t,a,r),e.memoizedState=m7,n):(xd(e),r=t.child,t=r.sibling,r=Vc(r,{mode:"visible",children:n.children}),r.return=e,r.sibling=null,t!==null&&(a=e.deletions,a===null?(e.deletions=[t],e.flags|=16):a.push(t)),e.child=r,e.memoizedState=null,r)}function oB(t,e){return e=hR({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function hR(t,e){return t=qs(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function v7(t,e,r){return qy(e,t.child,null,r),t=oB(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Rde(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),K7(t.return,e,r)}function b7(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function $pe(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(Vn(t,e,n.children,r),n=nn.current,(n&2)!==0)n=n&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Rde(t,r,e);else if(t.tag===19)Rde(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}switch(dr(nn,n),i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&dR(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),b7(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&dR(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}b7(e,!0,r,null,s);break;case"together":b7(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function zc(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Fd|=e.lanes,(r&e.childLanes)===0)if(t!==null){if(Hk(t,e,r,!1),(r&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(X(153));if(e.child!==null){for(t=e.child,r=Vc(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Vc(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function iV(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&aR(t)))}function PGe(t,e,r){switch(e.tag){case 3:ZP(e,e.stateNode.containerInfo),bd(e,rn,t.memoizedState.cache),qk();break;case 27:case 5:N7(e);break;case 4:ZP(e,e.stateNode.containerInfo);break;case 10:bd(e,e.type,e.memoizedProps.value);break;case 13:var n=e.memoizedState;if(n!==null)return n.dehydrated!==null?(xd(e),e.flags|=128,null):(r&e.child.childLanes)!==0?jpe(t,e,r):(xd(e),t=zc(t,e,r),t!==null?t.sibling:null);xd(e);break;case 19:var i=(t.flags&128)!==0;if(n=(r&e.childLanes)!==0,n||(Hk(t,e,r,!1),n=(r&e.childLanes)!==0),i){if(n)return $pe(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),dr(nn,nn.current),n)break;return null;case 22:case 23:return e.lanes=0,Vpe(t,e,r);case 24:bd(e,rn,t.memoizedState.cache)}return zc(t,e,r)}function Upe(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps)xn=!0;else{if(!iV(t,r)&&(e.flags&128)===0)return xn=!1,PGe(t,e,r);xn=(t.flags&131072)!==0}else xn=!1,bt&&(e.flags&1048576)!==0&&qfe(e,sR,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var n=e.elementType,i=n._init;if(n=i(n._payload),e.type=n,typeof n=="function")VB(n)?(t=gh(n,t),e.tag=1,e=Ade(null,e,n,t,r)):(e.tag=0,e=aB(null,e,n,t,r));else{if(n!=null){if(i=n.$$typeof,i===TB){e.tag=11,e=Cde(null,e,n,t,r);break e}else if(i===EB){e.tag=14,e=Tde(null,e,n,t,r);break e}}throw e=O7(n)||n,Error(X(306,e,""))}}return e;case 0:return aB(t,e,e.type,e.pendingProps,r);case 1:return n=e.type,i=gh(n,e.pendingProps),Ade(t,e,n,i,r);case 3:e:{if(ZP(e,e.stateNode.containerInfo),t===null)throw Error(X(387));n=e.pendingProps;var s=e.memoizedState;i=s.element,Z7(t,e),yk(e,n,null,r);var a=e.memoizedState;if(n=a.cache,bd(e,rn,n),n!==s.cache&&Y7(e,[rn],r,!0),gk(),n=a.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=Pde(t,e,n,r);break e}else if(n!==i){i=Oa(Error(X(424)),e),Ak(i),e=Pde(t,e,n,r);break e}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Tr=To(t.firstChild),Ai=e,bt=!0,ch=null,kl=!0,r=Rpe(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(qk(),n===i){e=zc(t,e,r);break e}Vn(t,e,n,r)}e=e.child}return e;case 26:return GP(t,e),t===null?(r=Yde(e.type,null,e.pendingProps,null))?e.memoizedState=r:bt||(r=e.type,t=e.pendingProps,n=wR(Id.current).createElement(r),n[ni]=e,n[is]=t,$n(n,r,t),bn(n),e.stateNode=n):e.memoizedState=Yde(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return N7(e),t===null&&bt&&(n=e.stateNode=Ahe(e.type,e.pendingProps,Id.current),Ai=e,kl=!0,i=Tr,Vd(e.type)?(wB=i,Tr=To(n.firstChild)):Tr=i),Vn(t,e,e.pendingProps.children,r),GP(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&bt&&((i=n=Tr)&&(n=tWe(n,e.type,e.pendingProps,kl),n!==null?(e.stateNode=n,Ai=e,Tr=To(n.firstChild),kl=!1,i=!0):i=!1),i||ph(e)),N7(e),i=e.type,s=e.pendingProps,a=t!==null?t.memoizedProps:null,n=s.children,vB(i,s)?n=null:a!==null&&vB(i,a)&&(e.flags|=32),e.memoizedState!==null&&(i=WB(t,e,wGe,null,null,r),Ok._currentValue=i),GP(t,e),Vn(t,e,n,r),e.child;case 6:return t===null&&bt&&((t=r=Tr)&&(r=rWe(r,e.pendingProps,kl),r!==null?(e.stateNode=r,Ai=e,Tr=null,t=!0):t=!1),t||ph(e)),null;case 13:return jpe(t,e,r);case 4:return ZP(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=qy(e,null,n,r):Vn(t,e,n,r),e.child;case 11:return Cde(t,e,e.type,e.pendingProps,r);case 7:return Vn(t,e,e.pendingProps,r),e.child;case 8:return Vn(t,e,e.pendingProps.children,r),e.child;case 12:return Vn(t,e,e.pendingProps.children,r),e.child;case 10:return n=e.pendingProps,bd(e,e.type,n.value),Vn(t,e,n.children,r),e.child;case 9:return i=e.type._context,n=e.pendingProps.children,hh(e),i=ii(i),n=n(i),e.flags|=1,Vn(t,e,n,r),e.child;case 14:return Tde(t,e,e.type,e.pendingProps,r);case 15:return Bpe(t,e,e.type,e.pendingProps,r);case 19:return $pe(t,e,r);case 31:return n=e.pendingProps,r=e.mode,n={mode:n.mode,children:n.children},t===null?(r=hR(n,r),r.ref=e.ref,e.child=r,r.return=e,e=r):(r=Vc(t.child,n),r.ref=e.ref,e.child=r,r.return=e,e=r),e;case 22:return Vpe(t,e,r);case 24:return hh(e),n=ii(rn),t===null?(i=zB(),i===null&&(i=Qt,s=UB(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=r),i=s),e.memoizedState={parent:n,cache:i},qB(e),bd(e,rn,i)):((t.lanes&r)!==0&&(Z7(t,e),yk(e,null,null,r),gk()),i=t.memoizedState,s=e.memoizedState,i.parent!==n?(i={parent:n,cache:n},e.memoizedState=i,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=i),bd(e,rn,n)):(n=s.cache,bd(e,rn,n),n!==i.cache&&Y7(e,[rn],r,!0))),Vn(t,e,e.pendingProps.children,r),e.child;case 29:throw e.pendingProps}throw Error(X(156,e.tag))}function Lc(t){t.flags|=4}function Lde(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Lhe(e)){if(e=Na.current,e!==null&&((at&4194048)===at?El!==null:(at&62914560)!==at&&(at&536870912)===0||e!==El))throw hk=Q7,Wfe;t.flags|=8192}}function MP(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?hfe():536870912,t.lanes|=e,Hy|=e)}function rk(t,e){if(!bt)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function yr(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&65011712,n|=i.flags&65011712,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function RGe(t,e,r){var n=e.pendingProps;switch($B(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yr(e),null;case 1:return yr(e),null;case 3:return r=e.stateNode,n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),jc(rn),By(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(ek(e)?Lc(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,ode())),yr(e),null;case 26:return r=e.memoizedState,t===null?(Lc(e),r!==null?(yr(e),Lde(e,r)):(yr(e),e.flags&=-16777217)):r?r!==t.memoizedState?(Lc(e),yr(e),Lde(e,r)):(yr(e),e.flags&=-16777217):(t.memoizedProps!==n&&Lc(e),yr(e),e.flags&=-16777217),null;case 27:JP(e),r=Id.current;var i=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==n&&Lc(e);else{if(!n){if(e.stateNode===null)throw Error(X(166));return yr(e),null}t=Cl.current,ek(e)?sde(e,t):(t=Ahe(i,n,r),e.stateNode=t,Lc(e))}return yr(e),null;case 5:if(JP(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&Lc(e);else{if(!n){if(e.stateNode===null)throw Error(X(166));return yr(e),null}if(t=Cl.current,ek(e))sde(e,t);else{switch(i=wR(Id.current),t){case 1:t=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:t=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":t=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":t=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":t=i.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof n.is=="string"?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?t.multiple=!0:n.size&&(t.size=n.size);break;default:t=typeof n.is=="string"?i.createElement(r,{is:n.is}):i.createElement(r)}}t[ni]=e,t[is]=n;e:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)t.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=t;e:switch($n(t,r,n),r){case"button":case"input":case"select":case"textarea":t=!!n.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Lc(e)}}return yr(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&Lc(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(X(166));if(t=Id.current,ek(e)){if(t=e.stateNode,r=e.memoizedProps,n=null,i=Ai,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}t[ni]=e,t=!!(t.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||The(t.nodeValue,r)),t||ph(e)}else t=wR(t).createTextNode(n),t[ni]=e,e.stateNode=t}return yr(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(i=ek(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(X(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(X(317));i[ni]=e}else qk(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;yr(e),i=!1}else i=ode(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return e.flags&256?(Bc(e),e):(Bc(e),null)}if(Bc(e),(e.flags&128)!==0)return e.lanes=r,e;if(r=n!==null,t=t!==null&&t.memoizedState!==null,r){n=e.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool);var s=null;n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==i&&(n.flags|=2048)}return r!==t&&r&&(e.child.flags|=8192),MP(e,e.updateQueue),yr(e),null;case 4:return By(),t===null&&fV(e.stateNode.containerInfo),yr(e),null;case 10:return jc(e.type),yr(e),null;case 19:if(wn(nn),i=e.memoizedState,i===null)return yr(e),null;if(n=(e.flags&128)!==0,s=i.rendering,s===null)if(n)rk(i,!1);else{if(Er!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=dR(t),s!==null){for(e.flags|=128,rk(i,!1),t=s.updateQueue,e.updateQueue=t,MP(e,t),e.subtreeFlags=0,t=r,r=e.child;r!==null;)zfe(r,t),r=r.sibling;return dr(nn,nn.current&1|2),e.child}t=t.sibling}i.tail!==null&&Tl()>gR&&(e.flags|=128,n=!0,rk(i,!1),e.lanes=4194304)}else{if(!n)if(t=dR(s),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,MP(e,t),rk(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!bt)return yr(e),null}else 2*Tl()-i.renderingStartTime>gR&&r!==536870912&&(e.flags|=128,n=!0,rk(i,!1),e.lanes=4194304);i.isBackwards?(s.sibling=e.child,e.child=s):(t=i.last,t!==null?t.sibling=s:e.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Tl(),e.sibling=null,t=nn.current,dr(nn,n?t&1|2:t&1),e):(yr(e),null);case 22:case 23:return Bc(e),HB(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?(r&536870912)!==0&&(e.flags&128)===0&&(yr(e),e.subtreeFlags&6&&(e.flags|=8192)):yr(e),r=e.updateQueue,r!==null&&MP(e,r.retryQueue),r=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==r&&(e.flags|=2048),t!==null&&wn(uh),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),jc(rn),yr(e),null;case 25:return null;case 30:return null}throw Error(X(156,e.tag))}function LGe(t,e){switch($B(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return jc(rn),By(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return JP(e),null;case 13:if(Bc(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(X(340));qk()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wn(nn),null;case 4:return By(),null;case 10:return jc(e.type),null;case 22:case 23:return Bc(e),HB(),t!==null&&wn(uh),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return jc(rn),null;case 25:return null;default:return null}}function zpe(t,e){switch($B(e),e.tag){case 3:jc(rn),By();break;case 26:case 27:case 5:JP(e);break;case 4:By();break;case 13:Bc(e);break;case 19:wn(nn);break;case 10:jc(e.type);break;case 22:case 23:Bc(e),HB(),t!==null&&wn(uh);break;case 24:jc(rn)}}function Xk(t,e){try{var r=e.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var i=n.next;r=i;do{if((r.tag&t)===t){n=void 0;var s=r.create,a=r.inst;n=s(),a.destroy=n}r=r.next}while(r!==i)}}catch(o){zt(e,e.return,o)}}function Nd(t,e,r){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var s=i.next;n=s;do{if((n.tag&t)===t){var a=n.inst,o=a.destroy;if(o!==void 0){a.destroy=void 0,i=e;var l=r,c=o;try{c()}catch(u){zt(i,l,u)}}}n=n.next}while(n!==s)}}catch(u){zt(e,e.return,u)}}function qpe(t){var e=t.updateQueue;if(e!==null){var r=t.stateNode;try{Xfe(e,r)}catch(n){zt(t,t.return,n)}}}function Hpe(t,e,r){r.props=gh(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(n){zt(t,e,n)}}function bk(t,e){try{var r=t.ref;if(r!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof r=="function"?t.refCleanup=r(n):r.current=n}}catch(i){zt(t,e,i)}}function Sl(t,e){var r=t.ref,n=t.refCleanup;if(r!==null)if(typeof n=="function")try{n()}catch(i){zt(t,e,i)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(i){zt(t,e,i)}else r.current=null}function Gpe(t){var e=t.type,r=t.memoizedProps,n=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break e;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(i){zt(t,t.return,i)}}function x7(t,e,r){try{var n=t.stateNode;XGe(n,t.type,r,e),n[is]=e}catch(i){zt(t,t.return,i)}}function Wpe(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Vd(t.type)||t.tag===4}function w7(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wpe(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Vd(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function lB(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(t,e):(e=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,e.appendChild(t),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=jR));else if(n!==4&&(n===27&&Vd(t.type)&&(r=t.stateNode,e=null),t=t.child,t!==null))for(lB(t,e,r),t=t.sibling;t!==null;)lB(t,e,r),t=t.sibling}function mR(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(n===27&&Vd(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(mR(t,e,r),t=t.sibling;t!==null;)mR(t,e,r),t=t.sibling}function Kpe(t){var e=t.stateNode,r=t.memoizedProps;try{for(var n=t.type,i=e.attributes;i.length;)e.removeAttributeNode(i[0]);$n(e,n,r),e[ni]=t,e[is]=r}catch(s){zt(t,t.return,s)}}var _c=!1,Or=!1,k7=!1,Mde=typeof WeakSet=="function"?WeakSet:Set,vn=null;function MGe(t,e){if(t=t.containerInfo,gB=TR,t=Dfe(t),NB(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var a=0,o=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(o=a+i),d!==s||n!==0&&d.nodeType!==3||(l=a+n),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===r&&++c===i&&(o=a),f===s&&++u===n&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(yB={focusedElem:t,selectionRange:r},TR=!1,vn=e;vn!==null;)if(e=vn,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,vn=t;else for(;vn!==null;){switch(e=vn,s=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,r=e,i=s.memoizedProps,s=s.memoizedState,n=r.stateNode;try{var h=gh(r.type,i,r.elementType===r.type);t=n.getSnapshotBeforeUpdate(h,s),n.__reactInternalSnapshotBeforeUpdate=t}catch(m){zt(r,r.return,m)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,r=t.nodeType,r===9)bB(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":bB(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(X(163))}if(t=e.sibling,t!==null){t.return=e.return,vn=t;break}vn=e.return}}function Ype(t,e,r){var n=r.flags;switch(r.tag){case 0:case 11:case 15:md(t,r),n&4&&Xk(5,r);break;case 1:if(md(t,r),n&4)if(t=r.stateNode,e===null)try{t.componentDidMount()}catch(a){zt(r,r.return,a)}else{var i=gh(r.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(i,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){zt(r,r.return,a)}}n&64&&qpe(r),n&512&&bk(r,r.return);break;case 3:if(md(t,r),n&64&&(t=r.updateQueue,t!==null)){if(e=null,r.child!==null)switch(r.child.tag){case 27:case 5:e=r.child.stateNode;break;case 1:e=r.child.stateNode}try{Xfe(t,e)}catch(a){zt(r,r.return,a)}}break;case 27:e===null&&n&4&&Kpe(r);case 26:case 5:md(t,r),e===null&&n&4&&Gpe(r),n&512&&bk(r,r.return);break;case 12:md(t,r);break;case 13:md(t,r),n&4&&Zpe(t,r),n&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=$Ge.bind(null,r),nWe(t,r))));break;case 22:if(n=r.memoizedState!==null||_c,!n){e=e!==null&&e.memoizedState!==null||Or,i=_c;var s=Or;_c=n,(Or=e)&&!s?gd(t,r,(r.subtreeFlags&8772)!==0):md(t,r),_c=i,Or=s}break;case 30:break;default:md(t,r)}}function Xpe(t){var e=t.alternate;e!==null&&(t.alternate=null,Xpe(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&RB(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ur=null,rs=!1;function Mc(t,e,r){for(r=r.child;r!==null;)Qpe(t,e,r),r=r.sibling}function Qpe(t,e,r){if(Hs&&typeof Hs.onCommitFiberUnmount=="function")try{Hs.onCommitFiberUnmount(Vk,r)}catch{}switch(r.tag){case 26:Or||Sl(r,e),Mc(t,e,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Or||Sl(r,e);var n=ur,i=rs;Vd(r.type)&&(ur=r.stateNode,rs=!1),Mc(t,e,r),Sk(r.stateNode),ur=n,rs=i;break;case 5:Or||Sl(r,e);case 6:if(n=ur,i=rs,ur=null,Mc(t,e,r),ur=n,rs=i,ur!==null)if(rs)try{(ur.nodeType===9?ur.body:ur.nodeName==="HTML"?ur.ownerDocument.body:ur).removeChild(r.stateNode)}catch(s){zt(r,e,s)}else try{ur.removeChild(r.stateNode)}catch(s){zt(r,e,s)}break;case 18:ur!==null&&(rs?(t=ur,Gde(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),Fk(t)):Gde(ur,r.stateNode));break;case 4:n=ur,i=rs,ur=r.stateNode.containerInfo,rs=!0,Mc(t,e,r),ur=n,rs=i;break;case 0:case 11:case 14:case 15:Or||Nd(2,r,e),Or||Nd(4,r,e),Mc(t,e,r);break;case 1:Or||(Sl(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"&&Hpe(r,e,n)),Mc(t,e,r);break;case 21:Mc(t,e,r);break;case 22:Or=(n=Or)||r.memoizedState!==null,Mc(t,e,r),Or=n;break;default:Mc(t,e,r)}}function Zpe(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Fk(t)}catch(r){zt(e,e.return,r)}}function _Ge(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Mde),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Mde),e;default:throw Error(X(435,t.tag))}}function S7(t,e){var r=_Ge(t);e.forEach(function(n){var i=UGe.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}function $s(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n],s=t,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 27:if(Vd(o.type)){ur=o.stateNode,rs=!1;break e}break;case 5:ur=o.stateNode,rs=!1;break e;case 3:case 4:ur=o.stateNode.containerInfo,rs=!0;break e}o=o.return}if(ur===null)throw Error(X(160));Qpe(s,a,i),ur=null,rs=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)Jpe(e,t),e=e.sibling}var Co=null;function Jpe(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:$s(e,t),Us(t),n&4&&(Nd(3,t,t.return),Xk(3,t),Nd(5,t,t.return));break;case 1:$s(e,t),Us(t),n&512&&(Or||r===null||Sl(r,r.return)),n&64&&_c&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(r=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=r===null?n:r.concat(n))));break;case 26:var i=Co;if($s(e,t),Us(t),n&512&&(Or||r===null||Sl(r,r.return)),n&4){var s=r!==null?r.memoizedState:null;if(n=t.memoizedState,r===null)if(n===null)if(t.stateNode===null){e:{n=t.type,r=t.memoizedProps,i=i.ownerDocument||i;t:switch(n){case"title":s=i.getElementsByTagName("title")[0],(!s||s[Uk]||s[ni]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(n),i.head.insertBefore(s,i.querySelector("head > title"))),$n(s,n,r),s[ni]=t,bn(s),n=s;break e;case"link":var a=Qde("link","href",i).get(n+(r.href||""));if(a){for(var o=0;o<a.length;o++)if(s=a[o],s.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&s.getAttribute("rel")===(r.rel==null?null:r.rel)&&s.getAttribute("title")===(r.title==null?null:r.title)&&s.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){a.splice(o,1);break t}}s=i.createElement(n),$n(s,n,r),i.head.appendChild(s);break;case"meta":if(a=Qde("meta","content",i).get(n+(r.content||""))){for(o=0;o<a.length;o++)if(s=a[o],s.getAttribute("content")===(r.content==null?null:""+r.content)&&s.getAttribute("name")===(r.name==null?null:r.name)&&s.getAttribute("property")===(r.property==null?null:r.property)&&s.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&s.getAttribute("charset")===(r.charSet==null?null:r.charSet)){a.splice(o,1);break t}}s=i.createElement(n),$n(s,n,r),i.head.appendChild(s);break;default:throw Error(X(468,n))}s[ni]=t,bn(s),n=s}t.stateNode=n}else Zde(i,t.type,t.stateNode);else t.stateNode=Xde(i,n,t.memoizedProps);else s!==n?(s===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):s.count--,n===null?Zde(i,t.type,t.stateNode):Xde(i,n,t.memoizedProps)):n===null&&t.stateNode!==null&&x7(t,t.memoizedProps,r.memoizedProps)}break;case 27:$s(e,t),Us(t),n&512&&(Or||r===null||Sl(r,r.return)),r!==null&&n&4&&x7(t,t.memoizedProps,r.memoizedProps);break;case 5:if($s(e,t),Us(t),n&512&&(Or||r===null||Sl(r,r.return)),t.flags&32){i=t.stateNode;try{jy(i,"")}catch(p){zt(t,t.return,p)}}n&4&&t.stateNode!=null&&(i=t.memoizedProps,x7(t,i,r!==null?r.memoizedProps:i)),n&1024&&(k7=!0);break;case 6:if($s(e,t),Us(t),n&4){if(t.stateNode===null)throw Error(X(162));n=t.memoizedProps,r=t.stateNode;try{r.nodeValue=n}catch(p){zt(t,t.return,p)}}break;case 3:if(YP=null,i=Co,Co=kR(e.containerInfo),$s(e,t),Co=i,Us(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Fk(e.containerInfo)}catch(p){zt(t,t.return,p)}k7&&(k7=!1,ehe(t));break;case 4:n=Co,Co=kR(t.stateNode.containerInfo),$s(e,t),Us(t),Co=n;break;case 12:$s(e,t),Us(t);break;case 13:$s(e,t),Us(t),t.child.flags&8192&&t.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(cV=Tl()),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,S7(t,n)));break;case 22:i=t.memoizedState!==null;var l=r!==null&&r.memoizedState!==null,c=_c,u=Or;if(_c=c||i,Or=u||l,$s(e,t),Or=u,_c=c,Us(t),n&8192)e:for(e=t.stateNode,e._visibility=i?e._visibility&-2:e._visibility|1,i&&(r===null||l||_c||Or||sh(t)),r=null,e=t;;){if(e.tag===5||e.tag===26){if(r===null){l=r=e;try{if(s=l.stateNode,i)a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{o=l.stateNode;var d=l.memoizedProps.style,f=d!=null&&d.hasOwnProperty("display")?d.display:null;o.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(p){zt(l,l.return,p)}}}else if(e.tag===6){if(r===null){l=e;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(p){zt(l,l.return,p)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;r===e&&(r=null),e=e.return}r===e&&(r=null),e.sibling.return=e.return,e=e.sibling}n&4&&(n=t.updateQueue,n!==null&&(r=n.retryQueue,r!==null&&(n.retryQueue=null,S7(t,r))));break;case 19:$s(e,t),Us(t),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,S7(t,n)));break;case 30:break;case 21:break;default:$s(e,t),Us(t)}}function Us(t){var e=t.flags;if(e&2){try{for(var r,n=t.return;n!==null;){if(Wpe(n)){r=n;break}n=n.return}if(r==null)throw Error(X(160));switch(r.tag){case 27:var i=r.stateNode,s=w7(t);mR(t,s,i);break;case 5:var a=r.stateNode;r.flags&32&&(jy(a,""),r.flags&=-33);var o=w7(t);mR(t,o,a);break;case 3:case 4:var l=r.stateNode.containerInfo,c=w7(t);lB(t,c,l);break;default:throw Error(X(161))}}catch(u){zt(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function ehe(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;ehe(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function md(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Ype(t,e.alternate,e),e=e.sibling}function sh(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Nd(4,e,e.return),sh(e);break;case 1:Sl(e,e.return);var r=e.stateNode;typeof r.componentWillUnmount=="function"&&Hpe(e,e.return,r),sh(e);break;case 27:Sk(e.stateNode);case 26:case 5:Sl(e,e.return),sh(e);break;case 22:e.memoizedState===null&&sh(e);break;case 30:sh(e);break;default:sh(e)}t=t.sibling}}function gd(t,e,r){for(r=r&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var n=e.alternate,i=t,s=e,a=s.flags;switch(s.tag){case 0:case 11:case 15:gd(i,s,r),Xk(4,s);break;case 1:if(gd(i,s,r),n=s,i=n.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(c){zt(n,n.return,c)}if(n=s,i=n.updateQueue,i!==null){var o=n.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Yfe(l[i],o)}catch(c){zt(n,n.return,c)}}r&&a&64&&qpe(s),bk(s,s.return);break;case 27:Kpe(s);case 26:case 5:gd(i,s,r),r&&n===null&&a&4&&Gpe(s),bk(s,s.return);break;case 12:gd(i,s,r);break;case 13:gd(i,s,r),r&&a&4&&Zpe(i,s);break;case 22:s.memoizedState===null&&gd(i,s,r),bk(s,s.return);break;case 30:break;default:gd(i,s,r)}e=e.sibling}}function sV(t,e){var r=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==r&&(t!=null&&t.refCount++,r!=null&&Gk(r))}function aV(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Gk(t))}function wl(t,e,r,n){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)the(t,e,r,n),e=e.sibling}function the(t,e,r,n){var i=e.flags;switch(e.tag){case 0:case 11:case 15:wl(t,e,r,n),i&2048&&Xk(9,e);break;case 1:wl(t,e,r,n);break;case 3:wl(t,e,r,n),i&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Gk(t)));break;case 12:if(i&2048){wl(t,e,r,n),t=e.stateNode;try{var s=e.memoizedProps,a=s.id,o=s.onPostCommit;typeof o=="function"&&o(a,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){zt(e,e.return,l)}}else wl(t,e,r,n);break;case 13:wl(t,e,r,n);break;case 23:break;case 22:s=e.stateNode,a=e.alternate,e.memoizedState!==null?s._visibility&2?wl(t,e,r,n):xk(t,e):s._visibility&2?wl(t,e,r,n):(s._visibility|=2,gy(t,e,r,n,(e.subtreeFlags&10256)!==0)),i&2048&&sV(a,e);break;case 24:wl(t,e,r,n),i&2048&&aV(e.alternate,e);break;default:wl(t,e,r,n)}}function gy(t,e,r,n,i){for(i=i&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var s=t,a=e,o=r,l=n,c=a.flags;switch(a.tag){case 0:case 11:case 15:gy(s,a,o,l,i),Xk(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?gy(s,a,o,l,i):xk(s,a):(u._visibility|=2,gy(s,a,o,l,i)),i&&c&2048&&sV(a.alternate,a);break;case 24:gy(s,a,o,l,i),i&&c&2048&&aV(a.alternate,a);break;default:gy(s,a,o,l,i)}e=e.sibling}}function xk(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var r=t,n=e,i=n.flags;switch(n.tag){case 22:xk(r,n),i&2048&&sV(n.alternate,n);break;case 24:xk(r,n),i&2048&&aV(n.alternate,n);break;default:xk(r,n)}e=e.sibling}}var ck=8192;function py(t){if(t.subtreeFlags&ck)for(t=t.child;t!==null;)rhe(t),t=t.sibling}function rhe(t){switch(t.tag){case 26:py(t),t.flags&ck&&t.memoizedState!==null&&gWe(Co,t.memoizedState,t.memoizedProps);break;case 5:py(t);break;case 3:case 4:var e=Co;Co=kR(t.stateNode.containerInfo),py(t),Co=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=ck,ck=16777216,py(t),ck=e):py(t));break;default:py(t)}}function nhe(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function nk(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var r=0;r<e.length;r++){var n=e[r];vn=n,she(n,t)}nhe(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ihe(t),t=t.sibling}function ihe(t){switch(t.tag){case 0:case 11:case 15:nk(t),t.flags&2048&&Nd(9,t,t.return);break;case 3:nk(t);break;case 12:nk(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,WP(t)):nk(t);break;default:nk(t)}}function WP(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var r=0;r<e.length;r++){var n=e[r];vn=n,she(n,t)}nhe(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Nd(8,e,e.return),WP(e);break;case 22:r=e.stateNode,r._visibility&2&&(r._visibility&=-3,WP(e));break;default:WP(e)}t=t.sibling}}function she(t,e){for(;vn!==null;){var r=vn;switch(r.tag){case 0:case 11:case 15:Nd(8,r,e);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var n=r.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Gk(r.memoizedState.cache)}if(n=r.child,n!==null)n.return=r,vn=n;else e:for(r=t;vn!==null;){n=vn;var i=n.sibling,s=n.return;if(Xpe(n),n===r){vn=null;break e}if(i!==null){i.return=s,vn=i;break e}vn=s}}}var OGe={getCacheForType:function(t){var e=ii(rn),r=e.data.get(t);return r===void 0&&(r=t(),e.data.set(t,r)),r}},DGe=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Qt=null,nt=null,at=0,Rt=0,zs=null,Td=!1,Zy=!1,oV=!1,qc=0,Er=0,Fd=0,dh=0,lV=0,Da=0,Hy=0,wk=null,ns=null,cB=!1,cV=0,gR=1/0,yR=null,Rd=null,jn=0,Ld=null,Gy=null,Fy=0,uB=0,dB=null,ahe=null,kk=0,fB=null;function Ws(){if((Lt&2)!==0&&at!==0)return at&-at;if(De.T!==null){var t=$y;return t!==0?t:dV()}return yfe()}function ohe(){Da===0&&(Da=(at&536870912)===0||bt?pfe():536870912);var t=Na.current;return t!==null&&(t.flags|=32),Da}function Ks(t,e,r){(t===Qt&&(Rt===2||Rt===9)||t.cancelPendingCommit!==null)&&(Wy(t,0),Ed(t,at,Da,!1)),$k(t,r),((Lt&2)===0||t!==Qt)&&(t===Qt&&((Lt&2)===0&&(dh|=r),Er===4&&Ed(t,at,Da,!1)),Al(t))}function lhe(t,e,r){if((Lt&6)!==0)throw Error(X(327));var n=!r&&(e&124)===0&&(e&t.expiredLanes)===0||jk(t,e),i=n?BGe(t,e):C7(t,e,!0),s=n;do{if(i===0){Zy&&!n&&Ed(t,e,0,!1);break}else{if(r=t.current.alternate,s&&!NGe(r)){i=C7(t,e,!1),s=!1;continue}if(i===2){if(s=e,t.errorRecoveryDisabledLanes&s)var a=0;else a=t.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){e=a;e:{var o=t;i=wk;var l=o.current.memoizedState.isDehydrated;if(l&&(Wy(o,a).flags|=256),a=C7(o,a,!1),a!==2){if(oV&&!l){o.errorRecoveryDisabledLanes|=s,dh|=s,i=4;break e}s=ns,ns=i,s!==null&&(ns===null?ns=s:ns.push.apply(ns,s))}i=a}if(s=!1,i!==2)continue}}if(i===1){Wy(t,0),Ed(t,e,0,!0);break}e:{switch(n=t,s=i,s){case 0:case 1:throw Error(X(345));case 4:if((e&4194048)!==e)break;case 6:Ed(n,e,Da,!Td);break e;case 2:ns=null;break;case 3:case 5:break;default:throw Error(X(329))}if((e&62914560)===e&&(i=cV+300-Tl(),10<i)){if(Ed(n,e,Da,!Td),IR(n,0,!0)!==0)break e;n.timeoutHandle=Ihe(_de.bind(null,n,r,ns,yR,cB,e,Da,dh,Hy,Td,s,2,-0,0),i);break e}_de(n,r,ns,yR,cB,e,Da,dh,Hy,Td,s,0,-0,0)}}break}while(!0);Al(t)}function _de(t,e,r,n,i,s,a,o,l,c,u,d,f,p){if(t.timeoutHandle=-1,d=e.subtreeFlags,(d&8192||(d&16785408)===16785408)&&(_k={stylesheets:null,count:0,unsuspend:mWe},rhe(e),d=yWe(),d!==null)){t.cancelPendingCommit=d(Dde.bind(null,t,e,s,r,n,i,a,o,l,u,1,f,p)),Ed(t,s,a,!c);return}Dde(t,e,s,r,n,i,a,o,l)}function NGe(t){for(var e=t;;){var r=e.tag;if((r===0||r===11||r===15)&&e.flags&16384&&(r=e.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!Ys(s(),i))return!1}catch{return!1}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ed(t,e,r,n){e&=~lV,e&=~dh,t.suspendedLanes|=e,t.pingedLanes&=~e,n&&(t.warmLanes|=e),n=t.expirationTimes;for(var i=e;0<i;){var s=31-Gs(i),a=1<<s;n[s]=-1,i&=~a}r!==0&&mfe(t,r,e)}function FR(){return(Lt&6)===0?(Qk(0,!1),!1):!0}function uV(){if(nt!==null){if(Rt===0)var t=nt.return;else t=nt,Fc=xh=null,XB(t),Ny=null,Rk=0,t=nt;for(;t!==null;)zpe(t.alternate,t),t=t.return;nt=null}}function Wy(t,e){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,ZGe(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),uV(),Qt=t,nt=r=Vc(t.current,null),at=e,Rt=0,zs=null,Td=!1,Zy=jk(t,e),oV=!1,Hy=Da=lV=dh=Fd=Er=0,ns=wk=null,cB=!1,(e&8)!==0&&(e|=e&32);var n=t.entangledLanes;if(n!==0)for(t=t.entanglements,n&=e;0<n;){var i=31-Gs(n),s=1<<i;e|=t[i],n&=~s}return qc=e,LR(),r}function che(t,e){et=null,De.H=uR,e===Wk||e===_R?(e=dde(),Rt=3):e===Wfe?(e=dde(),Rt=4):Rt=e===Fpe?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,zs=e,nt===null&&(Er=1,pR(t,Oa(e,t.current)))}function uhe(){var t=De.H;return De.H=uR,t===null?uR:t}function dhe(){var t=De.A;return De.A=OGe,t}function pB(){Er=4,Td||(at&4194048)!==at&&Na.current!==null||(Zy=!0),(Fd&134217727)===0&&(dh&134217727)===0||Qt===null||Ed(Qt,at,Da,!1)}function C7(t,e,r){var n=Lt;Lt|=2;var i=uhe(),s=dhe();(Qt!==t||at!==e)&&(yR=null,Wy(t,e)),e=!1;var a=Er;e:do try{if(Rt!==0&&nt!==null){var o=nt,l=zs;switch(Rt){case 8:uV(),a=6;break e;case 3:case 2:case 9:case 6:Na.current===null&&(e=!0);var c=Rt;if(Rt=0,zs=null,Py(t,o,l,c),r&&Zy){a=0;break e}break;default:c=Rt,Rt=0,zs=null,Py(t,o,l,c)}}FGe(),a=Er;break}catch(u){che(t,u)}while(!0);return e&&t.shellSuspendCounter++,Fc=xh=null,Lt=n,De.H=i,De.A=s,nt===null&&(Qt=null,at=0,LR()),a}function FGe(){for(;nt!==null;)fhe(nt)}function BGe(t,e){var r=Lt;Lt|=2;var n=uhe(),i=dhe();Qt!==t||at!==e?(yR=null,gR=Tl()+500,Wy(t,e)):Zy=jk(t,e);e:do try{if(Rt!==0&&nt!==null){e=nt;var s=zs;t:switch(Rt){case 1:Rt=0,zs=null,Py(t,e,s,1);break;case 2:case 9:if(ude(s)){Rt=0,zs=null,Ode(e);break}e=function(){Rt!==2&&Rt!==9||Qt!==t||(Rt=7),Al(t)},s.then(e,e);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:ude(s)?(Rt=0,zs=null,Ode(e)):(Rt=0,zs=null,Py(t,e,s,7));break;case 5:var a=null;switch(nt.tag){case 26:a=nt.memoizedState;case 5:case 27:var o=nt;if(!a||Lhe(a)){Rt=0,zs=null;var l=o.sibling;if(l!==null)nt=l;else{var c=o.return;c!==null?(nt=c,BR(c)):nt=null}break t}}Rt=0,zs=null,Py(t,e,s,5);break;case 6:Rt=0,zs=null,Py(t,e,s,6);break;case 8:uV(),Er=6;break e;default:throw Error(X(462))}}VGe();break}catch(u){che(t,u)}while(!0);return Fc=xh=null,De.H=n,De.A=i,Lt=r,nt!==null?0:(Qt=null,at=0,LR(),Er)}function VGe(){for(;nt!==null&&!oHe();)fhe(nt)}function fhe(t){var e=Upe(t.alternate,t,qc);t.memoizedProps=t.pendingProps,e===null?BR(t):nt=e}function Ode(t){var e=t,r=e.alternate;switch(e.tag){case 15:case 0:e=Ide(r,e,e.pendingProps,e.type,void 0,at);break;case 11:e=Ide(r,e,e.pendingProps,e.type.render,e.ref,at);break;case 5:XB(e);default:zpe(r,e),e=nt=zfe(e,qc),e=Upe(r,e,qc)}t.memoizedProps=t.pendingProps,e===null?BR(t):nt=e}function Py(t,e,r,n){Fc=xh=null,XB(e),Ny=null,Rk=0;var i=e.return;try{if(AGe(t,i,e,r,at)){Er=1,pR(t,Oa(r,t.current)),nt=null;return}}catch(s){if(i!==null)throw nt=i,s;Er=1,pR(t,Oa(r,t.current)),nt=null;return}e.flags&32768?(bt||n===1?t=!0:Zy||(at&536870912)!==0?t=!1:(Td=t=!0,(n===2||n===9||n===3||n===6)&&(n=Na.current,n!==null&&n.tag===13&&(n.flags|=16384))),phe(e,t)):BR(e)}function BR(t){var e=t;do{if((e.flags&32768)!==0){phe(e,Td);return}t=e.return;var r=RGe(e.alternate,e,qc);if(r!==null){nt=r;return}if(e=e.sibling,e!==null){nt=e;return}nt=e=t}while(e!==null);Er===0&&(Er=5)}function phe(t,e){do{var r=LGe(t.alternate,t);if(r!==null){r.flags&=32767,nt=r;return}if(r=t.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!e&&(t=t.sibling,t!==null)){nt=t;return}nt=t=r}while(t!==null);Er=6,nt=null}function Dde(t,e,r,n,i,s,a,o,l){t.cancelPendingCommit=null;do VR();while(jn!==0);if((Lt&6)!==0)throw Error(X(327));if(e!==null){if(e===t.current)throw Error(X(177));if(s=e.lanes|e.childLanes,s|=FB,yHe(t,r,s,a,o,l),t===Qt&&(nt=Qt=null,at=0),Gy=e,Ld=t,Fy=r,uB=s,dB=i,ahe=n,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,zGe(eR,function(){return vhe(!0),null})):(t.callbackNode=null,t.callbackPriority=0),n=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||n){n=De.T,De.T=null,i=xt.p,xt.p=2,a=Lt,Lt|=4;try{MGe(t,e,r)}finally{Lt=a,xt.p=i,De.T=n}}jn=1,hhe(),mhe(),ghe()}}function hhe(){if(jn===1){jn=0;var t=Ld,e=Gy,r=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||r){r=De.T,De.T=null;var n=xt.p;xt.p=2;var i=Lt;Lt|=4;try{Jpe(e,t);var s=yB,a=Dfe(t.containerInfo),o=s.focusedElem,l=s.selectionRange;if(a!==o&&o&&o.ownerDocument&&Ofe(o.ownerDocument.documentElement,o)){if(l!==null&&NB(o)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var d=o.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),h=o.textContent.length,m=Math.min(l.start,h),v=l.end===void 0?m:Math.min(l.end,h);!p.extend&&m>v&&(a=v,v=m,m=a);var b=rde(o,m),y=rde(o,v);if(b&&y&&(p.rangeCount!==1||p.anchorNode!==b.node||p.anchorOffset!==b.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var x=d.createRange();x.setStart(b.node,b.offset),p.removeAllRanges(),m>v?(p.addRange(x),p.extend(y.node,y.offset)):(x.setEnd(y.node,y.offset),p.addRange(x))}}}}for(d=[],p=o;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<d.length;o++){var w=d[o];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}TR=!!gB,yB=gB=null}finally{Lt=i,xt.p=n,De.T=r}}t.current=e,jn=2}}function mhe(){if(jn===2){jn=0;var t=Ld,e=Gy,r=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||r){r=De.T,De.T=null;var n=xt.p;xt.p=2;var i=Lt;Lt|=4;try{Ype(t,e.alternate,e)}finally{Lt=i,xt.p=n,De.T=r}}jn=3}}function ghe(){if(jn===4||jn===3){jn=0,lHe();var t=Ld,e=Gy,r=Fy,n=ahe;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?jn=5:(jn=0,Gy=Ld=null,yhe(t,t.pendingLanes));var i=t.pendingLanes;if(i===0&&(Rd=null),PB(r),e=e.stateNode,Hs&&typeof Hs.onCommitFiberRoot=="function")try{Hs.onCommitFiberRoot(Vk,e,void 0,(e.current.flags&128)===128)}catch{}if(n!==null){e=De.T,i=xt.p,xt.p=2,De.T=null;try{for(var s=t.onRecoverableError,a=0;a<n.length;a++){var o=n[a];s(o.value,{componentStack:o.stack})}}finally{De.T=e,xt.p=i}}(Fy&3)!==0&&VR(),Al(t),i=t.pendingLanes,(r&4194090)!==0&&(i&42)!==0?t===fB?kk++:(kk=0,fB=t):kk=0,Qk(0,!1)}}function yhe(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Gk(e)))}function VR(t){return hhe(),mhe(),ghe(),vhe(t)}function vhe(){if(jn!==5)return!1;var t=Ld,e=uB;uB=0;var r=PB(Fy),n=De.T,i=xt.p;try{xt.p=32>r?32:r,De.T=null,r=dB,dB=null;var s=Ld,a=Fy;if(jn=0,Gy=Ld=null,Fy=0,(Lt&6)!==0)throw Error(X(331));var o=Lt;if(Lt|=4,ihe(s.current),the(s,s.current,a,r),Lt=o,Qk(0,!1),Hs&&typeof Hs.onPostCommitFiberRoot=="function")try{Hs.onPostCommitFiberRoot(Vk,s)}catch{}return!0}finally{xt.p=i,De.T=n,yhe(t,e)}}function Nde(t,e,r){e=Oa(r,e),e=sB(t.stateNode,e,2),t=Pd(t,e,2),t!==null&&($k(t,2),Al(t))}function zt(t,e,r){if(t.tag===3)Nde(t,t,r);else for(;e!==null;){if(e.tag===3){Nde(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Rd===null||!Rd.has(n))){t=Oa(r,t),r=Dpe(2),n=Pd(e,r,2),n!==null&&(Npe(r,n,e,t),$k(n,2),Al(n));break}}e=e.return}}function T7(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new DGe;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(oV=!0,i.add(r),t=jGe.bind(null,t,e,r),e.then(t,t))}function jGe(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,Qt===t&&(at&r)===r&&(Er===4||Er===3&&(at&62914560)===at&&300>Tl()-cV?(Lt&2)===0&&Wy(t,0):lV|=r,Hy===at&&(Hy=0)),Al(t)}function bhe(t,e){e===0&&(e=hfe()),t=Qy(t,e),t!==null&&($k(t,e),Al(t))}function $Ge(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),bhe(t,r)}function UGe(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(X(314))}n!==null&&n.delete(e),bhe(t,r)}function zGe(t,e){return IB(t,e)}var vR=null,yy=null,hB=!1,bR=!1,E7=!1,fh=0;function Al(t){t!==yy&&t.next===null&&(yy===null?vR=yy=t:yy=yy.next=t),bR=!0,hB||(hB=!0,HGe())}function Qk(t,e){if(!E7&&bR){E7=!0;do for(var r=!1,n=vR;n!==null;){if(!e)if(t!==0){var i=n.pendingLanes;if(i===0)var s=0;else{var a=n.suspendedLanes,o=n.pingedLanes;s=(1<<31-Gs(42|t)+1)-1,s&=i&~(a&~o),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(r=!0,Fde(n,s))}else s=at,s=IR(n,n===Qt?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(s&3)===0||jk(n,s)||(r=!0,Fde(n,s));n=n.next}while(r);E7=!1}}function qGe(){xhe()}function xhe(){bR=hB=!1;var t=0;fh!==0&&(QGe()&&(t=fh),fh=0);for(var e=Tl(),r=null,n=vR;n!==null;){var i=n.next,s=whe(n,e);s===0?(n.next=null,r===null?vR=i:r.next=i,i===null&&(yy=r)):(r=n,(t!==0||(s&3)!==0)&&(bR=!0)),n=i}Qk(t,!1)}function whe(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var a=31-Gs(s),o=1<<a,l=i[a];l===-1?((o&r)===0||(o&n)!==0)&&(i[a]=gHe(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}if(e=Qt,r=at,r=IR(t,t===e?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n=t.callbackNode,r===0||t===e&&(Rt===2||Rt===9)||t.cancelPendingCommit!==null)return n!==null&&n!==null&&J9(n),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||jk(t,r)){if(e=r&-r,e===t.callbackPriority)return e;switch(n!==null&&J9(n),PB(r)){case 2:case 8:r=dfe;break;case 32:r=eR;break;case 268435456:r=ffe;break;default:r=eR}return n=khe.bind(null,t),r=IB(r,n),t.callbackPriority=e,t.callbackNode=r,e}return n!==null&&n!==null&&J9(n),t.callbackPriority=2,t.callbackNode=null,2}function khe(t,e){if(jn!==0&&jn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if(VR(!0)&&t.callbackNode!==r)return null;var n=at;return n=IR(t,t===Qt?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n===0?null:(lhe(t,n,e),whe(t,Tl()),t.callbackNode!=null&&t.callbackNode===r?khe.bind(null,t):null)}function Fde(t,e){if(VR())return null;lhe(t,e,!0)}function HGe(){JGe(function(){(Lt&6)!==0?IB(ufe,qGe):xhe()})}function dV(){return fh===0&&(fh=pfe()),fh}function Bde(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:VP(""+t)}function Vde(t,e){var r=e.ownerDocument.createElement("input");return r.name=e.name,r.value=e.value,t.id&&r.setAttribute("form",t.id),e.parentNode.insertBefore(r,e),t=new FormData(t),r.parentNode.removeChild(r),t}function GGe(t,e,r,n,i){if(e==="submit"&&r&&r.stateNode===i){var s=Bde((i[is]||null).action),a=n.submitter;a&&(e=(e=a[is]||null)?Bde(e.formAction):a.getAttribute("formAction"),e!==null&&(s=e,a=null));var o=new AR("action","action",null,n,i);t.push({event:o,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(fh!==0){var l=a?Vde(i,a):new FormData(i);nB(r,{pending:!0,data:l,method:i.method,action:s},null,l)}}else typeof s=="function"&&(o.preventDefault(),l=a?Vde(i,a):new FormData(i),nB(r,{pending:!0,data:l,method:i.method,action:s},s,l))},currentTarget:i}]})}}for(_P=0;_P<H7.length;_P++)OP=H7[_P],jde=OP.toLowerCase(),$de=OP[0].toUpperCase()+OP.slice(1),Eo(jde,"on"+$de);var OP,jde,$de,_P;Eo(Ffe,"onAnimationEnd");Eo(Bfe,"onAnimationIteration");Eo(Vfe,"onAnimationStart");Eo("dblclick","onDoubleClick");Eo("focusin","onFocus");Eo("focusout","onBlur");Eo(dGe,"onTransitionRun");Eo(fGe,"onTransitionStart");Eo(pGe,"onTransitionCancel");Eo(jfe,"onTransitionEnd");Vy("onMouseEnter",["mouseout","mouseover"]);Vy("onMouseLeave",["mouseout","mouseover"]);Vy("onPointerEnter",["pointerout","pointerover"]);Vy("onPointerLeave",["pointerout","pointerover"]);yh("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yh("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yh("onBeforeInput",["compositionend","keypress","textInput","paste"]);yh("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yh("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yh("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lk="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),WGe=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lk));function She(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;e:{var s=void 0;if(e)for(var a=n.length-1;0<=a;a--){var o=n[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;s=o,i.currentTarget=c;try{s(i)}catch(u){fR(u)}i.currentTarget=null,s=l}else for(a=0;a<n.length;a++){if(o=n[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;s=o,i.currentTarget=c;try{s(i)}catch(u){fR(u)}i.currentTarget=null,s=l}}}}function rt(t,e){var r=e[B7];r===void 0&&(r=e[B7]=new Set);var n=t+"__bubble";r.has(n)||(Che(e,t,2,!1),r.add(n))}function I7(t,e,r){var n=0;e&&(n|=4),Che(r,t,n,e)}var DP="_reactListening"+Math.random().toString(36).slice(2);function fV(t){if(!t[DP]){t[DP]=!0,vfe.forEach(function(r){r!=="selectionchange"&&(WGe.has(r)||I7(r,!1,t),I7(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[DP]||(e[DP]=!0,I7("selectionchange",!1,e))}}function Che(t,e,r,n){switch(Nhe(e)){case 2:var i=xWe;break;case 8:i=wWe;break;default:i=gV}r=i.bind(null,e,r,t),i=void 0,!U7||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),n?i!==void 0?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):i!==void 0?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function A7(t,e,r,n,i){var s=n;if((e&1)===0&&(e&2)===0&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var o=n.stateNode.containerInfo;if(o===i)break;if(a===4)for(a=n.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===i)return;a=a.return}for(;o!==null;){if(a=xy(o),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){n=s=a;continue e}o=o.parentNode}}n=n.return}Efe(function(){var c=s,u=MB(r),d=[];e:{var f=$fe.get(t);if(f!==void 0){var p=AR,h=t;switch(t){case"keypress":if($P(r)===0)break e;case"keydown":case"keyup":p=zHe;break;case"focusin":h="focus",p=o7;break;case"focusout":h="blur",p=o7;break;case"beforeblur":case"afterblur":p=o7;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Wue;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=LHe;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=GHe;break;case Ffe:case Bfe:case Vfe:p=OHe;break;case jfe:p=KHe;break;case"scroll":case"scrollend":p=PHe;break;case"wheel":p=XHe;break;case"copy":case"cut":case"paste":p=NHe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Yue;break;case"toggle":case"beforetoggle":p=ZHe}var m=(e&4)!==0,v=!m&&(t==="scroll"||t==="scrollend"),b=m?f!==null?f+"Capture":null:f;m=[];for(var y=c,x;y!==null;){var w=y;if(x=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||x===null||b===null||(w=Tk(y,b),w!=null&&m.push(Mk(y,w,x))),v)break;y=y.return}0<m.length&&(f=new p(f,h,null,r,u),d.push({event:f,listeners:m}))}}if((e&7)===0){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&r!==$7&&(h=r.relatedTarget||r.fromElement)&&(xy(h)||h[Yy]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(h=r.relatedTarget||r.toElement,p=c,h=h?xy(h):null,h!==null&&(v=Bk(h),m=h.tag,h!==v||m!==5&&m!==27&&m!==6)&&(h=null)):(p=null,h=c),p!==h)){if(m=Wue,w="onMouseLeave",b="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(m=Yue,w="onPointerLeave",b="onPointerEnter",y="pointer"),v=p==null?f:lk(p),x=h==null?f:lk(h),f=new m(w,y+"leave",p,r,u),f.target=v,f.relatedTarget=x,w=null,xy(u)===c&&(m=new m(b,y+"enter",h,r,u),m.target=x,m.relatedTarget=v,w=m),v=w,p&&h)t:{for(m=p,b=h,y=0,x=m;x;x=hy(x))y++;for(x=0,w=b;w;w=hy(w))x++;for(;0<y-x;)m=hy(m),y--;for(;0<x-y;)b=hy(b),x--;for(;y--;){if(m===b||b!==null&&m===b.alternate)break t;m=hy(m),b=hy(b)}m=null}else m=null;p!==null&&Ude(d,f,p,m,!1),h!==null&&v!==null&&Ude(d,v,h,m,!0)}}e:{if(f=c?lk(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=Jue;else if(Zue(f))if(Mfe)C=lGe;else{C=aGe;var O=sGe}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?c&&LB(c.elementType)&&(C=Jue):C=oGe;if(C&&(C=C(t,c))){Lfe(d,C,r,u);break e}O&&O(t,f,c),t==="focusout"&&c&&f.type==="number"&&c.memoizedProps.value!=null&&j7(f,"number",f.value)}switch(O=c?lk(c):window,t){case"focusin":(Zue(O)||O.contentEditable==="true")&&(Sy=O,z7=c,fk=null);break;case"focusout":fk=z7=Sy=null;break;case"mousedown":q7=!0;break;case"contextmenu":case"mouseup":case"dragend":q7=!1,nde(d,r,u);break;case"selectionchange":if(uGe)break;case"keydown":case"keyup":nde(d,r,u)}var S;if(DB)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else ky?Pfe(t,r)&&(T="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(Afe&&r.locale!=="ko"&&(ky||T!=="onCompositionStart"?T==="onCompositionEnd"&&ky&&(S=Ife()):(Cd=u,_B="value"in Cd?Cd.value:Cd.textContent,ky=!0)),O=xR(c,T),0<O.length&&(T=new Kue(T,t,null,r,u),d.push({event:T,listeners:O}),S?T.data=S:(S=Rfe(r),S!==null&&(T.data=S)))),(S=eGe?tGe(t,r):rGe(t,r))&&(T=xR(c,"onBeforeInput"),0<T.length&&(O=new Kue("onBeforeInput","beforeinput",null,r,u),d.push({event:O,listeners:T}),O.data=S)),GGe(d,t,c,r,u)}She(d,e)})}function Mk(t,e,r){return{instance:t,listener:e,currentTarget:r}}function xR(t,e){for(var r=e+"Capture",n=[];t!==null;){var i=t,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=Tk(t,r),i!=null&&n.unshift(Mk(t,i,s)),i=Tk(t,e),i!=null&&n.push(Mk(t,i,s))),t.tag===3)return n;t=t.return}return[]}function hy(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ude(t,e,r,n,i){for(var s=e._reactName,a=[];r!==null&&r!==n;){var o=r,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===n)break;o!==5&&o!==26&&o!==27||c===null||(l=c,i?(c=Tk(r,s),c!=null&&a.unshift(Mk(r,c,l))):i||(c=Tk(r,s),c!=null&&a.push(Mk(r,c,l)))),r=r.return}a.length!==0&&t.push({event:e,listeners:a})}var KGe=/\r\n?/g,YGe=/\u0000|\uFFFD/g;function zde(t){return(typeof t=="string"?t:""+t).replace(KGe,`
`).replace(YGe,"")}function The(t,e){return e=zde(e),zde(t)===e}function jR(){}function Nt(t,e,r,n,i,s){switch(r){case"children":typeof n=="string"?e==="body"||e==="textarea"&&n===""||jy(t,n):(typeof n=="number"||typeof n=="bigint")&&e!=="body"&&jy(t,""+n);break;case"className":CP(t,"class",n);break;case"tabIndex":CP(t,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":CP(t,r,n);break;case"style":Tfe(t,n,s);break;case"data":if(e!=="object"){CP(t,"data",n);break}case"src":case"href":if(n===""&&(e!=="a"||r!=="href")){t.removeAttribute(r);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(r);break}n=VP(""+n),t.setAttribute(r,n);break;case"action":case"formAction":if(typeof n=="function"){t.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(r==="formAction"?(e!=="input"&&Nt(t,e,"name",i.name,i,null),Nt(t,e,"formEncType",i.formEncType,i,null),Nt(t,e,"formMethod",i.formMethod,i,null),Nt(t,e,"formTarget",i.formTarget,i,null)):(Nt(t,e,"encType",i.encType,i,null),Nt(t,e,"method",i.method,i,null),Nt(t,e,"target",i.target,i,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(r);break}n=VP(""+n),t.setAttribute(r,n);break;case"onClick":n!=null&&(t.onclick=jR);break;case"onScroll":n!=null&&rt("scroll",t);break;case"onScrollEnd":n!=null&&rt("scrollend",t);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(X(61));if(r=n.__html,r!=null){if(i.children!=null)throw Error(X(60));t.innerHTML=r}}break;case"multiple":t.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":t.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){t.removeAttribute("xlink:href");break}r=VP(""+n),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(r,""+n):t.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(r,""):t.removeAttribute(r);break;case"capture":case"download":n===!0?t.setAttribute(r,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(r,n):t.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?t.setAttribute(r,n):t.removeAttribute(r);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?t.removeAttribute(r):t.setAttribute(r,n);break;case"popover":rt("beforetoggle",t),rt("toggle",t),BP(t,"popover",n);break;case"xlinkActuate":Rc(t,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Rc(t,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Rc(t,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Rc(t,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Rc(t,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Rc(t,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Rc(t,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Rc(t,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Rc(t,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":BP(t,"is",n);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=IHe.get(r)||r,BP(t,r,n))}}function mB(t,e,r,n,i,s){switch(r){case"style":Tfe(t,n,s);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(X(61));if(r=n.__html,r!=null){if(i.children!=null)throw Error(X(60));t.innerHTML=r}}break;case"children":typeof n=="string"?jy(t,n):(typeof n=="number"||typeof n=="bigint")&&jy(t,""+n);break;case"onScroll":n!=null&&rt("scroll",t);break;case"onScrollEnd":n!=null&&rt("scrollend",t);break;case"onClick":n!=null&&(t.onclick=jR);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bfe.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(i=r.endsWith("Capture"),e=r.slice(2,i?r.length-7:void 0),s=t[is]||null,s=s!=null?s[r]:null,typeof s=="function"&&t.removeEventListener(e,s,i),typeof n=="function")){typeof s!="function"&&s!==null&&(r in t?t[r]=null:t.hasAttribute(r)&&t.removeAttribute(r)),t.addEventListener(e,n,i);break e}r in t?t[r]=n:n===!0?t.setAttribute(r,""):BP(t,r,n)}}}function $n(t,e,r){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",t),rt("load",t);var n=!1,i=!1,s;for(s in r)if(r.hasOwnProperty(s)){var a=r[s];if(a!=null)switch(s){case"src":n=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(X(137,e));default:Nt(t,e,s,a,r,null)}}i&&Nt(t,e,"srcSet",r.srcSet,r,null),n&&Nt(t,e,"src",r.src,r,null);return;case"input":rt("invalid",t);var o=s=a=i=null,l=null,c=null;for(n in r)if(r.hasOwnProperty(n)){var u=r[n];if(u!=null)switch(n){case"name":i=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":o=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(X(137,e));break;default:Nt(t,e,n,u,r,null)}}kfe(t,s,o,l,c,a,i,!1),tR(t);return;case"select":rt("invalid",t),n=a=s=null;for(i in r)if(r.hasOwnProperty(i)&&(o=r[i],o!=null))switch(i){case"value":s=o;break;case"defaultValue":a=o;break;case"multiple":n=o;default:Nt(t,e,i,o,r,null)}e=s,r=a,t.multiple=!!n,e!=null?Ly(t,!!n,e,!1):r!=null&&Ly(t,!!n,r,!0);return;case"textarea":rt("invalid",t),s=i=n=null;for(a in r)if(r.hasOwnProperty(a)&&(o=r[a],o!=null))switch(a){case"value":n=o;break;case"defaultValue":i=o;break;case"children":s=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(X(91));break;default:Nt(t,e,a,o,r,null)}Cfe(t,n,i,s),tR(t);return;case"option":for(l in r)if(r.hasOwnProperty(l)&&(n=r[l],n!=null))switch(l){case"selected":t.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Nt(t,e,l,n,r,null)}return;case"dialog":rt("beforetoggle",t),rt("toggle",t),rt("cancel",t),rt("close",t);break;case"iframe":case"object":rt("load",t);break;case"video":case"audio":for(n=0;n<Lk.length;n++)rt(Lk[n],t);break;case"image":rt("error",t),rt("load",t);break;case"details":rt("toggle",t);break;case"embed":case"source":case"link":rt("error",t),rt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in r)if(r.hasOwnProperty(c)&&(n=r[c],n!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(X(137,e));default:Nt(t,e,c,n,r,null)}return;default:if(LB(e)){for(u in r)r.hasOwnProperty(u)&&(n=r[u],n!==void 0&&mB(t,e,u,n,r,void 0));return}}for(o in r)r.hasOwnProperty(o)&&(n=r[o],n!=null&&Nt(t,e,o,n,r,null))}function XGe(t,e,r,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,o=null,l=null,c=null,u=null;for(p in r){var d=r[p];if(r.hasOwnProperty(p)&&d!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":l=d;default:n.hasOwnProperty(p)||Nt(t,e,p,null,n,d)}}for(var f in n){var p=n[f];if(d=r[f],n.hasOwnProperty(f)&&(p!=null||d!=null))switch(f){case"type":s=p;break;case"name":i=p;break;case"checked":c=p;break;case"defaultChecked":u=p;break;case"value":a=p;break;case"defaultValue":o=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(X(137,e));break;default:p!==d&&Nt(t,e,f,p,n,d)}}V7(t,a,o,l,c,u,s,i);return;case"select":p=a=o=f=null;for(s in r)if(l=r[s],r.hasOwnProperty(s)&&l!=null)switch(s){case"value":break;case"multiple":p=l;default:n.hasOwnProperty(s)||Nt(t,e,s,null,n,l)}for(i in n)if(s=n[i],l=r[i],n.hasOwnProperty(i)&&(s!=null||l!=null))switch(i){case"value":f=s;break;case"defaultValue":o=s;break;case"multiple":a=s;default:s!==l&&Nt(t,e,i,s,n,l)}e=o,r=a,n=p,f!=null?Ly(t,!!r,f,!1):!!n!=!!r&&(e!=null?Ly(t,!!r,e,!0):Ly(t,!!r,r?[]:"",!1));return;case"textarea":p=f=null;for(o in r)if(i=r[o],r.hasOwnProperty(o)&&i!=null&&!n.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Nt(t,e,o,null,n,i)}for(a in n)if(i=n[a],s=r[a],n.hasOwnProperty(a)&&(i!=null||s!=null))switch(a){case"value":f=i;break;case"defaultValue":p=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(X(91));break;default:i!==s&&Nt(t,e,a,i,n,s)}Sfe(t,f,p);return;case"option":for(var h in r)if(f=r[h],r.hasOwnProperty(h)&&f!=null&&!n.hasOwnProperty(h))switch(h){case"selected":t.selected=!1;break;default:Nt(t,e,h,null,n,f)}for(l in n)if(f=n[l],p=r[l],n.hasOwnProperty(l)&&f!==p&&(f!=null||p!=null))switch(l){case"selected":t.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Nt(t,e,l,f,n,p)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var m in r)f=r[m],r.hasOwnProperty(m)&&f!=null&&!n.hasOwnProperty(m)&&Nt(t,e,m,null,n,f);for(c in n)if(f=n[c],p=r[c],n.hasOwnProperty(c)&&f!==p&&(f!=null||p!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(X(137,e));break;default:Nt(t,e,c,f,n,p)}return;default:if(LB(e)){for(var v in r)f=r[v],r.hasOwnProperty(v)&&f!==void 0&&!n.hasOwnProperty(v)&&mB(t,e,v,void 0,n,f);for(u in n)f=n[u],p=r[u],!n.hasOwnProperty(u)||f===p||f===void 0&&p===void 0||mB(t,e,u,f,n,p);return}}for(var b in r)f=r[b],r.hasOwnProperty(b)&&f!=null&&!n.hasOwnProperty(b)&&Nt(t,e,b,null,n,f);for(d in n)f=n[d],p=r[d],!n.hasOwnProperty(d)||f===p||f==null&&p==null||Nt(t,e,d,f,n,p)}var gB=null,yB=null;function wR(t){return t.nodeType===9?t:t.ownerDocument}function qde(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ehe(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function vB(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var P7=null;function QGe(){var t=window.event;return t&&t.type==="popstate"?t===P7?!1:(P7=t,!0):(P7=null,!1)}var Ihe=typeof setTimeout=="function"?setTimeout:void 0,ZGe=typeof clearTimeout=="function"?clearTimeout:void 0,Hde=typeof Promise=="function"?Promise:void 0,JGe=typeof queueMicrotask=="function"?queueMicrotask:typeof Hde<"u"?function(t){return Hde.resolve(null).then(t).catch(eWe)}:Ihe;function eWe(t){setTimeout(function(){throw t})}function Vd(t){return t==="head"}function Gde(t,e){var r=e,n=0,i=0;do{var s=r.nextSibling;if(t.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(0<n&&8>n){r=n;var a=t.ownerDocument;if(r&1&&Sk(a.documentElement),r&2&&Sk(a.body),r&4)for(r=a.head,Sk(r),a=r.firstChild;a;){var o=a.nextSibling,l=a.nodeName;a[Uk]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&a.rel.toLowerCase()==="stylesheet"||r.removeChild(a),a=o}}if(i===0){t.removeChild(s),Fk(e);return}i--}else r==="$"||r==="$?"||r==="$!"?i++:n=r.charCodeAt(0)-48;else n=0;r=s}while(r);Fk(e)}function bB(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var r=e;switch(e=e.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":bB(r),RB(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function tWe(t,e,r,n){for(;t.nodeType===1;){var i=r;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!n&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(n){if(!t[Uk])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==i.rel||t.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||t.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||t.getAttribute("title")!==(i.title==null?null:i.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(i.src==null?null:i.src)||t.getAttribute("type")!==(i.type==null?null:i.type)||t.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=To(t.nextSibling),t===null)break}return null}function rWe(t,e,r){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=To(t.nextSibling),t===null))return null;return t}function xB(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function nWe(t,e){var r=t.ownerDocument;if(t.data!=="$?"||r.readyState==="complete")e();else{var n=function(){e(),r.removeEventListener("DOMContentLoaded",n)};r.addEventListener("DOMContentLoaded",n),t._reactRetry=n}}function To(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var wB=null;function Wde(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}function Ahe(t,e,r){switch(e=wR(r),t){case"html":if(t=e.documentElement,!t)throw Error(X(452));return t;case"head":if(t=e.head,!t)throw Error(X(453));return t;case"body":if(t=e.body,!t)throw Error(X(454));return t;default:throw Error(X(451))}}function Sk(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);RB(t)}var Fa=new Map,Kde=new Set;function kR(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Hc=xt.d;xt.d={f:iWe,r:sWe,D:aWe,C:oWe,L:lWe,m:cWe,X:dWe,S:uWe,M:fWe};function iWe(){var t=Hc.f(),e=FR();return t||e}function sWe(t){var e=Xy(t);e!==null&&e.tag===5&&e.type==="form"?wpe(e):Hc.r(t)}var Jy=typeof document>"u"?null:document;function Phe(t,e,r){var n=Jy;if(n&&typeof e=="string"&&e){var i=_a(e);i='link[rel="'+t+'"][href="'+i+'"]',typeof r=="string"&&(i+='[crossorigin="'+r+'"]'),Kde.has(i)||(Kde.add(i),t={rel:t,crossOrigin:r,href:e},n.querySelector(i)===null&&(e=n.createElement("link"),$n(e,"link",t),bn(e),n.head.appendChild(e)))}}function aWe(t){Hc.D(t),Phe("dns-prefetch",t,null)}function oWe(t,e){Hc.C(t,e),Phe("preconnect",t,e)}function lWe(t,e,r){Hc.L(t,e,r);var n=Jy;if(n&&t&&e){var i='link[rel="preload"][as="'+_a(e)+'"]';e==="image"&&r&&r.imageSrcSet?(i+='[imagesrcset="'+_a(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(i+='[imagesizes="'+_a(r.imageSizes)+'"]')):i+='[href="'+_a(t)+'"]';var s=i;switch(e){case"style":s=Ky(t);break;case"script":s=ev(t)}Fa.has(s)||(t=rr({rel:"preload",href:e==="image"&&r&&r.imageSrcSet?void 0:t,as:e},r),Fa.set(s,t),n.querySelector(i)!==null||e==="style"&&n.querySelector(Zk(s))||e==="script"&&n.querySelector(Jk(s))||(e=n.createElement("link"),$n(e,"link",t),bn(e),n.head.appendChild(e)))}}function cWe(t,e){Hc.m(t,e);var r=Jy;if(r&&t){var n=e&&typeof e.as=="string"?e.as:"script",i='link[rel="modulepreload"][as="'+_a(n)+'"][href="'+_a(t)+'"]',s=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=ev(t)}if(!Fa.has(s)&&(t=rr({rel:"modulepreload",href:t},e),Fa.set(s,t),r.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Jk(s)))return}n=r.createElement("link"),$n(n,"link",t),bn(n),r.head.appendChild(n)}}}function uWe(t,e,r){Hc.S(t,e,r);var n=Jy;if(n&&t){var i=Ry(n).hoistableStyles,s=Ky(t);e=e||"default";var a=i.get(s);if(!a){var o={loading:0,preload:null};if(a=n.querySelector(Zk(s)))o.loading=5;else{t=rr({rel:"stylesheet",href:t,"data-precedence":e},r),(r=Fa.get(s))&&pV(t,r);var l=a=n.createElement("link");bn(l),$n(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,KP(a,e,n)}a={type:"stylesheet",instance:a,count:1,state:o},i.set(s,a)}}}function dWe(t,e){Hc.X(t,e);var r=Jy;if(r&&t){var n=Ry(r).hoistableScripts,i=ev(t),s=n.get(i);s||(s=r.querySelector(Jk(i)),s||(t=rr({src:t,async:!0},e),(e=Fa.get(i))&&hV(t,e),s=r.createElement("script"),bn(s),$n(s,"link",t),r.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(i,s))}}function fWe(t,e){Hc.M(t,e);var r=Jy;if(r&&t){var n=Ry(r).hoistableScripts,i=ev(t),s=n.get(i);s||(s=r.querySelector(Jk(i)),s||(t=rr({src:t,async:!0,type:"module"},e),(e=Fa.get(i))&&hV(t,e),s=r.createElement("script"),bn(s),$n(s,"link",t),r.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(i,s))}}function Yde(t,e,r,n){var i=(i=Id.current)?kR(i):null;if(!i)throw Error(X(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(e=Ky(r.href),r=Ry(i).hoistableStyles,n=r.get(e),n||(n={type:"style",instance:null,count:0,state:null},r.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){t=Ky(r.href);var s=Ry(i).hoistableStyles,a=s.get(t);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,a),(s=i.querySelector(Zk(t)))&&!s._p&&(a.instance=s,a.state.loading=5),Fa.has(t)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Fa.set(t,r),s||pWe(i,t,r,a.state))),e&&n===null)throw Error(X(528,""));return a}if(e&&n!==null)throw Error(X(529,""));return null;case"script":return e=r.async,r=r.src,typeof r=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=ev(r),r=Ry(i).hoistableScripts,n=r.get(e),n||(n={type:"script",instance:null,count:0,state:null},r.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(X(444,t))}}function Ky(t){return'href="'+_a(t)+'"'}function Zk(t){return'link[rel="stylesheet"]['+t+"]"}function Rhe(t){return rr({},t,{"data-precedence":t.precedence,precedence:null})}function pWe(t,e,r,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),$n(e,"link",r),bn(e),t.head.appendChild(e))}function ev(t){return'[src="'+_a(t)+'"]'}function Jk(t){return"script[async]"+t}function Xde(t,e,r){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+_a(r.href)+'"]');if(n)return e.instance=n,bn(n),n;var i=rr({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),bn(n),$n(n,"style",i),KP(n,r.precedence,t),e.instance=n;case"stylesheet":i=Ky(r.href);var s=t.querySelector(Zk(i));if(s)return e.state.loading|=4,e.instance=s,bn(s),s;n=Rhe(r),(i=Fa.get(i))&&pV(n,i),s=(t.ownerDocument||t).createElement("link"),bn(s);var a=s;return a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),$n(s,"link",n),e.state.loading|=4,KP(s,r.precedence,t),e.instance=s;case"script":return s=ev(r.src),(i=t.querySelector(Jk(s)))?(e.instance=i,bn(i),i):(n=r,(i=Fa.get(s))&&(n=rr({},r),hV(n,i)),t=t.ownerDocument||t,i=t.createElement("script"),bn(i),$n(i,"link",n),t.head.appendChild(i),e.instance=i);case"void":return null;default:throw Error(X(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,KP(n,r.precedence,t));return e.instance}function KP(t,e,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,s=i,a=0;a<n.length;a++){var o=n[a];if(o.dataset.precedence===e)s=o;else if(s!==i)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=r.nodeType===9?r.head:r,e.insertBefore(t,e.firstChild))}function pV(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function hV(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var YP=null;function Qde(t,e,r){if(YP===null){var n=new Map,i=YP=new Map;i.set(r,n)}else i=YP,n=i.get(r),n||(n=new Map,i.set(r,n));if(n.has(t))return n;for(n.set(t,null),r=r.getElementsByTagName(t),i=0;i<r.length;i++){var s=r[i];if(!(s[Uk]||s[ni]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var a=s.getAttribute(e)||"";a=t+a;var o=n.get(a);o?o.push(s):n.set(a,[s])}}return n}function Zde(t,e,r){t=t.ownerDocument||t,t.head.insertBefore(r,e==="title"?t.querySelector("head > title"):null)}function hWe(t,e,r){if(r===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Lhe(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var _k=null;function mWe(){}function gWe(t,e,r){if(_k===null)throw Error(X(475));var n=_k;if(e.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var i=Ky(r.href),s=t.querySelector(Zk(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(n.count++,n=SR.bind(n),t.then(n,n)),e.state.loading|=4,e.instance=s,bn(s);return}s=t.ownerDocument||t,r=Rhe(r),(i=Fa.get(i))&&pV(r,i),s=s.createElement("link"),bn(s);var a=s;a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),$n(s,"link",r),e.instance=s}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(n.count++,e=SR.bind(n),t.addEventListener("load",e),t.addEventListener("error",e))}}function yWe(){if(_k===null)throw Error(X(475));var t=_k;return t.stylesheets&&t.count===0&&kB(t,t.stylesheets),0<t.count?function(e){var r=setTimeout(function(){if(t.stylesheets&&kB(t,t.stylesheets),t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(r)}}:null}function SR(){if(this.count--,this.count===0){if(this.stylesheets)kB(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var CR=null;function kB(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,CR=new Map,e.forEach(vWe,t),CR=null,SR.call(t))}function vWe(t,e){if(!(e.state.loading&4)){var r=CR.get(t);if(r)var n=r.get(null);else{r=new Map,CR.set(t,r);for(var i=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var a=i[s];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(r.set(a.dataset.precedence,a),n=a)}n&&r.set(null,n)}i=e.instance,a=i.getAttribute("data-precedence"),s=r.get(a)||n,s===n&&r.set(null,i),r.set(a,i),this.count++,n=SR.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),s?s.parentNode.insertBefore(i,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(i,t.firstChild)),e.state.loading|=4}}var Ok={$$typeof:Oc,Provider:null,Consumer:null,_currentValue:ah,_currentValue2:ah,_threadCount:0};function bWe(t,e,r,n,i,s,a,o){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=e7(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=e7(0),this.hiddenUpdates=e7(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Mhe(t,e,r,n,i,s,a,o,l,c,u,d){return t=new bWe(t,e,r,a,o,l,c,d),e=1,s===!0&&(e|=24),s=qs(3,null,null,e),t.current=s,s.stateNode=t,e=UB(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:n,isDehydrated:r,cache:e},qB(s),t}function _he(t){return t?(t=Ey,t):Ey}function Ohe(t,e,r,n,i,s){i=_he(i),n.context===null?n.context=i:n.pendingContext=i,n=Ad(e),n.payload={element:r},s=s===void 0?null:s,s!==null&&(n.callback=s),r=Pd(t,n,e),r!==null&&(Ks(r,t,e),mk(r,t,e))}function Jde(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function mV(t,e){Jde(t,e),(t=t.alternate)&&Jde(t,e)}function Dhe(t){if(t.tag===13){var e=Qy(t,67108864);e!==null&&Ks(e,t,67108864),mV(t,67108864)}}var TR=!0;function xWe(t,e,r,n){var i=De.T;De.T=null;var s=xt.p;try{xt.p=2,gV(t,e,r,n)}finally{xt.p=s,De.T=i}}function wWe(t,e,r,n){var i=De.T;De.T=null;var s=xt.p;try{xt.p=8,gV(t,e,r,n)}finally{xt.p=s,De.T=i}}function gV(t,e,r,n){if(TR){var i=SB(n);if(i===null)A7(t,e,n,ER,r),efe(t,n);else if(SWe(i,t,e,r,n))n.stopPropagation();else if(efe(t,n),e&4&&-1<kWe.indexOf(t)){for(;i!==null;){var s=Xy(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var a=nh(s.pendingLanes);if(a!==0){var o=s;for(o.pendingLanes|=2,o.entangledLanes|=2;a;){var l=1<<31-Gs(a);o.entanglements[1]|=l,a&=~l}Al(s),(Lt&6)===0&&(gR=Tl()+500,Qk(0,!1))}}break;case 13:o=Qy(s,2),o!==null&&Ks(o,s,2),FR(),mV(s,2)}if(s=SB(n),s===null&&A7(t,e,n,ER,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else A7(t,e,n,null,r)}}function SB(t){return t=MB(t),yV(t)}var ER=null;function yV(t){if(ER=null,t=xy(t),t!==null){var e=Bk(t);if(e===null)t=null;else{var r=e.tag;if(r===13){if(t=afe(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return ER=t,null}function Nhe(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(cHe()){case ufe:return 2;case dfe:return 8;case eR:case uHe:return 32;case ffe:return 268435456;default:return 32}default:return 32}}var CB=!1,Md=null,_d=null,Od=null,Dk=new Map,Nk=new Map,kd=[],kWe="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function efe(t,e){switch(t){case"focusin":case"focusout":Md=null;break;case"dragenter":case"dragleave":_d=null;break;case"mouseover":case"mouseout":Od=null;break;case"pointerover":case"pointerout":Dk.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nk.delete(e.pointerId)}}function ik(t,e,r,n,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Xy(e),e!==null&&Dhe(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function SWe(t,e,r,n,i){switch(e){case"focusin":return Md=ik(Md,t,e,r,n,i),!0;case"dragenter":return _d=ik(_d,t,e,r,n,i),!0;case"mouseover":return Od=ik(Od,t,e,r,n,i),!0;case"pointerover":var s=i.pointerId;return Dk.set(s,ik(Dk.get(s)||null,t,e,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Nk.set(s,ik(Nk.get(s)||null,t,e,r,n,i)),!0}return!1}function Fhe(t){var e=xy(t.target);if(e!==null){var r=Bk(e);if(r!==null){if(e=r.tag,e===13){if(e=afe(r),e!==null){t.blockedOn=e,vHe(t.priority,function(){if(r.tag===13){var n=Ws();n=AB(n);var i=Qy(r,n);i!==null&&Ks(i,r,n),mV(r,n)}});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function XP(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=SB(t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);$7=n,r.target.dispatchEvent(n),$7=null}else return e=Xy(r),e!==null&&Dhe(e),t.blockedOn=r,!1;e.shift()}return!0}function tfe(t,e,r){XP(t)&&r.delete(e)}function CWe(){CB=!1,Md!==null&&XP(Md)&&(Md=null),_d!==null&&XP(_d)&&(_d=null),Od!==null&&XP(Od)&&(Od=null),Dk.forEach(tfe),Nk.forEach(tfe)}function NP(t,e){t.blockedOn===e&&(t.blockedOn=null,CB||(CB=!0,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,CWe)))}var FP=null;function rfe(t){FP!==t&&(FP=t,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,function(){FP===t&&(FP=null);for(var e=0;e<t.length;e+=3){var r=t[e],n=t[e+1],i=t[e+2];if(typeof n!="function"){if(yV(n||r)===null)continue;break}var s=Xy(r);s!==null&&(t.splice(e,3),e-=3,nB(s,{pending:!0,data:i,method:r.method,action:n},n,i))}}))}function Fk(t){function e(l){return NP(l,t)}Md!==null&&NP(Md,t),_d!==null&&NP(_d,t),Od!==null&&NP(Od,t),Dk.forEach(e),Nk.forEach(e);for(var r=0;r<kd.length;r++){var n=kd[r];n.blockedOn===t&&(n.blockedOn=null)}for(;0<kd.length&&(r=kd[0],r.blockedOn===null);)Fhe(r),r.blockedOn===null&&kd.shift();if(r=(t.ownerDocument||t).$$reactFormReplay,r!=null)for(n=0;n<r.length;n+=3){var i=r[n],s=r[n+1],a=i[is]||null;if(typeof s=="function")a||rfe(r);else if(a){var o=null;if(s&&s.hasAttribute("formAction")){if(i=s,a=s[is]||null)o=a.formAction;else if(yV(i)!==null)continue}else o=a.action;typeof o=="function"?r[n+1]=o:(r.splice(n,3),n-=3),rfe(r)}}}function vV(t){this._internalRoot=t}$R.prototype.render=vV.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(X(409));var r=e.current,n=Ws();Ohe(r,n,t,e,null,null)};$R.prototype.unmount=vV.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ohe(t.current,2,null,t,null,null),FR(),e[Yy]=null}};function $R(t){this._internalRoot=t}$R.prototype.unstable_scheduleHydration=function(t){if(t){var e=yfe();t={blockedOn:null,target:t,priority:e};for(var r=0;r<kd.length&&e!==0&&e<kd[r].priority;r++);kd.splice(r,0,t),r===0&&Fhe(t)}};var nfe=ife.version;if(nfe!=="19.1.0")throw Error(X(527,nfe,"19.1.0"));xt.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(X(188)):(t=Object.keys(t).join(","),Error(X(268,t)));return t=rHe(e),t=t!==null?ofe(t):null,t=t===null?null:t.stateNode,t};var TWe={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:De,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(sk=__REACT_DEVTOOLS_GLOBAL_HOOK__,!sk.isDisabled&&sk.supportsFiber))try{Vk=sk.inject(TWe),Hs=sk}catch{}var sk;UR.createRoot=function(t,e){if(!sfe(t))throw Error(X(299));var r=!1,n="",i=Mpe,s=_pe,a=Ope,o=null;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onUncaughtError!==void 0&&(i=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(a=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(o=e.unstable_transitionCallbacks)),e=Mhe(t,1,!1,null,null,r,n,i,s,a,o,null),t[Yy]=e.current,fV(t),new vV(e)};UR.hydrateRoot=function(t,e,r){if(!sfe(t))throw Error(X(299));var n=!1,i="",s=Mpe,a=_pe,o=Ope,l=null,c=null;return r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onUncaughtError!==void 0&&(s=r.onUncaughtError),r.onCaughtError!==void 0&&(a=r.onCaughtError),r.onRecoverableError!==void 0&&(o=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(l=r.unstable_transitionCallbacks),r.formState!==void 0&&(c=r.formState)),e=Mhe(t,1,!0,e,r??null,n,i,s,a,o,l,c),e.context=_he(null),r=e.current,n=Ws(),n=AB(n),i=Ad(n),i.callback=null,Pd(r,i,n),r=n,e.current.lanes=r,$k(e,r),Al(e),t[Yy]=e.current,fV(t),new $R(e)};UR.version="19.1.0"});var zR=L((REt,jhe)=>{"use strict";function Vhe(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vhe)}catch(t){console.error(t)}}Vhe(),jhe.exports=Bhe()});var bj=L(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.anumber=vj;Ah.abytes=fye;Ah.ahash=UKe;Ah.aexists=zKe;Ah.aoutput=qKe;function vj(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function $Ke(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function fye(t,...e){if(!$Ke(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function UKe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");vj(t.outputLen),vj(t.blockLen)}function zKe(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function qKe(t,e){fye(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Oye=L($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.add5L=$e.add5H=$e.add4H=$e.add4L=$e.add3H=$e.add3L=$e.rotlBL=$e.rotlBH=$e.rotlSL=$e.rotlSH=$e.rotr32L=$e.rotr32H=$e.rotrBL=$e.rotrBH=$e.rotrSL=$e.rotrSH=$e.shrSL=$e.shrSH=$e.toBig=void 0;$e.fromBig=wj;$e.split=pye;$e.add=Iye;var HL=BigInt(2**32-1),xj=BigInt(32);function wj(t,e=!1){return e?{h:Number(t&HL),l:Number(t>>xj&HL)}:{h:Number(t>>xj&HL)|0,l:Number(t&HL)|0}}function pye(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){let{h:s,l:a}=wj(t[i],e);[r[i],n[i]]=[s,a]}return[r,n]}var hye=(t,e)=>BigInt(t>>>0)<<xj|BigInt(e>>>0);$e.toBig=hye;var mye=(t,e,r)=>t>>>r;$e.shrSH=mye;var gye=(t,e,r)=>t<<32-r|e>>>r;$e.shrSL=gye;var yye=(t,e,r)=>t>>>r|e<<32-r;$e.rotrSH=yye;var vye=(t,e,r)=>t<<32-r|e>>>r;$e.rotrSL=vye;var bye=(t,e,r)=>t<<64-r|e>>>r-32;$e.rotrBH=bye;var xye=(t,e,r)=>t>>>r-32|e<<64-r;$e.rotrBL=xye;var wye=(t,e)=>e;$e.rotr32H=wye;var kye=(t,e)=>t;$e.rotr32L=kye;var Sye=(t,e,r)=>t<<r|e>>>32-r;$e.rotlSH=Sye;var Cye=(t,e,r)=>e<<r|t>>>32-r;$e.rotlSL=Cye;var Tye=(t,e,r)=>e<<r-32|t>>>64-r;$e.rotlBH=Tye;var Eye=(t,e,r)=>t<<r-32|e>>>64-r;$e.rotlBL=Eye;function Iye(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var Aye=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);$e.add3L=Aye;var Pye=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;$e.add3H=Pye;var Rye=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);$e.add4L=Rye;var Lye=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;$e.add4H=Lye;var Mye=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);$e.add5L=Mye;var _ye=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;$e.add5H=_ye;var HKe={fromBig:wj,split:pye,toBig:hye,shrSH:mye,shrSL:gye,rotrSH:yye,rotrSL:vye,rotrBH:bye,rotrBL:xye,rotr32H:wye,rotr32L:kye,rotlSH:Sye,rotlSL:Cye,rotlBH:Tye,rotlBL:Eye,add:Iye,add3L:Aye,add3H:Pye,add4L:Rye,add4H:Lye,add5H:_ye,add5L:Mye};$e.default=HKe});var Dye=L(GL=>{"use strict";Object.defineProperty(GL,"__esModule",{value:!0});GL.crypto=void 0;GL.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var Bye=L(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.Hash=wt.nextTick=wt.byteSwapIfBE=wt.isLE=void 0;wt.isBytes=GKe;wt.u8=WKe;wt.u32=KKe;wt.createView=YKe;wt.rotr=XKe;wt.rotl=QKe;wt.byteSwap=Cj;wt.byteSwap32=ZKe;wt.bytesToHex=eYe;wt.hexToBytes=tYe;wt.asyncLoop=nYe;wt.utf8ToBytes=Fye;wt.toBytes=WL;wt.concatBytes=iYe;wt.checkOpts=sYe;wt.wrapConstructor=aYe;wt.wrapConstructorWithOpts=oYe;wt.wrapXOFConstructorWithOpts=lYe;wt.randomBytes=cYe;var pv=Dye(),Sj=bj();function GKe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function WKe(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function KKe(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function YKe(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function XKe(t,e){return t<<32-e|t>>>e}function QKe(t,e){return t<<e|t>>>32-e>>>0}wt.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Cj(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}wt.byteSwapIfBE=wt.isLE?t=>t:t=>Cj(t);function ZKe(t){for(let e=0;e<t.length;e++)t[e]=Cj(t[e])}var JKe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function eYe(t){(0,Sj.abytes)(t);let e="";for(let r=0;r<t.length;r++)e+=JKe[t[r]];return e}var Yc={_0:48,_9:57,A:65,F:70,a:97,f:102};function Nye(t){if(t>=Yc._0&&t<=Yc._9)return t-Yc._0;if(t>=Yc.A&&t<=Yc.F)return t-(Yc.A-10);if(t>=Yc.a&&t<=Yc.f)return t-(Yc.a-10)}function tYe(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){let a=Nye(t.charCodeAt(s)),o=Nye(t.charCodeAt(s+1));if(a===void 0||o===void 0){let l=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+s)}n[i]=a*16+o}return n}var rYe=async()=>{};wt.nextTick=rYe;async function nYe(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);let s=Date.now()-n;s>=0&&s<e||(await(0,wt.nextTick)(),n+=s)}}function Fye(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function WL(t){return typeof t=="string"&&(t=Fye(t)),(0,Sj.abytes)(t),t}function iYe(...t){let e=0;for(let n=0;n<t.length;n++){let i=t[n];(0,Sj.abytes)(i),e+=i.length}let r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){let s=t[n];r.set(s,i),i+=s.length}return r}var kj=class{clone(){return this._cloneInto()}};wt.Hash=kj;function sYe(t,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function aYe(t){let e=n=>t().update(WL(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function oYe(t){let e=(n,i)=>t(i).update(WL(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function lYe(t){let e=(n,i)=>t(i).update(WL(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function cYe(t=32){if(pv.crypto&&typeof pv.crypto.getRandomValues=="function")return pv.crypto.getRandomValues(new Uint8Array(t));if(pv.crypto&&typeof pv.crypto.randomBytes=="function")return pv.crypto.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}});var Gye=L(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.shake256=nr.shake128=nr.keccak_512=nr.keccak_384=nr.keccak_256=nr.keccak_224=nr.sha3_512=nr.sha3_384=nr.sha3_256=nr.sha3_224=nr.Keccak=void 0;nr.keccakP=qye;var hv=bj(),yS=Oye(),Xc=Bye(),$ye=[],Uye=[],zye=[],uYe=BigInt(0),gS=BigInt(1),dYe=BigInt(2),fYe=BigInt(7),pYe=BigInt(256),hYe=BigInt(113);for(let t=0,e=gS,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],$ye.push(2*(5*n+r)),Uye.push((t+1)*(t+2)/2%64);let i=uYe;for(let s=0;s<7;s++)e=(e<<gS^(e>>fYe)*hYe)%pYe,e&dYe&&(i^=gS<<(gS<<BigInt(s))-gS);zye.push(i)}var[mYe,gYe]=(0,yS.split)(zye,!0),Vye=(t,e,r)=>r>32?(0,yS.rotlBH)(t,e,r):(0,yS.rotlSH)(t,e,r),jye=(t,e,r)=>r>32?(0,yS.rotlBL)(t,e,r):(0,yS.rotlSL)(t,e,r);function qye(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){let o=(a+8)%10,l=(a+2)%10,c=r[l],u=r[l+1],d=Vye(c,u,1)^r[o],f=jye(c,u,1)^r[o+1];for(let p=0;p<50;p+=10)t[a+p]^=d,t[a+p+1]^=f}let i=t[2],s=t[3];for(let a=0;a<24;a++){let o=Uye[a],l=Vye(i,s,o),c=jye(i,s,o),u=$ye[a];i=t[u],s=t[u+1],t[u]=l,t[u+1]=c}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)r[o]=t[a+o];for(let o=0;o<10;o++)t[a+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=mYe[n],t[1]^=gYe[n]}r.fill(0)}var vS=class t extends Xc.Hash{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,hv.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Xc.u32)(this.state)}keccak(){Xc.isLE||(0,Xc.byteSwap32)(this.state32),qye(this.state32,this.rounds),Xc.isLE||(0,Xc.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,hv.aexists)(this);let{blockLen:r,state:n}=this;e=(0,Xc.toBytes)(e);let i=e.length;for(let s=0;s<i;){let a=Math.min(r-this.pos,i-s);for(let o=0;o<a;o++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){(0,hv.aexists)(this,!1),(0,hv.abytes)(e),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,hv.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,hv.aoutput)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:a}=this;return e||(e=new t(r,n,i,a,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}};nr.Keccak=vS;var Yd=(t,e,r)=>(0,Xc.wrapConstructor)(()=>new vS(e,t,r));nr.sha3_224=Yd(6,144,224/8);nr.sha3_256=Yd(6,136,256/8);nr.sha3_384=Yd(6,104,384/8);nr.sha3_512=Yd(6,72,512/8);nr.keccak_224=Yd(1,144,224/8);nr.keccak_256=Yd(1,136,256/8);nr.keccak_384=Yd(1,104,384/8);nr.keccak_512=Yd(1,72,512/8);var Hye=(t,e,r)=>(0,Xc.wrapXOFConstructorWithOpts)((n={})=>new vS(e,t,n.dkLen===void 0?r:n.dkLen,!0));nr.shake128=Hye(31,168,128/8);nr.shake256=Hye(31,136,256/8)});var eve=L((AMt,Xd)=>{var{sha3_512:yYe}=Gye(),Kye=24,bS=32,Tj=(t=4,e=Math.random)=>{let r="";for(;r.length<t;)r=r+Math.floor(e()*36).toString(36);return r};function Yye(t){let e=8n,r=0n;for(let n of t.values()){let i=BigInt(n);r=(r<<e)+i}return r}var Xye=(t="")=>Yye(yYe(t)).toString(36).slice(1),Wye=Array.from({length:26},(t,e)=>String.fromCharCode(e+97)),vYe=t=>Wye[Math.floor(t()*Wye.length)],Qye=({globalObj:t=typeof global<"u"?global:typeof window<"u"?window:{},random:e=Math.random}={})=>{let r=Object.keys(t).toString(),n=r.length?r+Tj(bS,e):Tj(bS,e);return Xye(n).substring(0,bS)},Zye=t=>()=>t++,bYe=476782367,Jye=({random:t=Math.random,counter:e=Zye(Math.floor(t()*bYe)),length:r=Kye,fingerprint:n=Qye({random:t})}={})=>function(){let s=vYe(t),a=Date.now().toString(36),o=e().toString(36),l=Tj(r,t),c=`${a+l+o+n}`;return`${s+Xye(c).substring(1,r)}`},xYe=Jye(),wYe=(t,{minLength:e=2,maxLength:r=bS}={})=>{let n=t.length,i=/^[0-9a-z]+$/;try{if(typeof t=="string"&&n>=e&&n<=r&&i.test(t))return!0}finally{}return!1};Xd.exports.getConstants=()=>({defaultLength:Kye,bigLength:bS});Xd.exports.init=Jye;Xd.exports.createId=xYe;Xd.exports.bufToBigInt=Yye;Xd.exports.createCounter=Zye;Xd.exports.createFingerprint=Qye;Xd.exports.isCuid=wYe});var Ej=L((PMt,xS)=>{var{createId:kYe,init:SYe,getConstants:CYe,isCuid:TYe}=eve();xS.exports.createId=kYe;xS.exports.init=SYe;xS.exports.getConstants=CYe;xS.exports.isCuid=TYe});var jS=L((xNt,Tbe)=>{var hXe="2.0.0",mXe=Number.MAX_SAFE_INTEGER||9007199254740991,gXe=16,yXe=250,vXe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Tbe.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:gXe,MAX_SAFE_BUILD_LENGTH:yXe,MAX_SAFE_INTEGER:mXe,RELEASE_TYPES:vXe,SEMVER_SPEC_VERSION:hXe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var $S=L((wNt,Ebe)=>{var bXe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Ebe.exports=bXe});var _v=L((_l,Ibe)=>{var{MAX_SAFE_COMPONENT_LENGTH:g$,MAX_SAFE_BUILD_LENGTH:xXe,MAX_LENGTH:wXe}=jS(),kXe=$S();_l=Ibe.exports={};var SXe=_l.re=[],CXe=_l.safeRe=[],ce=_l.src=[],TXe=_l.safeSrc=[],ue=_l.t={},EXe=0,y$="[a-zA-Z0-9-]",IXe=[["\\s",1],["\\d",wXe],[y$,xXe]],AXe=t=>{for(let[e,r]of IXe)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},qe=(t,e,r)=>{let n=AXe(e),i=EXe++;kXe(t,i,e),ue[t]=i,ce[i]=e,TXe[i]=n,SXe[i]=new RegExp(e,r?"g":void 0),CXe[i]=new RegExp(n,r?"g":void 0)};qe("NUMERICIDENTIFIER","0|[1-9]\\d*");qe("NUMERICIDENTIFIERLOOSE","\\d+");qe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${y$}*`);qe("MAINVERSION",`(${ce[ue.NUMERICIDENTIFIER]})\\.(${ce[ue.NUMERICIDENTIFIER]})\\.(${ce[ue.NUMERICIDENTIFIER]})`);qe("MAINVERSIONLOOSE",`(${ce[ue.NUMERICIDENTIFIERLOOSE]})\\.(${ce[ue.NUMERICIDENTIFIERLOOSE]})\\.(${ce[ue.NUMERICIDENTIFIERLOOSE]})`);qe("PRERELEASEIDENTIFIER",`(?:${ce[ue.NUMERICIDENTIFIER]}|${ce[ue.NONNUMERICIDENTIFIER]})`);qe("PRERELEASEIDENTIFIERLOOSE",`(?:${ce[ue.NUMERICIDENTIFIERLOOSE]}|${ce[ue.NONNUMERICIDENTIFIER]})`);qe("PRERELEASE",`(?:-(${ce[ue.PRERELEASEIDENTIFIER]}(?:\\.${ce[ue.PRERELEASEIDENTIFIER]})*))`);qe("PRERELEASELOOSE",`(?:-?(${ce[ue.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ce[ue.PRERELEASEIDENTIFIERLOOSE]})*))`);qe("BUILDIDENTIFIER",`${y$}+`);qe("BUILD",`(?:\\+(${ce[ue.BUILDIDENTIFIER]}(?:\\.${ce[ue.BUILDIDENTIFIER]})*))`);qe("FULLPLAIN",`v?${ce[ue.MAINVERSION]}${ce[ue.PRERELEASE]}?${ce[ue.BUILD]}?`);qe("FULL",`^${ce[ue.FULLPLAIN]}$`);qe("LOOSEPLAIN",`[v=\\s]*${ce[ue.MAINVERSIONLOOSE]}${ce[ue.PRERELEASELOOSE]}?${ce[ue.BUILD]}?`);qe("LOOSE",`^${ce[ue.LOOSEPLAIN]}$`);qe("GTLT","((?:<|>)?=?)");qe("XRANGEIDENTIFIERLOOSE",`${ce[ue.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);qe("XRANGEIDENTIFIER",`${ce[ue.NUMERICIDENTIFIER]}|x|X|\\*`);qe("XRANGEPLAIN",`[v=\\s]*(${ce[ue.XRANGEIDENTIFIER]})(?:\\.(${ce[ue.XRANGEIDENTIFIER]})(?:\\.(${ce[ue.XRANGEIDENTIFIER]})(?:${ce[ue.PRERELEASE]})?${ce[ue.BUILD]}?)?)?`);qe("XRANGEPLAINLOOSE",`[v=\\s]*(${ce[ue.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ce[ue.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ce[ue.XRANGEIDENTIFIERLOOSE]})(?:${ce[ue.PRERELEASELOOSE]})?${ce[ue.BUILD]}?)?)?`);qe("XRANGE",`^${ce[ue.GTLT]}\\s*${ce[ue.XRANGEPLAIN]}$`);qe("XRANGELOOSE",`^${ce[ue.GTLT]}\\s*${ce[ue.XRANGEPLAINLOOSE]}$`);qe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${g$}})(?:\\.(\\d{1,${g$}}))?(?:\\.(\\d{1,${g$}}))?`);qe("COERCE",`${ce[ue.COERCEPLAIN]}(?:$|[^\\d])`);qe("COERCEFULL",ce[ue.COERCEPLAIN]+`(?:${ce[ue.PRERELEASE]})?(?:${ce[ue.BUILD]})?(?:$|[^\\d])`);qe("COERCERTL",ce[ue.COERCE],!0);qe("COERCERTLFULL",ce[ue.COERCEFULL],!0);qe("LONETILDE","(?:~>?)");qe("TILDETRIM",`(\\s*)${ce[ue.LONETILDE]}\\s+`,!0);_l.tildeTrimReplace="$1~";qe("TILDE",`^${ce[ue.LONETILDE]}${ce[ue.XRANGEPLAIN]}$`);qe("TILDELOOSE",`^${ce[ue.LONETILDE]}${ce[ue.XRANGEPLAINLOOSE]}$`);qe("LONECARET","(?:\\^)");qe("CARETTRIM",`(\\s*)${ce[ue.LONECARET]}\\s+`,!0);_l.caretTrimReplace="$1^";qe("CARET",`^${ce[ue.LONECARET]}${ce[ue.XRANGEPLAIN]}$`);qe("CARETLOOSE",`^${ce[ue.LONECARET]}${ce[ue.XRANGEPLAINLOOSE]}$`);qe("COMPARATORLOOSE",`^${ce[ue.GTLT]}\\s*(${ce[ue.LOOSEPLAIN]})$|^$`);qe("COMPARATOR",`^${ce[ue.GTLT]}\\s*(${ce[ue.FULLPLAIN]})$|^$`);qe("COMPARATORTRIM",`(\\s*)${ce[ue.GTLT]}\\s*(${ce[ue.LOOSEPLAIN]}|${ce[ue.XRANGEPLAIN]})`,!0);_l.comparatorTrimReplace="$1$2$3";qe("HYPHENRANGE",`^\\s*(${ce[ue.XRANGEPLAIN]})\\s+-\\s+(${ce[ue.XRANGEPLAIN]})\\s*$`);qe("HYPHENRANGELOOSE",`^\\s*(${ce[ue.XRANGEPLAINLOOSE]})\\s+-\\s+(${ce[ue.XRANGEPLAINLOOSE]})\\s*$`);qe("STAR","(<|>)?=?\\s*\\*");qe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");qe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var W3=L((kNt,Abe)=>{var PXe=Object.freeze({loose:!0}),RXe=Object.freeze({}),LXe=t=>t?typeof t!="object"?PXe:t:RXe;Abe.exports=LXe});var v$=L((SNt,Lbe)=>{var Pbe=/^[0-9]+$/,Rbe=(t,e)=>{let r=Pbe.test(t),n=Pbe.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},MXe=(t,e)=>Rbe(e,t);Lbe.exports={compareIdentifiers:Rbe,rcompareIdentifiers:MXe}});var oi=L((CNt,Dbe)=>{var K3=$S(),{MAX_LENGTH:Mbe,MAX_SAFE_INTEGER:Y3}=jS(),{safeRe:_be,safeSrc:Obe,t:X3}=_v(),_Xe=W3(),{compareIdentifiers:Ov}=v$(),b$=class t{constructor(e,r){if(r=_Xe(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Mbe)throw new TypeError(`version is longer than ${Mbe} characters`);K3("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?_be[X3.LOOSE]:_be[X3.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Y3||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Y3||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Y3||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<Y3)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(K3("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),Ov(this.major,e.major)||Ov(this.minor,e.minor)||Ov(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(K3("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Ov(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(K3("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Ov(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=new RegExp(`^${this.options.loose?Obe[X3.PRERELEASELOOSE]:Obe[X3.PRERELEASE]}$`),s=`-${r}`.match(i);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Ov(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Dbe.exports=b$});var Vh=L((TNt,Fbe)=>{var Nbe=oi(),OXe=(t,e,r=!1)=>{if(t instanceof Nbe)return t;try{return new Nbe(t,e)}catch(n){if(!r)return null;throw n}};Fbe.exports=OXe});var Vbe=L((ENt,Bbe)=>{var DXe=Vh(),NXe=(t,e)=>{let r=DXe(t,e);return r?r.version:null};Bbe.exports=NXe});var $be=L((INt,jbe)=>{var FXe=Vh(),BXe=(t,e)=>{let r=FXe(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};jbe.exports=BXe});var qbe=L((ANt,zbe)=>{var Ube=oi(),VXe=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Ube(t instanceof Ube?t.version:t,r).inc(e,n,i).version}catch{return null}};zbe.exports=VXe});var Wbe=L((PNt,Gbe)=>{var Hbe=Vh(),jXe=(t,e)=>{let r=Hbe(t,null,!0),n=Hbe(e,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,a=s?r:n,o=s?n:r,l=!!a.prerelease.length;if(!!o.prerelease.length&&!l){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let u=l?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};Gbe.exports=jXe});var Ybe=L((RNt,Kbe)=>{var $Xe=oi(),UXe=(t,e)=>new $Xe(t,e).major;Kbe.exports=UXe});var Qbe=L((LNt,Xbe)=>{var zXe=oi(),qXe=(t,e)=>new zXe(t,e).minor;Xbe.exports=qXe});var Jbe=L((MNt,Zbe)=>{var HXe=oi(),GXe=(t,e)=>new HXe(t,e).patch;Zbe.exports=GXe});var t0e=L((_Nt,e0e)=>{var WXe=Vh(),KXe=(t,e)=>{let r=WXe(t,e);return r&&r.prerelease.length?r.prerelease:null};e0e.exports=KXe});var $a=L((ONt,n0e)=>{var r0e=oi(),YXe=(t,e,r)=>new r0e(t,r).compare(new r0e(e,r));n0e.exports=YXe});var s0e=L((DNt,i0e)=>{var XXe=$a(),QXe=(t,e,r)=>XXe(e,t,r);i0e.exports=QXe});var o0e=L((NNt,a0e)=>{var ZXe=$a(),JXe=(t,e)=>ZXe(t,e,!0);a0e.exports=JXe});var Q3=L((FNt,c0e)=>{var l0e=oi(),eQe=(t,e,r)=>{let n=new l0e(t,r),i=new l0e(e,r);return n.compare(i)||n.compareBuild(i)};c0e.exports=eQe});var d0e=L((BNt,u0e)=>{var tQe=Q3(),rQe=(t,e)=>t.sort((r,n)=>tQe(r,n,e));u0e.exports=rQe});var p0e=L((VNt,f0e)=>{var nQe=Q3(),iQe=(t,e)=>t.sort((r,n)=>nQe(n,r,e));f0e.exports=iQe});var US=L((jNt,h0e)=>{var sQe=$a(),aQe=(t,e,r)=>sQe(t,e,r)>0;h0e.exports=aQe});var Z3=L(($Nt,m0e)=>{var oQe=$a(),lQe=(t,e,r)=>oQe(t,e,r)<0;m0e.exports=lQe});var x$=L((UNt,g0e)=>{var cQe=$a(),uQe=(t,e,r)=>cQe(t,e,r)===0;g0e.exports=uQe});var w$=L((zNt,y0e)=>{var dQe=$a(),fQe=(t,e,r)=>dQe(t,e,r)!==0;y0e.exports=fQe});var J3=L((qNt,v0e)=>{var pQe=$a(),hQe=(t,e,r)=>pQe(t,e,r)>=0;v0e.exports=hQe});var eM=L((HNt,b0e)=>{var mQe=$a(),gQe=(t,e,r)=>mQe(t,e,r)<=0;b0e.exports=gQe});var k$=L((GNt,x0e)=>{var yQe=x$(),vQe=w$(),bQe=US(),xQe=J3(),wQe=Z3(),kQe=eM(),SQe=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return yQe(t,r,n);case"!=":return vQe(t,r,n);case">":return bQe(t,r,n);case">=":return xQe(t,r,n);case"<":return wQe(t,r,n);case"<=":return kQe(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};x0e.exports=SQe});var k0e=L((WNt,w0e)=>{var CQe=oi(),TQe=Vh(),{safeRe:tM,t:rM}=_v(),EQe=(t,e)=>{if(t instanceof CQe)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?tM[rM.COERCEFULL]:tM[rM.COERCE]);else{let l=e.includePrerelease?tM[rM.COERCERTLFULL]:tM[rM.COERCERTL],c;for(;(c=l.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",o=e.includePrerelease&&r[6]?`+${r[6]}`:"";return TQe(`${n}.${i}.${s}${a}${o}`,e)};w0e.exports=EQe});var C0e=L((KNt,S0e)=>{var S$=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};S0e.exports=S$});var Ua=L((YNt,A0e)=>{var IQe=/\s+/g,C$=class t{constructor(e,r){if(r=PQe(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof T$)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(IQe," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!E0e(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&NQe(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&OQe)|(this.options.loose&&DQe))+":"+e,i=T0e.get(n);if(i)return i;let s=this.options.loose,a=s?ds[Mi.HYPHENRANGELOOSE]:ds[Mi.HYPHENRANGE];e=e.replace(a,GQe(this.options.includePrerelease)),sr("hyphen replace",e),e=e.replace(ds[Mi.COMPARATORTRIM],LQe),sr("comparator trim",e),e=e.replace(ds[Mi.TILDETRIM],MQe),sr("tilde trim",e),e=e.replace(ds[Mi.CARETTRIM],_Qe),sr("caret trim",e);let o=e.split(" ").map(d=>FQe(d,this.options)).join(" ").split(/\s+/).map(d=>HQe(d,this.options));s&&(o=o.filter(d=>(sr("loose invalid filter",d,this.options),!!d.match(ds[Mi.COMPARATORLOOSE])))),sr("range list",o);let l=new Map,c=o.map(d=>new T$(d,this.options));for(let d of c){if(E0e(d))return[d];l.set(d.value,d)}l.size>1&&l.has("")&&l.delete("");let u=[...l.values()];return T0e.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>I0e(n,r)&&e.set.some(i=>I0e(i,r)&&n.every(s=>i.every(a=>s.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new RQe(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(WQe(this.set[r],e,this.options))return!0;return!1}};A0e.exports=C$;var AQe=C0e(),T0e=new AQe,PQe=W3(),T$=zS(),sr=$S(),RQe=oi(),{safeRe:ds,t:Mi,comparatorTrimReplace:LQe,tildeTrimReplace:MQe,caretTrimReplace:_Qe}=_v(),{FLAG_INCLUDE_PRERELEASE:OQe,FLAG_LOOSE:DQe}=jS(),E0e=t=>t.value==="<0.0.0-0",NQe=t=>t.value==="",I0e=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,e)),i=n.pop();return r},FQe=(t,e)=>(sr("comp",t,e),t=jQe(t,e),sr("caret",t),t=BQe(t,e),sr("tildes",t),t=UQe(t,e),sr("xrange",t),t=qQe(t,e),sr("stars",t),t),_i=t=>!t||t.toLowerCase()==="x"||t==="*",BQe=(t,e)=>t.trim().split(/\s+/).map(r=>VQe(r,e)).join(" "),VQe=(t,e)=>{let r=e.loose?ds[Mi.TILDELOOSE]:ds[Mi.TILDE];return t.replace(r,(n,i,s,a,o)=>{sr("tilde",t,n,i,s,a,o);let l;return _i(i)?l="":_i(s)?l=`>=${i}.0.0 <${+i+1}.0.0-0`:_i(a)?l=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:o?(sr("replaceTilde pr",o),l=`>=${i}.${s}.${a}-${o} <${i}.${+s+1}.0-0`):l=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`,sr("tilde return",l),l})},jQe=(t,e)=>t.trim().split(/\s+/).map(r=>$Qe(r,e)).join(" "),$Qe=(t,e)=>{sr("caret",t,e);let r=e.loose?ds[Mi.CARETLOOSE]:ds[Mi.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,s,a,o,l)=>{sr("caret",t,i,s,a,o,l);let c;return _i(s)?c="":_i(a)?c=`>=${s}.0.0${n} <${+s+1}.0.0-0`:_i(o)?s==="0"?c=`>=${s}.${a}.0${n} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.0${n} <${+s+1}.0.0-0`:l?(sr("replaceCaret pr",l),s==="0"?a==="0"?c=`>=${s}.${a}.${o}-${l} <${s}.${a}.${+o+1}-0`:c=`>=${s}.${a}.${o}-${l} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${o}-${l} <${+s+1}.0.0-0`):(sr("no pr"),s==="0"?a==="0"?c=`>=${s}.${a}.${o}${n} <${s}.${a}.${+o+1}-0`:c=`>=${s}.${a}.${o}${n} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${o} <${+s+1}.0.0-0`),sr("caret return",c),c})},UQe=(t,e)=>(sr("replaceXRanges",t,e),t.split(/\s+/).map(r=>zQe(r,e)).join(" ")),zQe=(t,e)=>{t=t.trim();let r=e.loose?ds[Mi.XRANGELOOSE]:ds[Mi.XRANGE];return t.replace(r,(n,i,s,a,o,l)=>{sr("xRange",t,n,i,s,a,o,l);let c=_i(s),u=c||_i(a),d=u||_i(o),f=d;return i==="="&&f&&(i=""),l=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(u&&(a=0),o=0,i===">"?(i=">=",u?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):i==="<="&&(i="<",u?s=+s+1:a=+a+1),i==="<"&&(l="-0"),n=`${i+s}.${a}.${o}${l}`):u?n=`>=${s}.0.0${l} <${+s+1}.0.0-0`:d&&(n=`>=${s}.${a}.0${l} <${s}.${+a+1}.0-0`),sr("xRange return",n),n})},qQe=(t,e)=>(sr("replaceStars",t,e),t.trim().replace(ds[Mi.STAR],"")),HQe=(t,e)=>(sr("replaceGTE0",t,e),t.trim().replace(ds[e.includePrerelease?Mi.GTE0PRE:Mi.GTE0],"")),GQe=t=>(e,r,n,i,s,a,o,l,c,u,d,f)=>(_i(n)?r="":_i(i)?r=`>=${n}.0.0${t?"-0":""}`:_i(s)?r=`>=${n}.${i}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,_i(c)?l="":_i(u)?l=`<${+c+1}.0.0-0`:_i(d)?l=`<${c}.${+u+1}.0-0`:f?l=`<=${c}.${u}.${d}-${f}`:t?l=`<${c}.${u}.${+d+1}-0`:l=`<=${l}`,`${r} ${l}`.trim()),WQe=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(sr(t[n].semver),t[n].semver!==T$.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var zS=L((XNt,O0e)=>{var qS=Symbol("SemVer ANY"),A$=class t{static get ANY(){return qS}constructor(e,r){if(r=P0e(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),I$("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===qS?this.value="":this.value=this.operator+this.semver.version,I$("comp",this)}parse(e){let r=this.options.loose?R0e[L0e.COMPARATORLOOSE]:R0e[L0e.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new M0e(n[2],this.options.loose):this.semver=qS}toString(){return this.value}test(e){if(I$("Comparator.test",e,this.options.loose),this.semver===qS||e===qS)return!0;if(typeof e=="string")try{e=new M0e(e,this.options)}catch{return!1}return E$(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new _0e(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new _0e(this.value,r).test(e.semver):(r=P0e(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||E$(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||E$(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};O0e.exports=A$;var P0e=W3(),{safeRe:R0e,t:L0e}=_v(),E$=k$(),I$=$S(),M0e=oi(),_0e=Ua()});var HS=L((QNt,D0e)=>{var KQe=Ua(),YQe=(t,e,r)=>{try{e=new KQe(e,r)}catch{return!1}return e.test(t)};D0e.exports=YQe});var F0e=L((ZNt,N0e)=>{var XQe=Ua(),QQe=(t,e)=>new XQe(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));N0e.exports=QQe});var V0e=L((JNt,B0e)=>{var ZQe=oi(),JQe=Ua(),eZe=(t,e,r)=>{let n=null,i=null,s=null;try{s=new JQe(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new ZQe(n,r))}),n};B0e.exports=eZe});var $0e=L((e4t,j0e)=>{var tZe=oi(),rZe=Ua(),nZe=(t,e,r)=>{let n=null,i=null,s=null;try{s=new rZe(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new tZe(n,r))}),n};j0e.exports=nZe});var q0e=L((t4t,z0e)=>{var P$=oi(),iZe=Ua(),U0e=US(),sZe=(t,e)=>{t=new iZe(t,e);let r=new P$("0.0.0");if(t.test(r)||(r=new P$("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],s=null;i.forEach(a=>{let o=new P$(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||U0e(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||U0e(r,s))&&(r=s)}return r&&t.test(r)?r:null};z0e.exports=sZe});var G0e=L((r4t,H0e)=>{var aZe=Ua(),oZe=(t,e)=>{try{return new aZe(t,e).range||"*"}catch{return null}};H0e.exports=oZe});var nM=L((n4t,X0e)=>{var lZe=oi(),Y0e=zS(),{ANY:cZe}=Y0e,uZe=Ua(),dZe=HS(),W0e=US(),K0e=Z3(),fZe=eM(),pZe=J3(),hZe=(t,e,r,n)=>{t=new lZe(t,n),e=new uZe(e,n);let i,s,a,o,l;switch(r){case">":i=W0e,s=fZe,a=K0e,o=">",l=">=";break;case"<":i=K0e,s=pZe,a=W0e,o="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(dZe(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let u=e.set[c],d=null,f=null;if(u.forEach(p=>{p.semver===cZe&&(p=new Y0e(">=0.0.0")),d=d||p,f=f||p,i(p.semver,d.semver,n)?d=p:a(p.semver,f.semver,n)&&(f=p)}),d.operator===o||d.operator===l||(!f.operator||f.operator===o)&&s(t,f.semver))return!1;if(f.operator===l&&a(t,f.semver))return!1}return!0};X0e.exports=hZe});var Z0e=L((i4t,Q0e)=>{var mZe=nM(),gZe=(t,e,r)=>mZe(t,e,">",r);Q0e.exports=gZe});var exe=L((s4t,J0e)=>{var yZe=nM(),vZe=(t,e,r)=>yZe(t,e,"<",r);J0e.exports=vZe});var nxe=L((a4t,rxe)=>{var txe=Ua(),bZe=(t,e,r)=>(t=new txe(t,r),e=new txe(e,r),t.intersects(e,r));rxe.exports=bZe});var sxe=L((o4t,ixe)=>{var xZe=HS(),wZe=$a();ixe.exports=(t,e,r)=>{let n=[],i=null,s=null,a=t.sort((u,d)=>wZe(u,d,r));for(let u of a)xZe(u,e,r)?(s=u,i||(i=u)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let o=[];for(let[u,d]of n)u===d?o.push(u):!d&&u===a[0]?o.push("*"):d?u===a[0]?o.push(`<=${d}`):o.push(`${u} - ${d}`):o.push(`>=${u}`);let l=o.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length<c.length?l:e}});var dxe=L((l4t,uxe)=>{var axe=Ua(),L$=zS(),{ANY:R$}=L$,GS=HS(),M$=$a(),kZe=(t,e,r={})=>{if(t===e)return!0;t=new axe(t,r),e=new axe(e,r);let n=!1;e:for(let i of t.set){for(let s of e.set){let a=CZe(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},SZe=[new L$(">=0.0.0-0")],oxe=[new L$(">=0.0.0")],CZe=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===R$){if(e.length===1&&e[0].semver===R$)return!0;r.includePrerelease?t=SZe:t=oxe}if(e.length===1&&e[0].semver===R$){if(r.includePrerelease)return!0;e=oxe}let n=new Set,i,s;for(let p of t)p.operator===">"||p.operator===">="?i=lxe(i,p,r):p.operator==="<"||p.operator==="<="?s=cxe(s,p,r):n.add(p.semver);if(n.size>1)return null;let a;if(i&&s){if(a=M$(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let p of n){if(i&&!GS(p,String(i),r)||s&&!GS(p,String(s),r))return null;for(let h of e)if(!GS(p,String(h),r))return!1;return!0}let o,l,c,u,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let p of e){if(u=u||p.operator===">"||p.operator===">=",c=c||p.operator==="<"||p.operator==="<=",i){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator===">"||p.operator===">="){if(o=lxe(i,p,r),o===p&&o!==i)return!1}else if(i.operator===">="&&!GS(i.semver,String(p),r))return!1}if(s){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator==="<"||p.operator==="<="){if(l=cxe(s,p,r),l===p&&l!==s)return!1}else if(s.operator==="<="&&!GS(s.semver,String(p),r))return!1}if(!p.operator&&(s||i)&&a!==0)return!1}return!(i&&c&&!s&&a!==0||s&&u&&!i&&a!==0||f||d)},lxe=(t,e,r)=>{if(!t)return e;let n=M$(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},cxe=(t,e,r)=>{if(!t)return e;let n=M$(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};uxe.exports=kZe});var mxe=L((c4t,hxe)=>{var _$=_v(),fxe=jS(),TZe=oi(),pxe=v$(),EZe=Vh(),IZe=Vbe(),AZe=$be(),PZe=qbe(),RZe=Wbe(),LZe=Ybe(),MZe=Qbe(),_Ze=Jbe(),OZe=t0e(),DZe=$a(),NZe=s0e(),FZe=o0e(),BZe=Q3(),VZe=d0e(),jZe=p0e(),$Ze=US(),UZe=Z3(),zZe=x$(),qZe=w$(),HZe=J3(),GZe=eM(),WZe=k$(),KZe=k0e(),YZe=zS(),XZe=Ua(),QZe=HS(),ZZe=F0e(),JZe=V0e(),eJe=$0e(),tJe=q0e(),rJe=G0e(),nJe=nM(),iJe=Z0e(),sJe=exe(),aJe=nxe(),oJe=sxe(),lJe=dxe();hxe.exports={parse:EZe,valid:IZe,clean:AZe,inc:PZe,diff:RZe,major:LZe,minor:MZe,patch:_Ze,prerelease:OZe,compare:DZe,rcompare:NZe,compareLoose:FZe,compareBuild:BZe,sort:VZe,rsort:jZe,gt:$Ze,lt:UZe,eq:zZe,neq:qZe,gte:HZe,lte:GZe,cmp:WZe,coerce:KZe,Comparator:YZe,Range:XZe,satisfies:QZe,toComparators:ZZe,maxSatisfying:JZe,minSatisfying:eJe,minVersion:tJe,validRange:rJe,outside:nJe,gtr:iJe,ltr:sJe,intersects:aJe,simplifyRange:oJe,subset:lJe,SemVer:TZe,re:_$.re,src:_$.src,tokens:_$.t,SEMVER_SPEC_VERSION:fxe.SEMVER_SPEC_VERSION,RELEASE_TYPES:fxe.RELEASE_TYPES,compareIdentifiers:pxe.compareIdentifiers,rcompareIdentifiers:pxe.rcompareIdentifiers}});var Let={};ln(Let,{default:()=>p_});module.exports=MU(Let);var _rt=Z(kG(),1);var Pnt=Z(OK(),1);var Bnt=Z(tY(),1);var Lb=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,e,r,n,i,s){this.type=t,this.name=e,this.prefix=r,this.value=n,this.suffix=i,this.modifier=s}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},mRe=/[$_\p{ID_Start}]/u,gRe=/[$_\u200C\u200D\p{ID_Continue}]/u,c6=".*";function yRe(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function iY(t,e=!1){let r=[],n=0;for(;n<t.length;){let i=t[n],s=function(a){if(!e)throw new TypeError(a);r.push({type:"INVALID_CHAR",index:n,value:t[n++]})};if(i==="*"){r.push({type:"ASTERISK",index:n,value:t[n++]});continue}if(i==="+"||i==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:t[n++]});continue}if(i==="\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});continue}if(i==="{"){r.push({type:"OPEN",index:n,value:t[n++]});continue}if(i==="}"){r.push({type:"CLOSE",index:n,value:t[n++]});continue}if(i===":"){let a="",o=n+1;for(;o<t.length;){let l=t.substr(o,1);if(o===n+1&&mRe.test(l)||o!==n+1&&gRe.test(l)){a+=t[o++];continue}break}if(!a){s(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:a}),n=o;continue}if(i==="("){let a=1,o="",l=n+1,c=!1;if(t[l]==="?"){s(`Pattern cannot start with "?" at ${l}`);continue}for(;l<t.length;){if(!yRe(t[l],!1)){s(`Invalid character '${t[l]}' at ${l}.`),c=!0;break}if(t[l]==="\\"){o+=t[l++]+t[l++];continue}if(t[l]===")"){if(a--,a===0){l++;break}}else if(t[l]==="("&&(a++,t[l+1]!=="?")){s(`Capturing groups are not allowed at ${l}`),c=!0;break}o+=t[l++]}if(c)continue;if(a){s(`Unbalanced pattern at ${n}`);continue}if(!o){s(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=l;continue}r.push({type:"CHAR",index:n,value:t[n++]})}return r.push({type:"END",index:n,value:""}),r}function sY(t,e={}){let r=iY(t);e.delimiter??="/#?",e.prefixes??="./";let n=`[^${ra(e.delimiter)}]+?`,i=[],s=0,a=0,o="",l=new Set,c=x=>{if(a<r.length&&r[a].type===x)return r[a++].value},u=()=>c("OTHER_MODIFIER")??c("ASTERISK"),d=x=>{let w=c(x);if(w!==void 0)return w;let{type:C,index:O}=r[a];throw new TypeError(`Unexpected ${C} at ${O}, expected ${x}`)},f=()=>{let x="",w;for(;w=c("CHAR")??c("ESCAPED_CHAR");)x+=w;return x},p=x=>x,h=e.encodePart||p,m="",v=x=>{m+=x},b=()=>{m.length&&(i.push(new Lb(3,"","",h(m),"",3)),m="")},y=(x,w,C,O,S)=>{let T=3;switch(S){case"?":T=1;break;case"*":T=0;break;case"+":T=2;break}if(!w&&!C&&T===3){v(x);return}if(b(),!w&&!C){if(!x)return;i.push(new Lb(3,"","",h(x),"",T));return}let E;C?C==="*"?E=c6:E=C:E=n;let P=2;E===n?(P=1,E=""):E===c6&&(P=0,E="");let R;if(w?R=w:C&&(R=s++),l.has(R))throw new TypeError(`Duplicate name '${R}'.`);l.add(R),i.push(new Lb(P,R,h(x),E,h(O),T))};for(;a<r.length;){let x=c("CHAR"),w=c("NAME"),C=c("REGEX");if(!w&&!C&&(C=c("ASTERISK")),w||C){let S=x??"";e.prefixes.indexOf(S)===-1&&(v(S),S=""),b();let T=u();y(S,w,C,"",T);continue}let O=x??c("ESCAPED_CHAR");if(O){v(O);continue}if(c("OPEN")){let S=f(),T=c("NAME"),E=c("REGEX");!T&&!E&&(E=c("ASTERISK"));let P=f();d("CLOSE");let R=u();y(S,T,E,P,R);continue}b(),d("END")}return i}function ra(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function rY(t){return t&&t.ignoreCase?"ui":"u"}function vRe(t,e,r){return aY(sY(t,r),e,r)}function im(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function aY(t,e,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let o of t){if(o.type===3){o.modifier===3?n+=ra(o.value):n+=`(?:${ra(o.value)})${im(o.modifier)}`;continue}e&&e.push(o.name);let l=`[^${ra(r.delimiter)}]+?`,c=o.value;if(o.type===1?c=l:o.type===0&&(c=c6),!o.prefix.length&&!o.suffix.length){o.modifier===3||o.modifier===1?n+=`(${c})${im(o.modifier)}`:n+=`((?:${c})${im(o.modifier)})`;continue}if(o.modifier===3||o.modifier===1){n+=`(?:${ra(o.prefix)}(${c})${ra(o.suffix)})`,n+=im(o.modifier);continue}n+=`(?:${ra(o.prefix)}`,n+=`((?:${c})(?:`,n+=ra(o.suffix),n+=ra(o.prefix),n+=`(?:${c}))*)${ra(o.suffix)})`,o.modifier===0&&(n+="?")}let i=`[${ra(r.endsWith)}]|$`,s=`[${ra(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${s}?`),r.endsWith.length?n+=`(?=${i})`:n+="$",new RegExp(n,rY(r));r.strict||(n+=`(?:${s}(?=${i}))?`);let a=!1;if(t.length){let o=t[t.length-1];o.type===3&&o.modifier===3&&(a=r.delimiter.indexOf(o)>-1)}return a||(n+=`(?=${s}|${i})`),new RegExp(n,rY(r))}var fu={delimiter:"",prefixes:"",sensitive:!0,strict:!0},bRe={delimiter:".",prefixes:"",sensitive:!0,strict:!0},xRe={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function wRe(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":!1}function oY(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function kRe(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function lY(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}var cY=["ftp","file","http","https","ws","wss"];function uY(t){if(!t)return!0;for(let e of cY)if(t.test(e))return!0;return!1}function SRe(t,e){if(t=oY(t,"#"),e||t==="")return t;let r=new URL("https://example.com");return r.hash=t,r.hash?r.hash.substring(1,r.hash.length):""}function CRe(t,e){if(t=oY(t,"?"),e||t==="")return t;let r=new URL("https://example.com");return r.search=t,r.search?r.search.substring(1,r.search.length):""}function TRe(t,e){return e||t===""?t:lY(t)?pY(t):fY(t)}function ERe(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function IRe(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function ARe(t,e,r){if(r||t==="")return t;if(e&&!cY.includes(e))return new URL(`${e}:${t}`).pathname;let n=t[0]=="/";return t=new URL(n?t:"/-"+t,"https://example.com").pathname,n||(t=t.substring(2,t.length)),t}function PRe(t,e,r){return dY(e)===t&&(t=""),r||t===""?t:hY(t)}function RRe(t,e){return t=kRe(t,":"),e||t===""?t:u6(t)}function dY(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function u6(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function LRe(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function MRe(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function fY(t){if(t==="")return t;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(t))throw new TypeError(`Invalid hostname '${t}'`);let e=new URL("https://example.com");return e.hostname=t,e.hostname}function pY(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function hY(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function _Re(t){if(t==="")return t;let e=new URL("https://example.com");return e.pathname=t[0]!=="/"?"/-"+t:t,t[0]!=="/"?e.pathname.substring(2,e.pathname.length):e.pathname}function ORe(t){return t===""?t:new URL(`data:${t}`).pathname}function DRe(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function NRe(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}var FRe=class{#e;#t=[];#r={};#n=0;#i=1;#s=0;#a=0;#o=0;#l=0;#u=!1;constructor(t){this.#e=t}get result(){return this.#r}parse(){for(this.#t=iY(this.#e,!0);this.#n<this.#t.length;this.#n+=this.#i){if(this.#i=1,this.#t[this.#n].type==="END"){if(this.#a===0){this.#d(),this.#k()?this.#c(9,1):this.#v()?this.#c(8,1):this.#c(7,0);continue}else if(this.#a===2){this.#p(5);continue}this.#c(10,0);break}if(this.#o>0)if(this.#T())this.#o-=1;else continue;if(this.#C()){this.#o+=1;continue}switch(this.#a){case 0:this.#y()&&this.#p(1);break;case 1:if(this.#y()){this.#L();let t=7,e=1;this.#w()?(t=2,e=3):this.#u&&(t=2),this.#c(t,e)}break;case 2:this.#h()?this.#p(3):(this.#S()||this.#v()||this.#k())&&this.#p(5);break;case 3:this.#x()?this.#c(4,1):this.#h()&&this.#c(5,1);break;case 4:this.#h()&&this.#c(5,1);break;case 5:this.#E()?this.#l+=1:this.#P()&&(this.#l-=1),this.#b()&&!this.#l?this.#c(6,1):this.#S()?this.#c(7,0):this.#v()?this.#c(8,1):this.#k()&&this.#c(9,1);break;case 6:this.#S()?this.#c(7,0):this.#v()?this.#c(8,1):this.#k()&&this.#c(9,1);break;case 7:this.#v()?this.#c(8,1):this.#k()&&this.#c(9,1);break;case 8:this.#k()&&this.#c(9,1);break;case 9:break;case 10:break}}this.#r.hostname!==void 0&&this.#r.port===void 0&&(this.#r.port="")}#c(t,e){switch(this.#a){case 0:break;case 1:this.#r.protocol=this.#A();break;case 2:break;case 3:this.#r.username=this.#A();break;case 4:this.#r.password=this.#A();break;case 5:this.#r.hostname=this.#A();break;case 6:this.#r.port=this.#A();break;case 7:this.#r.pathname=this.#A();break;case 8:this.#r.search=this.#A();break;case 9:this.#r.hash=this.#A();break;case 10:break}this.#a!==0&&t!==10&&([1,2,3,4].includes(this.#a)&&[6,7,8,9].includes(t)&&(this.#r.hostname??=""),[1,2,3,4,5,6].includes(this.#a)&&[8,9].includes(t)&&(this.#r.pathname??=this.#u?"/":""),[1,2,3,4,5,6,7].includes(this.#a)&&t===9&&(this.#r.search??="")),this.#f(t,e)}#f(t,e){this.#a=t,this.#s=this.#n+e,this.#n+=e,this.#i=0}#d(){this.#n=this.#s,this.#i=0}#p(t){this.#d(),this.#a=t}#g(t){return t<0&&(t=this.#t.length-t),t<this.#t.length?this.#t[t]:this.#t[this.#t.length-1]}#m(t,e){let r=this.#g(t);return r.value===e&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}#y(){return this.#m(this.#n,":")}#w(){return this.#m(this.#n+1,"/")&&this.#m(this.#n+2,"/")}#h(){return this.#m(this.#n,"@")}#x(){return this.#m(this.#n,":")}#b(){return this.#m(this.#n,":")}#S(){return this.#m(this.#n,"/")}#v(){if(this.#m(this.#n,"?"))return!0;if(this.#t[this.#n].value!=="?")return!1;let t=this.#g(this.#n-1);return t.type!=="NAME"&&t.type!=="REGEX"&&t.type!=="CLOSE"&&t.type!=="ASTERISK"}#k(){return this.#m(this.#n,"#")}#C(){return this.#t[this.#n].type=="OPEN"}#T(){return this.#t[this.#n].type=="CLOSE"}#E(){return this.#m(this.#n,"[")}#P(){return this.#m(this.#n,"]")}#A(){let t=this.#t[this.#n],e=this.#g(this.#s).index;return this.#e.substring(e,t.index)}#L(){let t={};Object.assign(t,fu),t.encodePart=u6;let e=vRe(this.#A(),void 0,t);this.#u=uY(e)}},l6=["protocol","username","password","hostname","port","pathname","search","hash"],du="*";function nY(t,e){if(typeof t!="string")throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(t,e);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==""?r.search.substring(1,r.search.length):void 0,hash:r.hash!==""?r.hash.substring(1,r.hash.length):void 0}}function jl(t,e){return e?Rb(t):t}function Pb(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=jl(n.protocol.substring(0,n.protocol.length-1),r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(t.username=jl(n.username,r)),!r&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(t.password=jl(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=jl(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=jl(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=jl(n.pathname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(t.search=jl(n.search.substring(1,n.search.length),r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(t.hash=jl(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=RRe(e.protocol,r)),typeof e.username=="string"&&(t.username=IRe(e.username,r)),typeof e.password=="string"&&(t.password=ERe(e.password,r)),typeof e.hostname=="string"&&(t.hostname=TRe(e.hostname,r)),typeof e.port=="string"&&(t.port=PRe(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!wRe(t.pathname,r)){let i=n.pathname.lastIndexOf("/");i>=0&&(t.pathname=jl(n.pathname.substring(0,i+1),r)+t.pathname)}t.pathname=ARe(t.pathname,t.protocol,r)}return typeof e.search=="string"&&(t.search=CRe(e.search,r)),typeof e.hash=="string"&&(t.hash=SRe(e.hash,r)),t}function Rb(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function BRe(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function VRe(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=".*",n=`[^${BRe(e.delimiter)}]+?`,i=/[$_\u200C\u200D\p{ID_Continue}]/u,s="";for(let a=0;a<t.length;++a){let o=t[a];if(o.type===3){if(o.modifier===3){s+=Rb(o.value);continue}s+=`{${Rb(o.value)}}${im(o.modifier)}`;continue}let l=o.hasCustomName(),c=!!o.suffix.length||!!o.prefix.length&&(o.prefix.length!==1||!e.prefixes.includes(o.prefix)),u=a>0?t[a-1]:null,d=a<t.length-1?t[a+1]:null;if(!c&&l&&o.type===1&&o.modifier===3&&d&&!d.prefix.length&&!d.suffix.length)if(d.type===3){let f=d.value.length>0?d.value[0]:"";c=i.test(f)}else c=!d.hasCustomName();if(!c&&!o.prefix.length&&u&&u.type===3){let f=u.value[u.value.length-1];c=e.prefixes.includes(f)}c&&(s+="{"),s+=Rb(o.prefix),l&&(s+=`:${o.name}`),o.type===2?s+=`(${o.value})`:o.type===1?l||(s+=`(${n})`):o.type===0&&(!l&&(!u||u.type===3||u.modifier!==3||c||o.prefix!=="")?s+="*":s+=`(${r})`),o.type===1&&l&&o.suffix.length&&i.test(o.suffix[0])&&(s+="\\"),s+=Rb(o.suffix),c&&(s+="}"),o.modifier!==3&&(s+=im(o.modifier))}return s}var mY=class{#e;#t={};#r={};#n={};#i={};#s=!1;constructor(t={},e,r){try{let n;if(typeof e=="string"?n=e:r=e,typeof t=="string"){let o=new FRe(t);if(o.parse(),t=o.result,n===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=n}else{if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let i={ignoreCase:r.ignoreCase===!0},s={pathname:du,protocol:du,username:du,password:du,hostname:du,port:du,search:du,hash:du};this.#e=Pb(s,t,!0),dY(this.#e.protocol)===this.#e.port&&(this.#e.port="");let a;for(a of l6){if(!(a in this.#e))continue;let o={},l=this.#e[a];switch(this.#r[a]=[],a){case"protocol":Object.assign(o,fu),o.encodePart=u6;break;case"username":Object.assign(o,fu),o.encodePart=LRe;break;case"password":Object.assign(o,fu),o.encodePart=MRe;break;case"hostname":Object.assign(o,bRe),lY(l)?o.encodePart=pY:o.encodePart=fY;break;case"port":Object.assign(o,fu),o.encodePart=hY;break;case"pathname":uY(this.#t.protocol)?(Object.assign(o,xRe,i),o.encodePart=_Re):(Object.assign(o,fu,i),o.encodePart=ORe);break;case"search":Object.assign(o,fu,i),o.encodePart=DRe;break;case"hash":Object.assign(o,fu,i),o.encodePart=NRe;break}try{this.#i[a]=sY(l,o),this.#t[a]=aY(this.#i[a],this.#r[a],o),this.#n[a]=VRe(this.#i[a],o),this.#s=this.#s||this.#i[a].some(c=>c.type===2)}catch{throw new TypeError(`invalid ${a} pattern '${this.#e[a]}'.`)}}}catch(n){throw new TypeError(`Failed to construct 'URLPattern': ${n.message}`)}}test(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return!1;try{typeof t=="object"?r=Pb(r,t,!1):r=Pb(r,nY(t,e),!1)}catch{return!1}let n;for(n of l6)if(!this.#t[n].exec(r[n]))return!1;return!0}exec(t={},e){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{typeof t=="object"?r=Pb(r,t,!1):r=Pb(r,nY(t,e),!1)}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let i;for(i of l6){let s=this.#t[i].exec(r[i]);if(!s)return null;let a={};for(let[o,l]of this.#r[i].entries())if(typeof l=="string"||typeof l=="number"){let c=s[o+1];a[l]=c}n[i]={input:r[i]??"",groups:a}}return n}static compareComponent(t,e,r){let n=(o,l)=>{for(let c of["type","modifier","prefix","value","suffix"]){if(o[c]<l[c])return-1;if(o[c]!==l[c])return 1}return 0},i=new Lb(3,"","","","",3),s=new Lb(0,"","","","",3),a=(o,l)=>{let c=0;for(;c<Math.min(o.length,l.length);++c){let u=n(o[c],l[c]);if(u)return u}return o.length===l.length?0:n(o[c]??i,l[c]??i)};return!e.#n[t]&&!r.#n[t]?0:e.#n[t]&&!r.#n[t]?a(e.#i[t],[s]):!e.#n[t]&&r.#n[t]?a([s],r.#i[t]):a(e.#i[t],r.#i[t])}get protocol(){return this.#n.protocol}get username(){return this.#n.username}get password(){return this.#n.password}get hostname(){return this.#n.hostname}get port(){return this.#n.port}get pathname(){return this.#n.pathname}get search(){return this.#n.search}get hash(){return this.#n.hash}get hasRegExpGroups(){return this.#s}};globalThis.URLPattern||(globalThis.URLPattern=mY);var d6=require("obsidian"),jRe={bilibili:'<path fill-rule="evenodd" clip-rule="evenodd" d="M 20.736 14.88 C 18.513 12.735 18.513 9.173 20.736 7.028 C 22.849 4.99 26.197 4.99 28.311 7.028 L 40.096 18.397 C 40.43 18.72 40.715 19.075 40.949 19.453 L 58.772 19.453 C 59.006 19.075 59.291 18.72 59.625 18.397 L 71.41 7.028 C 73.523 4.99 76.871 4.99 78.984 7.028 C 81.208 9.173 81.208 12.735 78.984 14.88 L 74.244 19.453 L 77.778 19.453 C 90.051 19.453 100 29.402 100 41.675 L 100 72.262 C 100 84.534 90.051 94.484 77.778 94.484 L 22.222 94.484 C 9.949 94.484 0 84.534 0 72.262 L 0 41.675 C 0 29.402 9.949 19.453 22.222 19.453 L 25.477 19.453 L 20.736 14.88 Z M 22.222 30.172 C 16.086 30.172 11.111 35.146 11.111 41.283 L 11.111 72.654 C 11.111 78.79 16.086 83.765 22.222 83.765 L 77.778 83.765 C 83.914 83.765 88.889 78.79 88.889 72.654 L 88.889 41.283 C 88.889 35.146 83.914 30.172 77.778 30.172 L 22.222 30.172 Z M 27.778 51.805 C 27.778 48.737 30.265 46.25 33.333 46.25 C 36.402 46.25 38.889 48.737 38.889 51.805 L 38.889 56.772 C 38.889 59.84 36.402 62.328 33.333 62.328 C 30.265 62.328 27.778 59.84 27.778 56.772 L 27.778 51.805 Z M 66.667 46.25 C 63.598 46.25 61.111 48.737 61.111 51.805 L 61.111 56.772 C 61.111 59.84 63.598 62.328 66.667 62.328 C 69.735 62.328 72.222 59.84 72.222 56.772 L 72.222 51.805 C 72.222 48.737 69.735 46.25 66.667 46.25 Z" fill="currentColor"/>',vimeo:'<path d="M 99.952 26.773 C 99.508 36.508 92.705 49.844 79.555 66.768 C 65.962 84.445 54.458 93.287 45.044 93.287 C 39.218 93.287 34.286 87.905 30.254 77.134 C 27.566 67.263 24.872 57.4 22.185 47.53 C 19.194 36.765 15.986 31.377 12.552 31.377 C 11.806 31.377 9.182 32.952 4.701 36.09 L 0 30.027 C 4.932 25.692 9.799 21.352 14.59 17.005 C 21.175 11.321 26.113 8.324 29.412 8.022 C 37.193 7.276 41.983 12.6 43.783 23.988 C 45.725 36.283 47.069 43.929 47.822 46.919 C 50.066 57.117 52.535 62.21 55.229 62.21 C 57.325 62.21 60.47 58.898 64.663 52.287 C 68.849 45.671 71.093 40.636 71.395 37.183 C 71.993 31.473 69.749 28.612 64.663 28.612 C 62.264 28.612 59.795 29.158 57.261 30.252 C 62.174 14.15 71.562 6.324 85.426 6.768 C 95.701 7.07 100.544 13.739 99.952 26.773" fill="currentColor"/>',coursera:'<path d="M 2.8 50.013 C 2.8 22.278 25.472 0.001 53.82 0.001 C 71.135 -0.12 87.347 8.489 96.943 22.903 L 75.688 35.232 C 70.696 28.099 62.527 23.863 53.82 23.893 C 39.244 23.893 27.298 36.043 27.298 50.013 C 27.298 63.983 39.244 76.133 53.82 76.133 C 62.954 76.192 71.463 71.505 76.294 63.754 L 97.339 76.306 C 87.854 91.149 71.422 100.093 53.808 99.999 C 25.472 100.024 2.8 77.321 2.8 50.013 Z" fill="currentColor" />',youtube:null,"baidu-pan":'<path d="M88.6,46.1c-4.6-4.6-10.8-6.7-16.8-6.3c0.4-6-1.7-12.2-6.3-16.8c-8.5-8.5-22.4-8.5-30.9,0 c-4.6,4.6-6.7,10.8-6.3,16.8c-6-0.4-12.2,1.7-16.8,6.3c-8.5,8.5-8.5,22.4,0,30.9s22.4,8.5,30.9,0l14.3-14.3l1.1-1.1l7.7-7.7 c4.3-4.3,11.2-4.3,15.4,0s4.3,11.2,0,15.4c-4.3,4.3-11.2,4.3-15.4,0c-2.1-2.1-5.6-2.1-7.7,0s-2.1,5.6,0,7.7 c8.5,8.5,22.4,8.5,30.9,0C97.1,68.5,97.1,54.7,88.6,46.1z M19.1,69.3c-4.3-4.3-4.3-11.2,0-15.4c4.3-4.3,11.2-4.3,15.4,0 s4.3,11.2,0,15.4C30.3,73.6,23.4,73.6,19.1,69.3z M42.3,46.1C38,41.9,38,35,42.3,30.7c4.3-4.3,11.2-4.3,15.4,0s4.3,11.2,0,15.4 C53.5,50.4,46.5,50.4,42.3,46.1z"/>'};for(let[t,e]of Object.entries(jRe))e&&(0,d6.addIcon)(t,e);(0,d6.addIcon)("google",'<path fill-rule="evenodd" d="M50.154 91.658a42.971 42.971 0 0 1-29.867-12.704 41.2 41.2 0 0 1-11.95-29.658 41.446 41.446 0 0 1 12.767-28.954A43.208 43.208 0 0 1 50.883 8.333h.733a41.396 41.396 0 0 1 27.558 10.683L68.571 28.667a25.779 25.779 0 0 0-17.213-6.525 28.75 28.75 0 0 0-19.975 7.971 27.575 27.575 0 0 0-8.521 19.404 27.533 27.533 0 0 0 7.842 19.679 28.713 28.713 0 0 0 19.688 8.625h.596c5.875.3 11.667-1.475 16.321-5a24.042 24.042 0 0 0 9.05-14.208l.179-.488H50.917v-14.208h40.325c.313 2.571.454 5.158.417 7.746-.413 23.921-16.738 40-40.608 40l-.896-.008Z" clip-rule="evenodd"/>');var yke=require("obsidian");var gY=`.vtt-editor-container {
padding-top: var(--size-4-3);
}
.vtt-editor {
/* padding-bottom: var(--size-4-8); */
padding-left: var(--size-4-3);
padding-right: var(--size-4-3);
}
.vtt-editor-search {
padding-left: var(--size-4-3);
padding-right: var(--size-4-3);
}
`;var yY=`/*! tailwindcss v4.0.14 | MIT License | https://tailwindcss.com */@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-600:oklch(57.7% .245 27.325);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs--line-height:calc(1/.75);--text-sm--line-height:calc(1.25/.875);--text-base--line-height: 1.5 ;--text-lg--line-height:calc(1.75/1.125);--text-xl--line-height:calc(1.75/1.25);--text-3xl--line-height: 1.2 ;--text-4xl--line-height:calc(2.5/2.25);--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-xs:.125rem;--radius-xl:var(--radius-xl,calc(var(--mx-radius) + 4px));--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-feature-settings:initial;font-variation-settings:initial;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:initial;font-variation-settings:initial;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.dark.mx-player{background-color:var(--mx-video-background,var(--background-primary,var(--mx-background)));color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}*{border-color:var(--mx-video-border,var(--background-modifier-border,var(--mx-border)));outline-color:color-mix(in oklab,var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))50%,transparent)}body{background-color:var(--mx-video-background,var(--background-primary,var(--mx-background)));color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}}@layer components;@layer utilities{.\\@container\\/card-header{container:card-header/inline-size}.\\@container{container-type:inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-4{top:calc(var(--spacing)*4)}.top-\\[50\\%\\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.left-\\(--slider-fill\\){left:var(--slider-fill)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-3{left:calc(var(--spacing)*3)}.left-\\[50\\%\\]{left:50%}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-1{grid-column:1}.col-2{grid-column:2}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.col-start-3{grid-column-start:3}.col-start-4{grid-column-start:4}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.row-start-2{grid-row-start:2}.row-start-3{grid-row-start:3}.row-start-4{grid-row-start:4}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-m-1{margin:calc(var(--spacing)*-1)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.prose{color:var(--tw-prose-body);--tw-prose-body:oklch(37.3% .034 259.733);--tw-prose-headings:oklch(21% .034 264.665);--tw-prose-lead:oklch(44.6% .03 256.802);--tw-prose-links:oklch(21% .034 264.665);--tw-prose-bold:oklch(21% .034 264.665);--tw-prose-counters:oklch(55.1% .027 264.364);--tw-prose-bullets:oklch(87.2% .01 258.338);--tw-prose-hr:oklch(92.8% .006 264.531);--tw-prose-quotes:oklch(21% .034 264.665);--tw-prose-quote-borders:oklch(92.8% .006 264.531);--tw-prose-captions:oklch(55.1% .027 264.364);--tw-prose-kbd:oklch(21% .034 264.665);--tw-prose-kbd-shadows:NaN NaN NaN;--tw-prose-code:oklch(21% .034 264.665);--tw-prose-pre-code:oklch(92.8% .006 264.531);--tw-prose-pre-bg:oklch(27.8% .033 256.848);--tw-prose-th-borders:oklch(87.2% .01 258.338);--tw-prose-td-borders:oklch(92.8% .006 264.531);--tw-prose-invert-body:oklch(87.2% .01 258.338);--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:oklch(70.7% .022 261.325);--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:oklch(70.7% .022 261.325);--tw-prose-invert-bullets:oklch(44.6% .03 256.802);--tw-prose-invert-hr:oklch(37.3% .034 259.733);--tw-prose-invert-quotes:oklch(96.7% .003 264.542);--tw-prose-invert-quote-borders:oklch(37.3% .034 259.733);--tw-prose-invert-captions:oklch(70.7% .022 261.325);--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:255 255 255;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:oklch(87.2% .01 258.338);--tw-prose-invert-pre-bg:#00000080;--tw-prose-invert-th-borders:oklch(44.6% .03 256.802);--tw-prose-invert-td-borders:oklch(37.3% .034 259.733);max-width:65ch;font-size:1rem;line-height:1.75}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);margin-top:1.2em;margin-bottom:1.2em;font-size:1.25em;line-height:1.6}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:decimal}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em;list-style-type:disc}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.25em;font-weight:600}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\u201C""\u201D""\u2018""\u2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em;font-style:italic;font-weight:500}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:0;margin-bottom:.888889em;font-size:2.25em;font-weight:800;line-height:1.11111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:2em;margin-bottom:1em;font-size:1.5em;font-weight:700;line-height:1.33333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.6em;margin-bottom:.6em;font-size:1.25em;font-weight:600;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);margin-top:1.5em;margin-bottom:.5em;font-weight:600;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em;display:block}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows)/10%),0 3px rgb(var(--tw-prose-kbd-shadows)/10%);padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;border-radius:.3125rem;padding-inline-start:.375em;font-family:inherit;font-size:.875em;font-weight:500}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"\`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);padding-top:.857143em;padding-inline-end:1.14286em;padding-bottom:.857143em;border-radius:.375rem;margin-top:1.71429em;margin-bottom:1.71429em;padding-inline-start:1.14286em;font-size:.875em;font-weight:400;line-height:1.71429;overflow-x:auto}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;background-color:#0000;border-width:0;border-radius:0;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before,.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){table-layout:auto;width:100%;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.71429}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);vertical-align:bottom;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em;font-weight:600}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);margin-top:.857143em;font-size:.875em;line-height:1.42857}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.571429em;padding-inline-end:.571429em;padding-bottom:.571429em;padding-inline-start:.571429em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.71429}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.888889em;margin-bottom:.888889em;font-size:1.28571em;line-height:1.55556}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.33333em;margin-bottom:1.33333em;padding-inline-start:1.11111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:.8em;font-size:2.14286em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6em;margin-bottom:.8em;font-size:1.42857em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.55556em;margin-bottom:.444444em;font-size:1.28571em;line-height:1.55556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.42857em;margin-bottom:.571429em;line-height:1.42857}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.142857em;padding-inline-end:.357143em;padding-bottom:.142857em;border-radius:.3125rem;padding-inline-start:.357143em;font-size:.857143em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.857143em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.666667em;padding-inline-end:1em;padding-bottom:.666667em;border-radius:.25rem;margin-top:1.66667em;margin-bottom:1.66667em;padding-inline-start:1em;font-size:.857143em;line-height:1.66667}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em;padding-inline-start:1.57143em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.285714em;margin-bottom:.285714em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.428571em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.571429em;margin-bottom:.571429em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.14286em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.14286em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.571429em;margin-bottom:.571429em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em;margin-bottom:1.14286em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.14286em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.285714em;padding-inline-start:1.57143em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.85714em;margin-bottom:2.85714em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.857143em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.666667em;padding-inline-end:1em;padding-bottom:.666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.71429em;margin-bottom:1.71429em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.666667em;font-size:.857143em;line-height:1.33333}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-6{margin-left:calc(var(--spacing)*6)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.field-sizing-content{field-sizing:content}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-3\\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-5{width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}.size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-12{width:calc(var(--spacing)*12);height:calc(var(--spacing)*12)}.size-full{width:100%;height:100%}.h-\\(--radix-select-trigger-height\\){height:var(--radix-select-trigger-height)}.h-0\\.5{height:calc(var(--spacing)*.5)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-2\\/5{height:40%}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-32{height:calc(var(--spacing)*32)}.h-\\[1\\.15rem\\]{height:1.15rem}.h-\\[6px\\]{height:6px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-\\(--radix-select-content-available-height\\){max-height:var(--radix-select-content-available-height)}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-\\[80vh\\]{max-height:80vh}.max-h-\\[300px\\]{max-height:300px}.max-h-\\[calc\\(100vh-320px\\)\\]{max-height:calc(100vh - 320px)}.max-h-full{max-height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-1{min-height:calc(var(--spacing)*1)}.min-h-4{min-height:calc(var(--spacing)*4)}.min-h-8{min-height:calc(var(--spacing)*8)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-20{min-height:calc(var(--spacing)*20)}.min-h-\\[24px\\]{min-height:24px}.min-h-screen{min-height:100vh}.w-\\(--chapter-fill\\){width:var(--chapter-fill)}.w-\\(--chapter-progress\\){width:var(--chapter-progress)}.w-\\(--slider-fill\\){width:var(--slider-fill)}.w-1\\/5{width:20%}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-32{width:calc(var(--spacing)*32)}.w-40{width:calc(var(--spacing)*40)}.w-60{width:calc(var(--spacing)*60)}.w-72{width:calc(var(--spacing)*72)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-0{max-width:calc(var(--spacing)*0)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-20{max-width:calc(var(--spacing)*20)}.max-w-40{max-width:calc(var(--spacing)*40)}.max-w-48{max-width:calc(var(--spacing)*48)}.max-w-72{max-width:calc(var(--spacing)*72)}.max-w-96{max-width:calc(var(--spacing)*96)}.max-w-\\[48ch\\]{max-width:48ch}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-\\(--radix-select-trigger-width\\){min-width:var(--radix-select-trigger-width)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-1{min-width:calc(var(--spacing)*1)}.min-w-8{min-width:calc(var(--spacing)*8)}.min-w-9{min-width:calc(var(--spacing)*9)}.min-w-10{min-width:calc(var(--spacing)*10)}.min-w-32{min-width:calc(var(--spacing)*32)}.min-w-48{min-width:calc(var(--spacing)*48)}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\(--radix-select-content-transform-origin\\){transform-origin:var(--radix-select-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x)var(--tw-rotate-y)var(--tw-rotate-z)var(--tw-skew-x)var(--tw-skew-y)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.vtt-editor [data-part=cue]{cursor:pointer;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:75ms;transition-duration:75ms}.vtt-editor [data-part=cue][data-active]{border-left-style:var(--tw-border-style);border-left-width:2px;border-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)));background-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))10%,transparent);color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.vtt-editor [data-part=timed]{border-radius:var(--radius-m,calc(var(--mx-radius) - 2px));transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.vtt-editor [data-part=timed]:hover{background-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))10%,transparent);color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.vtt-editor [data-part=timed][data-current]{--tw-font-weight:var(--font-bold,700);font-weight:var(--font-bold,700)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing)*1)}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[0_1fr\\]{grid-template-columns:0 1fr}.grid-cols-\\[1fr_min-content\\]{grid-template-columns:1fr min-content}.grid-cols-\\[auto_auto_1fr_auto\\]{grid-template-columns:auto auto 1fr auto}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))}.grid-rows-\\[2\\.5rem_1fr_6px_2rem\\]{grid-template-rows:2.5rem 1fr 6px 2rem}.grid-rows-\\[2rem_1fr_2rem_6px\\]{grid-template-rows:2rem 1fr 2rem 6px}.grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.place-content-end{place-content:end}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-items-start{justify-items:start}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*0)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*0)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-0\\.5{column-gap:calc(var(--spacing)*.5)}.gap-x-1{column-gap:calc(var(--spacing)*1)}.gap-x-1\\.5{column-gap:calc(var(--spacing)*1.5)}.gap-x-2{column-gap:calc(var(--spacing)*2)}.gap-x-4{column-gap:calc(var(--spacing)*4)}.gap-x-6{column-gap:calc(var(--spacing)*6)}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*3)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\\.5{row-gap:calc(var(--spacing)*.5)}.gap-y-1{row-gap:calc(var(--spacing)*1)}.gap-y-2{row-gap:calc(var(--spacing)*2)}.gap-y-3{row-gap:calc(var(--spacing)*3)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-l,var(--mx-radius))}.rounded-md{border-radius:var(--radius-m,calc(var(--mx-radius) - 2px))}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-s,calc(var(--mx-radius) - 4px))}.rounded-xl{border-radius:var(--radius-xl,calc(var(--mx-radius) + 4px))}.rounded-xs{border-radius:var(--radius-xs)}.rounded-b-md{border-bottom-right-radius:var(--radius-m,calc(var(--mx-radius) - 2px));border-bottom-left-radius:var(--radius-m,calc(var(--mx-radius) - 2px))}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-background\\/20{border-color:color-mix(in oklab,var(--mx-video-background,var(--background-primary,var(--mx-background)))20%,transparent)}.border-blue-200{border-color:var(--color-blue-200)}.border-border{border-color:var(--mx-video-border,var(--background-modifier-border,var(--mx-border)))}.border-border\\/20{border-color:color-mix(in oklab,var(--mx-video-border,var(--background-modifier-border,var(--mx-border)))20%,transparent)}.border-emerald-300{border-color:var(--color-emerald-300)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-200{border-color:var(--color-green-200)}.border-input{border-color:var(--mx-video-input,var(--background-modifier-border,var(--mx-input)))}.border-orange-300{border-color:var(--color-orange-300)}.border-primary{border-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.border-primary\\/20{border-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))20%,transparent)}.border-red-200{border-color:var(--color-red-200)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-\\(--slider-track-background\\){background-color:var(--slider-track-background)}.bg-accent{background-color:var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))}.bg-background{background-color:var(--mx-video-background,var(--background-primary,var(--mx-background)))}.bg-background\\/10{background-color:color-mix(in oklab,var(--mx-video-background,var(--background-primary,var(--mx-background)))10%,transparent)}.bg-background\\/50{background-color:color-mix(in oklab,var(--mx-video-background,var(--background-primary,var(--mx-background)))50%,transparent)}.bg-background\\/90{background-color:color-mix(in oklab,var(--mx-video-background,var(--background-primary,var(--mx-background)))90%,transparent)}.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--mx-video-border,var(--background-modifier-border,var(--mx-border)))}.bg-card{background-color:var(--mx-video-card,var(--background-primary,var(--mx-card)))}.bg-destructive{background-color:var(--background-modifier-error,var(--mx-destructive))}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-foreground{background-color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}.bg-foreground\\/80{background-color:color-mix(in oklab,var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))80%,transparent)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-green-50{background-color:var(--color-green-50)}.bg-muted{background-color:var(--mx-video-muted,var(--background-primary-alt,var(--mx-muted)))}.bg-muted\\/20{background-color:color-mix(in oklab,var(--mx-video-muted,var(--background-primary-alt,var(--mx-muted)))20%,transparent)}.bg-muted\\/50{background-color:color-mix(in oklab,var(--mx-video-muted,var(--background-primary-alt,var(--mx-muted)))50%,transparent)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-popover{background-color:var(--mx-popover)}.bg-primary{background-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.bg-primary\\/10{background-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))10%,transparent)}.bg-primary\\/40{background-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))40%,transparent)}.bg-primary\\/70{background-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))70%,transparent)}.bg-red-50{background-color:var(--color-red-50)}.bg-secondary{background-color:var(--mx-video-secondary,var(--background-secondary,var(--mx-secondary)))}.bg-secondary-foreground\\/20{background-color:color-mix(in oklab,var(--mx-video-secondary-foreground,var(--text-normal,var(--mx-secondary-foreground)))20%,transparent)}.bg-secondary\\/60{background-color:color-mix(in oklab,var(--mx-video-secondary,var(--background-secondary,var(--mx-secondary)))60%,transparent)}.bg-thumb{background-color:var(--mx-video-thumb,var(--background-primary,var(--mx-background)))}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-linear-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-video-overlay\\/20{--tw-gradient-from:color-mix(in oklab,var(--mx-video-overlay)20%,transparent);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-0\\%{--tw-gradient-from-position:0%}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-\\[4rem_calc\\(100\\%-5rem\\)\\]{--tw-gradient-via-position:4rem calc(100% - 5rem) }.to-video-overlay\\/20{--tw-gradient-to:color-mix(in oklab,var(--mx-video-overlay)20%,transparent);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-100\\%{--tw-gradient-to-position:100%}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-px{padding:1px}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-px{padding-inline:1px}.py-0{padding-block:calc(var(--spacing)*0)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-px{padding-block:1px}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-3{padding-right:calc(var(--spacing)*3)}.pr-4{padding-right:calc(var(--spacing)*4)}.pr-6{padding-right:calc(var(--spacing)*6)}.pr-8{padding-right:calc(var(--spacing)*8)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-6{padding-bottom:calc(var(--spacing)*6)}.pb-\\[calc\\(var\\(--editor-height\\)-4rem\\)\\]{padding-bottom:calc(var(--editor-height) - 4rem)}.pl-0{padding-left:calc(var(--spacing)*0)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.align-text-bottom{vertical-align:text-bottom}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-3xl{font-size:calc(var(--font-ui-large,20px)*1.5);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:calc(var(--font-ui-large,20px)*1.8);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--font-ui-medium,1rem);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:calc(var(--font-ui-large,20px)*.9);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--font-ui-small,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--font-ui-large,1.25rem);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--font-ui-smaller,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-bold,700);font-weight:var(--font-bold,700)}.font-medium{--tw-font-weight:var(--font-medium,500);font-weight:var(--font-medium,500)}.font-semibold{--tw-font-weight:var(--font-semibold,600);font-weight:var(--font-semibold,600)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-accent-foreground{color:var(--mx-video-accent-foreground,var(--text-normal,var(--mx-accent-foreground)))}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-card-foreground{color:var(--mx-video-card-foreground,var(--text-normal,var(--mx-card-foreground)))}.text-current{color:currentColor}.text-destructive{color:var(--background-modifier-error,var(--mx-destructive))}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-700{color:var(--color-emerald-700)}.text-foreground{color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-900{color:var(--color-gray-900)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-muted-foreground{color:var(--mx-video-muted-foreground,var(--text-muted,var(--mx-muted-foreground)))}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-popover-foreground{color:var(--mx-popover-foreground)}.text-primary{color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.text-primary-foreground{color:var(--mx-video-primary-foreground,var(--text-on-accent,var(--mx-primary-foreground)))}.text-red-600{color:var(--color-red-600)}.text-secondary-foreground{color:var(--mx-video-secondary-foreground,var(--text-normal,var(--mx-secondary-foreground)))}.text-success{color:var(--background-modifier-success,var(--mx-success))}.text-warning{color:var(--color-orange,var(--mx-warning))}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-ring{--tw-ring-color:var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))}.ring-ring\\/10{--tw-ring-color:color-mix(in oklab,var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))10%,transparent)}.ring-ring\\/50{--tw-ring-color:color-mix(in oklab,var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))50%,transparent)}.ring-transparent{--tw-ring-color:transparent}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-background{--tw-ring-offset-color:var(--mx-video-background,var(--background-primary,var(--mx-background)))}.ring-offset-primary{--tw-ring-offset-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-ring\\/50{outline-color:color-mix(in oklab,var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))50%,transparent)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[max-width\\]{transition-property:max-width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,bottom\\]{transition-property:opacity,bottom;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,box-shadow\\]{transition-property:opacity,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,padding\\,font-size\\]{transition-property:opacity,padding,font-size;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.delay-0{transition-delay:0s}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.will-change-\\[left\\]{will-change:left}.will-change-\\[width\\]{will-change:width}.delay-0{animation-delay:0s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.select-text{-webkit-user-select:text;user-select:text}.not-group-data-active\\:opacity-0:not(:is(:where(.group)[data-active] *)),.not-group-data-muted\\:opacity-0:not(:is(:where(.group)[data-muted] *)),.not-group-data-paused\\:opacity-0:not(:is(:where(.group)[data-paused] *)),.not-group-data-\\[state\\=high\\]\\:opacity-0:not(:is(:where(.group)[data-state=high] *)),.not-group-data-\\[state\\=low\\]\\:opacity-0:not(:is(:where(.group)[data-state=low] *)){opacity:0}.not-data-supported\\:hidden:not([data-supported]){display:none}@media (hover:hover){.group-hover\\:max-w-full:is(:where(.group):hover *){max-width:100%}.group-hover\\:text-blue-700:is(:where(.group):hover *){color:var(--color-blue-700)}.group-hover\\:text-foreground:is(:where(.group):hover *){color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}.group-hover\\:text-primary:is(:where(.group):hover *){color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:shadow-sm:is(:where(.group):hover *){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-hover\\:delay-200:is(:where(.group):hover *){transition-delay:.2s;animation-delay:.2s}.group-hover\\/cue\\:h-2\\.5:is(:where(.group\\/cue):hover *){height:calc(var(--spacing)*2.5)}.group-hover\\/cue\\:max-h-2\\.5:is(:where(.group\\/cue):hover *){max-height:calc(var(--spacing)*2.5)}.group-hover\\/item\\:opacity-100:is(:where(.group\\/item):hover *){opacity:1}}.group-data-active\\:opacity-0:is(:where(.group)[data-active] *){opacity:0}.group-data-active\\:opacity-100:is(:where(.group)[data-active] *){opacity:1}.group-data-dragging\\:ring-2:is(:where(.group)[data-dragging] *){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-dragging\\:ring-thumb\\/30:is(:where(.group)[data-dragging] *){--tw-ring-color:color-mix(in oklab,var(--mx-video-thumb,var(--background-primary,var(--mx-background)))30%,transparent)}.group-data-focus\\:h-2:is(:where(.group)[data-focus] *){height:calc(var(--spacing)*2)}.group-data-focus\\:ring-2:is(:where(.group)[data-focus] *){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-focus\\:ring-ring:is(:where(.group)[data-focus] *){--tw-ring-color:var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))}.group-data-focus\\:outline-2:is(:where(.group)[data-focus] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-focus\\:outline-offset-1:is(:where(.group)[data-focus] *){outline-offset:1px}.group-data-focus\\:outline-ring:is(:where(.group)[data-focus] *){outline-color:var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))}.group-data-muted\\:opacity-0:is(:where(.group)[data-muted] *),.group-data-paused\\:opacity-0:is(:where(.group)[data-paused] *){opacity:0}.group-data-pointing\\:opacity-100:is(:where(.group)[data-pointing] *){opacity:1}.group-data-\\[disabled\\=true\\]\\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\\[disabled\\=true\\]\\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\\[state\\=high\\]\\:opacity-0:is(:where(.group)[data-state=high] *){opacity:0}.group-\\[\\&\\:hover\\]\\/vol-ctrl\\:mr-3:is(:where(.group\\/vol-ctrl):hover *){margin-right:calc(var(--spacing)*3)}.group-\\[\\&\\:hover\\]\\/vol-ctrl\\:pl-2:is(:where(.group\\/vol-ctrl):hover *){padding-left:calc(var(--spacing)*2)}.peer-focus-visible\\:mr-3:is(:where(.peer):focus-visible~*){margin-right:calc(var(--spacing)*3)}.peer-focus-visible\\:max-w-full:is(:where(.peer):focus-visible~*){max-width:100%}.peer-focus-visible\\:pl-2:is(:where(.peer):focus-visible~*){padding-left:calc(var(--spacing)*2)}.peer-focus-visible\\:opacity-100:is(:where(.peer):focus-visible~*){opacity:1}.peer-disabled\\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\\:bg-primary ::selection{background-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.selection\\:bg-primary::selection{background-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.selection\\:text-primary-foreground ::selection{color:var(--mx-video-primary-foreground,var(--text-on-accent,var(--mx-primary-foreground)))}.selection\\:text-primary-foreground::selection{color:var(--mx-video-primary-foreground,var(--text-on-accent,var(--mx-primary-foreground)))}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.file\\:text-sm::file-selector-button{font-size:var(--font-ui-small,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-medium,500);font-weight:var(--font-medium,500)}.file\\:text-foreground::file-selector-button{color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}.placeholder\\:text-muted-foreground::placeholder{color:var(--mx-video-muted-foreground,var(--text-muted,var(--mx-muted-foreground)))}.first\\:rounded-l-md:first-child{border-top-left-radius:var(--radius-m,calc(var(--mx-radius) - 2px));border-bottom-left-radius:var(--radius-m,calc(var(--mx-radius) - 2px))}.last\\:rounded-r-md:last-child{border-top-right-radius:var(--radius-m,calc(var(--mx-radius) - 2px));border-bottom-right-radius:var(--radius-m,calc(var(--mx-radius) - 2px))}.empty\\:hidden:empty{display:none}@media (hover:hover){.hover\\:max-w-full:hover{max-width:100%}.hover\\:border-blue-300:hover{border-color:var(--color-blue-300)}.hover\\:border-primary:hover{border-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.hover\\:bg-accent:hover{background-color:var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))}.hover\\:bg-accent\\/30:hover{background-color:color-mix(in oklab,var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))30%,transparent)}.hover\\:bg-accent\\/50:hover{background-color:color-mix(in oklab,var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))50%,transparent)}.hover\\:bg-background\\/10:hover{background-color:color-mix(in oklab,var(--mx-video-background,var(--background-primary,var(--mx-background)))10%,transparent)}.hover\\:bg-blue-50:hover{background-color:var(--color-blue-50)}.hover\\:bg-blue-100:hover{background-color:var(--color-blue-100)}.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-destructive\\/10:hover{background-color:color-mix(in oklab,var(--background-modifier-error,var(--mx-destructive))10%,transparent)}.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--background-modifier-error,var(--mx-destructive))90%,transparent)}.hover\\:bg-emerald-200:hover{background-color:var(--color-emerald-200)}.hover\\:bg-green-100:hover{background-color:var(--color-green-100)}.hover\\:bg-muted:hover{background-color:var(--mx-video-muted,var(--background-primary-alt,var(--mx-muted)))}.hover\\:bg-orange-200:hover{background-color:var(--color-orange-200)}.hover\\:bg-primary-foreground\\/20:hover{background-color:color-mix(in oklab,var(--mx-video-primary-foreground,var(--text-on-accent,var(--mx-primary-foreground)))20%,transparent)}.hover\\:bg-primary\\/80:hover{background-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))80%,transparent)}.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))90%,transparent)}.hover\\:bg-red-100:hover{background-color:var(--color-red-100)}.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--mx-video-secondary,var(--background-secondary,var(--mx-secondary)))80%,transparent)}.hover\\:text-accent-foreground:hover{color:var(--mx-video-accent-foreground,var(--text-normal,var(--mx-accent-foreground)))}.hover\\:text-background:hover{color:var(--mx-video-background,var(--background-primary,var(--mx-background)))}.hover\\:text-blue-600:hover{color:var(--color-blue-600)}.hover\\:text-destructive:hover{color:var(--background-modifier-error,var(--mx-destructive))}.hover\\:text-foreground:hover{color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}.hover\\:text-muted-foreground:hover{color:var(--mx-video-muted-foreground,var(--text-muted,var(--mx-muted-foreground)))}.hover\\:text-primary\\/80:hover{color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))80%,transparent)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\\:delay-200:hover{transition-delay:.2s;animation-delay:.2s}}.focus\\:z-10:focus{z-index:10}.focus\\:bg-accent:focus{background-color:var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))}.focus\\:text-accent-foreground:focus{color:var(--mx-video-accent-foreground,var(--text-normal,var(--mx-accent-foreground)))}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-ring:focus{--tw-ring-color:var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\\:z-10:focus-visible{z-index:10}.focus-visible\\:mr-3:focus-visible{margin-right:calc(var(--spacing)*3)}.focus-visible\\:max-w-full:focus-visible{max-width:100%}.focus-visible\\:border-ring:focus-visible{border-color:var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))}.focus-visible\\:pl-2:focus-visible{padding-left:calc(var(--spacing)*2)}.focus-visible\\:opacity-100:focus-visible{opacity:1}.focus-visible\\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--background-modifier-error,var(--mx-destructive))20%,transparent)}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))50%,transparent)}.focus-visible\\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus-visible\\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}.disabled\\:hover\\:text-accent-foreground:disabled:hover{color:var(--mx-video-accent-foreground,var(--text-normal,var(--mx-accent-foreground)))}}.has-focus-visible\\:ring-2:has(:focus-visible){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-focus-visible\\:ring-ring:has(:focus-visible){--tw-ring-color:var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))}.has-focus-visible\\:ring-offset-2:has(:focus-visible){--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.has-focus-visible\\:outline-hidden:has(:focus-visible){--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.has-focus-visible\\:outline-hidden:has(:focus-visible){outline-offset:2px;outline:2px solid #0000}}.has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\\[\\>svg\\]\\:grid-cols-\\[calc\\(var\\(--spacing\\)\\*4\\)_1fr\\]:has(>svg){grid-template-columns:calc(var(--spacing)*4)1fr}.has-\\[\\>svg\\]\\:gap-x-3:has(>svg){column-gap:calc(var(--spacing)*3)}.has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\\:cursor-auto[aria-disabled=true]{cursor:auto}.aria-hidden\\:hidden[aria-hidden=true]{display:none}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--background-modifier-error,var(--mx-destructive))}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--background-modifier-error,var(--mx-destructive))20%,transparent)}.aria-invalid\\:focus-visible\\:ring-0[aria-invalid=true]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-active\\:mr-3[data-active]{margin-right:calc(var(--spacing)*3)}.data-active\\:pl-2[data-active]{padding-left:calc(var(--spacing)*2)}.data-disabled\\:pointer-events-none[data-disabled]{pointer-events:none}.data-disabled\\:opacity-50[data-disabled]{opacity:.5}.data-enabled\\:max-w-full[data-enabled]{max-width:100%}.data-enabled\\:opacity-100[data-enabled]{opacity:1}.data-focus\\:ring-4[data-focus]{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(.\\*\\*\\:data-media-provider\\:origin-center *)[data-media-provider]{transform-origin:50%}:is(.\\*\\*\\:data-media-provider\\:scale-x-\\[-1\\] *)[data-media-provider]{--tw-scale-x:-1;scale:var(--tw-scale-x)var(--tw-scale-y)}:is(.\\*\\*\\:data-media-provider\\:scale-y-\\[-1\\] *)[data-media-provider]{--tw-scale-y:-1;scale:var(--tw-scale-x)var(--tw-scale-y)}:is(.\\*\\*\\:data-media-provider\\:\\!rounded-none *)[data-media-provider]{border-radius:0!important}.data-placeholder\\:text-muted-foreground[data-placeholder]{color:var(--mx-video-muted-foreground,var(--text-muted,var(--mx-muted-foreground)))}.data-\\[copy-state\\=copied\\]\\:text-success[data-copy-state=copied]{color:var(--background-modifier-success,var(--mx-success))}.data-\\[copy-state\\=copying\\]\\:text-muted-foreground[data-copy-state=copying]{color:var(--mx-video-muted-foreground,var(--text-muted,var(--mx-muted-foreground)))}.data-\\[copy-state\\=error\\]\\:text-destructive[data-copy-state=error]{color:var(--background-modifier-error,var(--mx-destructive))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[disabled\\=true\\]\\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\\[disabled\\=true\\]\\:opacity-50[data-disabled=true]{opacity:.5}.data-\\[error\\=true\\]\\:text-destructive[data-error=true]{color:var(--background-modifier-error,var(--mx-destructive))}.data-\\[orientation\\=horizontal\\]\\:h-1\\.5[data-orientation=horizontal]{height:calc(var(--spacing)*1.5)}.data-\\[orientation\\=horizontal\\]\\:h-full[data-orientation=horizontal]{height:100%}.data-\\[orientation\\=horizontal\\]\\:h-px[data-orientation=horizontal]{height:1px}.data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:h-3[data-orientation=vertical]{height:calc(var(--spacing)*3)}.data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.data-\\[orientation\\=vertical\\]\\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing)*44)}.data-\\[orientation\\=vertical\\]\\:w-1\\.5[data-orientation=vertical]{width:calc(var(--spacing)*1.5)}.data-\\[orientation\\=vertical\\]\\:w-auto[data-orientation=vertical]{width:auto}.data-\\[orientation\\=vertical\\]\\:w-full[data-orientation=vertical]{width:100%}.data-\\[orientation\\=vertical\\]\\:w-px[data-orientation=vertical]{width:1px}.data-\\[orientation\\=vertical\\]\\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\\[selected\\=true\\]\\:bg-accent[data-selected=true]{background-color:var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))}.data-\\[selected\\=true\\]\\:text-accent-foreground[data-selected=true]{color:var(--mx-video-accent-foreground,var(--text-normal,var(--mx-accent-foreground)))}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\\[size\\=default\\]\\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\\[size\\=sm\\]\\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\\*\\:data-\\[slot\\=alert-description\\]\\:text-destructive\\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--background-modifier-error,var(--mx-destructive))90%,transparent)}:is(.\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing)*12)}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:flex>*)[data-slot=select-value]{display:flex}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\\[state\\=checked\\]\\:translate-x-\\[calc\\(100\\%-2px\\)\\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:border-primary[data-state=checked]{border-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked]{color:var(--mx-video-primary-foreground,var(--text-on-accent,var(--mx-primary-foreground)))}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation:exit var(--tw-duration,.15s)var(--tw-ease,ease)}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=on\\]\\:bg-accent[data-state=on]{background-color:var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))}.data-\\[state\\=on\\]\\:text-accent-foreground[data-state=on]{color:var(--mx-video-accent-foreground,var(--text-normal,var(--mx-accent-foreground)))}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation:enter var(--tw-duration,.15s)var(--tw-ease,ease)}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))}.data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:var(--mx-video-muted-foreground,var(--text-muted,var(--mx-muted-foreground)))}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:var(--mx-video-input,var(--background-modifier-border,var(--mx-input)))}.data-\\[variant\\=outline\\]\\:border-l-0[data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.data-\\[variant\\=outline\\]\\:shadow-xs[data-variant=outline]{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\\[variant\\=outline\\]\\:first\\:border-l[data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}@media (width>=40rem){.sm\\:block{display:block}.sm\\:max-w-lg{max-width:var(--container-lg)}.sm\\:flex-row{flex-direction:row}.sm\\:justify-end{justify-content:flex-end}.sm\\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\\:text-left{text-align:left}}@media (width>=48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:text-sm{font-size:var(--font-ui-small,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (width>=64rem){.lg\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\\:px-8{padding-inline:calc(var(--spacing)*8)}}@container (width>=24rem){.\\@sm\\:col-span-2{grid-column:span 2/span 2}.\\@sm\\:block{display:block}.\\@sm\\:flex{display:flex}.\\@sm\\:hidden{display:none}.\\@sm\\:h-4{height:calc(var(--spacing)*4)}.\\@sm\\:w-4{width:calc(var(--spacing)*4)}.\\@sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\\@sm\\:px-2{padding-inline:calc(var(--spacing)*2)}.\\@sm\\:text-xs{font-size:var(--font-ui-smaller,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height))}}@container (width>=28rem){.\\@md\\:block{display:block}.\\@md\\:hidden{display:none}}@container (width>=32rem){.\\@lg\\:col-span-1{grid-column:span 1/span 1}.\\@lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.\\@lg\\:flex-row{flex-direction:row}.\\@lg\\:items-center{align-items:center}.\\@lg\\:self-center{align-self:center}}@container (width>=36rem){.\\@xl\\:grid{display:grid}.\\@xl\\:hidden{display:none}.\\@xl\\:grid-rows-\\[2\\.5rem_1fr_6px_2rem\\]{grid-template-rows:2.5rem 1fr 6px 2rem}.\\@xl\\:px-4{padding-inline:calc(var(--spacing)*4)}.\\@xl\\:pt-4{padding-top:calc(var(--spacing)*4)}.\\@xl\\:text-base{font-size:var(--font-ui-medium,1rem);line-height:var(--tw-leading,var(--text-base--line-height))}.\\@xl\\:text-lg{font-size:calc(var(--font-ui-large,20px)*.9);line-height:var(--tw-leading,var(--text-lg--line-height))}.\\@xl\\:font-medium{--tw-font-weight:var(--font-medium,500);font-weight:var(--font-medium,500)}.\\@xl\\:font-normal{--tw-font-weight:var(--font-normal,400);font-weight:var(--font-normal,400)}}@container (width>=56rem){.\\@4xl\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.dark\\:border-input:is(.dark,.dark *){border-color:var(--mx-video-input,var(--background-modifier-border,var(--mx-input)))}.dark\\:bg-destructive\\/60:is(.dark,.dark *){background-color:color-mix(in oklab,var(--background-modifier-error,var(--mx-destructive))60%,transparent)}.dark\\:bg-input\\/30:is(.dark,.dark *){background-color:color-mix(in oklab,var(--mx-video-input,var(--background-modifier-border,var(--mx-input)))30%,transparent)}.dark\\:ring-ring\\/20:is(.dark,.dark *){--tw-ring-color:color-mix(in oklab,var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))20%,transparent)}.dark\\:outline-ring\\/40:is(.dark,.dark *){outline-color:color-mix(in oklab,var(--mx-video-ring,var(--background-modifier-border-focus,var(--mx-ring)))40%,transparent)}@media (hover:hover){.dark\\:hover\\:bg-accent\\/50:is(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))50%,transparent)}.dark\\:hover\\:bg-input\\/50:is(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--mx-video-input,var(--background-modifier-border,var(--mx-input)))50%,transparent)}}.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark,.dark *):focus-visible,.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark,.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--background-modifier-error,var(--mx-destructive))40%,transparent)}.dark\\:data-\\[state\\=checked\\]\\:bg-primary:is(.dark,.dark *)[data-state=checked]{background-color:var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))}.dark\\:data-\\[state\\=checked\\]\\:bg-primary-foreground:is(.dark,.dark *)[data-state=checked]{background-color:var(--mx-video-primary-foreground,var(--text-on-accent,var(--mx-primary-foreground)))}.dark\\:data-\\[state\\=unchecked\\]\\:bg-foreground:is(.dark,.dark *)[data-state=unchecked]{background-color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}.dark\\:data-\\[state\\=unchecked\\]\\:bg-input\\/80:is(.dark,.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--mx-video-input,var(--background-modifier-border,var(--mx-input)))80%,transparent)}.prose-p\\:my-1 :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-block:calc(var(--spacing)*1)}.prose-p\\:rounded-md :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){border-radius:var(--radius-m,calc(var(--mx-radius) - 2px))}.prose-p\\:py-1 :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){padding-block:calc(var(--spacing)*1)}.prose-p\\:pr-2 :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:calc(var(--spacing)*2)}.prose-p\\:pl-2\\.5 :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:calc(var(--spacing)*2.5)}.prose-p\\:text-foreground :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--mx-video-foreground,var(--text-normal,var(--mx-foreground)))}@media (hover:hover){.prose-p\\:hover\\:bg-muted :where(p):not(:where([class~=not-prose],[class~=not-prose] *)):hover{background-color:var(--mx-video-muted,var(--background-primary-alt,var(--mx-muted)))}}div[data-captions] .media-captions\\:opacity-100{opacity:1}div[data-controls] .media-controls\\:bottom-14{bottom:calc(var(--spacing)*14)}div[data-controls] .media-controls\\:opacity-100,div[data-paused] .media-paused\\:opacity-100{opacity:1}div[data-preview] .media-preview\\:opacity-0{opacity:0}@media (pointer:fine){.pointer-fine\\:opacity-0{opacity:0}}.vol-active\\:mr-3[data-active],.vol-active\\:mr-3:has(>[data-active]),.vol-active\\:mr-3:is(:where(.group\\/vol-ctrl):hover *),.vol-active\\:mr-3:is(:where(.group\\/vol-ctrl)>:focus-visible~.vol-active\\:mr-3),.vol-active\\:mr-3:is(:where(.group\\/vol-ctrl)>.vol-active\\:mr-3:focus-visible),.vol-active\\:mr-3:is(:where(.group\\/vol-ctrl)>.vol-active\\:mr-3:has(>:focus-visible)){margin-right:calc(var(--spacing)*3)}.vol-active\\:ml-3[data-active],.vol-active\\:ml-3:has(>[data-active]),.vol-active\\:ml-3:is(:where(.group\\/vol-ctrl):hover *),.vol-active\\:ml-3:is(:where(.group\\/vol-ctrl)>:focus-visible~.vol-active\\:ml-3),.vol-active\\:ml-3:is(:where(.group\\/vol-ctrl)>.vol-active\\:ml-3:focus-visible),.vol-active\\:ml-3:is(:where(.group\\/vol-ctrl)>.vol-active\\:ml-3:has(>:focus-visible)){margin-left:calc(var(--spacing)*3)}.vol-active\\:max-w-20[data-active],.vol-active\\:max-w-20:has(>[data-active]),.vol-active\\:max-w-20:is(:where(.group\\/vol-ctrl):hover *),.vol-active\\:max-w-20:is(:where(.group\\/vol-ctrl)>:focus-visible~.vol-active\\:max-w-20),.vol-active\\:max-w-20:is(:where(.group\\/vol-ctrl)>.vol-active\\:max-w-20:focus-visible),.vol-active\\:max-w-20:is(:where(.group\\/vol-ctrl)>.vol-active\\:max-w-20:has(>:focus-visible)){max-width:calc(var(--spacing)*20)}.vol-active\\:pr-2[data-active],.vol-active\\:pr-2:has(>[data-active]),.vol-active\\:pr-2:is(:where(.group\\/vol-ctrl):hover *),.vol-active\\:pr-2:is(:where(.group\\/vol-ctrl)>:focus-visible~.vol-active\\:pr-2),.vol-active\\:pr-2:is(:where(.group\\/vol-ctrl)>.vol-active\\:pr-2:focus-visible),.vol-active\\:pr-2:is(:where(.group\\/vol-ctrl)>.vol-active\\:pr-2:has(>:focus-visible)){padding-right:calc(var(--spacing)*2)}.vol-active\\:pl-2[data-active],.vol-active\\:pl-2:has(>[data-active]),.vol-active\\:pl-2:is(:where(.group\\/vol-ctrl):hover *),.vol-active\\:pl-2:is(:where(.group\\/vol-ctrl)>:focus-visible~.vol-active\\:pl-2),.vol-active\\:pl-2:is(:where(.group\\/vol-ctrl)>.vol-active\\:pl-2:focus-visible),.vol-active\\:pl-2:is(:where(.group\\/vol-ctrl)>.vol-active\\:pl-2:has(>:focus-visible)){padding-left:calc(var(--spacing)*2)}.vol-active\\:delay-200[data-active],.vol-active\\:delay-200:has(>[data-active]),.vol-active\\:delay-200:is(:where(.group\\/vol-ctrl):hover *),.vol-active\\:delay-200:is(:where(.group\\/vol-ctrl)>:focus-visible~.vol-active\\:delay-200),.vol-active\\:delay-200:is(:where(.group\\/vol-ctrl)>.vol-active\\:delay-200:focus-visible),.vol-active\\:delay-200:is(:where(.group\\/vol-ctrl)>.vol-active\\:delay-200:has(>:focus-visible)){transition-delay:.2s;animation-delay:.2s}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs [cmdk-group-heading]{font-size:var(--font-ui-smaller,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-medium,500);font-weight:var(--font-medium,500)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground [cmdk-group-heading]{color:var(--mx-video-muted-foreground,var(--text-muted,var(--mx-muted-foreground)))}.\\[\\&_\\[cmdk-group\\]\\]\\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-input\\]\\]\\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\\[\\&_\\[cmdk-item\\]\\]\\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-item\\]\\]\\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\\[\\&_p\\]\\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-3\\.5 svg{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground svg:not([class*=text-]){color:var(--mx-video-muted-foreground,var(--text-muted,var(--mx-muted-foreground)))}.\\[\\&_svg\\:not\\(\\[class\\*\\=size-\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\\[\\&_svg\\:not\\(\\[class\\*\\=size-\\]\\)\\]\\:size-5 svg:not([class*=size-]){width:calc(var(--spacing)*5);height:calc(var(--spacing)*5)}.\\[\\&_svg\\:not\\(\\[class\\*\\=size-\\]\\)\\]\\:size-6 svg:not([class*=size-]){width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}.\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:is(.\\*\\:\\[span\\]\\:last\\:flex>*):is(span):last-child{display:flex}:is(.\\*\\:\\[span\\]\\:last\\:items-center>*):is(span):last-child{align-items:center}:is(.\\*\\:\\[span\\]\\:last\\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}.\\[\\&\\>\\*\\]\\:border-b>*{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\\[\\&\\>\\*\\:last-child\\]\\:border-b-0>:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@container (width>=56rem){.\\@4xl\\:\\[\\&\\>\\*\\:nth-child\\(even\\)\\]\\:border-l>:nth-child(2n){border-left-style:var(--tw-border-style);border-left-width:1px}.\\@4xl\\:\\[\\&\\>\\*\\:nth-last-child\\(-n\\+2\\)\\]\\:border-b-0>:nth-last-child(-n+2){border-bottom-style:var(--tw-border-style);border-bottom-width:0}}.\\[\\&\\>svg\\]\\:pointer-events-none>svg{pointer-events:none}.\\[\\&\\>svg\\]\\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\\[\\&\\>svg\\]\\:size-4>svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\\[\\&\\>svg\\]\\:translate-y-0\\.5>svg{--tw-translate-y:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.\\[\\&\\>svg\\]\\:text-current>svg{color:currentColor}@media (hover:hover){a.\\[a\\&\\]\\:hover\\:bg-accent:hover{background-color:var(--mx-video-accent,var(--background-modifier-hover,var(--mx-accent)))}a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--background-modifier-error,var(--mx-destructive))90%,transparent)}a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--mx-video-primary,var(--interactive-accent,var(--mx-primary)))90%,transparent)}a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:color-mix(in oklab,var(--mx-video-secondary,var(--background-secondary,var(--mx-secondary)))90%,transparent)}a.\\[a\\&\\]\\:hover\\:text-accent-foreground:hover{color:var(--mx-video-accent-foreground,var(--text-normal,var(--mx-accent-foreground)))}}}[data-media-player]{contain:style;box-sizing:border-box;-webkit-user-select:none;user-select:none;align-items:center;width:100%;display:inline-flex;position:relative}[data-media-player] *{box-sizing:border-box}:where([data-media-player][data-view-type=video]){aspect-ratio:16/9}[data-media-player]:focus,[data-media-player]:focus-visible{outline:none}[data-media-player][data-view-type=video][data-started]:not([data-controls]){pointer-events:auto;cursor:none}[data-media-player] slot{display:contents}[data-media-provider]{box-sizing:border-box;border-radius:inherit;width:100%;aspect-ratio:inherit;align-items:center;display:flex;position:relative;overflow:hidden}[data-media-player]:not([data-view-type=audio]) [data-media-provider],[data-media-player][data-fullscreen] [data-media-provider]{height:100%}[data-media-player][data-view-type=audio] [data-media-provider]{background-color:unset;display:contents}[data-media-provider] audio{width:100%}:where(video:not([width]):not([height]),iframe:not([width]):not([height])){aspect-ratio:16/9;width:100%}:where([data-media-provider] video),:where([data-media-provider] iframe){aspect-ratio:inherit;object-fit:contain;touch-action:manipulation;border-radius:inherit;width:100%;height:auto;display:inline-block}[data-media-provider] iframe{height:100%}[data-media-player][data-view-type=audio] video,[data-media-player][data-view-type=audio] iframe{display:none}[data-media-player][data-fullscreen] video{height:100%}[data-media-provider] iframe:not([src]){display:none}iframe.vds-youtube[data-no-controls]{height:1000%}.vds-blocker{width:100%;height:auto;aspect-ratio:inherit;pointer-events:auto;border-radius:inherit;z-index:1;position:absolute;top:0;right:0;bottom:0;left:0}[data-ended] .vds-blocker{background-color:#000}.vds-icon:focus{outline:none}.vds-google-cast{color:#dedede;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;font-family:sans-serif;font-weight:500;display:flex}.vds-google-cast svg{--size:max(18%,40px);width:var(--size);height:var(--size);margin-bottom:8px}.vds-google-cast-info{font-size:calc(var(--media-height)/100*6)}.ProseMirror{word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:"liga" 0;position:relative}.ProseMirror pre{white-space:pre-wrap}.ProseMirror li{position:relative}.ProseMirror-hideselection ::selection{background:0 0}.ProseMirror-hideselection{caret-color:#0000}.ProseMirror [draggable][contenteditable=false]{-webkit-user-select:text;user-select:text}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:"";pointer-events:none;border:2px solid #8cf;position:absolute;top:-2px;right:-2px;bottom:-2px;left:-32px}img.ProseMirror-separator{border:none!important;margin:0!important;display:inline!important}.prosemirror-flat-list{margin-top:0;margin-bottom:0;margin-left:32px;padding:0;list-style:none;display:list-item;position:relative}.prosemirror-flat-list.ProseMirror-selectednode{outline:none}.prosemirror-flat-list.ProseMirror-selectednode:after{content:"";pointer-events:none;border:2px solid #8cf;position:absolute;top:-2px;right:-2px;bottom:-2px;left:-32px}.prosemirror-flat-list[data-list-kind=bullet]{list-style:outside}.prosemirror-flat-list[data-list-kind=ordered]{counter-increment:prosemirror-flat-list-counter}.prosemirror-flat-list[data-list-kind=ordered]>*{contain:style}.prosemirror-flat-list[data-list-kind=ordered]:before{font-variant-numeric:tabular-nums;content:counter(prosemirror-flat-list-counter,decimal)". ";position:absolute;right:100%}.prosemirror-flat-list[data-list-kind=ordered]:first-child,:not(.prosemirror-flat-list[data-list-kind=ordered])+.prosemirror-flat-list[data-list-kind=ordered]{counter-reset:prosemirror-flat-list-counter}@supports (counter-set:prosemirror-flat-list-counter 1){[data-list-order]:is(.prosemirror-flat-list[data-list-kind=ordered]:first-child,:not(.prosemirror-flat-list[data-list-kind=ordered])+.prosemirror-flat-list[data-list-kind=ordered]){counter-set:prosemirror-flat-list-counter var(--prosemirror-flat-list-order)}}@supports not (counter-set:prosemirror-flat-list-counter 1){[data-list-order]:is(.prosemirror-flat-list[data-list-kind=ordered]:first-child,:not(.prosemirror-flat-list[data-list-kind=ordered])+.prosemirror-flat-list[data-list-kind=ordered]){counter-increment:prosemirror-flat-list-counter var(--prosemirror-flat-list-order)}}.prosemirror-flat-list[data-list-kind=task]>.list-marker{text-align:center;width:1lh;position:absolute;right:100%}.prosemirror-flat-list[data-list-kind=task]>.list-marker,.prosemirror-flat-list[data-list-kind=task]>.list-marker *{cursor:pointer}.prosemirror-flat-list[data-list-kind=toggle]>.list-marker{text-align:center;width:1lh;position:absolute;right:100%}.prosemirror-flat-list[data-list-kind=toggle]>.list-marker:before{content:"\u23F7"}.prosemirror-flat-list[data-list-kind=toggle][data-list-collapsable][data-list-collapsed]>.list-marker:before{content:"\u23F5"}.prosemirror-flat-list[data-list-kind=toggle][data-list-collapsable]>.list-marker{cursor:pointer}.prosemirror-flat-list[data-list-kind=toggle]:not([data-list-collapsable])>.list-marker{opacity:.4;pointer-events:none}.prosemirror-flat-list[data-list-kind=toggle][data-list-collapsable][data-list-collapsed]>.list-content>:nth-child(n+2){display:none}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,.ProseMirror th{vertical-align:top;box-sizing:border-box;border-width:1px;padding-left:.75rem;padding-right:.75rem;position:relative}.ProseMirror .column-resize-handle{z-index:20;pointer-events:none;background-color:highlighttext;width:4px;position:absolute;top:0;bottom:0;right:-2px}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell{--color:210,100%,56%;background-color:hsla(var(--color),20%);border:1px double hsl(var(--color))}.prosekit-placeholder:before{opacity:.3;pointer-events:none;content:attr(data-placeholder);height:0;position:absolute}.prosekit-virtual-selection{background-color:#8888884d;border-radius:2px;box-shadow:0 0 0 2px #8888884d}.prosekit-commit-deletion{background-color:#e5534b80;text-decoration:line-through}.prosekit-commit-addition{background-color:#53e54b80}.ProseMirror-gapcursor{pointer-events:none;display:none;position:relative}.ProseMirror-gapcursor:after{content:"";border-top:1px solid;width:20px;animation:1.1s steps(2,start) infinite ProseMirror-cursor-blink;display:block;position:absolute;top:-2px}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}.ProseMirror-focused .ProseMirror-gapcursor{display:block}.ProseMirror-search-match{background-color:var(--text-highlight-bg,#ffff0054);box-shadow:0 0 0 2px var(--text-highlight-bg,#ffff0054);border-radius:2px}.ProseMirror:not(.ProseMirror-focused) .ProseMirror-active-search-match{background-color:var(--text-highlight-bg,#ffff0054);box-shadow:0 0 0 3px var(--text-accent,#ff6a0054);mix-blend-mode:var(--highlight-mix-blend-mode,darken);border-radius:2px}.ProseMirror.ProseMirror-focused .ProseMirror-active-search-match::selection{background-color:var(--text-highlight-bg,#ffff0054);box-shadow:0 0 0 3px var(--text-accent,#ff6a0054);mix-blend-mode:var(--highlight-mix-blend-mode,darken);border-radius:2px}.mx-html-dropdown{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb25zLXVwLWRvd24taWNvbiBsdWNpZGUtY2hldnJvbnMtdXAtZG93biI+PHBhdGggZD0ibTcgMTUgNSA1IDUtNSIvPjxwYXRoIGQ9Im03IDkgNS01IDUgNSIvPjwvc3ZnPg==);background-position:right .5rem center;background-repeat:no-repeat;background-size:1rem}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0))}}.mx-player-video{color:#fafafa;--mx-video-background: oklch(.145 0 0);--mx-video-foreground: oklch(.985 0 0);--mx-video-card: oklch(1 0 0);--mx-video-card-foreground: oklch(.145 0 0);--mx-video-secondary: oklch(.269 0 0);--mx-video-secondary-foreground: oklch(.985 0 0);--mx-video-muted: oklch(.269 0 0);--mx-video-muted-foreground: oklch(.985 0 0);--mx-video-accent: oklch(.269 0 0);--mx-video-accent-foreground: oklch(.985 0 0);--mx-video-border: oklch(1 0 0 / 10%);--mx-video-input: oklch(1 0 0 / 15%);--mx-video-ring: oklch(.556 0 0);--mx-video-overlay: oklch(.145 0 0);--mx-video-thumb: oklch(.985 0 0)}._captions_1ihkv_9{--cue-color: var(--media-cue-color, white);--cue-bg-color: var(--media-cue-bg, rgba(0, 0, 0, .7));--cue-font-size: calc(var(--overlay-height) / 100 * 4.5);--cue-line-height: calc(var(--cue-font-size) * 1.2);--cue-padding-x: calc(var(--cue-font-size) * .6);--cue-padding-y: calc(var(--cue-font-size) * .4);font-size:var(--cue-font-size);word-spacing:normal;contain:layout style}._captions_1ihkv_9[aria-hidden=true]{display:none}._captions_1ihkv_9 [data-part=cue-display]{position:absolute;direction:ltr;overflow:visible;contain:content;top:var(--cue-top);left:var(--cue-left);right:var(--cue-right);bottom:var(--cue-bottom);width:var(--cue-width, auto);height:var(--cue-height, auto);transform:var(--cue-transform);text-align:var(--cue-text-align);writing-mode:var(--cue-writing-mode, unset);white-space:pre-line;unicode-bidi:plaintext;min-width:min-content;min-height:min-content}._captions_1ihkv_9[data-dir=rtl] [data-part=cue-display]{direction:rtl}._captions_1ihkv_9 [data-part=cue]{display:inline-block;contain:content;border-radius:2px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);padding:var(--cue-padding-y) var(--cue-padding-x);line-height:var(--cue-line-height);background-color:var(--cue-bg-color);color:var(--cue-color);white-space:pre-wrap;outline:var(--cue-outline);text-shadow:var(--cue-text-shadow)}._captions_1ihkv_9 [data-part=cue-display][data-vertical] [data-part=cue]{padding:var(--cue-padding-x) var(--cue-padding-y)}
`;var vY=`:root,
:host {
--mx-radius: 0.625rem;
--mx-background: oklch(1 0 0);
--mx-foreground: oklch(0.145 0 0);
--mx-card: oklch(1 0 0);
--mx-card-foreground: oklch(0.145 0 0);
--mx-popover: oklch(1 0 0);
--mx-popover-foreground: oklch(0.145 0 0);
--mx-primary: oklch(0.205 0 0);
--mx-primary-foreground: oklch(0.985 0 0);
--mx-secondary: oklch(0.97 0 0);
--mx-secondary-foreground: oklch(0.205 0 0);
--mx-muted: oklch(0.97 0 0);
--mx-muted-foreground: oklch(0.556 0 0);
--mx-accent: oklch(0.97 0 0);
--mx-accent-foreground: oklch(0.205 0 0);
--mx-destructive: oklch(0.577 0.245 27.325);
--mx-success: oklch(62.7% 0.194 149.214);
--mx-warning: oklch(64.6% 0.222 41.116);
--mx-border: oklch(0.922 0 0);
--mx-input: oklch(0.922 0 0);
--mx-ring: oklch(0.708 0 0);
--mx-chart-1: oklch(0.646 0.222 41.116);
--mx-chart-2: oklch(0.6 0.118 184.704);
--mx-chart-3: oklch(0.398 0.07 227.392);
--mx-chart-4: oklch(0.828 0.189 84.429);
--mx-chart-5: oklch(0.769 0.188 70.08);
--mx-sidebar: oklch(0.985 0 0);
--mx-sidebar-foreground: oklch(0.145 0 0);
--mx-sidebar-primary: oklch(0.205 0 0);
--mx-sidebar-primary-foreground: oklch(0.985 0 0);
--mx-sidebar-accent: oklch(0.97 0 0);
--mx-sidebar-accent-foreground: oklch(0.205 0 0);
--mx-sidebar-border: oklch(0.922 0 0);
--mx-sidebar-ring: oklch(0.708 0 0);
}
.dark,
:host[class~="dark"],
:root[class~="dark"] {
--mx-background: oklch(0.145 0 0);
--mx-foreground: oklch(0.985 0 0);
--mx-card: oklch(0.205 0 0);
--mx-card-foreground: oklch(0.985 0 0);
--mx-popover: oklch(0.205 0 0);
--mx-popover-foreground: oklch(0.985 0 0);
--mx-primary: oklch(0.922 0 0);
--mx-primary-foreground: oklch(0.205 0 0);
--mx-secondary: oklch(0.269 0 0);
--mx-secondary-foreground: oklch(0.985 0 0);
--mx-muted: oklch(0.269 0 0);
--mx-muted-foreground: oklch(0.708 0 0);
--mx-accent: oklch(0.269 0 0);
--mx-accent-foreground: oklch(0.985 0 0);
--mx-destructive: oklch(0.704 0.191 22.216);
--mx-border: oklch(1 0 0 / 10%);
--mx-input: oklch(1 0 0 / 15%);
--mx-ring: oklch(0.556 0 0);
--mx-chart-1: oklch(0.488 0.243 264.376);
--mx-chart-2: oklch(0.696 0.17 162.48);
--mx-chart-3: oklch(0.769 0.188 70.08);
--mx-chart-4: oklch(0.627 0.265 303.9);
--mx-chart-5: oklch(0.645 0.246 16.439);
--mx-sidebar: oklch(0.205 0 0);
--mx-sidebar-foreground: oklch(0.985 0 0);
--mx-sidebar-primary: oklch(0.488 0.243 264.376);
--mx-sidebar-primary-foreground: oklch(0.985 0 0);
--mx-sidebar-accent: oklch(0.269 0 0);
--mx-sidebar-accent-foreground: oklch(0.985 0 0);
--mx-sidebar-border: oklch(1 0 0 / 10%);
--mx-sidebar-ring: oklch(0.556 0 0);
}
`;var yT=Z(Ge(),1);var Yr=Z(Te(),1);var oLe=Z(Te(),1);function DY(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function NY(...t){return e=>{let r=!1,n=t.map(i=>{let s=DY(i,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){let s=n[i];typeof s=="function"?s():DY(t[i],null)}}}}var om=Z(Ge(),1),b6=Yr.forwardRef((t,e)=>{let{children:r,...n}=t,i=Yr.Children.toArray(r),s=i.find(cLe);if(s){let a=s.props.children,o=i.map(l=>l===s?Yr.Children.count(a)>1?Yr.Children.only(null):Yr.isValidElement(a)?a.props.children:null:l);return(0,om.jsx)(v6,{...n,ref:e,children:Yr.isValidElement(a)?Yr.cloneElement(a,void 0,o):null})}return(0,om.jsx)(v6,{...n,ref:e,children:r})});b6.displayName="Slot";var v6=Yr.forwardRef((t,e)=>{let{children:r,...n}=t;if(Yr.isValidElement(r)){let i=dLe(r),s=uLe(n,r.props);return r.type!==Yr.Fragment&&(s.ref=e?NY(e,i):i),Yr.cloneElement(r,s)}return Yr.Children.count(r)>1?Yr.Children.only(null):null});v6.displayName="SlotClone";var lLe=({children:t})=>(0,om.jsx)(om.Fragment,{children:t});function cLe(t){return Yr.isValidElement(t)&&t.type===lLe}function uLe(t,e){let r={...e};for(let n in e){let i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...o)=>{s(...o),i(...o)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function dLe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Pf=Z(Te(),1),UY=Z(Af(),1);var lm=Z(Te(),1);function gT(t){let e=(0,lm.useRef)(void 0),r=(0,lm.useCallback)(n=>{let i=t.map(s=>{if(s!=null){if(typeof s=="function"){let a=s,o=a(n);return typeof o=="function"?o:()=>{a(null)}}return s.current=n,()=>{s.current=null}}});return()=>{for(let s of i)s?.()}},t);return(0,lm.useMemo)(()=>t.every(n=>n==null)?null:n=>{e.current&&(e.current(),e.current=void 0),n!=null&&(e.current=r(n))},t)}var $Y=Z(Te(),1),x6=(0,$Y.createContext)(null);function mLe({root:t,children:e=null}){return(0,UY.createPortal)(e,t)}function w6({mode:t="open",delegatesFocus:e=!1,styleSheets:r=[],children:n,ref:i,asChild:s,...a}){let o=(0,Pf.useRef)(null),l=gT([o,i]),[c,u]=(0,Pf.useState)(null),d=`node_${t}${e}`,f=s?b6:"div";return(0,Pf.useLayoutEffect)(()=>{if(!o.current||o.current.shadowRoot)return;let p=null;p=o.current.attachShadow({mode:t,delegatesFocus:e}),u(p)},[t,e]),(0,Pf.useLayoutEffect)(()=>{c&&(c.adoptedStyleSheets=r)},[c,r]),(0,yT.jsx)(f,{ref:l,...a,children:(0,yT.jsx)(x6.Provider,{value:c,children:c&&(0,yT.jsx)(mLe,{root:c,children:n})})},d)}var zY=Z(Te(),1),qY=Z(Ge(),1),k6=new WeakMap;async function vT(t=window){let e=t.document;if(k6.has(e))return k6.get(e);let r=Promise.all([S6(yY,t),S6(vY,t),S6(gY,t)]);return k6.set(e,r),await r}async function S6(t,e){let{CSSStyleSheet:r}=e,n=new r;return await n.replace(t),n}function Rf(t){let[e,r]=(0,zY.useState)([]);return(0,qY.jsx)(w6,{ref:n=>{n&&(n.onWindowMigrated(i=>{vT(i).then(r)}),vT(n.win).then(r))},styleSheets:e,...t})}function Vr(t,e){return t instanceof Promise?gLe(t,e):yLe(t,e)}function gLe(t,e){let{promise:r,reject:n}=Promise.withResolvers(),i=()=>n(e.reason);return e.aborted&&i(),e.addEventListener("abort",i,{once:!0}),Promise.race([r,t]).finally(()=>{e.removeEventListener("abort",i)})}async function*yLe(t,e){e.throwIfAborted();let{promise:r,reject:n}=Promise.withResolvers(),i=()=>n(e.reason);e.addEventListener("abort",i,{once:!0});let s=t[Symbol.asyncIterator]();try{for(;;){let a=Promise.race([r,s.next()]);a.catch(()=>{e.removeEventListener("abort",i)});let{done:o,value:l}=await a;if(o)return e.removeEventListener("abort",i),(await s.return?.(l))?.value;yield l}}catch(a){throw await s.return?.(),a}}var GY;GY=Symbol.asyncIterator;var HY=class{#e=0;#t=[];#r=[];#n=Promise.withResolvers();add(e){++this.#e,this.#i(e[Symbol.asyncIterator]())}async#i(e){try{let{value:r,done:n}=await e.next();n?--this.#e:this.#t.push({iterator:e,value:r})}catch(r){this.#r.push(r)}this.#n.resolve()}async*iterate(){for(;this.#e>0;){await this.#n.promise;for(let{iterator:e,value:r}of this.#t)yield r,this.#i(e);if(this.#r.length)for(let e of this.#r)throw e;this.#t.length=0,this.#n=Promise.withResolvers()}}[GY](){return this.iterate()}};function C6(t,e,r,n,i){let s=Math.min(t,e*n**r);return(1-i*Math.random())*s}var bT=class extends Error{constructor(e,r){super(`Retrying exceeded the maxAttempts (${r}).`),this.name="RetryError",this.cause=e}};var T6=require("obsidian");var kt=class extends DOMException{constructor(e="Aborted"){super(e,"AbortError")}static test(e){return e instanceof DOMException&&e.name==="AbortError"}};function xr(t,e){t.defer(()=>e.e.offref(e))}function cm(t,e,r,n,i){e.addEventListener(r,n,i),t.defer(()=>e.removeEventListener(r,n,i))}function um(t,e,r,n,i){let s=e.register(r,n,i);t.defer(()=>e.unregister(s))}var hu=class extends AbortController{[Symbol.dispose](){this.abort(new kt)}};async function WY(t,{app:e,signal:r}){var s=[];try{let n=J(s,new DisposableStack);let i=new Promise(c=>{function u(){for(let{view:d}of e.workspace.getLeavesOfType(t))if(d instanceof T6.MarkdownView)return c(d),!0;return!1}e.workspace.onLayoutReady(()=>{u()||xr(n,e.workspace.on("layout-change",u))})});return await Vr(i,r)}catch(a){var o=a,l=!0}finally{ee(s,o,l)}}function KY(t){return t.constructor.prototype}function E6(t){return Promise.all(t.getLeavesOfType("markdown").map(async e=>{let r=e.getViewState();await e.setViewState({type:"empty"}),await e.setViewState(r)}))}var YY=Promise.withResolvers();async function XY(t){let e=new AbortController;t.register(()=>e.abort());let r=await WY("markdown",{app:t.app,signal:e.signal}),n=vLe(r,"triggerClickableToken");if(!n)throw new Error("Failed to find markdown view prototype");YY.resolve({edit:n})}async function QY(){return(await YY.promise).edit}function vLe(t,e){let r=t;for(;r;){if(Object.hasOwn(r,e))return r;r=Object.getPrototypeOf(r)}return null}async function dm(t){let e=new AbortController,r=()=>e.abort();t.register(r);try{await Vr(new Promise(i=>{t.app.workspace.onLayoutReady(i)}),e.signal);let n=t._events.indexOf(r);n!==-1&&t._events.splice(n,1)}catch{return}}function pr(t,e){let r=Object.keys(e).map(n=>bLe(t,n,e[n]));return r.length===1?r[0]:function(){r.forEach(n=>n())}}function bLe(t,e,r){let n=t[e],i=t.hasOwnProperty(e),s=i?n:function(){return Object.getPrototypeOf(t)[e].apply(this,arguments)},a=r(s);return n&&Object.setPrototypeOf(a,n),Object.setPrototypeOf(o,a),t[e]=o,l;function o(...c){return a===s&&t[e]===o&&l(),a.apply(this,c)}function l(){t[e]===o&&(i?t[e]=s:delete t[e]),a!==s&&(a=s,Object.setPrototypeOf(o,n||Function))}}var ZY=require("obsidian");async function xLe(t){let e=new ZY.WorkspaceLeaf(t);return await e.setViewState({type:"empty"}),e.view.constructor}async function JY(t,e){let r=await xLe(t);if(!r)return console.error("Failed to get EmptyView"),null;let n=[...e].reverse(),i=new WeakMap,s=o=>{if(i.has(o))return;let l=n.map(c=>createDiv({cls:"empty-state-action tappable",text:c.title},u=>{u.addEventListener("click",c.callback)}));for(let c of l)o.actionListEl.lastElementChild?.insertAdjacentElement("beforebegin",c);i.set(o,()=>{for(let c of l)c.remove();i.delete(o)})};for(let o of t.workspace.getLeavesOfType("empty"))s(o.view);let a=pr(r.prototype,{onOpen(o){return async function(){let l=await o.apply(this);return s(this),l}}});return()=>{a();for(let o of t.workspace.getLeavesOfType("empty"))i.get(o.view)?.()}}var eX=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>(mu(),Lf)).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};var _b=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}},xT=class extends _b{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}},wT=class extends _b{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}},kT=class extends _b{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}},ST;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(ST||(ST={}));var TLe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})},Ob=class{constructor(e,{headers:r={},customFetch:n,region:i=ST.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=eX(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return TLe(this,void 0,void 0,function*(){try{let{headers:i,method:s,body:a}=r,o={},{region:l}=r;l||(l=this.region),l&&l!=="any"&&(o["x-region"]=l);let c;a&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&a instanceof Blob||a instanceof ArrayBuffer?(o["Content-Type"]="application/octet-stream",c=a):typeof a=="string"?(o["Content-Type"]="text/plain",c=a):typeof FormData<"u"&&a instanceof FormData?c=a:(o["Content-Type"]="application/json",c=JSON.stringify(a)));let u=yield this.fetch(`${this.url}/${e}`,{method:s||"POST",headers:Object.assign(Object.assign(Object.assign({},o),this.headers),i),body:c}).catch(h=>{throw new xT(h)}),d=u.headers.get("x-relay-error");if(d&&d==="true")throw new wT(u);if(!u.ok)throw new kT(u);let f=((n=u.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),p;return f==="application/json"?p=yield u.json():f==="application/octet-stream"?p=yield u.blob():f==="text/event-stream"?p=u:f==="multipart/form-data"?p=yield u.formData():p=yield u.text(),{data:p,error:null}}catch(i){return{data:null,error:i}}})}};var pX=Z(fX(),1),{PostgrestClient:hX,PostgrestQueryBuilder:yst,PostgrestFilterBuilder:vst,PostgrestTransformBuilder:bst,PostgrestBuilder:xst,PostgrestError:FLe}=pX.default;var mX="2.11.2";var gX={"X-Client-Info":`realtime-js/${mX}`},yX="1.0.0",AT=1e4,vX=1e3,Mf;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Mf||(Mf={}));var Fi;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Fi||(Fi={}));var ys;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(ys||(ys={}));var IT;(function(t){t.websocket="websocket"})(IT||(IT={}));var gu;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(gu||(gu={}));var $b=class{constructor(){this.HEADER_LENGTH=1}decode(e,r){return e.constructor===ArrayBuffer?r(this._binaryDecode(e)):r(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){let r=new DataView(e),n=new TextDecoder;return this._decodeBroadcast(e,r,n)}_decodeBroadcast(e,r,n){let i=r.getUint8(1),s=r.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+i));a=a+i;let l=n.decode(e.slice(a,a+s));a=a+s;let c=JSON.parse(n.decode(e.slice(a,e.byteLength)));return{ref:null,topic:o,event:l,payload:c}}};var _f=class{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var Wt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Wt||(Wt={}));var $6=(t,e,r={})=>{var n;let i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return Object.keys(e).reduce((s,a)=>(s[a]=BLe(a,t,e,i),s),{})},BLe=(t,e,r,n)=>{let i=e.find(o=>o.name===t),s=i?.type,a=r[t];return s&&!n.includes(s)?bX(s,a):j6(a)},bX=(t,e)=>{if(t.charAt(0)==="_"){let r=t.slice(1,t.length);return ULe(e,r)}switch(t){case Wt.bool:return VLe(e);case Wt.float4:case Wt.float8:case Wt.int2:case Wt.int4:case Wt.int8:case Wt.numeric:case Wt.oid:return jLe(e);case Wt.json:case Wt.jsonb:return $Le(e);case Wt.timestamp:return zLe(e);case Wt.abstime:case Wt.date:case Wt.daterange:case Wt.int4range:case Wt.int8range:case Wt.money:case Wt.reltime:case Wt.text:case Wt.time:case Wt.timestamptz:case Wt.timetz:case Wt.tsrange:case Wt.tstzrange:return j6(e);default:return j6(e)}},j6=t=>t,VLe=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},jLe=t=>{if(typeof t=="string"){let e=parseFloat(t);if(!Number.isNaN(e))return e}return t},$Le=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},ULe=(t,e)=>{if(typeof t!="string")return t;let r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let s,a=t.slice(1,r);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>bX(e,o))}return t},zLe=t=>typeof t=="string"?t.replace(" ","T"):t,PT=t=>{let e=t;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};var Of=class{constructor(e,r,n={},i=AT){this.channel=e,this.event=r,this.payload=n,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,r){var n;return this._hasReceived(e)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:e,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let e=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(r))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}};var U6;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(U6||(U6={}));var hm=class t{constructor(e,r){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let n=r?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},i=>{let{onJoin:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=t.syncState(this.state,i,s,a),this.pendingDiffs.forEach(l=>{this.state=t.syncDiff(this.state,l,s,a)}),this.pendingDiffs=[],o()}),this.channel._on(n.diff,{},i=>{let{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=t.syncDiff(this.state,i,s,a),o())}),this.onJoin((i,s,a)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:a})}),this.onLeave((i,s,a)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,r,n,i){let s=this.cloneDeep(e),a=this.transformState(r),o={},l={};return this.map(s,(c,u)=>{a[c]||(l[c]=u)}),this.map(a,(c,u)=>{let d=s[c];if(d){let f=u.map(v=>v.presence_ref),p=d.map(v=>v.presence_ref),h=u.filter(v=>p.indexOf(v.presence_ref)<0),m=d.filter(v=>f.indexOf(v.presence_ref)<0);h.length>0&&(o[c]=h),m.length>0&&(l[c]=m)}else o[c]=u}),this.syncDiff(s,{joins:o,leaves:l},n,i)}static syncDiff(e,r,n,i){let{joins:s,leaves:a}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),i||(i=()=>{}),this.map(s,(o,l)=>{var c;let u=(c=e[o])!==null&&c!==void 0?c:[];if(e[o]=this.cloneDeep(l),u.length>0){let d=e[o].map(p=>p.presence_ref),f=u.filter(p=>d.indexOf(p.presence_ref)<0);e[o].unshift(...f)}n(o,u,l)}),this.map(a,(o,l)=>{let c=e[o];if(!c)return;let u=l.map(d=>d.presence_ref);c=c.filter(d=>u.indexOf(d.presence_ref)<0),e[o]=c,i(o,c,l),c.length===0&&delete e[o]}),e}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{let i=e[n];return"metas"in i?r[n]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):r[n]=i,r},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var z6;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(z6||(z6={}));var q6;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(q6||(q6={}));var qo;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(qo||(qo={}));var mm=class t{constructor(e,r={config:{}},n){this.topic=e,this.params=r,this.socket=n,this.bindings={},this.state=Fi.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new Of(this,ys.join,this.params,this.timeout),this.rejoinTimer=new _f(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Fi.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Fi.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=Fi.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Fi.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ys.reply,{},(i,s)=>{this._trigger(this._replyEventName(s),i)}),this.presence=new hm(this),this.broadcastEndpointURL=PT(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(e,r=this.timeout){var n,i;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{let{config:{broadcast:s,presence:a,private:o}}=this.params;this._onError(u=>e?.(qo.CHANNEL_ERROR,u)),this._onClose(()=>e?.(qo.CLOSED));let l={},c={broadcast:s,presence:a,postgres_changes:(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(u=>u.filter))!==null&&i!==void 0?i:[],private:o};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:c},l)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:u})=>{var d;if(this.socket.setAuth(),u===void 0){e?.(qo.SUBSCRIBED);return}else{let f=this.bindings.postgres_changes,p=(d=f?.length)!==null&&d!==void 0?d:0,h=[];for(let m=0;m<p;m++){let v=f[m],{filter:{event:b,schema:y,table:x,filter:w}}=v,C=u&&u[m];if(C&&C.event===b&&C.schema===y&&C.table===x&&C.filter===w)h.push(Object.assign(Object.assign({},v),{id:C.id}));else{this.unsubscribe(),e?.(qo.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=h,e&&e(qo.SUBSCRIBED);return}}).receive("error",u=>{e?.(qo.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(u).join(", ")||"error")))}).receive("timeout",()=>{e?.(qo.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){return this._on(e,r,n)}async send(e,r={}){var n,i;if(!this._canPush()&&e.type==="broadcast"){let{event:s,payload:a}=e,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{let c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=c.body)===null||i===void 0?void 0:i.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,o,l;let c=this._push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&s("ok"),c.receive("ok",()=>s("ok")),c.receive("error",()=>s("error")),c.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Fi.leaving;let r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ys.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(n=>{let i=new Of(this,ys.leave,{},e);i.receive("ok",()=>{r(),n("ok")}).receive("timeout",()=>{r(),n("timed out")}).receive("error",()=>{n("error")}),i.send(),this._canPush()||i.trigger("ok",{})})}async _fetchWithTimeout(e,r,n){let i=new AbortController,s=setTimeout(()=>i.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(s),a}_push(e,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new Of(this,e,r,n);return this._canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}_onMessage(e,r,n){return r}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,r,n){var i,s;let a=e.toLocaleLowerCase(),{close:o,error:l,leave:c,join:u}=ys;if(n&&[o,l,c,u].indexOf(a)>=0&&n!==this._joinRef())return;let f=this._onMessage(a,r,n);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(p=>{var h,m,v;return((h=p.filter)===null||h===void 0?void 0:h.event)==="*"||((v=(m=p.filter)===null||m===void 0?void 0:m.event)===null||v===void 0?void 0:v.toLocaleLowerCase())===a}).map(p=>p.callback(f,n)):(s=this.bindings[a])===null||s===void 0||s.filter(p=>{var h,m,v,b,y,x;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in p){let w=p.id,C=(h=p.filter)===null||h===void 0?void 0:h.event;return w&&((m=r.ids)===null||m===void 0?void 0:m.includes(w))&&(C==="*"||C?.toLocaleLowerCase()===((v=r.data)===null||v===void 0?void 0:v.type.toLocaleLowerCase()))}else{let w=(y=(b=p?.filter)===null||b===void 0?void 0:b.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return w==="*"||w===((x=r?.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===a}).map(p=>{if(typeof f=="object"&&"ids"in f){let h=f.data,{schema:m,table:v,commit_timestamp:b,type:y,errors:x}=h;f=Object.assign(Object.assign({},{schema:m,table:v,commit_timestamp:b,eventType:y,new:{},old:{},errors:x}),this._getPayloadRecords(h))}p.callback(f,n)})}_isClosed(){return this.state===Fi.closed}_isJoined(){return this.state===Fi.joined}_isJoining(){return this.state===Fi.joining}_isLeaving(){return this.state===Fi.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,r,n){let i=e.toLocaleLowerCase(),s={type:i,filter:r,callback:n};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(e,r){let n=e.toLocaleLowerCase();return this.bindings[n]=this.bindings[n].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===n&&t.isEqual(i.filter,r))}),this}static isEqual(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(let n in e)if(e[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(ys.close,{},e)}_onError(e){this._on(ys.error,{},r=>e(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Fi.joining,this.joinPush.resend(e))}_getPayloadRecords(e){let r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=$6(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=$6(e.columns,e.old_record)),r}};var HLe=()=>{},GLe=typeof WebSocket<"u",WLe=`
addEventListener("message", (e) => {
if (e.data.event === "start") {
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
}
});`,gm=class{constructor(e,r){var n;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=gX,this.params={},this.timeout=AT,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=HLe,this.conn=null,this.sendBuffer=[],this.serializer=new $b,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=s=>{let a;return s?a=s:typeof fetch>"u"?a=(...o)=>Promise.resolve().then(()=>(mu(),Lf)).then(({default:l})=>l(...o)):a=fetch,(...o)=>a(...o)},this.endPoint=`${e}/${IT.websocket}`,this.httpEndpoint=PT(e),r?.transport?this.transport=r.transport:this.transport=null,r?.params&&(this.params=r.params),r?.headers&&(this.headers=Object.assign(Object.assign({},this.headers),r.headers)),r?.timeout&&(this.timeout=r.timeout),r?.logger&&(this.logger=r.logger),r?.heartbeatIntervalMs&&(this.heartbeatIntervalMs=r.heartbeatIntervalMs);let i=(n=r?.params)===null||n===void 0?void 0:n.apikey;if(i&&(this.accessTokenValue=i,this.apiKey=i),this.reconnectAfterMs=r?.reconnectAfterMs?r.reconnectAfterMs:s=>[1e3,2e3,5e3,1e4][s-1]||1e4,this.encode=r?.encode?r.encode:(s,a)=>a(JSON.stringify(s)),this.decode=r?.decode?r.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new _f(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(r?.fetch),r?.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=r?.worker||!1,this.workerUrl=r?.workerUrl}this.accessToken=r?.accessToken||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(GLe){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new H6(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),Promise.resolve().then(()=>Z(wX())).then(({default:e})=>{this.conn=new e(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:yX}))}disconnect(e,r){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,r??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){let r=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){let e=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.disconnect(),e}log(e,r,n){this.logger(e,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Mf.connecting:return gu.Connecting;case Mf.open:return gu.Open;case Mf.closing:return gu.Closing;default:return gu.Closed}}isConnected(){return this.connectionState()===gu.Open}channel(e,r={config:{}}){let n=new mm(`realtime:${e}`,r,this);return this.channels.push(n),n}push(e){let{topic:r,event:n,payload:i,ref:s}=e,a=()=>{this.encode(e,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${r} ${n} (${s})`,i),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(e=null){let r=e||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(r){let n=null;try{n=JSON.parse(atob(r.split(".")[1]))}catch{}if(n&&n.exp&&!(Math.floor(Date.now()/1e3)-n.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${n.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${n.exp}`);this.accessTokenValue=r,this.channels.forEach(i=>{r&&i.updateJoinPayload({access_token:r}),i.joinedOnce&&i._isJoined()&&i._push(ys.access_token,{access_token:r})})}}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(vX,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let r=this.channels.find(n=>n.topic===e&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${e}"`),r.unsubscribe())}_remove(e){this.channels=this.channels.filter(r=>r._joinRef()!==e._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_onConnMessage(e){this.decode(e.data,r=>{let{topic:n,event:i,payload:s,ref:a}=r;a&&a===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${s.status||""} ${n} ${i} ${a&&"("+a+")"||""}`,s),this.channels.filter(o=>o._isMember(n)).forEach(o=>o._trigger(i,s,a)),this.stateChangeCallbacks.message.forEach(o=>o(r))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(r=>r(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(r=>r(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(ys.error))}_appendParams(e,r){if(Object.keys(r).length===0)return e;let n=e.match(/\?/)?"&":"?",i=new URLSearchParams(r);return`${e}${n}${i}`}_workerObjectUrl(e){let r;if(e)r=e;else{let n=new Blob([WLe],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}},H6=class{constructor(e,r,n){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=Mf.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=n.close}};var ym=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function jr(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var RT=class extends ym{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}},Df=class extends ym{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};var KLe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})},MT=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>(mu(),Lf)).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},kX=()=>KLe(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(mu(),Lf))).Response:Response}),LT=t=>{if(Array.isArray(t))return t.map(r=>LT(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[i]=LT(n)}),e};var Nf=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})},G6=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),YLe=(t,e,r)=>Nf(void 0,void 0,void 0,function*(){let n=yield kX();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new RT(G6(i),t.status||500))}).catch(i=>{e(new Df(G6(i),i))}):e(new Df(G6(t),t))}),XLe=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},e?.headers),n&&(i.body=JSON.stringify(n)),Object.assign(Object.assign({},i),r))};function Ub(t,e,r,n,i,s){return Nf(this,void 0,void 0,function*(){return new Promise((a,o)=>{t(r,XLe(e,n,i,s)).then(l=>{if(!l.ok)throw l;return n?.noResolveJson?l:l.json()}).then(l=>a(l)).catch(l=>YLe(l,o,n))})})}function vm(t,e,r,n){return Nf(this,void 0,void 0,function*(){return Ub(t,"GET",e,r,n)})}function Ho(t,e,r,n,i){return Nf(this,void 0,void 0,function*(){return Ub(t,"POST",e,n,i,r)})}function SX(t,e,r,n,i){return Nf(this,void 0,void 0,function*(){return Ub(t,"PUT",e,n,i,r)})}function CX(t,e,r,n){return Nf(this,void 0,void 0,function*(){return Ub(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function _T(t,e,r,n,i){return Nf(this,void 0,void 0,function*(){return Ub(t,"DELETE",e,n,i,r)})}var Bi=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})},QLe={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},TX={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},zb=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=MT(i)}uploadOrUpdate(e,r,n,i){return Bi(this,void 0,void 0,function*(){try{let s,a=Object.assign(Object.assign({},TX),i),o=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(a.upsert)}),l=a.metadata;typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),l&&s.append("metadata",this.encodeMetadata(l)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.append("cacheControl",a.cacheControl),l&&s.append("metadata",this.encodeMetadata(l))):(s=n,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),i?.headers&&(o=Object.assign(Object.assign({},o),i.headers));let c=this._removeEmptyFolders(r),u=this._getFinalPath(c),d=yield this.fetch(`${this.url}/object/${u}`,Object.assign({method:e,body:s,headers:o},a?.duplex?{duplex:a.duplex}:{})),f=yield d.json();return d.ok?{data:{path:c,id:f.Id,fullPath:f.Key},error:null}:{data:null,error:f}}catch(s){if(jr(s))return{data:null,error:s};throw s}})}upload(e,r,n){return Bi(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Bi(this,void 0,void 0,function*(){let s=this._removeEmptyFolders(e),a=this._getFinalPath(s),o=new URL(this.url+`/object/upload/sign/${a}`);o.searchParams.set("token",r);try{let l,c=Object.assign({upsert:TX.upsert},i),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",c.cacheControl)):(l=n,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType);let d=yield this.fetch(o.toString(),{method:"PUT",body:l,headers:u}),f=yield d.json();return d.ok?{data:{path:s,fullPath:f.Key},error:null}:{data:null,error:f}}catch(l){if(jr(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e,r){return Bi(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let s=yield Ho(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),a=new URL(this.url+s.url),o=a.searchParams.get("token");if(!o)throw new ym("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:o},error:null}}catch(n){if(jr(n))return{data:null,error:n};throw n}})}update(e,r,n){return Bi(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Bi(this,void 0,void 0,function*(){try{return{data:yield Ho(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(jr(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Bi(this,void 0,void 0,function*(){try{return{data:{path:(yield Ho(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(jr(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Bi(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),s=yield Ho(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),a=n?.download?`&download=${n.download===!0?"":n.download}`:"";return s={signedUrl:encodeURI(`${this.url}${s.signedURL}${a}`)},{data:s,error:null}}catch(i){if(jr(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Bi(this,void 0,void 0,function*(){try{let i=yield Ho(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(a=>Object.assign(Object.assign({},a),{signedUrl:a.signedURL?encodeURI(`${this.url}${a.signedURL}${s}`):null})),error:null}}catch(i){if(jr(i))return{data:null,error:i};throw i}})}download(e,r){return Bi(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString(r?.transform||{}),a=s?`?${s}`:"";try{let o=this._getFinalPath(e);return{data:yield(yield vm(this.fetch,`${this.url}/${i}/${o}${a}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(o){if(jr(o))return{data:null,error:o};throw o}})}info(e){return Bi(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield vm(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:LT(n),error:null}}catch(n){if(jr(n))return{data:null,error:n};throw n}})}exists(e){return Bi(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield CX(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(jr(n)&&n instanceof Df){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],s=r?.download?`download=${r.download===!0?"":r.download}`:"";s!==""&&i.push(s);let o=typeof r?.transform<"u"?"render/image":"object",l=this.transformOptsToQueryString(r?.transform||{});l!==""&&i.push(l);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${n}${c}`)}}}remove(e){return Bi(this,void 0,void 0,function*(){try{return{data:yield _T(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(jr(r))return{data:null,error:r};throw r}})}list(e,r,n){return Bi(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},QLe),r),{prefix:e||""});return{data:yield Ho(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if(jr(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};var EX="2.7.1";var IX={"X-Client-Info":`storage-js/${EX}`};var bm=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})},qb=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},IX),r),this.fetch=MT(n)}listBuckets(){return bm(this,void 0,void 0,function*(){try{return{data:yield vm(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(jr(e))return{data:null,error:e};throw e}})}getBucket(e){return bm(this,void 0,void 0,function*(){try{return{data:yield vm(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(jr(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return bm(this,void 0,void 0,function*(){try{return{data:yield Ho(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(jr(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return bm(this,void 0,void 0,function*(){try{return{data:yield SX(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(jr(n))return{data:null,error:n};throw n}})}emptyBucket(e){return bm(this,void 0,void 0,function*(){try{return{data:yield Ho(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(jr(r))return{data:null,error:r};throw r}})}deleteBucket(e){return bm(this,void 0,void 0,function*(){try{return{data:yield _T(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(jr(r))return{data:null,error:r};throw r}})}};var Hb=class extends qb{constructor(e,r={},n){super(e,r,n)}from(e){return new zb(this.url,this.headers,e,this.fetch)}};var AX="2.49.1";var Gb="";typeof Deno<"u"?Gb="deno":typeof document<"u"?Gb="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Gb="react-native":Gb="node";var ZLe={"X-Client-Info":`supabase-js-${Gb}/${AX}`},PX={headers:ZLe},RX={schema:"public"},LX={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},MX={};mu();var JLe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})},e3e=t=>{let e;return t?e=t:typeof fetch>"u"?e=I6:e=fetch,(...r)=>e(...r)},t3e=()=>typeof Headers>"u"?A6:Headers,_X=(t,e,r)=>{let n=e3e(r),i=t3e();return(s,a)=>JLe(void 0,void 0,void 0,function*(){var o;let l=(o=yield e())!==null&&o!==void 0?o:t,c=new i(a?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),n(s,Object.assign(Object.assign({},a),{headers:c}))})};var r3e=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};function OX(t){return t.replace(/\/$/,"")}function DX(t,e){let{db:r,auth:n,realtime:i,global:s}=t,{db:a,auth:o,realtime:l,global:c}=e,u={db:Object.assign(Object.assign({},a),r),auth:Object.assign(Object.assign({},o),n),realtime:Object.assign(Object.assign({},l),i),global:Object.assign(Object.assign({},c),s),accessToken:()=>r3e(this,void 0,void 0,function*(){return""})};return t.accessToken?u.accessToken=t.accessToken:delete u.accessToken,u}var OT="2.68.0";var Ff=30*1e3,DT=3,NT=DT*Ff,NX="http://localhost:9999",FX="supabase.auth.token";var BX={"X-Client-Info":`gotrue-js/${OT}`};var Wb="X-Supabase-Api-Version",W6={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function VX(t){return Math.round(Date.now()/1e3)+t}function jX(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}var Ya=()=>typeof window<"u"&&typeof document<"u",Bf={tested:!1,writable:!1},yu=()=>{if(!Ya())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Bf.tested)return Bf.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Bf.tested=!0,Bf.writable=!0}catch{Bf.tested=!0,Bf.writable=!1}return Bf.writable};function $X(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,s)=>{e[s]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}var FT=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>(mu(),Lf)).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},UX=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",K6=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},Yb=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Xb=async(t,e)=>{await t.removeItem(e)};function n3e(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,s,a,o,l,c,u=0;for(t=t.replace("-","+").replace("_","/");u<t.length;)a=e.indexOf(t.charAt(u++)),o=e.indexOf(t.charAt(u++)),l=e.indexOf(t.charAt(u++)),c=e.indexOf(t.charAt(u++)),n=a<<2|o>>4,i=(o&15)<<4|l>>2,s=(l&3)<<6|c,r=r+String.fromCharCode(n),l!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&s!=0&&(r=r+String.fromCharCode(s));return r}var Kb=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};Kb.promiseConstructor=Promise;function Y6(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(n3e(n))}async function zX(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function qX(t,e){return new Promise((n,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{let a=await t(s);if(!e(s,null,a)){n(a);return}}catch(a){if(!e(s,a)){i(a);return}}})()})}function i3e(t){return("0"+t.toString(16)).substr(-2)}function s3e(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let s=0;s<56;s++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,i3e).join("")}async function a3e(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}function o3e(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function l3e(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await a3e(t);return o3e(r)}async function Vf(t,e,r=!1){let n=s3e(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await K6(t,`${e}-code-verifier`,i);let s=await l3e(n);return[s,n===s?"plain":"s256"]}var c3e=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function HX(t){let e=t.headers.get(Wb);if(!e||!e.match(c3e))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}var Qb=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};function He(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}var BT=class extends Qb{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};function GX(t){return He(t)&&t.name==="AuthApiError"}var xm=class extends Qb{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}},$l=class extends Qb{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}},na=class extends $l{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function WX(t){return He(t)&&t.name==="AuthSessionMissingError"}var wm=class extends $l{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},jf=class extends $l{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}},$f=class extends $l{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function KX(t){return He(t)&&t.name==="AuthImplicitGrantRedirectError"}var Zb=class extends $l{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},km=class extends $l{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};function VT(t){return He(t)&&t.name==="AuthRetryableFetchError"}var Jb=class extends $l{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};var u3e=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r},Uf=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),d3e=[502,503,504];async function YX(t){var e;if(!UX(t))throw new km(Uf(t),0);if(d3e.includes(t.status))throw new km(Uf(t),t.status);let r;try{r=await t.json()}catch(s){throw new xm(Uf(s),s)}let n,i=HX(t);if(i&&i.getTime()>=W6["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Jb(Uf(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new na}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0))throw new Jb(Uf(r),t.status,r.weak_password.reasons);throw new BT(Uf(r),t.status||500,n)}var f3e=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function tt(t,e,r,n){var i;let s=Object.assign({},n?.headers);s[Wb]||(s[Wb]=W6["2024-01-01"].name),n?.jwt&&(s.Authorization=`Bearer ${n.jwt}`);let a=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(a.redirect_to=n.redirectTo);let o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await p3e(t,e,r+o,{headers:s,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(l):{data:Object.assign({},l),error:null}}async function p3e(t,e,r,n,i,s){let a=f3e(e,n,i,s),o;try{o=await t(r,Object.assign({},a))}catch(l){throw console.error(l),new km(Uf(l),0)}if(o.ok||await YX(o),n?.noResolveJson)return o;try{return await o.json()}catch(l){await YX(l)}}function Ul(t){var e;let r=null;h3e(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=VX(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function X6(t){let e=Ul(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Go(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function XX(t){return{data:t,error:null}}function QX(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s}=t,a=u3e(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function ZX(t){return t}function h3e(t){return t.access_token&&t.refresh_token&&t.expires_in}var m3e=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r},zf=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=FT(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await tt(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(He(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await tt(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Go})}catch(n){if(He(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=m3e(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await tt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:QX,redirectTo:r?.redirectTo})}catch(r){if(He(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await tt(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Go})}catch(r){if(He(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,s,a,o,l;try{let c={nextPage:null,lastPage:0,total:0},u=await tt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(s=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:ZX});if(u.error)throw u.error;let d=await u.json(),f=(a=u.headers.get("x-total-count"))!==null&&a!==void 0?a:0,p=(l=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(h=>{let m=parseInt(h.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(h.split(";")[1].split("=")[1]);c[`${v}Page`]=m}),c.total=parseInt(f)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(He(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await tt(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Go})}catch(r){if(He(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await tt(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Go})}catch(n){if(He(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await tt(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Go})}catch(n){if(He(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await tt(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(He(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await tt(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(He(r))return{data:null,error:r};throw r}}};var JX={getItem:t=>yu()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{yu()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{yu()&&globalThis.localStorage.removeItem(t)}};function Q6(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}function eQ(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}var qf={debug:!!(globalThis&&yu()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},e0=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}},jT=class extends e0{};async function Z6(t,e,r){qf.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),qf.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){qf.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{qf.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw qf.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new jT(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(qf.debug)try{let s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}eQ();var g3e={url:NX,storageKey:FX,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:BX,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function tQ(t,e,r){return await r()}var Hf=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&Ya()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},g3e),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new zf({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=FT(i.fetch),this.lock=i.lock||tQ,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:Ya()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=Z6:this.lock=tQ,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:yu()?this.storage=JX:(this.memoryStorage={},this.storage=Q6(this.memoryStorage)):(this.memoryStorage={},this.storage=Q6(this.memoryStorage)),Ya()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${OT}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r=$X(window.location.href),n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),Ya()&&this.detectSessionInUrl&&n!=="none"){let{data:i,error:s}=await this._getSessionFromURL(r,n);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),KX(s)){let l=(e=s.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:s}}return await this._removeSession(),{error:s}}let{session:a,redirectType:o}=i;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return He(r)?{error:r}:{error:new xm("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let s=await tt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:Ul}),{data:a,error:o}=s;if(o||!a)return{data:{user:null,session:null},error:o};let l=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(s){if(He(s))return{data:{user:null,session:null},error:s};throw s}}async signUp(e){var r,n,i;try{let s;if("email"in e){let{email:u,password:d,options:f}=e,p=null,h=null;this.flowType==="pkce"&&([p,h]=await Vf(this.storage,this.storageKey)),s=await tt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f?.emailRedirectTo,body:{email:u,password:d,data:(r=f?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:p,code_challenge_method:h},xform:Ul})}else if("phone"in e){let{phone:u,password:d,options:f}=e;s=await tt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(n=f?.data)!==null&&n!==void 0?n:{},channel:(i=f?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:Ul})}else throw new jf("You must provide either an email or phone number and a password");let{data:a,error:o}=s;if(o||!a)return{data:{user:null,session:null},error:o};let l=a.session,c=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(s){if(He(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithPassword(e){try{let r;if("email"in e){let{email:s,password:a,options:o}=e;r=await tt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:o?.captchaToken}},xform:X6})}else if("phone"in e){let{phone:s,password:a,options:o}=e;r=await tt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:o?.captchaToken}},xform:X6})}else throw new jf("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new wm}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(He(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await Yb(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:s,error:a}=await tt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Ul});if(await Xb(this.storage,`${this.storageKey}-code-verifier`),a)throw a;return!s||!s.session||!s.user?{data:{user:null,session:null,redirectType:null},error:new wm}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:a})}catch(s){if(He(s))return{data:{user:null,session:null,redirectType:null},error:s};throw s}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:s,nonce:a}=e,o=await tt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:Ul}),{data:l,error:c}=o;return c?{data:{user:null,session:null},error:c}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new wm}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:c})}catch(r){if(He(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,s,a;try{if("email"in e){let{email:o,options:l}=e,c=null,u=null;this.flowType==="pkce"&&([c,u]=await Vf(this.storage,this.storageKey));let{error:d}=await tt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(r=l?.data)!==null&&r!==void 0?r:{},create_user:(n=l?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:l?.emailRedirectTo});return{data:{user:null,session:null},error:d}}if("phone"in e){let{phone:o,options:l}=e,{data:c,error:u}=await tt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=l?.data)!==null&&i!==void 0?i:{},create_user:(s=l?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(a=l?.channel)!==null&&a!==void 0?a:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:u}}throw new jf("You must provide either an email or phone number.")}catch(o){if(He(o))return{data:{user:null,session:null},error:o};throw o}}async verifyOtp(e){var r,n;try{let i,s;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,s=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:a,error:o}=await tt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Ul});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");let l=a.session,c=a.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(i){if(He(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let s=null,a=null;return this.flowType==="pkce"&&([s,a]=await Vf(this.storage,this.storageKey)),await tt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:a}),headers:this.headers,xform:XX})}catch(s){if(He(s))return{data:null,error:s};throw s}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new na;let{error:i}=await tt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if(He(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:s}=e,{error:a}=await tt(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:s?.captchaToken}},redirectTo:s?.emailRedirectTo});return{data:{user:null,session:null},error:a}}else if("phone"in e){let{phone:n,type:i,options:s}=e,{data:a,error:o}=await tt(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:s?.captchaToken}}});return{data:{user:null,session:null,messageId:a?.message_id},error:o}}throw new jf("You must provide either an email or phone number and a type")}catch(r){if(He(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await Yb(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()<NT:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let a=this.suppressGetSessionWarning;e=new Proxy(e,{get:(l,c,u)=>(!a&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),a=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,c,u))})}return{data:{session:e},error:null}}let{session:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?{data:{session:null},error:s}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await tt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Go}):await this._useSession(async r=>{var n,i,s;let{data:a,error:o}=r;if(o)throw o;return!(!((n=a.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new na}:await tt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:Go})})}catch(r){if(He(r))return WX(r)&&(await this._removeSession(),await Xb(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:s}=n;if(s)throw s;if(!i.session)throw new na;let a=i.session,o=null,l=null;this.flowType==="pkce"&&e.email!=null&&([o,l]=await Vf(this.storage,this.storageKey));let{data:c,error:u}=await tt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:l}),jwt:a.access_token,xform:Go});if(u)throw u;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),{data:{user:a.user},error:null}})}catch(n){if(He(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return Y6(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new na;let r=Date.now()/1e3,n=r,i=!0,s=null,a=Y6(e.access_token);if(a.exp&&(n=a.exp,i=n<=r),i){let{session:o,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!o)return{data:{user:null,session:null},error:null};s=o}else{let{data:o,error:l}=await this._getUser(e.access_token);if(l)throw l;s={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return{data:{user:s.user,session:s},error:null}}catch(r){if(He(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:a,error:o}=r;if(o)throw o;e=(n=a.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new na;let{session:i,error:s}=await this._callRefreshToken(e.refresh_token);return s?{data:{user:null,session:null},error:s}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(He(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e,r){try{if(!Ya())throw new $f("No browser detected.");if(e.error||e.error_description||e.error_code)throw new $f(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Zb("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new $f("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Zb("No code detected.");let{data:y,error:x}=await this._exchangeCodeForSession(e.code);if(x)throw x;let w=new URL(window.location.href);return w.searchParams.delete("code"),window.history.replaceState(window.history.state,"",w.toString()),{data:{session:y.session,redirectType:null},error:null}}let{provider_token:n,provider_refresh_token:i,access_token:s,refresh_token:a,expires_in:o,expires_at:l,token_type:c}=e;if(!s||!o||!a||!c)throw new $f("No session defined in URL");let u=Math.round(Date.now()/1e3),d=parseInt(o),f=u+d;l&&(f=parseInt(l));let p=f-u;p*1e3<=Ff&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);let h=f-d;u-h>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",h,f,u):u-h<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",h,f,u);let{data:m,error:v}=await this._getUser(s);if(v)throw v;let b={provider_token:n,provider_refresh_token:i,access_token:s,expires_in:d,expires_at:f,refresh_token:a,token_type:c,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:b,redirectType:e.type},error:null}}catch(n){if(He(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){let r=await Yb(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:s}=r;if(s)return{error:s};let a=(n=i.session)===null||n===void 0?void 0:n.access_token;if(a){let{error:o}=await this.admin.signOut(a,e);if(o&&!(GX(o)&&(o.status===404||o.status===401||o.status===403)))return{error:o}}return e!=="others"&&(await this._removeSession(),await Xb(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=jX(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:s},error:a}=r;if(a)throw a;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await Vf(this.storage,this.storageKey,!0));try{return await tt(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(s){if(He(s))return{data:null,error:s};throw s}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if(He(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async s=>{var a,o,l,c,u;let{data:d,error:f}=s;if(f)throw f;let p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await tt(this.fetch,"GET",p,{headers:this.headers,jwt:(u=(c=d.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(i)throw i;return Ya()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if(He(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:s,error:a}=r;if(a)throw a;return await tt(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=s.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(He(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await qX(async i=>(i>0&&await zX(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await tt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Ul})),(i,s)=>{let a=200*Math.pow(2,i);return s&&VT(s)&&Date.now()+a-n<Ff})}catch(n){if(this._debug(r,"error",n),He(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),Ya()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await Yb(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=((e=n.expires_at)!==null&&e!==void 0?e:1/0)*1e3-Date.now()<NT;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${NT}s`),i){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),VT(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new na;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new Kb;let{data:s,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!s.session)throw new na;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);let o={session:s.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(s){if(this._debug(i,"error",s),He(s)){let a={session:null,error:s};return VT(s)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(a),a}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let s=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,r)}catch(l){s.push(l)}});if(await Promise.all(a),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await K6(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await Xb(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Ya()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),Ff);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/Ff);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ff}ms, refresh threshold is ${DT} ticks`),i<=DT&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof e0)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ya()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[s,a]=await Vf(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(o.toString())}if(n?.queryParams){let s=new URLSearchParams(n.queryParams);i.push(s.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;return s?{data:null,error:s}:await tt(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(He(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:s,error:a}=r;if(a)return{data:null,error:a};let o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:l,error:c}=await tt(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=s?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=l?.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(r){if(He(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;if(s)return{data:null,error:s};let{data:a,error:o}=await tt(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return o?{data:null,error:o}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),{data:a,error:o})})}catch(r){if(He(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:s}=r;return s?{data:null,error:s}:await tt(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(He(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(a=>a.factor_type==="totp"&&a.status==="verified"),s=n.filter(a=>a.factor_type==="phone"&&a.status==="verified");return{data:{all:n,totp:i,phone:s},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:s}=e;if(s)return{data:null,error:s};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let a=this._decodeJWT(i.access_token),o=null;a.aal&&(o=a.aal);let l=o;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(d=>d.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(l="aal2");let u=a.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:u},error:null}}))}};Hf.nextInstanceID=0;var y3e=Hf,J6=y3e;var $T=class extends J6{constructor(e){super(e)}};var v3e=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})},t0=class{constructor(e,r,n){var i,s,a;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let o=OX(e);this.realtimeUrl=`${o}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${o}/auth/v1`,this.storageUrl=`${o}/storage/v1`,this.functionsUrl=`${o}/functions/v1`;let l=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:RX,realtime:MX,auth:Object.assign(Object.assign({},LX),{storageKey:l}),global:PX},u=DX(n??{},c);this.storageKey=(i=u.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(s=u.global.headers)!==null&&s!==void 0?s:{},u.accessToken?(this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((a=u.auth)!==null&&a!==void 0?a:{},this.headers,u.global.fetch),this.fetch=_X(r,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.rest=new hX(`${o}/rest/v1`,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),u.accessToken||this._listenForAuthEvents()}get functions(){return new Ob(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new Hb(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,r;return v3e(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:s,flowType:a,lock:o,debug:l},c,u){let d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new $T({url:this.authUrl,headers:Object.assign(Object.assign({},d),c),storageKey:s,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:a,lock:o,debug:l,fetch:u,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new gm(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?this.changedAccessToken=n:e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};var rQ=(t,e,r)=>new t0(t,e,r);var aQ=require("obsidian");function ia(){return require("node:fs/promises")}function vs(){return require("node:path")}function Vi(){return require("node:url")}function Wo(){return require("@electron/remote")}function nQ(){return Wo().safeStorage}function iQ(){return Wo().dialog}function UT(){return require("node:crypto")}function sQ(){return require("electron")}function Sm(t){let{pathToFileURL:e}=Vi();try{return e(t)}catch(r){return console.error(`Failed to convert path ${t} to URL: `,r),null}}var un=rQ("https://oulmgjettaoutfvywylg.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im91bG1namV0dGFvdXRmdnl3eWxnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTA1ODM1ODQsImV4cCI6MjA2NjE1OTU4NH0.fl3J1ykWiYw0dxWMRfEf-MuQJzXYOk4Tc3xs7y_rjDQ",{auth:{detectSessionInUrl:!1,flowType:"pkce",persistSession:!0,autoRefreshToken:!1,storageKey:"mx-auth-session",storage:(()=>{if(!aQ.Platform.isDesktopApp)return localStorage;let t=nQ();return{isServer:!1,getItem:e=>{let r=localStorage.getItem(e);if(!r)return null;let n=Buffer.from(r,"base64");return t.decryptString(n)},setItem:(e,r)=>{let n=t.encryptString(r);localStorage.setItem(e,n.toString("base64"))},removeItem:e=>{localStorage.removeItem(e)}}})()}});var oQ=`
`,eD=class extends Error{constructor(e){super(e),Object.defineProperty(this,"message",{enumerable:!1,value:e}),Object.defineProperty(this,"name",{enumerable:!1,value:this.constructor.name}),"captureStackTrace"in Error?Error.captureStackTrace(this,this.constructor):Object.defineProperty(this,"stack",{enumerable:!1,value:Error(e).stack,writable:!0,configurable:!0})}},i0=class extends eD{},Tm=class t extends i0{constructor(e,r,n,i){super(`${e}: expected ${r} to be ${n}, but got ${i}.`)}static assert(e,r,n,i,s){if(!e)throw new t(r,n,i,s);return e}},Cm=class extends i0{constructor(e,r,n){let i=e.toString(),s=r.map(({name:l})=>l.toString());s.push(i);let a=s.join(" -> "),o=`Could not resolve '${i}'.`;n&&(o+=` ${n}`),o+=oQ+oQ,o+=`Resolution path: ${a}`,super(o)}},tD=class extends i0{constructor(e,r){let i=`Could not register '${e.toString()}'.`;r&&(i+=` ${r}`),super(i)}},Gf={PROXY:"PROXY",CLASSIC:"CLASSIC"},qn={SINGLETON:"SINGLETON",TRANSIENT:"TRANSIENT",SCOPED:"SCOPED"};function b3e(t,e){return t===qn.SINGLETON&&e!==qn.SINGLETON||t===qn.SCOPED&&e===qn.TRANSIENT}function dQ(t){let e=t.length,r=0,n="EOF",i="",s=0,a=0,o=0;return{next:l,done:m};function l(v=0){return s=v,c(),h()}function c(){for(i="",n="EOF";;){if(r>=e)return n="EOF";let v=t.charAt(r);if(lQ(v)){r++;continue}switch(v){case"(":return r++,a++,n=v;case")":return r++,o++,n=v;case"*":return r++,n=v;case",":return r++,n=v;case"=":return r++,(s&1)===0&&d(),n=v;case"/":{r++;let b=t.charAt(r);b==="/"&&(f(y=>y===`
`,!0),r++),b==="*"&&(f(y=>{let x=t.charAt(r+1);return y==="*"&&x==="/"},!0),r++);break}default:if(S3e(v))return u(),n;r++}}}function u(){let v=t.charAt(r),b=++r;for(;C3e(t.charAt(r));)r++;return i=""+v+t.substring(b,r),n=i==="function"||i==="class"?i:"ident",n!=="ident"&&(i=""),i}function d(){f(v=>{let b=a===o+1;return v===","&&b?!0:v==="("?(a++,!1):!!(v===")"&&(o++,b))})}function f(v,b=!1){for(;r<t.length;){let y=t.charAt(r);if(v(y))return;if(!b){if(lQ(y)){r++;continue}if(x3e(y)){p();continue}}r++}}function p(){let v=t.charAt(r);for(r++;r<t.length;){let b=t.charAt(r),y=t.charAt(r-1);if(b===v&&y!=="\\"){r++;return}v==="`"&&t.charAt(r+1)==="$"&&t.charAt(r+2)==="{"&&(r=r+2,f(C=>C==="}")),r++}}function h(){return i?{value:i,type:n}:{type:n}}function m(){return n==="EOF"}}function lQ(t){switch(t){case"\r":case`
`:case" ":return!0}return!1}function x3e(t){switch(t){case"'":case'"':case"`":return!0}return!1}var w3e=/^[_$a-zA-Z\xA0-\uFFFF]$/,k3e=/^[?._$a-zA-Z0-9\xA0-\uFFFF]$/;function S3e(t){return w3e.test(t)}function C3e(t){return k3e.test(t)}function T3e(t,e){let r=t;return typeof r=="string"||typeof r=="symbol"?{[t]:e}:r}function E3e(t){return t[t.length-1]}function I3e(t){if(typeof t!="function")return!1;let e=dQ(t.toString()),r=e.next();if(r.type==="class")return!0;let n=e.next();return!!(r.type==="function"&&n.value&&n.value[0]===n.value[0].toUpperCase())}function fQ(t){return typeof t=="function"}function A3e(t){return Array.from(new Set(t))}function P3e(t){let{next:e,done:r}=dQ(t),n=[],i=null;for(l();!r();)switch(i.type){case"class":{if(!a())return null;break}case"function":{let u=l();(u.type==="ident"||u.type==="*")&&l();break}case"(":s();break;case")":return n;case"ident":{let u={name:i.value,optional:!1};if(i.value==="async"){let d=l();if(d&&d.type!=="=")break}return n.push(u),n}default:throw c()}return n;function s(){let u={name:"",optional:!1};for(;!r();)switch(l(),i.type){case"ident":u.name=i.value;break;case"=":u.optional=!0;break;case",":n.push(u),u={name:"",optional:!1};break;case")":u.name&&n.push(u);return;default:throw c()}}function a(){for(;!r();){if(o()){if(l(1),i.type!=="(")continue;return!0}l(1)}return!1}function o(){return i.type==="ident"&&i.value==="constructor"}function l(u=0){return i=e(u),i}function c(){return new SyntaxError(`Parsing parameter list, did not expect ${i.type} token${i.value?` (${i.value})`:""}`)}}var pQ=Symbol("Awilix Resolver Config");function Wf(t){return{resolve:()=>t,isLeakSafe:!0}}function zT(t,e){if(!fQ(t))throw new Tm("asFunction","fn","function",t);let r={lifetime:qn.TRANSIENT};e=hQ(r,e,t[pQ]);let i={resolve:gQ(t),...e};return rD(n0(i))}function ji(t,e){if(!fQ(t))throw new Tm("asClass","Type","class",t);let r={lifetime:qn.TRANSIENT};e=hQ(r,e,t[pQ]);let i=gQ(function(...a){return Reflect.construct(t,a)},t);return rD(n0({...e,resolve:i}))}function n0(t){function e(i){return n0({...this,lifetime:i})}function r(i){return n0({...this,injectionMode:i})}function n(i){return n0({...this,injector:i})}return mQ(t,{setLifetime:e,inject:n,transient:r0(e,qn.TRANSIENT),scoped:r0(e,qn.SCOPED),singleton:r0(e,qn.SINGLETON),setInjectionMode:r,proxy:r0(r,Gf.PROXY),classic:r0(r,Gf.CLASSIC)})}function rD(t){function e(r){return rD({...this,dispose:r})}return mQ(t,{disposer:e})}function r0(t,e){return function(){return t.call(this,e)}}function hQ(t,...e){return Object.assign({},t,...e)}function mQ(t,e){return{...t,...e}}function R3e(t,e){return function(n,i){return n in e?e[n]:t.resolve(n,i)}}function L3e(t,e){let r=e(t),n=A3e([...Reflect.ownKeys(t.cradle),...Reflect.ownKeys(r)]);return new Proxy({},{get(s,a){return a===Symbol.iterator?function*(){for(let l in t.cradle)yield l;for(let l in r)yield l}:a in r?r[a]:t.resolve(a)},ownKeys(){return n},getOwnPropertyDescriptor(s,a){if(n.indexOf(a)>-1)return{enumerable:!0,configurable:!0}}})}function gQ(t,e){e||(e=t);let r=yQ(e);return function(i){if((this.injectionMode||i.options.injectionMode||Gf.PROXY)!==Gf.CLASSIC){let a=this.injector?L3e(i,this.injector):i.cradle;return t(a)}if(r.length>0){let a=this.injector?R3e(i,this.injector(i)):i.resolve,o=r.map(l=>a(l.name,{allowUnregistered:l.optional}));return t(...o)}return t()}}function yQ(t){let e=P3e(t.toString());if(!e){let r=Object.getPrototypeOf(t);return typeof r=="function"&&r!==Function.prototype?yQ(r):[]}return e}var cQ=Symbol("familyTree"),uQ=Symbol("rollUpRegistrations"),M3e="AwilixContainerCradle";function nD(t={}){return vQ(t)}function vQ(t,e,r){t={injectionMode:Gf.PROXY,strict:!1,...t};let n=r??[],i={},s=new Proxy({},{get:(w,C)=>v(C),set:(w,C)=>{throw new Error(`Attempted setting property "${C}" on container cradle - this is not allowed.`)},ownKeys(){return Array.from(s)},getOwnPropertyDescriptor(w,C){let O=u();if(Object.getOwnPropertyDescriptor(O,C))return{enumerable:!0,configurable:!0}}}),a={options:t,cradle:s,inspect:c,cache:new Map,loadModules:()=>{throw new Error("loadModules is not supported in the browser.")},createScope:f,register:p,build:y,resolve:v,hasRegistration:b,dispose:x,getRegistration:m,[uQ]:u,get registrations(){return u()}},o=e?[a].concat(e[cQ]):[a];a[cQ]=o;let l=E3e(o);return a;function c(){return`[AwilixContainer (${e?"scoped, ":""}registrations: ${Object.keys(a.registrations).length})]`}function u(){return{...e&&e[uQ](),...i}}function*d(){let w=u();for(let C in w)yield C}function f(){return vQ(t,a,n)}function p(w,C){let O=T3e(w,C),S=[...Object.keys(O),...Object.getOwnPropertySymbols(O)];for(let T of S){let E=O[T];if(t.strict&&E.lifetime===qn.SINGLETON&&e)throw new tD(T,"Cannot register a singleton on a scoped container.");i[T]=E}return a}function h(){return Object.prototype.toString.call(s)}function m(w){let C=i[w];return C||(e?e.getRegistration(w):null)}function v(w,C){C=C||{};try{let O=m(w);if(n.some(({name:P})=>P===w))throw new Cm(w,n,"Cyclic dependencies detected.");if(w==="toJSON")return h;if(w==="constructor")return nD;if(!O){switch(w){case"inspect":case"toString":return h;case Symbol.toStringTag:return M3e;case"then":return;case Symbol.iterator:return d}if(C.allowUnregistered)return;throw new Cm(w,n)}let S=O.lifetime||qn.TRANSIENT;if(t.strict&&!O.isLeakSafe){let P=n.findIndex(({lifetime:R})=>b3e(R,S));if(P>-1)throw new Cm(w,n,`Dependency '${w.toString()}' has a shorter lifetime than its ancestor: '${n[P].name.toString()}'`)}n.push({name:w,lifetime:S});let T,E;switch(S){case qn.TRANSIENT:E=O.resolve(a);break;case qn.SINGLETON:T=l.cache.get(w),T?E=T.value:(E=O.resolve(t.strict?l:a),l.cache.set(w,{resolver:O,value:E}));break;case qn.SCOPED:if(T=a.cache.get(w),T!==void 0){E=T.value;break}E=O.resolve(a),a.cache.set(w,{resolver:O,value:E});break;default:throw new Cm(w,n,`Unknown lifetime "${O.lifetime}"`)}return n.pop(),E}catch(O){throw n.length=0,O}}function b(w){return!!m(w)}function y(w,C){if(w&&w.resolve)return w.resolve(a);let O="build",S="targetOrResolver";return Tm.assert(w,O,S,"a registration, function or class",w),Tm.assert(typeof w=="function",O,S,"a function or class",w),(I3e(w)?ji(w,C):zT(w,C)).resolve(a)}function x(){let w=Array.from(a.cache.entries());return a.cache.clear(),Promise.all(w.map(([,C])=>{let{resolver:O,value:S}=C,T=O;return T.dispose?Promise.resolve().then(()=>T.dispose(S)):Promise.resolve()})).then(()=>{})}}var Ko={},bQ=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,xQ=t=>"init"in t,iD=t=>!!t.write,wQ=t=>"v"in t||"e"in t,qT=t=>{if("e"in t)throw t.e;if((Ko.env?Ko.env.MODE:void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},HT=new WeakMap,kQ=t=>{var e;return GT(t)&&!!((e=HT.get(t))!=null&&e[0])},_3e=t=>{let e=HT.get(t);e?.[0]&&(e[0]=!1,e[1].forEach(r=>r()))},CQ=(t,e)=>{let r=HT.get(t);if(!r){r=[!0,new Set],HT.set(t,r);let n=()=>{r[0]=!1};t.then(n,n)}r[1].add(e)},GT=t=>typeof t?.then=="function",TQ=(t,e,r)=>{r.p.has(t)||(r.p.add(t),e.then(()=>{r.p.delete(t)},()=>{r.p.delete(t)}))},sD=(t,e,r)=>{let n=r(t),i="v"in n,s=n.v;if(GT(e))for(let a of n.d.keys())TQ(t,e,r(a));n.v=e,delete n.e,(!i||!Object.is(s,n.v))&&(++n.n,GT(s)&&_3e(s))},SQ=(t,e,r)=>{var n;let i=new Set;for(let s of((n=r.get(t))==null?void 0:n.t)||[])r.has(s)&&i.add(s);for(let s of e.p)i.add(s);return i},O3e=()=>{let t=new Set,e=()=>{t.forEach(r=>r())};return e.add=r=>(t.add(r),()=>{t.delete(r)}),e},aD=()=>{let t={},e=new WeakMap,r=n=>{var i,s;(i=e.get(t))==null||i.forEach(a=>a(n)),(s=e.get(n))==null||s.forEach(a=>a())};return r.add=(n,i)=>{let s=n||t,a=(e.has(s)?e:e.set(s,new Set)).get(s);return a.add(i),()=>{a?.delete(i),a.size||e.delete(s)}},r},D3e=t=>(t.c||(t.c=aD()),t.m||(t.m=aD()),t.u||(t.u=aD()),t.f||(t.f=O3e()),t),N3e=Symbol();var F3e=(t=new WeakMap,e=new WeakMap,r=new WeakMap,n=new Set,i=new Set,s=new Set,a={},o=(f,...p)=>f.read(...p),l=(f,...p)=>f.write(...p),c=(f,p)=>{var h;return(h=f.unstable_onInit)==null?void 0:h.call(f,p)},u=(f,p)=>{var h;return(h=f.onMount)==null?void 0:h.call(f,p)},...d)=>{let f=d[0]||(S=>{if((Ko.env?Ko.env.MODE:void 0)!=="production"&&!S)throw new Error("Atom is undefined or null");let T=t.get(S);return T||(T={d:new Map,p:new Set,n:0},t.set(S,T),c?.(S,O)),T}),p=d[1]||(()=>{let S=[],T=E=>{try{E()}catch(P){S.push(P)}};do{a.f&&T(a.f);let E=new Set,P=E.add.bind(E);n.forEach(R=>{var I;return(I=e.get(R))==null?void 0:I.l.forEach(P)}),n.clear(),s.forEach(P),s.clear(),i.forEach(P),i.clear(),E.forEach(T),n.size&&h()}while(n.size||s.size||i.size);if(S.length)throw new AggregateError(S)}),h=d[2]||(()=>{let S=[],T=new WeakSet,E=new WeakSet,P=Array.from(n);for(;P.length;){let R=P[P.length-1],I=f(R);if(E.has(R)){P.pop();continue}if(T.has(R)){if(r.get(R)===I.n)S.push([R,I]);else if((Ko.env?Ko.env.MODE:void 0)!=="production"&&r.has(R))throw new Error("[Bug] invalidated atom exists");E.add(R),P.pop();continue}T.add(R);for(let B of SQ(R,I,e))T.has(B)||P.push(B)}for(let R=S.length-1;R>=0;--R){let[I,B]=S[R],M=!1;for(let z of B.d.keys())if(z!==I&&n.has(z)){M=!0;break}M&&(m(I),y(I)),r.delete(I)}}),m=d[3]||(S=>{var T;let E=f(S);if(wQ(E)&&(e.has(S)&&r.get(S)!==E.n||Array.from(E.d).every(([V,K])=>m(V).n===K)))return E;E.d.clear();let P=!0,R=()=>{e.has(S)&&(y(S),h(),p())},I=V=>{var K;if(bQ(S,V)){let Me=f(V);if(!wQ(Me))if(xQ(V))sD(V,V.init,f);else throw new Error("no atom init");return qT(Me)}let de=m(V);try{return qT(de)}finally{E.d.set(V,de.n),kQ(E.v)&&TQ(S,E.v,de),(K=e.get(V))==null||K.t.add(S),P||R()}},B,M,z={get signal(){return B||(B=new AbortController),B.signal},get setSelf(){return(Ko.env?Ko.env.MODE:void 0)!=="production"&&!iD(S)&&console.warn("setSelf function cannot be used with read-only atom"),!M&&iD(S)&&(M=(...V)=>{if((Ko.env?Ko.env.MODE:void 0)!=="production"&&P&&console.warn("setSelf function cannot be called in sync"),!P)try{return b(S,...V)}finally{h(),p()}}),M}},G=E.n;try{let V=o(S,I,z);return sD(S,V,f),GT(V)&&(CQ(V,()=>B?.abort()),V.then(R,R)),E}catch(V){return delete E.v,E.e=V,++E.n,E}finally{P=!1,G!==E.n&&r.get(S)===G&&(r.set(S,E.n),n.add(S),(T=a.c)==null||T.call(a,S))}}),v=d[4]||(S=>{let T=[S];for(;T.length;){let E=T.pop(),P=f(E);for(let R of SQ(E,P,e)){let I=f(R);r.set(R,I.n),T.push(R)}}}),b=d[5]||((S,...T)=>{let E=!0,P=I=>qT(m(I)),R=(I,...B)=>{var M;let z=f(I);try{if(bQ(S,I)){if(!xQ(I))throw new Error("atom not writable");let G=z.n,V=B[0];sD(I,V,f),y(I),G!==z.n&&(n.add(I),(M=a.c)==null||M.call(a,I),v(I));return}else return b(I,...B)}finally{E||(h(),p())}};try{return l(S,P,R,...T)}finally{E=!1}}),y=d[6]||(S=>{var T;let E=f(S),P=e.get(S);if(P&&!kQ(E.v)){for(let[R,I]of E.d)if(!P.d.has(R)){let B=f(R);x(R).t.add(S),P.d.add(R),I!==B.n&&(n.add(R),(T=a.c)==null||T.call(a,R),v(R))}for(let R of P.d||[])if(!E.d.has(R)){P.d.delete(R);let I=w(R);I?.t.delete(S)}}}),x=d[7]||(S=>{var T;let E=f(S),P=e.get(S);if(!P){m(S);for(let R of E.d.keys())x(R).t.add(S);if(P={l:new Set,d:new Set(E.d.keys()),t:new Set},e.set(S,P),(T=a.m)==null||T.call(a,S),iD(S)){let R=()=>{let I=!0,B=(...M)=>{try{return b(S,...M)}finally{I||(h(),p())}};try{let M=u(S,B);M&&(P.u=()=>{I=!0;try{M()}finally{I=!1}})}finally{I=!1}};i.add(R)}}return P}),w=d[8]||(S=>{var T;let E=f(S),P=e.get(S);if(P&&!P.l.size&&!Array.from(P.t).some(R=>{var I;return(I=e.get(R))==null?void 0:I.d.has(S)})){P.u&&s.add(P.u),P=void 0,e.delete(S),(T=a.u)==null||T.call(a,S);for(let R of E.d.keys()){let I=w(R);I?.t.delete(S)}return}return P}),C=[t,e,r,n,i,s,a,o,l,c,u,f,p,h,m,v,b,y,x,w],O={get:S=>qT(m(S)),set:(S,...T)=>{try{return b(S,...T)}finally{h(),p()}},sub:(S,T)=>{let P=x(S).l;return P.add(T),p(),()=>{P.delete(T),w(S),p()}}};return Object.defineProperty(O,N3e,{value:C}),O},oD=F3e;var EQ=D3e;var lD=CQ;var Em={},B3e=0;function re(t,e){let r=`atom${++B3e}`,n={toString(){return(Em.env?Em.env.MODE:void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof t=="function"?n.read=t:(n.init=t,n.read=V3e,n.write=j3e),e&&(n.write=e),n}function V3e(t){return t(this)}function j3e(t,e,r){return e(this,typeof r=="function"?r(t(this)):r)}var $3e=()=>{let t=0,e=EQ({}),r=new WeakMap,n=new WeakMap,i=oD(r,n,void 0,void 0,void 0,void 0,e,void 0,(o,l,c,...u)=>t?c(o,...u):o.write(l,c,...u)),s=new Set;return e.m.add(void 0,o=>{s.add(o);let l=r.get(o);l.m=n.get(o)}),e.u.add(void 0,o=>{s.delete(o);let l=r.get(o);delete l.m}),Object.assign(i,{dev4_get_internal_weak_map:()=>r,dev4_get_mounted_atoms:()=>s,dev4_restore_atoms:o=>{let l={read:()=>null,write:(c,u)=>{++t;try{for(let[d,f]of o)"init"in d&&u(d,f)}finally{--t}}};i.set(l)}})};function Kf(){return(Em.env?Em.env.MODE:void 0)!=="production"?$3e():oD()}var s0;function WT(){return s0||(s0=Kf(),(Em.env?Em.env.MODE:void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=s0),globalThis.__JOTAI_DEFAULT_STORE__!==s0&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),s0}var dn=Z(Te(),1);var AQ={},PQ=(0,dn.createContext)(void 0);function vu(t){let e=(0,dn.useContext)(PQ);return t?.store||e||WT()}function RQ({children:t,store:e}){let r=(0,dn.useRef)(void 0);return!e&&!r.current&&(r.current=Kf()),(0,dn.createElement)(PQ.Provider,{value:e||r.current},t)}var uD=t=>typeof t?.then=="function",LQ=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},U3e=dn.default.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(LQ(t),t)}),cD=new WeakMap,IQ=(t,e)=>{let r=cD.get(t);return r||(r=new Promise((n,i)=>{let s=t,a=c=>u=>{s===c&&n(u)},o=c=>u=>{s===c&&i(u)},l=()=>{try{let c=e();uD(c)?(cD.set(c,r),s=c,c.then(a(c),o(c)),lD(c,l)):n(c)}catch(c){i(c)}};t.then(a(t),o(t)),lD(t,l)}),cD.set(t,r)),r};function St(t,e){let r=vu(e),[[n,i,s],a]=(0,dn.useReducer)(c=>{let u=r.get(t);return Object.is(c[0],u)&&c[1]===r&&c[2]===t?c:[u,r,t]},void 0,()=>[r.get(t),r,t]),o=n;(i!==r||s!==t)&&(a(),o=r.get(t));let l=e?.delay;if((0,dn.useEffect)(()=>{let c=r.sub(t,()=>{if(typeof l=="number"){let u=r.get(t);uD(u)&&LQ(IQ(u,()=>r.get(t))),setTimeout(a,l);return}a()});return a(),c},[r,t,l]),(0,dn.useDebugValue)(o),uD(o)){let c=IQ(o,()=>r.get(t));return U3e(c)}return o}function Im(t,e){let r=vu(e);return(0,dn.useCallback)((...i)=>{if((AQ.env?AQ.env.MODE:void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return r.set(t,...i)},[r,t])}function sa(t,e){return[St(t,e),Im(t,e)]}var Z1e=require("obsidian");function dD(t,e){let r={},n=Object.entries(t);for(let i of n){let[s,a]=e(i);r[s]=a}return r}function MQ(t){let e=new Set(t);return Array.from(e)}function KT(t,e){let r=new Set,n=[];for(let i of t){let s=e(i);r.has(s)||(r.add(s),n.push(i))}return n}function YT(t,e){let r={},n=Object.entries(t);for(let[i,s]of n)e(s)&&(r[i]=s);return r}function Hn(t,e){let r={},n=Object.entries(t);for(let[i,s]of n){let a=e(s,i);r[i]=a}return r}function a0(t,e){let r=new Set(e);return Object.fromEntries(Object.entries(t).filter(([n,i])=>!r.has(n)))}function Yf(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}var YR=require("obsidian");var Yo="mx-file",bs="mx-url";function o0(t){return typeof t.view<"u"}function Xo(t,e){return e.activeTime-t.activeTime}function l0(t,e){return t.view===void 0?1:e.view===void 0?-1:0}function zl(...t){return(e,r)=>{for(let n of t){let i=n(e,r);if(i!==0)return i}return 0}}var HR=require("obsidian");var fD;function XT(t){return{lang:t?.lang??fD?.lang,message:t?.message,abortEarly:t?.abortEarly??fD?.abortEarly,abortPipeEarly:t?.abortPipeEarly??fD?.abortPipeEarly}}var z3e;function q3e(t){return z3e?.get(t)}var H3e;function G3e(t){return H3e?.get(t)}var W3e;function K3e(t,e){return W3e?.get(t)?.get(e)}function ql(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function Zt(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,a=i?.expected??t.expects??null,o=i?.received??ql(s),l={kind:t.kind,type:t.type,input:s,expected:a,received:o,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${o}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",u=i?.message??t.message??K3e(t.reference,l.lang)??(c?G3e(l.lang):null)??n.message??q3e(l.lang);u!==void 0&&(l.message=typeof u=="function"?u(l):u),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function mi(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},XT())}}}function OQ(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}function DQ(t){if(t.path){let e="";for(let r of t.path)if(typeof r.key=="string"||typeof r.key=="number")e?e+=`.${r.key}`:e+=r.key;else return null;return e}return null}var Am=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};var Y3e=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,X3e=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u;var Q3e=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Hl(t){return{kind:"transformation",type:"brand",reference:Hl,async:!1,name:t,"~run"(e){return e}}}function Pm(t,e){return{kind:"validation",type:"check",reference:Pm,async:!1,expects:null,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement(r.value)&&Zt(this,"input",r,n),r}}}function Gl(t,e){return{kind:"validation",type:"gt_value",reference:Gl,async:!1,expects:`>${t instanceof Date?t.toJSON():ql(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value>this.requirement)&&Zt(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():ql(r.value)}),r}}}function c0(t){return{kind:"validation",type:"integer",reference:c0,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&Zt(this,"integer",e,r),e}}}function pD(t){return{kind:"validation",type:"iso_date",reference:pD,async:!1,expects:null,requirement:Y3e,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&Zt(this,"date",e,r),e}}}function hD(t){return{kind:"validation",type:"iso_date_time",reference:hD,async:!1,expects:null,requirement:X3e,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&Zt(this,"date-time",e,r),e}}}function mD(t){return{kind:"validation",type:"iso_timestamp",reference:mD,async:!1,expects:null,requirement:Q3e,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&Zt(this,"timestamp",e,r),e}}}function xs(t,e){return{kind:"validation",type:"max_value",reference:xs,async:!1,expects:`<=${t instanceof Date?t.toJSON():ql(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value<=this.requirement)&&Zt(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():ql(r.value)}),r}}}function Rm(t,e){return{kind:"validation",type:"min_length",reference:Rm,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&Zt(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Xa(t,e){return{kind:"validation",type:"min_value",reference:Xa,async:!1,expects:`>=${t instanceof Date?t.toJSON():ql(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value>=this.requirement)&&Zt(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():ql(r.value)}),r}}}function gi(t){return{kind:"validation",type:"non_empty",reference:gi,async:!1,expects:"!0",message:t,"~run"(e,r){return e.typed&&e.value.length===0&&Zt(this,"length",e,r,{received:"0"}),e}}}function u0(t,e){return{kind:"transformation",type:"parse_json",reference:u0,config:t,message:e,async:!1,"~run"(r,n){try{r.value=JSON.parse(r.value,this.config?.reviver)}catch(i){if(i instanceof Error)Zt(this,"JSON",r,n,{received:`"${i.message}"`}),r.typed=!1;else throw i}return r}}}function gD(t){return{kind:"transformation",type:"raw_transform",reference:gD,async:!1,"~run"(e,r){let n=t({dataset:e,config:r,addIssue:i=>Zt(this,i?.label??"input",e,r,i),NEVER:null});return e.issues?e.typed=!1:e.value=n,e}}}function d0(t,e){return{kind:"validation",type:"regex",reference:d0,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement.test(r.value)&&Zt(this,"format",r,n),r}}}function aa(t){return{kind:"transformation",type:"transform",reference:aa,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Qa(){return{kind:"transformation",type:"trim",reference:Qa,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function NQ(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function Vt(t,e){return{...t,fallback:e,get"~standard"(){return mi(this)},"~run"(r,n){let i=t["~run"](r,n);return i.issues?{typed:!0,value:NQ(this,i,n)}:i}}}function yD(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function ws(t,e){return!t["~run"]({value:e},{abortEarly:!0}).issues}function Wl(t,e){return{kind:"schema",type:"array",reference:Wl,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return mi(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let a=i[s],o=this.item["~run"]({value:a},n);if(o.issues){let l={type:"array",origin:"value",input:i,key:s,value:a};for(let c of o.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=o.issues),n.abortEarly){r.typed=!1;break}}o.typed||(r.typed=!1),r.value.push(o.value)}}else Zt(this,"type",r,n);return r}}}function wr(t){return{kind:"schema",type:"boolean",reference:wr,expects:"boolean",async:!1,message:t,get"~standard"(){return mi(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:Zt(this,"type",e,r),e}}}function Qo(t,e){return{kind:"schema",type:"literal",reference:Qo,expects:ql(t),async:!1,literal:t,message:e,get"~standard"(){return mi(this)},"~run"(r,n){return r.value===this.literal?r.typed=!0:Zt(this,"type",r,n),r}}}function vD(t,e){return{kind:"schema",type:"non_nullable",reference:vD,expects:"!null",async:!1,wrapped:t,message:e,get"~standard"(){return mi(this)},"~run"(r,n){return r.value!==null&&(r=this.wrapped["~run"](r,n)),r.value===null&&Zt(this,"type",r,n),r}}}function f0(t){return{kind:"schema",type:"null",reference:f0,expects:"null",async:!1,message:t,get"~standard"(){return mi(this)},"~run"(e,r){return e.value===null?e.typed=!0:Zt(this,"type",e,r),e}}}function oa(t,e){return{kind:"schema",type:"nullable",reference:oa,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,get"~standard"(){return mi(this)},"~run"(r,n){return r.value===null&&(this.default!==void 0&&(r.value=yD(this,r,n)),r.value===null)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function hr(t){return{kind:"schema",type:"number",reference:hr,expects:"number",async:!1,message:t,get"~standard"(){return mi(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Zt(this,"type",e,r),e}}}function An(t,e){return{kind:"schema",type:"object",reference:An,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return mi(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let a=this.entries[s];if(s in i||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){let o=s in i?i[s]:yD(a),l=a["~run"]({value:o},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:o};for(let u of l.issues)u.path?u.path.unshift(c):u.path=[c],r.issues?.push(u);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(a.fallback!==void 0)r.value[s]=NQ(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(Zt(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else Zt(this,"type",r,n);return r}}}function ks(t,e){return{kind:"schema",type:"optional",reference:ks,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return mi(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=yD(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Pt(t,e){return{kind:"schema",type:"picklist",reference:Pt,expects:OQ(t.map(ql),"|"),async:!1,options:t,message:e,get"~standard"(){return mi(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:Zt(this,"type",r,n),r}}}function ke(t){return{kind:"schema",type:"string",reference:ke,expects:"string",async:!1,message:t,get"~standard"(){return mi(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:Zt(this,"type",e,r),e}}}function _Q(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function Zo(t,e){return{kind:"schema",type:"union",reference:Zo,expects:OQ(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return mi(this)},"~run"(r,n){let i,s,a;for(let o of this.options){let l=o["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else a?a.push(l):a=[l]}if(i)return i;if(s){if(s.length===1)return s[0];Zt(this,"type",r,n,{issues:_Q(s)}),r.typed=!0}else{if(a?.length===1)return a[0];Zt(this,"type",r,n,{issues:_Q(a)})}return r}}}function FQ(t,e){let r={...t.entries};for(let n of e)delete r[n];return{...t,entries:r,get"~standard"(){return mi(this)}}}function Za(t,e,r){let n=t["~run"]({value:e},XT(r));if(n.issues)throw new Am(n.issues);return n.value}function Ee(...t){return{...t[0],pipe:t,get"~standard"(){return mi(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function Pn(t,e,r){let n=t["~run"]({value:e},XT(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}async function BQ(t,e,r){let n=await t["~run"]({value:e},XT(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var bu={video:["mp4","webm","ogv","mov","mkv"],audio:["mp3","wav","m4a","3gp","flac","ogg","oga","opus"],track:["vtt","srt","ssa","ass"]},Ja=[...bu.video,...bu.audio],QT=[...bu.track],Lm={video:Pt(bu.video),audio:Pt(bu.audio),track:Pt(bu.track),media:Pt(Ja)},VQ=Lm.track;function Kl(t){return ws(Lm.media,t.extension)}function p0(t){return ws(Lm.video,t.extension)}function bD(t){return ws(Lm.audio,t.extension)}function ZT(t){return ws(Lm.track,t.extension)}function xD(t){let{pathname:e}=t,r=e.split(".").pop();return ws(Lm.media,r)}function jQ(){return[...bu.video,...bu.audio]}var h0="mx-vault-track",Mm="mx-url-track";var xV=require("obsidian");var Ot=class extends Error{constructor(e,r){super(e,r),this.name="AssertionError"}};function $Q(t){return t instanceof Set||t instanceof Map}function Z3e(t,e){let r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e);return r===n||r===Object.prototype&&n===null||r===null&&n===Object.prototype}function J3e(t){let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||e===Array.prototype}function zQ(t){return[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)]}function UQ(t){let e=new Set;for(;t!==Object.prototype&&t!==Array.prototype&&t!=null;){for(let r of zQ(t))e.add(r);t=Object.getPrototypeOf(t)}return e}var xu=globalThis.Temporal??new Proxy({},{get:()=>{}}),eMe=new Set([Intl.Locale,RegExp,xu.Duration,xu.Instant,xu.PlainDate,xu.PlainDateTime,xu.PlainTime,xu.PlainYearMonth,xu.PlainMonthDay,xu.ZonedDateTime,URL,URLSearchParams].filter(t=>t!=null).map(t=>t.prototype));function wD(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||typeof t=="symbol"||t==null}var tMe=Object.getPrototypeOf(Uint8Array);function rMe(t,e){if(t.length!==e.length)return!1;for(let r=0;r<e.length;r++)if(!qQ(t[r],e[r]))return!1;return!0}function qQ(t,e){return t===e||Object.is(t,e)}function Yl(t,e){let r=new Map;return function n(i,s){if(qQ(i,s))return!0;if(wD(i)||wD(s))return!1;if(i instanceof Date&&s instanceof Date)return Object.is(i.getTime(),s.getTime());if(i&&typeof i=="object"&&s&&typeof s=="object"){if(!Z3e(i,s))return!1;if(i instanceof tMe)return rMe(i,s);if(i instanceof WeakMap)throw new TypeError("cannot compare WeakMap instances");if(i instanceof WeakSet)throw new TypeError("cannot compare WeakSet instances");if(i instanceof WeakRef)return n(i.deref(),s.deref());if(r.get(i)===s)return!0;if(Object.keys(i).length!==Object.keys(s).length)return!1;if(r.set(i,s),$Q(i)&&$Q(s)){if(i.size!==s.size)return!1;let o=[...i.keys()];if(o.every(wD)){if(i instanceof Set)return i.symmetricDifference(s).size===0;for(let u of o)if(!s.has(u)||!n(i.get(u),s.get(u)))return!1;return!0}let c=i.size;for(let[u,d]of i.entries())for(let[f,p]of s.entries())if(n(u,f)&&(u===d&&f===p||n(d,p))){c--;break}return c===0}let a;if(J3e(i))a=zQ({...i,...s});else{if(eMe.has(Object.getPrototypeOf(i)))return String(i)===String(s);a=UQ(i).union(UQ(s))}for(let o of a)if(!n(i[o],s[o])||o in i&&!(o in s)||o in s&&!(o in i))return!1;return!0}return!1}(t,e)}function eo(t){let{Deno:e}=globalThis;return typeof e?.inspect=="function"?e.inspect(t,{depth:1/0,sorted:!0,trailingComma:!0,compact:!1,iterableLimit:1/0,getters:!0,strAbbreviateSize:1/0}):`"${String(t).replace(/(?=["\\])/g,"\\")}"`}var{Deno:HQ}=globalThis,Wct=typeof HQ?.noColor=="boolean"?HQ.noColor:!1;var Kct=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))"].join("|"),"g");function WQ(t,e=""){if(!t)throw new Ot(e)}var la={},YQ=Symbol((la.env?la.env.MODE:void 0)!=="production"?"RESET":"");var kD=(t,e,r)=>(e.has(r)?e:e.set(r,t())).get(r),oMe=new WeakMap,lMe=(t,e,r,n)=>{let i=kD(()=>new WeakMap,oMe,e),s=kD(()=>new WeakMap,i,r);return kD(t,s,n)};function m0(t,e,r=Object.is){return lMe(()=>{let n=Symbol(),i=([a,o])=>{if(o===n)return e(a);let l=e(a,o);return r(o,l)?o:l},s=re(a=>{let o=a(s),l=a(t);return i([l,o])});return s.init=n,s},t,e,r)}var cMe=t=>typeof t?.then=="function";function uMe(t=()=>{try{return window.localStorage}catch(r){(la.env?la.env.MODE:void 0)!=="production"&&typeof window<"u"&&console.warn(r);return}},e){var r;let n,i,s={getItem:(l,c)=>{var u,d;let f=h=>{if(h=h||"",n!==h){try{i=JSON.parse(h,e?.reviver)}catch{return c}n=h}return i},p=(d=(u=t())==null?void 0:u.getItem(l))!=null?d:null;return cMe(p)?p.then(f):f(p)},setItem:(l,c)=>{var u;return(u=t())==null?void 0:u.setItem(l,JSON.stringify(c,e?.replacer))},removeItem:l=>{var c;return(c=t())==null?void 0:c.removeItem(l)}},a=l=>(c,u,d)=>l(c,f=>{let p;try{p=JSON.parse(f||"")}catch{p=d}u(p)}),o;try{o=(r=t())==null?void 0:r.subscribe}catch{}return!o&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(o=(l,c)=>{if(!(t()instanceof window.Storage))return()=>{};let u=d=>{d.storageArea===t()&&d.key===l&&c(d.newValue)};return window.addEventListener("storage",u),()=>{window.removeEventListener("storage",u)}}),o&&(s.subscribe=a(o)),s}var Qdt=uMe();var KQ=(t,e,r)=>(e.has(r)?e:e.set(r,t())).get(r),dMe=new WeakMap,fMe=(t,e,r)=>{let n=KQ(()=>new WeakMap,dMe,e);return KQ(t,n,r)},pMe=t=>t instanceof Promise,hMe=()=>{};function XQ(t,e=hMe){return fMe(()=>{let r=new WeakMap,n=new WeakMap,i=re(0);(la.env?la.env.MODE:void 0)!=="production"&&(i.debugPrivate=!0);let s=re((a,{setSelf:o})=>{a(i);let l=a(s),c=a(t);if(!pMe(c))return{v:c};if(c!==l?.p&&c.then(u=>{n.set(c,u),o()},u=>{r.set(c,u),o()}),r.has(c))throw r.get(c);return n.has(c)?{p:c,v:n.get(c)}:l&&"v"in l?{p:c,f:e(l.v),v:l.v}:{p:c,f:e()}},(a,o)=>{o(i,l=>l+1)});return s.init=void 0,(la.env?la.env.MODE:void 0)!=="production"&&(s.debugPrivate=!0),re(a=>{let o=a(s);return"f"in o?o.f:o.v},(a,o,...l)=>o(t,...l))},t,e)}function QQ(t,e){let r=re(0);return(la.env?la.env.MODE:void 0)!=="production"&&(r.debugPrivate=!0),re((n,i)=>(n(r),t(n,i)),(n,i,...s)=>{if(s.length===0)i(r,a=>a+1);else{if(e)return e(n,i,...s);if((la.env?la.env.MODE:void 0)!=="production")throw new Error("refresh must be called without arguments")}})}var JQ=Z(Te(),1);var ZQ=new WeakMap;function eZ(t,e){let r=vu(e),n=mMe(r);for(let[i,s]of t)(!n.has(i)||e?.dangerouslyForceHydrate)&&(n.add(i),r.set(i,s))}var mMe=t=>{let e=ZQ.get(t);return e||(e=new WeakSet,ZQ.set(t,e)),e};function $i(t){let e=re(0),r=re(()=>({i:0}),(l,c)=>{let u=l(r);return Object.assign(u,{m:!0,peek:l,set:c}),c(e,d=>d+1),()=>{u.m=!1,a(u),o(u)}});r.onMount=l=>l();let n=re(l=>{l(e);let c=l(r);if(!c.m||c.irc||c.i&&!c.irf)return c.p;o(c);let u=new Map,d=m=>{let v=l(m);return u.set(m,v),v};d.peek=c.peek;let f=(...m)=>{try{return++c.i,c.set(...m)}finally{Array.from(u.keys(),l),--c.i}};f.recurse=(m,...v)=>{if(!c.fc)try{return c.irc=!0,c.set(m,...v)}finally{c.irc=!1,Array.from(u).some(p)&&s(c)}};function p([m,v]){return l(m)!==v}++c.i;function h(){try{if(c.irf=!1,!c.m)return;a(c),c.c=i.effect(d,f)}catch(m){c.e=m,s(c)}finally{c.p=void 0,--c.i}}return c.irf?h():c.p=Promise.resolve().then(h)}),i=re(l=>void l(n));return i.effect=t,i;function s(l){try{l.irf=!0,l.set(e,c=>c+1)}finally{l.irf=!1}}function a(l){if(typeof l.c=="function")try{l.fc=!0,l.c()}finally{l.fc=!1,l.c=void 0}}function o(l){if("e"in l){let c=l.e;throw delete l.e,c}}}function fn(t,e){let r=$i((a,o)=>{let l=c=>a(c===s?t:c);return l.peek=a.peek,s.effect(l,o)}),n=Object.getOwnPropertyDescriptors(t);n.read.value=a=>{try{return a(t)}finally{a(r)}},"write"in t&&typeof t.write=="function"&&(n.write.value=t.write.bind(t),delete n.onMount);let i=Object.getPrototypeOf(t),s=Object.create(i,n);return s.effect=e,s}var JT=new WeakMap;function ca(t,e=WT()){JT.has(e)||JT.set(e,new Map);let r=JT.get(e),n=r.get(t);if(!n){let i=$i(t),s=e.sub(i,()=>{});n=()=>{s&&(r.delete(t),r.size===0&&JT.delete(e),s=void s())},r.set(t,n)}return n}function Be(t,e){throw new Ot(e??`Expect ${eo(t)} to be of type never`)}var tZ="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Xr=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=tZ[r[t]&63];return e};var SD=new WeakMap;function eE(t){return SD.has(t)||SD.set(t,Xr()),SD.get(t)}function ua(t){return t?t.type==="url:hosted"&&t.vid.host==="youtube":!1}function Xf(t){return!!t&&(t.type==="url:direct"||t.type==="url:hosted")}function gMe(t){return t.host==="youtube"||t.host==="vimeo"}function rZ(t){return t.type==="url:hosted"&&gMe(t.vid)}function Xl(t){if(t.type==="file")return`file:${eE(t.file)}`;if(t.type==="url:direct")return`url:${t.url.toString()}`;if(t.type==="url:hosted")return`url:${t.url.toString()}`;Be(t)}function da(t,e){if(!t||!e)return!1;let r=Xl(t),n=Xl(e);return r===n}var Tt=re({}),Jo=re(null),Kt=m0(Jo,t=>t?.info,da),jt=m0(Jo,t=>t?.hash??null,(t,e)=>Yl(t,e)),Qf=re(null),nE=re(null,(t,e)=>{e(Qf,{tempFragment:null}),e(Jo,r=>r&&{...r,hash:{...r.hash,tempFragment:null}})}),iE=re(t=>t(wu)===!1),g0=fn(re(!0),(t,e)=>{if(!t(Jo))return;e(g0,!1);let r=window.setTimeout(()=>{e(g0,!0)},500);return()=>window.clearTimeout(r)}),nZ=re(null,(t,e,r)=>{t(g0)||e(Jo,i=>i&&{...i,hash:r}),e(Qf,r)}),wu=re(!1),tE=class extends Event{constructor(r){super("ephemeral-hash-event");this.hash=r}},rE=class extends Event{sources;constructor(e){super("initial-hash-event"),this.sources=e}};var N=Z(Te(),1),$=Z(Te(),1);var aE=Z(Te(),1);var iZ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sE=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();var y0=Z(Te(),1);var sZ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var aZ=(0,y0.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:a,...o},l)=>(0,y0.createElement)("svg",{ref:l,...sZ,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:sE("lucide",i),...o},[...a.map(([c,u])=>(0,y0.createElement)(c,u)),...Array.isArray(s)?s:[s]]));var W=(t,e)=>{let r=(0,aE.forwardRef)(({className:n,...i},s)=>(0,aE.createElement)(aZ,{ref:s,iconNode:e,className:sE(`lucide-${iZ(t)}`,n),...i}));return r.displayName=`${t}`,r};var yMe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],v0=W("ArrowDown",yMe);var vMe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],b0=W("ArrowUpRight",vMe);var bMe=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],x0=W("ArrowUp",bMe);var xMe=[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]],w0=W("AudioWaveform",xMe);var wMe=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],k0=W("Blocks",wMe);var kMe=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],S0=W("Book",kMe);var SMe=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],C0=W("Bug",SMe);var CMe=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],_m=W("Camera",CMe);var TMe=[["path",{d:"M10.5 5H19a2 2 0 0 1 2 2v8.5",key:"jqtk4d"}],["path",{d:"M17 11h-.5",key:"1961ue"}],["path",{d:"M19 19H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2",key:"1keqsi"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M7 11h4",key:"1o1z6v"}],["path",{d:"M7 15h2.5",key:"1ina1g"}]],T0=W("CaptionsOff",TMe);var EMe=[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]],Ql=W("Captions",EMe);var IMe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zf=W("Check",IMe);var AMe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],E0=W("ChevronDown",AMe);var PMe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Zl=W("CircleAlert",PMe);var RMe=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Jl=W("CircleCheckBig",RMe);var LMe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ku=W("CircleX",LMe);var MMe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Om=W("Clock",MMe);var _Me=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Dm=W("Copy",_Me);var OMe=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],I0=W("Download",OMe);var DMe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Su=W("ExternalLink",DMe);var NMe=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],A0=W("EyeOff",NMe);var FMe=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Nm=W("Eye",FMe);var BMe=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],P0=W("FilePlus",BMe);var VMe=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Jf=W("FileText",VMe);var jMe=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],R0=W("FolderOpen",jMe);var $Me=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],L0=W("Gauge",$Me);var UMe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],M0=W("Globe",UMe);var zMe=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],_0=W("Hash",zMe);var qMe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],O0=W("Image",qMe);var HMe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fm=W("Info",HMe);var GMe=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Bm=W("Languages",GMe);var WMe=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],ep=W("Link",WMe);var KMe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],to=W("LoaderCircle",KMe);var YMe=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],D0=W("Lock",YMe);var XMe=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],N0=W("Maximize",XMe);var QMe=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],F0=W("Mic",QMe);var ZMe=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],B0=W("Minimize",ZMe);var JMe=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Vm=W("Music",JMe);var e_e=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],V0=W("Pause",e_e);var t_e=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Cu=W("Pen",t_e);var r_e=[["path",{d:"M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4",key:"daa4of"}],["rect",{width:"10",height:"7",x:"12",y:"13",rx:"2",key:"1nb8gs"}]],j0=W("PictureInPicture2",r_e);var n_e=[["path",{d:"M2 10h6V4",key:"zwrco"}],["path",{d:"m2 4 6 6",key:"ug085t"}],["path",{d:"M21 10V7a2 2 0 0 0-2-2h-7",key:"git5jr"}],["path",{d:"M3 14v2a2 2 0 0 0 2 2h3",key:"1f7fh3"}],["rect",{x:"12",y:"14",width:"10",height:"7",rx:"1",key:"1wjs3o"}]],jm=W("PictureInPicture",n_e);var i_e=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],Tu=W("Pin",i_e);var s_e=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Eu=W("Play",s_e);var a_e=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$m=W("Plus",a_e);var o_e=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],$0=W("Redo",o_e);var l_e=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],U0=W("RefreshCcw",l_e);var c_e=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],z0=W("Repeat",c_e);var u_e=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],q0=W("Rocket",u_e);var d_e=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Iu=W("RotateCcw",d_e);var f_e=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Um=W("Save",f_e);var p_e=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],zm=W("Scissors",p_e);var h_e=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],H0=W("Search",h_e);var m_e=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],G0=W("Settings",m_e);var g_e=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Au=W("Sparkles",g_e);var y_e=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Ui=W("SquarePen",y_e);var v_e=[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"2",key:"1btzen"}],["circle",{cx:"8",cy:"8",r:"2",key:"14cg06"}],["path",{d:"M9.414 9.414 12 12",key:"qz4lzr"}],["path",{d:"M14.8 14.8 18 18",key:"11flf1"}],["circle",{cx:"8",cy:"16",r:"2",key:"1acxsx"}],["path",{d:"m18 6-8.586 8.586",key:"11kzk1"}]],Pu=W("SquareScissors",v_e);var b_e=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],W0=W("Star",b_e);var x_e=[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]],K0=W("TestTube",x_e);var w_e=[["path",{d:"M17 6.1H3",key:"wptmhv"}],["path",{d:"M21 12.1H3",key:"1j38uz"}],["path",{d:"M15.1 18H3",key:"1nb16a"}]],Y0=W("Text",w_e);var k_e=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],X0=W("Trash2",k_e);var S_e=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Q0=W("Undo2",S_e);var C_e=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],Z0=W("Undo",C_e);var T_e=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],J0=W("Upload",T_e);var E_e=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],qm=W("User",E_e);var I_e=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ex=W("Video",I_e);var A_e=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]],tx=W("Volume1",A_e);var P_e=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Hm=W("Volume2",P_e);var R_e=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],Gm=W("VolumeX",R_e);var L_e=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],el=W("X",L_e);var M_e=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],rx=W("Zap",M_e);va();va();var Le=Z(Te(),1);cx();var Pe=Z(Te(),1);cx();va();var Y=Z(Te(),1);cx();va();oo();lo();var $ee=Z(Af(),1);function gg(){return GD(Sw)}var yNe=ze(Qx,{domEventsRegex:/^onMedia/}),Uee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(yNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));Uee.displayName="AirPlayButton";var vNe=ze(Xx,{domEventsRegex:/^onMedia/}),B2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(vNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));B2.displayName="PlayButton";var bNe=ze(Hx,{domEventsRegex:/^onMedia/}),V2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(bNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));V2.displayName="CaptionButton";var xNe=ze(Gx,{domEventsRegex:/^onMedia/}),j2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(xNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));j2.displayName="FullscreenButton";var wNe=ze(Kx,{domEventsRegex:/^onMedia/}),$2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(wNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));$2.displayName="MuteButton";var kNe=ze(Yx,{domEventsRegex:/^onMedia/}),U2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(kNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));U2.displayName="PIPButton";var SNe=ze(Jx,{domEventsRegex:/^onMedia/}),z2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(SNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));z2.displayName="SeekButton";var CNe=ze(Wx,{domEventsRegex:/^onMedia/}),zee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(CNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));zee.displayName="LiveButton";var vp=["onDragStart","onDragEnd","onDragValueChange","onValueChange","onPointerValueChange"],TNe=ze(cw),ENe=ze(hg,{events:vp}),qee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(ENe,{...e,ref:r},n=>Y.createElement(we.div,{...n},t)));qee.displayName="Slider";var Ew=Y.forwardRef((t,e)=>Y.createElement(we.div,{...t,ref:e}));Ew.displayName="SliderThumb";var Iw=Y.forwardRef((t,e)=>Y.createElement(we.div,{...t,ref:e}));Iw.displayName="SliderTrack";var Aw=Y.forwardRef((t,e)=>Y.createElement(we.div,{...t,ref:e}));Aw.displayName="SliderTrackFill";var INe=ze(dw),Pw=Y.forwardRef(({children:t,...e},r)=>Y.createElement(INe,{...e},n=>Y.createElement(we.div,{...n,ref:st(n.ref,r)},t)));Pw.displayName="SliderPreview";var Rw=Y.forwardRef(({children:t,...e},r)=>Y.createElement(TNe,{...e},(n,i)=>{let s=Ut(()=>i.getValueText(),i);return Y.createElement(we.div,{...n,ref:r},s,t)}));Rw.displayName="SliderValue";var Lw=Y.forwardRef(({children:t,...e},r)=>{let n=Tw("min"),i=Tw("max"),s=Tw("step"),a=(i-n)/s;return Y.createElement(we.div,{...e,ref:r},Array.from({length:Math.floor(a)+1}).map((o,l)=>t(l)))});Lw.displayName="SliderSteps";var Mw=Object.freeze({__proto__:null,Preview:Pw,Root:qee,Steps:Lw,Thumb:Ew,Track:Iw,TrackFill:Aw,Value:Rw}),ANe=ze(iw,{events:vp,domEventsRegex:/^onMedia/}),Hee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(ANe,{...e,ref:r},n=>Y.createElement(we.div,{...n},t)));Hee.displayName="VolumeSlider";var dF=Object.freeze({__proto__:null,Preview:Pw,Root:Hee,Steps:Lw,Thumb:Ew,Track:Iw,TrackFill:Aw,Value:Rw});function PNe(t=0,e=0,r=""){return le?{startTime:t,endTime:e,text:r,addEventListener:io,removeEventListener:io,dispatchEvent:io}:new window.VTTCue(t,e,r)}var RNe=ze(mg),LNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(RNe,{...e},n=>Y.createElement(we.div,{...n,ref:st(n.ref,r)},t)));LNe.displayName="Thumbnail";var Gee=Y.forwardRef(({children:t,...e},r)=>{let{src:n,img:i,crossOrigin:s}=tc(mg.state),a=Ut(n),o=Ut(s);return Y.createElement(we.img,{crossOrigin:o,...e,src:a||void 0,ref:st(i.set,r)},t)});Gee.displayName="ThumbnailImg";var q2=Y.createContext({$chapters:be(null)});q2.displayName="TimeSliderContext";var MNe=ze(nw,{events:vp,domEventsRegex:/^onMedia/}),Wee=Y.forwardRef(({children:t,...e},r)=>{let n=Y.useMemo(()=>be(null),[]);return Y.createElement(q2.Provider,{value:{$chapters:n}},Y.createElement(MNe,{...e,ref:r},i=>Y.createElement(we.div,{...i},t)))});Wee.displayName="TimeSlider";var _Ne=ze(fw),Kee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(_Ne,{...e},(n,i)=>Y.createElement(we.div,{...n,ref:st(n.ref,r)},Y.createElement(Yee,{instance:i},t))));Kee.displayName="SliderChapters";function Yee({instance:t,children:e}){let r=Ut(()=>t.cues,t),n=Y.useRef([]),i=Y.useRef(null),{$chapters:s}=Y.useContext(q2);return i.current||(i.current=PNe()),Y.useEffect(()=>(s.set(t),()=>void s.set(null)),[t]),Y.useEffect(()=>{t.setRefs(n.current)},[r]),e(r.length?r:[i.current],a=>{if(!a){n.current.length=0;return}n.current.push(a)})}Yee.displayName="SliderChapterTracks";var Xee=Y.forwardRef(({children:t,...e},r)=>{let{$chapters:n}=Y.useContext(q2),[i,s]=Y.useState();return Y.useEffect(()=>U(()=>{let a=n(),o=a?.activePointerCue||a?.activeCue;s(o?.text||"")}),[]),Y.createElement(we.div,{...e,ref:r},i,t)});Xee.displayName="SliderChapterTitle";var Qee=Y.forwardRef((t,e)=>Y.createElement(we.div,{...t,ref:e}));Qee.displayName="SliderProgress";var ONe=ze(lw),Zee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(ONe,{...e},n=>Y.createElement(we.div,{...n,ref:st(n.ref,r)},t)));Zee.displayName="SliderThumbnail";var DNe={Root:Zee,Img:Gee},NNe=ze(uw,{events:["onCanPlay","onError"]}),Jee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(NNe,{...e},(n,i)=>Y.createElement(ete,{...n,instance:i,ref:st(n.ref,r)},t)));Jee.displayName="SliderVideo";var ete=Y.forwardRef(({instance:t,children:e,...r},n)=>{let{canLoad:i}=tc(Nu),{src:s,video:a,crossOrigin:o}=t.$state,l=Ut(s),c=Ut(i),u=Ut(o);return Y.createElement(we.video,{style:{maxWidth:"unset"},...r,src:l||void 0,muted:!0,playsInline:!0,preload:c?"auto":"none",crossOrigin:u||void 0,ref:st(a.set,n)},e)});ete.displayName="SliderVideoProvider";var bp=Object.freeze({__proto__:null,ChapterTitle:Xee,Chapters:Kee,Preview:Pw,Progress:Qee,Root:Wee,Steps:Lw,Thumb:Ew,Thumbnail:DNe,Track:Iw,TrackFill:Aw,Value:Rw,Video:Jee}),FNe=ze(yw,{events:["onChange"]}),BNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(FNe,{...e,ref:r},n=>Y.createElement(we.div,{...n},t)));BNe.displayName="RadioGroup";var VNe=ze(vw,{events:["onChange","onSelect"]}),jNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(VNe,{...e},n=>Y.createElement(we.div,{...n,ref:st(n.ref,r)},t)));jNe.displayName="RadioItem";var $Ne=ze(pw,{events:["onOpen","onClose"],domEventsRegex:/^onMedia/}),UNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement($Ne,{...e,ref:r},(n,i)=>Y.createElement(we.div,{...n,style:{display:i.isSubmenu?void 0:"contents",...n.style}},t)));UNe.displayName="Menu";var zNe=ze(hw,{events:["onSelect"]}),qNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(zNe,{...e},n=>Y.createElement(we.button,{...n,ref:st(n.ref,r)},t)));qNe.displayName="MenuButton";var HNe=Y.forwardRef(({container:t=null,disabled:e=!1,children:r,...n},i)=>{let s=Wi("fullscreen"),a=e==="fullscreen"?!s:!e,o=Y.useMemo(()=>le?null:(me(t)?document.querySelector(t):t)??document.body,[t]);return!o||!a?r:(0,$ee.createPortal)(Y.createElement(we.div,{...n,style:{display:"contents",...n.style},ref:i},r),o)});HNe.displayName="MenuPortal";var GNe=ze(mw),WNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(GNe,{...e},n=>Y.createElement(we.div,{...n,ref:st(n.ref,r)},t)));WNe.displayName="MenuItems";var KNe=ze(gw),YNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(KNe,{...e},n=>Y.createElement(we.div,{...n,ref:st(n.ref,r)},t)));YNe.displayName="MenuItem";var XNe=ze(xw,{events:["onWillTrigger","onTrigger"]}),H2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(XNe,{...e,ref:r},n=>Y.createElement(we.div,{...n},t)));H2.displayName="Gesture";var QNe=ze(ww),tte=Y.forwardRef(({children:t,...e},r)=>Y.createElement(QNe,{...e},(n,i)=>Y.createElement(rte,{...n,instance:i,ref:st(n.ref,r)},t)));tte.displayName="Time";var rte=Y.forwardRef(({instance:t,children:e,...r},n)=>{let{timeText:i}=t.$state,s=Ut(i);return Y.createElement(we.div,{...r,ref:n},s,e)});rte.displayName="TimeText";function G2(){return gg()?.player||null}lo();var ZNe=ze(Ux,{events:["onChange"]}),nte=Pe.forwardRef(({style:t,children:e,...r},n)=>Pe.createElement(ZNe,{...r},i=>Pe.createElement(we.div,{...i,style:{display:"contents",...t},ref:st(i.ref,n)},e)));nte.displayName="MediaAnnouncer";var JNe=ze(zx),ite=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(JNe,{...e},n=>Pe.createElement(we.div,{...n,ref:st(n.ref,r)},t)));ite.displayName="Controls";var e4e=ze(qx),ste=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(e4e,{...e},n=>Pe.createElement(we.div,{...n,ref:st(n.ref,r)},t)));ste.displayName="ControlsGroup";var gr=Object.freeze({__proto__:null,Group:ste,Root:ite}),t4e=ze(ew);function r4e({children:t,...e}){return Pe.createElement(t4e,{...e},t)}r4e.displayName="Tooltip";var n4e=ze(tw),i4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(n4e,{...e},n=>Pe.createElement(we.button,{...n,ref:st(n.ref,r)},t)));i4e.displayName="TooltipTrigger";var s4e=ze(rw),a4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(s4e,{...e},n=>Pe.createElement(we.div,{...n,ref:st(n.ref,r)},t)));a4e.displayName="TooltipContent";var o4e=ze(Zx,{domEventsRegex:/^onMedia/}),ate=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(o4e,{...e},n=>Pe.createElement(we.button,{...n,ref:st(n.ref,r)},t)));ate.displayName="GoogleCastButton";var l4e=ze(ow,{events:vp,domEventsRegex:/^onMedia/}),c4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(l4e,{...e,ref:r},n=>Pe.createElement(we.div,{...n},t)));c4e.displayName="QualitySlider";var u4e=ze(sw,{events:vp,domEventsRegex:/^onMedia/}),d4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(u4e,{...e,ref:r},n=>Pe.createElement(we.div,{...n},t)));d4e.displayName="AudioGainSlider";var f4e=ze(aw,{events:vp,domEventsRegex:/^onMedia/}),p4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(f4e,{...e,ref:r},n=>Pe.createElement(we.div,{...n},t)));p4e.displayName="SpeedSlider";var ote=Pe.forwardRef(({children:t,...e},r)=>{let n=Wi("title");return Pe.createElement(we.span,{...e,ref:r},n,t)});ote.displayName="Title";function lte(t){let[e,r]=Pe.useState([]);return Pe.useEffect(()=>{if(!t){r([]);return}function n(){t&&r(t.activeCues)}return n(),We(t,"cue-change",n)},[t]),e}function cte(t){let e=gg(),[r,n]=Pe.useState(null);return Pe.useEffect(()=>kw(e.textTracks,t,n),[t]),r}function W2(){let t=cte("chapters");return lte(t)[0]?.text||""}var ute=Pe.forwardRef(({defaultText:t="",children:e,...r},n)=>{let i=W2();return Pe.createElement(we.span,{...r,ref:n},i||t,e)});ute.displayName="ChapterTitle";var h4e=ze(bw),K2=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(h4e,{...e,ref:r},n=>Pe.createElement(we.div,{...n},t)));K2.displayName="Captions";var _vt=Pe.forwardRef(({size:t=96,children:e,...r},n)=>Pe.createElement("svg",{width:t,height:t,fill:"none",viewBox:"0 0 120 120","aria-hidden":"true","data-part":"root",...r,ref:n},e)),Ovt=Pe.forwardRef(({width:t=8,children:e,...r},n)=>Pe.createElement("circle",{cx:"60",cy:"60",r:"54",stroke:"currentColor",strokeWidth:t,"data-part":"track",...r,ref:n},e)),Dvt=Pe.forwardRef(({width:t=8,fillPercent:e=50,children:r,...n},i)=>Pe.createElement("circle",{cx:"60",cy:"60",r:"54",stroke:"currentColor",pathLength:"100",strokeWidth:t,strokeDasharray:100,strokeDashoffset:100-e,"data-part":"track-fill",...n,ref:i},r));lo();var Y2=Z(Te(),1),fF=Y2.forwardRef((t,e)=>{let{width:r,height:n,size:i=null,paths:s,...a}=t;return Y2.createElement("svg",{viewBox:"0 0 32 32",...a,width:r??i,height:n??i,fill:"none","aria-hidden":"true",focusable:"false",xmlns:"http://www.w3.org/2000/svg",ref:e,dangerouslySetInnerHTML:{__html:s}})});fF.displayName="VidstackIcon";oo();var pbt=Z(Af(),1),m4e=Symbol(0),dte=class t{constructor(e,r,n,i,s){this.logger=e,this.level=r,this.title=n,this.root=i,this.parent=s}[m4e]=!0;logs=[];log(...e){return this.logs.push({data:e}),this}labelledLog(e,...r){return this.logs.push({label:e,data:r}),this}groupStart(e){return new t(this.logger,this.level,e,this.root??this,this)}groupEnd(){return this.parent?.logs.push(this),this.parent??this}dispatch(){return this.logger.dispatch(this.level,this.root??this)}};var g4e=[1,1.25,1.5,1.75,2,2.5,3,4],pF=class extends je{static props={normalLabel:"Disabled",gains:g4e};#e;#t;#r;get value(){return this.#r.value}get disabled(){let{gains:e}=this.$props,{canSetAudioGain:r}=this.#e.$state;return!r()||e().length===0}constructor(){super(),this.#r=new $x,this.#r.onValueChange=this.#o.bind(this)}onSetup(){this.#e=Et(),so(il)&&(this.#t=mr(il))}onConnect(e){U(this.#n.bind(this)),U(this.#i.bind(this)),U(this.#s.bind(this))}getOptions(){let{gains:e,normalLabel:r}=this.$props;return e().map(n=>({label:n===1||n===null?r:String(n*100)+"%",value:n.toString()}))}#n(){this.#r.value=this.#a()}#i(){let{normalLabel:e}=this.$props,{audioGain:r}=this.#e.$state,n=r();this.#t?.hint.set(n===1||n==null?e():String(n*100)+"%")}#s(){this.#t?.disable(this.disabled)}#a(){let{audioGain:e}=this.#e.$state;return e()?.toString()??"1"}#o(e,r){if(this.disabled)return;let n=+e;this.#e.remote.changeAudioGain(n,r),this.dispatch("change",{detail:n,trigger:r})}},hF=pF.prototype;ht(hF,"value");ht(hF,"disabled");$r(hF,"getOptions");var y4e=["onAbort","onAudioTrackChange","onAudioTracksChange","onAutoPlay","onAutoPlayChange","onAutoPlayFail","onCanLoad","onCanPlay","onCanPlayThrough","onControlsChange","onDestroy","onDurationChange","onEmptied","onEnd","onEnded","onError","onFindMediaPlayer","onFullscreenChange","onFullscreenError","onLiveChange","onLiveEdgeChange","onLoadedData","onLoadedMetadata","onLoadStart","onLoopChange","onOrientationChange","onPause","onPictureInPictureChange","onPictureInPictureError","onPlay","onPlayFail","onPlaying","onPlaysInlineChange","onPosterChange","onProgress","onProviderChange","onProviderLoaderChange","onProviderSetup","onQualitiesChange","onQualityChange","onRateChange","onReplay","onSeeked","onSeeking","onSourceChange","onSourceChange","onStalled","onStarted","onStreamTypeChange","onSuspend","onTextTrackChange","onTextTracksChange","onTimeUpdate","onTitleChange","onVdsLog","onVideoPresentationChange","onVolumeChange","onWaiting"],v4e=ze(gp,{events:y4e,eventsRegex:/^onHls/,domEventsRegex:/^onMedia/}),mF=Le.forwardRef(({aspectRatio:t,children:e,...r},n)=>Le.createElement(v4e,{...r,src:r.src,ref:n,style:{aspectRatio:t,...r.style}},i=>Le.createElement(we.div,{...i},e)));mF.displayName="MediaPlayer";var b4e=ze(M2),gF=Le.forwardRef(({loaders:t=[],children:e,iframeProps:r,mediaProps:n,...i},s)=>{let a=Le.useMemo(()=>t.map(o=>new o),t);return Le.createElement(b4e,{...i,loaders:a,ref:s},(o,l)=>Le.createElement("div",{...o},Le.createElement(fte,{provider:l,mediaProps:n,iframeProps:r}),e))});gF.displayName="MediaProvider";function fte({provider:t,mediaProps:e,iframeProps:r}){let{sources:n,crossOrigin:i,poster:s,remotePlaybackInfo:a,nativeControls:o,viewType:l}=tc(Nu),{loader:c}=t.$state,{$provider:u,$providerSetup:d}=gg(),f=Ut(n),p=Ut(o),h=Ut(i),m=Ut(s),v=Ut(c),b=Ut(u),y=Ut(d),x=Ut(a),w=v?.mediaType(),C=Ut(l),O=C==="audio",S=v?.name==="youtube",T=v?.name==="vimeo",E=S||T,P=v?.name==="remotion",R=v?.name==="google-cast",[I,B]=Le.useState(""),[M,z]=Le.useState(!1);return Le.useEffect(()=>{!R||I||Promise.resolve().then(()=>(XD(),LZ)).then(function(G){return G.chromecast}).then(G=>{B(G.default)})},[R]),Le.useEffect(()=>{z(!0)},[]),R?Le.createElement("div",{className:"vds-google-cast",ref:G=>{t.load(G)}},Le.createElement(fF,{paths:I}),x?.deviceName?Le.createElement("span",{className:"vds-google-cast-info"},"Google Cast on"," ",Le.createElement("span",{className:"vds-google-cast-device-name"},x.deviceName)):null):P?Le.createElement("div",{"data-remotion-canvas":!0},Le.createElement("div",{"data-remotion-container":!0,ref:G=>{t.load(G)}},Vee(b)&&y?Le.createElement(b.render):null)):E?Le.createElement(Le.Fragment,null,Le.createElement("iframe",{...r,className:(r?.className?`${r.className} `:"")+S?"vds-youtube":"vds-vimeo",suppressHydrationWarning:!0,tabIndex:p?void 0:-1,"aria-hidden":"true","data-no-controls":p?void 0:"",ref(G){t.load(G)}}),!p&&!O?Le.createElement("div",{className:"vds-blocker"}):null):w?Le.createElement(w==="audio"?"audio":"video",{...e,controls:p?!0:null,crossOrigin:typeof h=="boolean"?"":h,poster:w==="video"&&p&&m?m:null,suppressHydrationWarning:!0,children:M?null:f.map(({src:G,type:V})=>me(G)?Le.createElement("source",{src:G,type:V!=="?"?V:void 0,key:G}):null),ref(G){t.load(G)}}):null}fte.displayName="MediaOutlet";function x4e(t){let e=gg(),r=Le.useMemo(()=>new Kn(t),Object.values(t));return Le.useEffect(()=>(e.textTracks.add(r),()=>void e.textTracks.remove(r)),[r]),r}function w4e({lang:t,...e}){return x4e({language:t,...e}),null}w4e.displayName="Track";var k4e=ze(_2),S4e=Le.forwardRef(({children:t,...e},r)=>Le.createElement(k4e,{...e},n=>Le.createElement(we.button,{...n,ref:st(n.ref,r)},t)));S4e.displayName="ToggleButton";var C4e=ze(O2),T4e=Le.forwardRef(({children:t,...e},r)=>Le.createElement(C4e,{src:e.asChild&&Le.isValidElement(t)?t.props.src:void 0,...e},(n,i)=>Le.createElement(pte,{...n,instance:i,ref:st(n.ref,r)},t)));T4e.displayName="Poster";var pte=Le.forwardRef(({instance:t,children:e,...r},n)=>{let{src:i,img:s,alt:a,crossOrigin:o,hidden:l}=t.$state,c=Ut(i),u=Ut(a),d=Ut(o),f=Ut(l);return Le.createElement(we.img,{...r,src:c||void 0,alt:u||void 0,crossOrigin:d||void 0,ref:st(s.set,n),style:{display:f?"none":void 0}},e)});pte.displayName="PosterImg";var E4e=Le.forwardRef(({children:t,...e},r)=>Le.createElement(we.div,{translate:"yes","aria-live":"off","aria-atomic":"true",...e,ref:r},t));E4e.displayName="Caption";var I4e=Le.forwardRef((t,e)=>{let r=Wi("textTrack"),[n,i]=Le.useState();return Le.useEffect(()=>{if(!r)return;function s(){i(r?.activeCues[0])}return r.addEventListener("cue-change",s),()=>{r.removeEventListener("cue-change",s),i(void 0)}},[r]),Le.createElement(we.span,{...t,"data-part":"cue",dangerouslySetInnerHTML:{__html:n?.text||""},ref:e})});I4e.displayName="CaptionText";var MCt=Z(Af(),1);function Yn(t){this.content=t}Yn.prototype={constructor:Yn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),s=n.content.slice();return i==-1?s.push(r||t,e):(s[i+1]=e,r&&(s[i]=r)),new Yn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Yn(r)},addToStart:function(t,e){return new Yn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Yn(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),s=n.find(t);return i.splice(s==-1?i.length:s,0,e,r),new Yn(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Yn.from(t),t.size?new Yn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Yn.from(t),t.size?new Yn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Yn.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};Yn.from=function(t){if(t instanceof Yn)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Yn(e)};var Is=Yn;function Ste(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),s=e.child(n);if(i==s){r+=i.nodeSize;continue}if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)r++;return r}if(i.content.size||s.content.size){let a=Ste(i.content,s.content,r+1);if(a!=null)return a}r+=i.nodeSize}}function Cte(t,e,r,n){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:r,b:n};let a=t.child(--i),o=e.child(--s),l=a.nodeSize;if(a==o){r-=l,n-=l;continue}if(!a.sameMarkup(o))return{a:r,b:n};if(a.isText&&a.text!=o.text){let c=0,u=Math.min(a.text.length,o.text.length);for(;c<u&&a.text[a.text.length-c-1]==o.text[o.text.length-c-1];)c++,r--,n--;return{a:r,b:n}}if(a.content.size||o.content.size){let c=Cte(a.content,o.content,r-1,n-1);if(c)return c}r-=l,n-=l}}var se=class t{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,s){for(let a=0,o=0;o<r;a++){let l=this.content[a],c=o+l.nodeSize;if(c>e&&n(l,i+o,s||null,a)!==!1&&l.content.size){let u=o+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,r-u),n,i+u)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let s="",a=!0;return this.nodesBetween(e,r,(o,l)=>{let c=o.isText?o.text.slice(Math.max(e,l)-l,r-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new t(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let s=0,a=0;a<r;s++){let o=this.content[s],l=a+o.nodeSize;l>e&&((a<e||l>r)&&(o.isText?o=o.cut(Math.max(0,e-a),Math.min(o.text.length,r-a)):o=o.cut(Math.max(0,e-a-1),Math.min(o.content.size,r-a-1))),n.push(o),i+=o.nodeSize),a=l}return new t(n,i)}cutByIndex(e,r){return e==r?t.empty:e==0&&r==this.content.length?this:new t(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),s=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new t(i,s)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return Ste(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return Cte(this,e,r,n)}findIndex(e,r=-1){if(e==0)return X2(0,e);if(e==this.size)return X2(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=this.child(n),a=i+s.nodeSize;if(a>=e)return a==e||r>0?X2(n+1,a):X2(n,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return t.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let r,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(r||(r=e.slice(0,i)),r[r.length-1]=s.withText(r[r.length-1].text+s.text)):r&&r.push(s)}return new t(r||e,n)}static from(e){if(!e)return t.empty;if(e instanceof t)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};se.empty=new se([],0);var yF={index:0,offset:0};function X2(t,e){return yF.index=t,yF.offset=e,yF}function Z2(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Z2(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Z2(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}var ct=class t{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))r||(r=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(s)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Z2(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return t.none;if(e instanceof t)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};ct.none=[];var kp=class extends Error{},oe=class t{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=Ete(this.content,e+this.openStart,r);return n&&new t(n,this.openStart,this.openEnd)}removeBetween(e,r){return new t(Tte(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return t.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(se.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.lastChild)i++;return new t(e,n,i)}};oe.empty=new oe(se.empty,0,0);function Tte(t,e,r){let{index:n,offset:i}=t.findIndex(e),s=t.maybeChild(n),{index:a,offset:o}=t.findIndex(r);if(i==e||s.isText){if(o!=r&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(n,s.copy(Tte(s.content,e-i-1,r-i-1)))}function Ete(t,e,r,n){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return n&&!n.canReplace(i,i,r)?null:t.cut(0,e).append(r).append(t.cut(e));let o=Ete(a.content,e-s-1,r);return o&&t.replaceChild(i,a.copy(o))}function A4e(t,e,r){if(r.openStart>t.depth)throw new kp("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new kp("Inconsistent open depths");return Ite(t,e,r,0)}function Ite(t,e,r,n){let i=t.index(n),s=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let a=Ite(t,e,r,n+1);return s.copy(s.content.replaceChild(i,a))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let a=t.parent,o=a.content;return wp(a,o.cut(0,t.parentOffset).append(r.content).append(o.cut(e.parentOffset)))}else{let{start:a,end:o}=P4e(r,t);return wp(s,Pte(t,a,o,e,n))}else return wp(s,J2(t,e,n))}function Ate(t,e){if(!e.type.compatibleContent(t.type))throw new kp("Cannot join "+e.type.name+" onto "+t.type.name)}function bF(t,e,r){let n=t.node(r);return Ate(n,e.node(r)),n}function xp(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function _w(t,e,r,n){let i=(e||t).node(r),s=0,a=e?e.index(r):i.childCount;t&&(s=t.index(r),t.depth>r?s++:t.textOffset&&(xp(t.nodeAfter,n),s++));for(let o=s;o<a;o++)xp(i.child(o),n);e&&e.depth==r&&e.textOffset&&xp(e.nodeBefore,n)}function wp(t,e){return t.type.checkContent(e),t.copy(e)}function Pte(t,e,r,n,i){let s=t.depth>i&&bF(t,e,i+1),a=n.depth>i&&bF(r,n,i+1),o=[];return _w(null,t,i,o),s&&a&&e.index(i)==r.index(i)?(Ate(s,a),xp(wp(s,Pte(t,e,r,n,i+1)),o)):(s&&xp(wp(s,J2(t,e,i+1)),o),_w(e,r,i,o),a&&xp(wp(a,J2(r,n,i+1)),o)),_w(n,null,i,o),new se(o)}function J2(t,e,r){let n=[];if(_w(null,t,r,n),t.depth>r){let i=bF(t,e,r+1);xp(wp(i,J2(t,e,r+1)),n)}return _w(e,null,r,n),new se(n)}function P4e(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let s=r-1;s>=0;s--)i=e.node(s).copy(se.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}var eI=class t{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let s=0;s<e;s++)i+=n.child(s).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return ct.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let o=n;n=i,i=o}let s=n.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<n.length;s++)n[s].type.spec.inclusive===!1&&(!i||!n[s].isInSet(i.marks))&&(n=n[s--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new wF(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,s=r;for(let a=e;;){let{index:o,offset:l}=a.content.findIndex(s),c=s-l;if(n.push(a,o,i+l),!c||(a=a.child(o),a.isText))break;s=c-1,i+=l+1}return new t(r,n,s)}static resolveCached(e,r){let n=hte.get(e);if(n)for(let s=0;s<n.elts.length;s++){let a=n.elts[s];if(a.pos==r)return a}else hte.set(e,n=new xF);let i=n.elts[n.i]=t.resolve(e,r);return n.i=(n.i+1)%R4e,i}},xF=class{constructor(){this.elts=[],this.i=0}},R4e=12,hte=new WeakMap,wF=class{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},L4e=Object.create(null),As=class t{constructor(e,r,n,i=ct.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||se.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&Z2(this.attrs,r||e.defaultAttrs||L4e)&&ct.sameSet(this.marks,n||ct.none)}copy(e=null){return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return oe.empty;let i=this.resolve(e),s=this.resolve(r),a=n?0:i.sharedDepth(r),o=i.start(a),c=i.node(a).content.cut(i.pos-o,s.pos-o);return new oe(c,i.depth-a,s.depth-a)}replace(e,r,n){return A4e(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return eI.resolveCached(this,e)}resolveNoCache(e){return eI.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Rte(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=se.empty,i=0,s=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,i,s),o=a&&a.matchFragment(this.content,r);if(!o||!o.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(n),a=s&&s.matchFragment(this.content,r);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ct.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ct.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=se.fromJSON(e,r.content),s=e.nodeType(r.type).create(r.attrs,i,n);return s.type.checkAttrs(s.attrs),s}};As.prototype.text=void 0;var kF=class t extends As{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Rte(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Rte(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}var Sp=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new SF(e,r);if(n.next==null)return t.empty;let i=Lte(n);n.next&&n.err("Unexpected trailing text");let s=B4e(F4e(i));return V4e(s,n),s}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let s=r;i&&s<n;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function s(a,o){let l=a.matchFragment(e,n);if(l&&(!r||l.validEnd))return se.from(o.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:u,next:d}=a.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,o.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:o,next:l}=s.next[a];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in r)&&(!i.type||l.validEnd)&&(n.push({match:o.contentMatch,type:o,via:i}),r[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let a=0;a<n.next.length;a++)s+=(a?", ":"")+n.next[a].type.name+"->"+e.indexOf(n.next[a].next);return s}).join(`
`)}};Sp.empty=new Sp(!0);var SF=class{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function Lte(t){let e=[];do e.push(M4e(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function M4e(t){let e=[];do e.push(_4e(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function _4e(t){let e=N4e(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=O4e(t,e);else break;return e}function mte(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function O4e(t,e){let r=mte(t),n=r;return t.eat(",")&&(t.next!="}"?n=mte(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function D4e(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let s in r){let a=r[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function N4e(t){if(t.eat("(")){let e=Lte(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=D4e(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function F4e(t){let e=[[]];return i(s(t,0),r()),e;function r(){return e.push([])-1}function n(a,o,l){let c={term:l,to:o};return e[a].push(c),c}function i(a,o){a.forEach(l=>l.to=o)}function s(a,o){if(a.type=="choice")return a.exprs.reduce((l,c)=>l.concat(s(c,o)),[]);if(a.type=="seq")for(let l=0;;l++){let c=s(a.exprs[l],o);if(l==a.exprs.length-1)return c;i(c,o=r())}else if(a.type=="star"){let l=r();return n(o,l),i(s(a.expr,l),l),[n(l)]}else if(a.type=="plus"){let l=r();return i(s(a.expr,o),l),i(s(a.expr,l),l),[n(l)]}else{if(a.type=="opt")return[n(o)].concat(s(a.expr,o));if(a.type=="range"){let l=o;for(let c=0;c<a.min;c++){let u=r();i(s(a.expr,l),u),l=u}if(a.max==-1)i(s(a.expr,l),l);else for(let c=a.min;c<a.max;c++){let u=r();n(l,u),i(s(a.expr,l),u),l=u}return[n(l)]}else{if(a.type=="name")return[n(o,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Mte(t,e){return e-t}function gte(t,e){let r=[];return n(e),r.sort(Mte);function n(i){let s=t[i];if(s.length==1&&!s[0].term)return n(s[0].to);r.push(i);for(let a=0;a<s.length;a++){let{term:o,to:l}=s[a];!o&&r.indexOf(l)==-1&&n(l)}}}function B4e(t){let e=Object.create(null);return r(gte(t,0));function r(n){let i=[];n.forEach(a=>{t[a].forEach(({term:o,to:l})=>{if(!o)return;let c;for(let u=0;u<i.length;u++)i[u][0]==o&&(c=i[u][1]);gte(t,l).forEach(u=>{c||i.push([o,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[n.join(",")]=new Sp(n.indexOf(t.length-1)>-1);for(let a=0;a<i.length;a++){let o=i[a][1].sort(Mte);s.next.push({type:i[a][0],next:e[o.join(",")]||r(o)})}return s}}function V4e(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],s=!i.validEnd,a=[];for(let o=0;o<i.next.length;o++){let{type:l,next:c}=i.next[o];a.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),n.indexOf(c)==-1&&n.push(c)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function _te(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function Ote(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let s=t[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function Dte(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function Nte(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new CF(t,n,e[n]);return r}var tI=class t{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Nte(e,n.attrs),this.defaultAttrs=_te(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Sp.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ote(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new As(this,this.computeAttrs(e),se.from(r),ct.setFrom(n))}createChecked(e=null,r,n){return r=se.from(r),this.checkContent(r),new As(this,this.computeAttrs(e),r,ct.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=se.from(r),r.size){let a=this.contentMatch.fillBefore(r);if(!a)return null;r=a.append(r)}let i=this.contentMatch.matchFragment(r),s=i&&i.fillBefore(se.empty,!0);return s?new As(this,e,r.append(s),ct.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Dte(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:ct.none:e}static compile(e,r){let n=Object.create(null);e.forEach((s,a)=>n[s]=new t(s,r,a));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function j4e(t,e,r){let n=r.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${s}`)}}var CF=class{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?j4e(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Dw=class t{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=Nte(e,i.attrs),this.excluded=null;let s=_te(this.attrs);this.instance=s?new ct(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ct(this,Ote(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((s,a)=>n[s]=new t(s,i++,r,a)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){Dte(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},rI=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=Is.from(e.nodes),r.marks=Is.from(e.marks||{}),this.nodes=tI.compile(this.spec.nodes,this),this.marks=Dw.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",o=s.spec.marks;if(s.contentMatch=n[a]||(n[a]=Sp.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=o=="_"?null:o?yte(this,o.split(" ")):o==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:yte(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof tI){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new kF(n,n.defaultAttrs,e,ct.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeFromJSON(e){return As.fromJSON(this,e)}markFromJSON(e){return ct.fromJSON(this,e)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}};function yte(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],s=t.marks[i],a=s;if(s)r.push(s);else for(let o in t.marks){let l=t.marks[o];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function $4e(t){return t.tag!=null}function U4e(t){return t.style!=null}var Cp=class t{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if($4e(i))this.tags.push(i);else if(U4e(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,r={}){let n=new nI(this,r,!1);return n.addAll(e,ct.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new nI(this,r,!0);return n.addAll(e,ct.none,r.from,r.to),oe.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(H4e(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||r.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,r,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],o=a.style;if(!(o.indexOf(e)!=0||a.context&&!n.matchesContext(a.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=r))){if(a.getAttrs){let l=a.getAttrs(r);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(e){let r=[];function n(i){let s=i.priority==null?50:i.priority,a=0;for(;a<r.length;a++){let o=r[a];if((o.priority==null?50:o.priority)<s)break}r.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{n(a=bte(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{n(a=bte(a)),a.node||a.ignore||a.mark||(a.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}},Fte={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},z4e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Bte={ol:!0,ul:!0},Nw=1,TF=2,Ow=4;function vte(t,e,r){return e!=null?(e?Nw:0)|(e==="full"?TF:0):t&&t.whitespace=="pre"?Nw|TF:r&~Ow}var yg=class{constructor(e,r,n,i,s,a){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=a,this.content=[],this.activeMarks=ct.none,this.match=s||(a&Ow?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(se.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Nw)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let r=se.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(se.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Fte.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},nI=class{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,s,a=vte(null,r.preserveWhitespace,0)|(n?Ow:0);i?s=new yg(i.type,i.attrs,ct.none,!0,r.topMatch||i.type.contentMatch,a):n?s=new yg(null,null,ct.none,!0,null,a):s=new yg(e.schema.topNodeType,null,ct.none,!0,null,a),this.nodes=[s],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,s=i.options&TF?"full":this.localPreserveWS||(i.options&Nw)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)s!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
`);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],o=e.previousSibling;(!a||o&&o.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),r),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Bte.hasOwnProperty(a)&&this.parser.normalizeLists&&q4e(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(l?l.ignore:z4e.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(Fte.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let d=l&&l.skip?r:this.readStyles(e,r);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,r);c&&this.addElementByRule(e,l,c,l.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=n.getPropertyValue(s);if(a)for(let o=void 0;;){let l=this.parser.matchStyle(s,a,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(c=>!l.clearMark(c)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return r}addElementByRule(e,r,n,i){let s,a;if(r.node)if(a=this.parser.schema.nodes[r.node],a.isLeaf)this.insertNode(a.create(r.attrs),n)||this.leafFallback(e,n);else{let l=this.enter(a,r.attrs||null,n,r.preserveWhitespace);l&&(s=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}s&&this.sync(o)&&this.open--}addAll(e,r,n,i){let s=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=i==null?null:e.childNodes[i];a!=o;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,r);this.findAtPoint(e,s)}findPlace(e,r){let n,i;for(let s=this.open;s>=0;s--){let a=this.nodes[s],o=a.findWrapping(e);if(o&&(!n||n.length>o.length)&&(n=o,i=a,!o.length)||a.solid)break}if(!n)return null;this.sync(i);for(let s=0;s<n.length;s++)r=this.enterInner(n[s],null,r,!1);return r}insertNode(e,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(r=this.enterInner(i,null,r))}let n=this.findPlace(e,r);if(n){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=ct.none;for(let a of n.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):xte(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,r,n,i){let s=this.findPlace(e.create(r),n);return s&&(s=this.enterInner(e,r,n,!0,i)),s}enterInner(e,r,n,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=vte(e,s,a.options);a.options&Ow&&a.content.length==0&&(o|=Ow);let l=ct.none;return n=n.filter(c=>(a.type?a.type.allowsMarkType(c.type):xte(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new yg(e,r,l,i,null,o)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=Nw)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),a=(o,l)=>{for(;o>=0;o--){let c=r[o];if(c==""){if(o==r.length-1||o==0)continue;for(;l>=s;l--)if(a(o-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:n&&l>=s?n.node(l-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return a(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}};function q4e(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Bte.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function H4e(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function bte(t){let e={};for(let r in t)e[r]=t[r];return e}function xte(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let s=[],a=o=>{s.push(o);for(let l=0;l<o.edgeCount;l++){let{type:c,next:u}=o.edge(l);if(c==e||s.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}var Ps=class t{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=vF(r).createDocumentFragment());let i=n,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let o=0,l=0;for(;o<s.length&&l<a.marks.length;){let c=a.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[o][0])||c.type.spec.spanning===!1)break;o++,l++}for(;o<s.length;)i=s.pop()[1];for(;l<a.marks.length;){let c=a.marks[l++],u=this.serializeMark(c,a.isInline,r);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=Q2(vF(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,r);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&Q2(vF(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return Q2(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=wte(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return wte(e.marks)}};function wte(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function vF(t){return t.document||window.document}var kte=new WeakMap;function G4e(t){let e=kte.get(t);return e===void 0&&kte.set(t,e=W4e(t)),e}function W4e(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function Q2(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=G4e(n))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(r=i.slice(0,a),i=i.slice(a+1));let o,l=r?t.createElementNS(r,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:h}=Q2(t,f,r,n);if(l.appendChild(p),h){if(o)throw new RangeError("Multiple content holes");o=h}}}return{dom:l,contentDOM:o}}var jte=65535,$te=Math.pow(2,16);function K4e(t,e){return t+e*$te}function Vte(t){return t&jte}function Y4e(t){return(t-(t&jte))/$te}var Ute=1,zte=2,iI=4,qte=8,Vw=class{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&qte)>0}get deletedBefore(){return(this.delInfo&(Ute|iI))>0}get deletedAfter(){return(this.delInfo&(zte|iI))>0}get deletedAcross(){return(this.delInfo&iI)>0}},pc=class t{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&t.empty)return t.empty}recover(e){let r=0,n=Vte(e);if(!this.inverted)for(let i=0;i<n;i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+Y4e(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[o+s],u=this.ranges[o+a],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:r:r,p=l+i+(f<0?0:u);if(n)return p;let h=e==(r<0?l:d)?null:K4e(o/3,e-l),m=e==l?zte:e==d?Ute:iI;return(r<0?e!=l:e!=d)&&(m|=qte),new Vw(p,m,h)}i+=u-c}return n?e+i:new Vw(e+i,0,null)}touches(e,r){let n=0,i=Vte(r),s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[o+s],u=l+c;if(e<=u&&o==i*3)return!0;n+=this.ranges[o+a]-c}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],o=a-(this.inverted?s:0),l=a+(this.inverted?0:s),c=this.ranges[i+r],u=this.ranges[i+n];e(o,o+c,l,l+u),s+=u-c}}invert(){return new t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?t.empty:new t(e<0?[0,-e,0]:[0,0,e])}};pc.empty=new pc([]);var jw=class t{constructor(e,r,n=0,i=e?e.length:0){this.mirror=r,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new t(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let i=e.getMirror(r);this.appendMap(e._maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],o=a.mapResult(e,r);if(o.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return n?e:new Vw(e,i,null)}},EF=Object.create(null),mn=class{getMap(){return pc.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=EF[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in EF)throw new RangeError("Duplicate use of step JSON ID "+e);return EF[e]=r,r.prototype.jsonID=e,r}},_n=class t{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new t(e,null)}static fail(e){return new t(null,e)}static fromReplace(e,r,n,i){try{return t.ok(e.replace(r,n,i))}catch(s){if(s instanceof kp)return t.fail(s.message);throw s}}};function LF(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(LF(s.content,e,s))),s.isInline&&(s=e(s,r,i)),n.push(s)}return se.fromArray(n)}var $w=class t extends mn{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new oe(LF(r.content,(a,o)=>!a.isAtom||!o.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),r.openStart,r.openEnd);return _n.fromReplace(e,this.from,this.to,s)}invert(){return new Tp(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new t(r.pos,n.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(r.from,r.to,e.markFromJSON(r.mark))}};mn.jsonID("addMark",$w);var Tp=class t extends mn{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new oe(LF(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return _n.fromReplace(e,this.from,this.to,n)}invert(){return new $w(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new t(r.pos,n.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(r.from,r.to,e.markFromJSON(r.mark))}};mn.jsonID("removeMark",Tp);var Uw=class t extends mn{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return _n.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return _n.fromReplace(e,this.pos,this.pos+1,new oe(se.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new t(this.pos,r.marks[i]);return new t(this.pos,this.mark)}}return new zw(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new t(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new t(r.pos,e.markFromJSON(r.mark))}};mn.jsonID("addNodeMark",Uw);var zw=class t extends mn{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return _n.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return _n.fromReplace(e,this.pos,this.pos+1,new oe(se.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new Uw(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new t(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new t(r.pos,e.markFromJSON(r.mark))}};mn.jsonID("removeNodeMark",zw);var Ki=class t extends mn{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&PF(e,this.from,this.to)?_n.fail("Structure replace would overwrite content"):_n.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new pc([this.from,this.to-this.from,this.slice.size])}invert(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new t(r.pos,Math.max(r.pos,n.pos),this.slice)}merge(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?oe.empty:new oe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?oe.empty:new oe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(r.from,r.to,oe.fromJSON(e,r.slice),!!r.structure)}};mn.jsonID("replace",Ki);var Rs=class t extends mn{constructor(e,r,n,i,s,a,o=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=a,this.structure=o}apply(e){if(this.structure&&(PF(e,this.from,this.gapFrom)||PF(e,this.gapTo,this.to)))return _n.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return _n.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?_n.fromReplace(e,this.from,this.to,n):_n.fail("Content does not fit in gap")}getMap(){return new pc([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||s>n.pos?null:new t(r.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(r.from,r.to,r.gapFrom,r.gapTo,oe.fromJSON(e,r.slice),r.insert,!!r.structure)}};mn.jsonID("replaceAround",Rs);function PF(t,e,r){let n=t.resolve(e),i=r-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let a=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function X4e(t,e,r,n){let i=[],s=[],a,o;t.doc.nodesBetween(e,r,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,r),h=n.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(h)||(a&&a.to==f&&a.mark.eq(d[m])?a.to=p:i.push(a=new Tp(f,p,d[m])));o&&o.to==f?o.to=p:s.push(o=new $w(f,p,n))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function Q4e(t,e,r,n){let i=[],s=0;t.doc.nodesBetween(e,r,(a,o)=>{if(!a.isInline)return;s++;let l=null;if(n instanceof Dw){let c=a.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(a.marks)&&(l=[n]):l=a.marks;if(l&&l.length){let c=Math.min(o+a.nodeSize,r);for(let u=0;u<l.length;u++){let d=l[u],f;for(let p=0;p<i.length;p++){let h=i[p];h.step==s-1&&d.eq(i[p].style)&&(f=h)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(o,e),to:c,step:s})}}}),i.forEach(a=>t.step(new Tp(a.from,a.to,a.style)))}function MF(t,e,r,n=r.contentMatch,i=!0){let s=t.doc.nodeAt(e),a=[],o=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),u=o+c.nodeSize,d=n.matchType(c.type);if(!d)a.push(new Ki(o,u,oe.empty));else{n=d;for(let f=0;f<c.marks.length;f++)r.allowsMarkType(c.marks[f].type)||t.step(new Tp(o,u,c.marks[f]));if(i&&c.isText&&r.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new oe(se.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),a.push(new Ki(o+f.index,o+f.index+f[0].length,h))}}o=u}if(!n.validEnd){let l=n.fillBefore(se.empty,!0);t.replace(o,o,new oe(l,0,0))}for(let l=a.length-1;l>=0;l--)t.step(a[l])}function Z4e(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function lI(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let i=t.$from.node(n),s=t.$from.index(n),a=t.$to.indexAfter(n);if(n<t.depth&&i.canReplace(s,a,r))return n;if(n==0||i.type.spec.isolating||!Z4e(i,s,a))break}return null}function J4e(t,e,r){let{$from:n,$to:i,depth:s}=e,a=n.before(s+1),o=i.after(s+1),l=a,c=o,u=se.empty,d=0;for(let h=s,m=!1;h>r;h--)m||n.index(h)>0?(m=!0,u=se.from(n.node(h).copy(u)),d++):l--;let f=se.empty,p=0;for(let h=s,m=!1;h>r;h--)m||i.after(h+1)<i.end(h)?(m=!0,f=se.from(i.node(h).copy(f)),p++):c++;t.step(new Rs(l,c,a,o,new oe(u.append(f),d,p),u.size-d,!0))}function eFe(t,e,r){let n=se.empty;for(let a=r.length-1;a>=0;a--){if(n.size){let o=r[a].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=se.from(r[a].type.create(r[a].attrs,n))}let i=e.start,s=e.end;t.step(new Rs(i,s,i,s,new oe(n,0,0),r.length,!0))}function tFe(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,r,(a,o)=>{let l=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(n,l)&&rFe(t.doc,t.mapping.slice(s).map(o),n)){let c=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",h=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0)}c===!1&&Gte(t,a,o,s),MF(t,t.mapping.slice(s).map(o,1),n,void 0,c===null);let u=t.mapping.slice(s),d=u.map(o,1),f=u.map(o+a.nodeSize,1);return t.step(new Rs(d,f,d+1,f-1,new oe(se.from(n.create(l,null,a.marks)),0,0),1,!0)),c===!0&&Hte(t,a,o,s),!1}})}function Hte(t,e,r,n){e.forEach((i,s)=>{if(i.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(i.text);){let l=t.mapping.slice(n).map(r+1+s+a.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Gte(t,e,r,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(n).map(r+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
`))}})}function rFe(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function nFe(t,e,r,n,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");r||(r=s.type);let a=r.create(n,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!r.validContent(s.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new Rs(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new oe(se.from(a),0,0),1,!0))}function hc(t,e,r=1,n){let i=t.resolve(e),s=i.depth-r,a=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=r-2;c>s;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=n&&n[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let o=i.indexAfter(s),l=n&&n[0];return i.node(s).canReplaceWith(o,o,l?l.type:i.node(s+1).type)}function iFe(t,e,r=1,n){let i=t.doc.resolve(e),s=se.empty,a=se.empty;for(let o=i.depth,l=i.depth-r,c=r-1;o>l;o--,c--){s=se.from(i.node(o).copy(s));let u=n&&n[c];a=se.from(u?u.type.create(u.attrs,a):i.node(o).copy(a))}t.step(new Ki(e,e,new oe(s.append(a),r,r),!0))}function _F(t,e){let r=t.resolve(e),n=r.index();return aFe(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function sFe(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),a=s.type==n?t.type.schema.nodes.text:s.type;if(r=r.matchType(a),!r||!t.type.allowsMarks(s.marks))return!1}return r.validEnd}function aFe(t,e){return!!(t&&e&&!t.isLeaf&&sFe(t,e))}function oFe(t,e,r){let n=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-r),a=s.node().type;if(i&&a.inlineContent){let u=a.whitespace=="pre",d=!!a.contentMatch.matchType(i);u&&!d?n=!1:!u&&d&&(n=!0)}let o=t.steps.length;if(n===!1){let u=t.doc.resolve(e+r);Gte(t,u.node(),u.before(),o)}a.inlineContent&&MF(t,e+r-1,a,s.node().contentMatchAt(s.index()),n==null);let l=t.mapping.slice(o),c=l.map(e-r);if(t.step(new Ki(c,l.map(e+r,-1),oe.empty,!0)),n===!0){let u=t.doc.resolve(c);Hte(t,u.node(),u.before(),t.steps.length)}return t}function lFe(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,r))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,r))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function cI(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let i=r.content;for(let s=0;s<r.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(r.openStart==0&&r.size?2:1);s++)for(let a=n.depth;a>=0;a--){let o=a==n.depth?0:n.pos<=(n.start(a+1)+n.end(a+1))/2?-1:1,l=n.index(a)+(o>0?1:0),c=n.node(a),u=!1;if(s==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return o==0?n.pos:o<0?n.before(a+1):n.after(a+1)}return null}function qw(t,e,r=e,n=oe.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),s=t.resolve(r);return Wte(i,s,n)?new Ki(e,r,n):new RF(i,s,n).fit()}function Wte(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}var RF=class{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=se.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=se.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,a=n.depth,o=i.depth;for(;a&&o&&s.childCount==1;)s=s.firstChild.content,a--,o--;let l=new oe(s,a,o);return e>-1?new Rs(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Ki(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=r.firstChild;if(r.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}r=s.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=IF(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:l,match:c}=this.frontier[o],u,d=null;if(r==1&&(a?c.matchType(a.type)||(d=c.fillBefore(se.from(a),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:o,parent:s,inject:d};if(r==2&&a&&(u=c.findWrapping(a.type)))return{sliceDepth:n,frontierDepth:o,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=IF(e,r);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new oe(e,r+1,Math.max(n,i.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,i=IF(e,r);if(i.childCount<=1&&r>0){let s=e.size-r<=r+i.size;this.unplaced=new oe(Fw(e,r-1,1),r-1,s?r-1:n)}else this.unplaced=new oe(Fw(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:i,wrap:s}){for(;this.depth>r;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let a=this.unplaced,o=n?n.content:a.content,l=a.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[r];if(i){for(let m=0;m<i.childCount;m++)u.push(i.child(m));d=d.matchFragment(i)}let p=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let m=o.child(c),v=d.matchType(m.type);if(!v)break;c++,(c>1||l==0||m.content.size)&&(d=v,u.push(Kte(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==o.childCount?p:-1)))}let h=c==o.childCount;h||(p=-1),this.placed=Bw(this.placed,r,se.from(u)),this.frontier[r].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,v=o;m<p;m++){let b=v.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),v=b.content}this.unplaced=h?e==0?oe.empty:new oe(Fw(a.content,e-1,1),e-1,p<0?a.openEnd:e-1):new oe(Fw(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!AF(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:i}=this.frontier[r],s=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),a=AF(e,r,i,n,s);if(a){for(let o=r-1;o>=0;o--){let{match:l,type:c}=this.frontier[o],u=AF(e,o,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:a,move:s?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Bw(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,r=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Bw(this.placed,this.depth,se.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(se.empty,!0);r.childCount&&(this.placed=Bw(this.placed,this.frontier.length,r))}};function Fw(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Fw(t.firstChild.content,e-1,r)))}function Bw(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Bw(t.lastChild.content,e-1,r)))}function IF(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function Kte(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,Kte(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(se.empty,!0)))),t.copy(n)}function AF(t,e,r,n,i){let s=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==s.childCount&&!r.compatibleContent(s.type))return null;let o=n.fillBefore(s.content,!0,a);return o&&!cFe(r,s.content,a)?o:null}function cFe(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function uFe(t){return t.spec.defining||t.spec.definingForContent}function dFe(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let i=t.doc.resolve(e),s=t.doc.resolve(r);if(Wte(i,s,n))return t.step(new Ki(e,r,n));let a=Xte(i,t.doc.resolve(r));a[a.length-1]==0&&a.pop();let o=-(i.depth+1);a.unshift(o);for(let f=i.depth,p=i.pos-1;f>0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(f)>-1?o=f:i.before(f)==p&&a.splice(1,0,-f)}let l=a.indexOf(o),c=[],u=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=uFe(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(o)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+u+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m<a.length;m++){let v=a[(m+l)%a.length],b=!0;v<0&&(b=!1,v=-v);let y=i.node(v-1),x=i.index(v-1);if(y.canReplaceWith(x,x,h.type,h.marks))return t.replace(i.before(v),b?s.after(v):r,new oe(Yte(n.content,0,n.openStart,p),p,n.openEnd))}}let d=t.steps.length;for(let f=a.length-1;f>=0&&(t.replace(e,r,n),!(t.steps.length>d));f--){let p=a[f];p<0||(e=i.before(p),r=s.after(p))}}function Yte(t,e,r,n,i){if(e<r){let s=t.firstChild;t=t.replaceChild(0,s.copy(Yte(s.content,e+1,r,n,s)))}if(e>n){let s=i.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(se.empty,!0))}return t}function fFe(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=lFe(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new oe(se.from(n),0,0))}function pFe(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r),s=Xte(n,i);for(let a=0;a<s.length;a++){let o=s[a],l=a==s.length-1;if(l&&o==0||n.node(o).type.contentMatch.validEnd)return t.delete(n.start(o),i.end(o));if(o>0&&(l||n.node(o-1).canReplace(n.index(o-1),i.indexAfter(o-1))))return t.delete(n.before(o),i.after(o))}for(let a=1;a<=n.depth&&a<=i.depth;a++)if(e-n.start(a)==n.depth-a&&r>n.end(a)&&i.end(a)-r!=i.depth-a&&n.start(a-1)==i.start(a-1)&&n.node(a-1).canReplace(n.index(a-1),i.index(a-1)))return t.delete(n.before(a),r);t.delete(e,r)}function Xte(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let i=n;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&r.push(i)}return r}var sI=class t extends mn{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return _n.fail("No node at attribute step's position");let n=Object.create(null);for(let s in r.attrs)n[s]=r.attrs[s];n[this.attr]=this.value;let i=r.type.create(n,null,r.marks);return _n.fromReplace(e,this.pos,this.pos+1,new oe(se.from(i),0,r.isLeaf?0:1))}getMap(){return pc.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new t(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(r.pos,r.attr,r.value)}};mn.jsonID("attr",sI);var aI=class t extends mn{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let i in e.attrs)r[i]=e.attrs[i];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return _n.ok(n)}getMap(){return pc.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(r.attr,r.value)}};mn.jsonID("docAttr",aI);var vg=class extends Error{};vg=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};vg.prototype=Object.create(Error.prototype);vg.prototype.constructor=vg;vg.prototype.name="TransformError";var oI=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new jw}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new vg(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=oe.empty){let i=qw(this.doc,e,r,n);return i&&this.step(i),this}replaceWith(e,r,n){return this.replace(e,r,new oe(se.from(n),0,0))}delete(e,r){return this.replace(e,r,oe.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return dFe(this,e,r,n),this}replaceRangeWith(e,r,n){return fFe(this,e,r,n),this}deleteRange(e,r){return pFe(this,e,r),this}lift(e,r){return J4e(this,e,r),this}join(e,r=1){return oFe(this,e,r),this}wrap(e,r){return eFe(this,e,r),this}setBlockType(e,r=e,n,i=null){return tFe(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return nFe(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new sI(e,r,n)),this}setDocAttribute(e,r){return this.step(new aI(e,r)),this}addNodeMark(e,r){return this.step(new Uw(e,r)),this}removeNodeMark(e,r){if(!(r instanceof ct)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r=r.isInSet(n.marks),!r)return this}return this.step(new zw(e,r)),this}split(e,r=1,n){return iFe(this,e,r,n),this}addMark(e,r,n){return X4e(this,e,r,n),this}removeMark(e,r,n){return Q4e(this,e,r,n),this}clearIncompatible(e,r,n){return MF(this,e,r,n),this}};var OF=Object.create(null),Fe=class{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new xg(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=oe.empty){let n=r.content.lastChild,i=null;for(let o=0;o<r.openEnd;o++)i=n,n=n.lastChild;let s=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:l,$to:c}=a[o],u=e.mapping.slice(s);e.replaceRange(u.map(l.pos),u.map(c.pos),o?oe.empty:r),o==0&&Jte(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,r){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:o}=i[s],l=e.mapping.slice(n),c=l.map(a.pos),u=l.map(o.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,r),Jte(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let i=e.parent.inlineContent?new Ze(e):bg(e.node(0),e.parent,e.pos,e.index(),r,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=r<0?bg(e.node(0),e.node(s),e.before(s+1),e.index(s),r,n):bg(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,r,n);if(a)return a}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new Xn(e.node(0))}static atStart(e){return bg(e,e,0,0,1)||new Xn(e)}static atEnd(e){return bg(e,e,e.content.size,e.childCount,-1)||new Xn(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=OF[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in OF)throw new RangeError("Duplicate use of selection JSON ID "+e);return OF[e]=r,r.prototype.jsonID=e,r}getBookmark(){return Ze.between(this.$anchor,this.$head).getBookmark()}};Fe.prototype.visible=!0;var xg=class{constructor(e,r){this.$from=e,this.$to=r}},Qte=!1;function Zte(t){!Qte&&!t.parent.inlineContent&&(Qte=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var Ze=class t extends Fe{constructor(e,r=e){Zte(e),Zte(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return Fe.near(n);let i=e.resolve(r.map(this.anchor));return new t(i.parent.inlineContent?i:n,n)}replace(e,r=oe.empty){if(super.replace(e,r),r==oe.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new dI(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let i=e.resolve(r);return new this(i,n==r?i:e.resolve(n))}static between(e,r,n){let i=e.pos-r.pos;if((!n||i)&&(n=i>=0?1:-1),!r.parent.inlineContent){let s=Fe.findFrom(r,n,!0)||Fe.findFrom(r,-n,!0);if(s)r=s.$head;else return Fe.near(r,n)}return e.parent.inlineContent||(i==0?e=r:(e=(Fe.findFrom(e,-n,!0)||Fe.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=i<0&&(e=r))),new t(e,r)}};Fe.jsonID("text",Ze);var dI=class t{constructor(e,r){this.anchor=e,this.head=r}map(e){return new t(e.map(this.anchor),e.map(this.head))}resolve(e){return Ze.between(e.resolve(this.anchor),e.resolve(this.head))}},_e=class t extends Fe{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r}map(e,r){let{deleted:n,pos:i}=r.mapResult(this.anchor),s=e.resolve(i);return n?Fe.near(s):new t(s)}content(){return new oe(se.from(this.node),0,0)}eq(e){return e instanceof t&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new NF(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(r.anchor))}static create(e,r){return new t(e.resolve(r))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};_e.prototype.visible=!1;Fe.jsonID("node",_e);var NF=class t{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new dI(n,n):new t(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&_e.isSelectable(n)?new _e(r):Fe.near(r)}},Xn=class t extends Fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,r=oe.empty){if(r==oe.empty){e.delete(0,e.doc.content.size);let n=Fe.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(e){return new t(e)}map(e){return new t(e)}eq(e){return e instanceof t}getBookmark(){return hFe}};Fe.jsonID("all",Xn);var hFe={map(){return this},resolve(t){return new Xn(t)}};function bg(t,e,r,n,i,s=!1){if(e.inlineContent)return Ze.create(t,r);for(let a=n-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let o=e.child(a);if(o.isAtom){if(!s&&_e.isSelectable(o))return _e.create(t,r-(i<0?o.nodeSize:0))}else{let l=bg(t,o,r+i,i<0?o.childCount:0,i,s);if(l)return l}r+=o.nodeSize*i}return null}function Jte(t,e,r){let n=t.steps.length-1;if(n<e)return;let i=t.steps[n];if(!(i instanceof Ki||i instanceof Rs))return;let s=t.mapping.maps[n],a;s.forEach((o,l,c,u)=>{a==null&&(a=u)}),t.setSelection(Fe.near(t.doc.resolve(a),r))}var ere=1,uI=2,tre=4,FF=class extends oI{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|ere)&~uI,this.storedMarks=null,this}get selectionSet(){return(this.updated&ere)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=uI,this}ensureMarks(e){return ct.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&uI)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~uI,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||ct.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let i=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!e)return this.deleteRange(r,n);let s=this.storedMarks;if(!s){let a=this.doc.resolve(r);s=n==r?a.marks():a.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,i.text(e,s)),this.selection.empty||this.setSelection(Fe.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=tre,this}get scrolledIntoView(){return(this.updated&tre)>0}};function rre(t,e){return!e||!t?t:t.bind(e)}var Ep=class{constructor(e,r,n){this.name=e,this.init=rre(r.init,n),this.apply=rre(r.apply,n)}},mFe=[new Ep("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ep("selection",{init(t,e){return t.selection||Fe.atStart(e.doc)},apply(t){return t.selection}}),new Ep("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new Ep("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],Hw=class{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=mFe.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Ep(n.key,n.spec.state,n))})}},Gw=class t{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let r=[e],n=this.applyInner(e),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let l=i?i[a].n:0,c=i?i[a].state:this,u=l<r.length&&o.spec.appendTransaction.call(o,l?r.slice(l):r,c,n);if(u&&n.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<a?{state:n,n:r.length}:{state:this,n:0})}r.push(u),n=n.applyInner(u),s=!0}i&&(i[a]={state:n,n:r.length})}}if(!s)return{state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new t(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let s=n[i];r[s.name]=s.apply(e,this[s.name],this,r)}return r}get tr(){return new FF(this)}static create(e){let r=new Hw(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new t(r);for(let i=0;i<r.fields.length;i++)n[r.fields[i].name]=r.fields[i].init(e,n);return n}reconfigure(e){let r=new Hw(this.schema,e.plugins),n=r.fields,i=new t(r);for(let s=0;s<n.length;s++){let a=n[s].name;i[a]=this.hasOwnProperty(a)?this[a]:n[s].init(e,i)}return i}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(r[n]=s.toJSON.call(i,this[i.key]))}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Hw(e.schema,e.plugins),s=new t(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=As.fromJSON(e.schema,r.doc);else if(a.name=="selection")s.selection=Fe.fromJSON(s.doc,r.selection);else if(a.name=="storedMarks")r.storedMarks&&(s.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let l=n[o],c=l.spec.state;if(l.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,o)){s[a.name]=c.fromJSON.call(l,e,r[o],s);return}}s[a.name]=a.init(e,s)}}),s}};function nre(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=nre(i,e,{})),r[n]=i}return r}var Ve=class{constructor(e){this.spec=e,this.props={},e.props&&nre(e.props,this,this.props),this.key=e.key?e.key.key:ire("plugin")}getState(e){return e[this.key]}},DF=Object.create(null);function ire(t){return t in DF?t+"$"+ ++DF[t]:(DF[t]=0,t+"$")}var ut=class{constructor(e="key"){this.key=ire(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var On=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Tg=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},zF=null,gc=function(t,e,r){let n=zF||(zF=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},gFe=function(){zF=null},_p=function(t,e,r,n){return r&&(sre(t,e,r,n,-1)||sre(t,e,r,n,1))},yFe=/^(img|br|input|textarea|hr)$/i;function sre(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:wa(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Jw(t)||yFe.test(t.nodeName)||t.contentEditable=="false")return!1;e=On(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?wa(t):0}else return!1}}function wa(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vFe(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=wa(t)}else if(t.parentNode&&!Jw(t))e=On(t),t=t.parentNode;else return null}}function bFe(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Jw(t))e=On(t)+1,t=t.parentNode;else return null}}function xFe(t,e,r){for(let n=e==0,i=e==wa(t);n||i;){if(t==r)return!0;let s=On(t);if(t=t.parentNode,!t)return!1;n=n&&s==0,i=i&&s==wa(t)}}function Jw(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var SI=function(t){return t.focusNode&&_p(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Ip(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function wFe(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function kFe(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:Math.min(wa(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:Math.min(wa(n.startContainer),n.startOffset)}}}var sl=typeof navigator<"u"?navigator:null,are=typeof document<"u"?document:null,Hu=sl&&sl.userAgent||"",qF=/Edge\/(\d+)/.exec(Hu),Bre=/MSIE \d/.exec(Hu),HF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Hu),Yi=!!(Bre||HF||qF),zu=Bre?document.documentMode:HF?+HF[1]:qF?+qF[1]:0,mo=!Yi&&/gecko\/(\d+)/i.test(Hu);mo&&+(/Firefox\/(\d+)/.exec(Hu)||[0,0])[1];var GF=!Yi&&/Chrome\/(\d+)/.exec(Hu),Zn=!!GF,Vre=GF?+GF[1]:0,wi=!Yi&&!!sl&&/Apple Computer/.test(sl.vendor),Eg=wi&&(/Mobile\/\w+/.test(Hu)||!!sl&&sl.maxTouchPoints>2),xa=Eg||(sl?/Mac/.test(sl.platform):!1),SFe=sl?/Win/.test(sl.platform):!1,yc=/Android \d/.test(Hu),e1=!!are&&"webkitFontSmoothing"in are.documentElement.style,CFe=e1?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function TFe(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function mc(t,e){return typeof t=="number"?t:t[e]}function EFe(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function ore(t,e,r){let n=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=r||t.dom;a;){if(a.nodeType!=1){a=Tg(a);continue}let o=a,l=o==s.body,c=l?TFe(s):EFe(o),u=0,d=0;if(e.top<c.top+mc(n,"top")?d=-(c.top-e.top+mc(i,"top")):e.bottom>c.bottom-mc(n,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+mc(i,"top")-c.top:e.bottom-c.bottom+mc(i,"bottom")),e.left<c.left+mc(n,"left")?u=-(c.left-e.left+mc(i,"left")):e.right>c.right-mc(n,"right")&&(u=e.right-c.right+mc(i,"right")),u||d)if(l)s.defaultView.scrollBy(u,d);else{let p=o.scrollLeft,h=o.scrollTop;d&&(o.scrollTop+=d),u&&(o.scrollLeft+=u);let m=o.scrollLeft-p,v=o.scrollTop-h;e={left:e.left-m,top:e.top-v,right:e.right-m,bottom:e.bottom-v}}let f=l?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(f))break;a=f=="absolute"?a.offsetParent:Tg(a)}}function IFe(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,a=r+1;a<Math.min(innerHeight,e.bottom);a+=5){let o=t.root.elementFromPoint(s,a);if(!o||o==t.dom||!t.dom.contains(o))continue;let l=o.getBoundingClientRect();if(l.top>=r-20){n=o,i=l.top;break}}return{refDOM:n,refTop:i,stack:jre(t.dom)}}function jre(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=Tg(n));return e}function AFe({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;$re(r,n==0?0:n-e)}function $re(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:i,left:s}=t[r];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=s&&(n.scrollLeft=s)}}var wg=null;function PFe(t){if(t.setActive)return t.setActive();if(wg)return t.focus(wg);let e=jre(t);t.focus(wg==null?{get preventScroll(){return wg={preventScroll:!0},!0}}:void 0),wg||(wg=!1,$re(e,0))}function Ure(t,e){let r,n=2e8,i,s=0,a=e.top,o=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=gc(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=a&&h.bottom>=o){a=Math.max(h.bottom,a),o=Math.min(h.top,o);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<n){r=u,n=m,i=m&&r.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,u.nodeType==1&&m&&(s=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!r&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(s=d+1)}}return!r&&l&&(r=l,i=c,n=0),r&&r.nodeType==3?RFe(r,i):!r||n&&r.nodeType==1?{node:t,offset:s}:Ure(r,i)}function RFe(t,e){let r=t.nodeValue.length,n=document.createRange();for(let i=0;i<r;i++){n.setEnd(t,i+1),n.setStart(t,i);let s=ju(n,1);if(s.top!=s.bottom&&o5(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function o5(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function LFe(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function MFe(t,e,r){let{node:n,offset:i}=Ure(e,r),s=-1;if(n.nodeType==1&&!n.firstChild){let a=n.getBoundingClientRect();s=a.left!=a.right&&r.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(n,i,s)}function _Fe(t,e,r,n){let i=-1;for(let s=e,a=!1;s!=t.dom;){let o=t.docView.nearestDesc(s,!0),l;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((l=o.dom.getBoundingClientRect()).width||l.height)&&(o.node.isBlock&&o.parent&&(!a&&l.left>n.left||l.top>n.top?i=o.posBefore:(!a&&l.right<n.left||l.bottom<n.top)&&(i=o.posAfter),a=!0),!o.contentDOM&&i<0&&!o.node.isText))return(o.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?o.posBefore:o.posAfter;s=o.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,r,-1)}function zre(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),s=i;;){let a=t.childNodes[s];if(a.nodeType==1){let o=a.getClientRects();for(let l=0;l<o.length;l++){let c=o[l];if(o5(e,c))return zre(a,e,c)}}if((s=(s+1)%n)==i)break}return t}function OFe(t,e){let r=t.dom.ownerDocument,n,i=0,s=kFe(r,e.left,e.top);s&&({node:n,offset:i}=s);let a=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),o;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let c=t.dom.getBoundingClientRect();if(!o5(e,c)||(a=zre(t.dom,e,c),!a))return null}if(wi)for(let c=a;n&&c;c=Tg(c))c.draggable&&(n=void 0);if(a=LFe(a,e),n){if(mo&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let u=n.childNodes[i],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let c;e1&&i&&n.nodeType==1&&(c=n.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?o=t.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(o=_Fe(t,n,i,e))}o==null&&(o=MFe(t,a,e));let l=t.docView.nearestDesc(a,!0);return{pos:o,inside:l?l.posAtStart-l.border:-1}}function lre(t){return t.top<t.bottom||t.left<t.right}function ju(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(lre(n))return n}return Array.prototype.find.call(r,lre)||t.getBoundingClientRect()}var DFe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function qre(t,e,r){let{node:n,offset:i,atom:s}=t.docView.domFromPos(e,r<0?-1:1),a=e1||mo;if(n.nodeType==3)if(a&&(DFe.test(n.nodeValue)||(r<0?!i:i==n.nodeValue.length))){let l=ju(gc(n,i,i),r);if(mo&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let c=ju(gc(n,i-1,i-1),-1);if(c.top==l.top){let u=ju(gc(n,i,i+1),-1);if(u.top!=l.top)return Ww(u,u.left<c.left)}}return l}else{let l=i,c=i,u=r<0?1:-1;return r<0&&!i?(c++,u=-1):r>=0&&i==n.nodeValue.length?(l--,u=1):r<0?l--:c++,Ww(ju(gc(n,l,c),u),u<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(r<0||i==wa(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return BF(l.getBoundingClientRect(),!1)}if(s==null&&i<wa(n)){let l=n.childNodes[i];if(l.nodeType==1)return BF(l.getBoundingClientRect(),!0)}return BF(n.getBoundingClientRect(),r>=0)}if(s==null&&i&&(r<0||i==wa(n))){let l=n.childNodes[i-1],c=l.nodeType==3?gc(l,wa(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Ww(ju(c,1),!1)}if(s==null&&i<wa(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?gc(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Ww(ju(c,-1),!0)}return Ww(ju(n.nodeType==3?gc(n):n,-r),r>=0)}function Ww(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function BF(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function Hre(t,e,r){let n=t.state,i=t.root.activeElement;n!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),i!=t.dom&&i&&i.focus()}}function NFe(t,e,r){let n=e.selection,i=r=="up"?n.$from:n.$to;return Hre(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,r=="up"?-1:1);for(;;){let o=t.docView.nearestDesc(s,!0);if(!o)break;if(o.node.isBlock){s=o.contentDOM||o.dom;break}s=o.dom.parentNode}let a=qre(t,i.pos,1);for(let o=s.firstChild;o;o=o.nextSibling){let l;if(o.nodeType==1)l=o.getClientRects();else if(o.nodeType==3)l=gc(o,0,o.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(r=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}var FFe=/[\u0590-\u08ac]/;function BFe(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,a=i==n.parent.content.size,o=t.domSelection();return o?!FFe.test(n.parent.textContent)||!o.modify?r=="left"||r=="backward"?s:a:Hre(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=o.caretBidiLevel;o.modify("move",r,"character");let p=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),v=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{o.collapse(u,d),l&&(l!=u||c!=d)&&o.extend&&o.extend(l,c)}catch{}return f!=null&&(o.caretBidiLevel=f),v}):n.pos==n.start()||n.pos==n.end()}var cre=null,ure=null,dre=!1;function VFe(t,e,r){return cre==e&&ure==r?dre:(cre=e,ure=r,dre=r=="up"||r=="down"?NFe(t,e,r):BFe(t,e,r))}var ka=0,fre=1,Ap=2,al=3,Op=class{constructor(e,r,n,i){this.parent=e,this.children=r,this.dom=n,this.contentDOM=i,this.dirty=ka,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let i=this.children[r];if(i==e)return n;n+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let s,a;if(e==this.contentDOM)s=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}else{let s,a;if(e==this.contentDOM)s=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=r>On(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&r==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),a;if(s&&(!r||s.node))if(n&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return s}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,r,n)}return-1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let i=this.children[r],s=n+i.size;if(n==e&&s!=n){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let o=i.children[a];if(o.size){i=o;break}}return i}if(e<s)return i.descAt(e-n-i.border);n=s}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let s=0;n<this.children.length;n++){let a=this.children[n],o=s+a.size;if(o>e||a instanceof hI){i=e-s;break}s=o}if(i)return this.children[n].domFromPos(i-this.children[n].border,r);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof fI&&s.side>=0;n--);if(r<=0){let s,a=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,a=!1);return s&&r&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,r):{node:this.contentDOM,offset:s?On(s.dom)+1:0}}else{let s,a=!0;for(;s=n<this.children.length?this.children[n]:null,!(!s||s.dom.parentNode==this.contentDOM);n++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,r):{node:this.contentDOM,offset:s?On(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=n,o=0;;o++){let l=this.children[o],c=a+l.size;if(i==-1&&e<=c){let u=a+l.border;if(e>=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,r,u);e=a;for(let d=o;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=On(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>r||o==this.children.length-1)){r=c;for(let u=o+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=On(d.dom);break}r+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:e,to:r,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,i=!1){let s=Math.min(e,r),a=Math.max(e,r);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],v=h+m.size;if(s>h&&a<v)return m.setSelection(e-h-m.border,r-h-m.border,n,i);h=v}let o=this.domFromPos(e,e?-1:1),l=r==e?o:this.domFromPos(r,r?-1:1),c=n.root.getSelection(),u=n.domSelectionRange(),d=!1;if((mo||wi)&&e==r){let{node:p,offset:h}=o;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==`
`),d&&h==p.nodeValue.length)for(let m=p,v;m;m=m.parentNode){if(v=m.nextSibling){v.nodeName=="BR"&&(o=l={node:v.parentNode,offset:On(v)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let m=p.childNodes[h-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(mo&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||d&&wi)&&_p(o.node,o.offset,u.anchorNode,u.anchorOffset)&&_p(l.node,l.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==r)&&!d){c.collapse(o.node,o.offset);try{e!=r&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>r){let h=o;o=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,i=0;i<this.children.length;i++){let s=this.children[i],a=n+s.size;if(n==a?e<=a&&r>=n:e<a&&r>n){let o=n+s.border,l=a-s.border;if(e>=o&&r<=l){this.dirty=e==n||r==a?Ap:fre,e==o&&r==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=al:s.markDirty(e-o,r-o);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Ap:al}n=a}this.dirty=Ap}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?Ap:fre;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}},fI=class extends Op{constructor(e,r,n,i){let s,a=r.type.toDOM;if(typeof a=="function"&&(a=a(n,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!r.type.spec.raw){if(a.nodeType!=1){let o=document.createElement("span");o.appendChild(a),a=o}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=r,this.widget=r,s=this}matchesWidget(e){return this.dirty==ka&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}},WF=class extends Op{constructor(e,r,n,i){super(e,[],r,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Ig=class t extends Op{constructor(e,r,n,i,s){super(e,[],n,i),this.mark=r,this.spec=s}static create(e,r,n,i){let s=i.nodeViews[r.type.name],a=s&&s(r,i,n);return(!a||!a.dom)&&(a=Ps.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new t(e,r,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&al||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=al&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=ka){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=ka}}slice(e,r,n){let i=t.create(this.parent,this.mark,!0,n),s=this.children,a=this.size;r<a&&(s=QF(s,r,a,n)),e>0&&(s=QF(s,0,e,n));for(let o=0;o<s.length;o++)s[o].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},qu=class t extends Op{constructor(e,r,n,i,s,a,o,l,c){super(e,[],s,a),this.node=r,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=o}static create(e,r,n,i,s,a){let o=s.nodeViews[r.type.name],l,c=o&&o(r,s,()=>{if(!l)return a;if(l.parent)return l.parent.posBeforeChild(l)},n,i),u=c&&c.dom,d=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Ps.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!d&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Kre(u,n,r),c?l=new KF(e,r,n,i,u,d||null,f,c,s,a+1):r.isText?new pI(e,r,n,i,u,f,s):new t(e,r,n,i,u,d||null,f,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>se.empty)}return e}matchesNode(e,r,n){return this.dirty==ka&&e.eq(this.node)&&mI(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,i=r,s=e.composing?this.localCompositionInfo(e,r):null,a=s&&s.pos>-1?s:null,o=s&&s.pos<0,l=new XF(this,a&&a.node,e);zFe(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?ct.none:this.node.child(u).marks,n,e),l.placeWidget(c,e,i)},(c,u,d,f)=>{l.syncToMarks(c.marks,n,e);let p;l.findNodeMatch(c,u,d,f)||o&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(p=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,i)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ap)&&(a&&this.protectLocalComposition(e,a),Gre(this.contentDOM,this.children,e),Eg&&qFe(this.dom))}localCompositionInfo(e,r){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof Ze)||n<r||i>r+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,o=HFe(this.node.content,a,n-r,i-r);return o<0?null:{node:s,pos:o,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:i}){if(this.getDesc(r))return;let s=r;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new WF(this,s,r,i);e.input.compositionNodes.push(a),this.children=QF(this.children,n,n+i.length,e,a)}update(e,r,n,i){return this.dirty==al||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,i),!0)}updateInner(e,r,n,i){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=ka}updateOuterDeco(e){if(mI(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Wre(this.dom,this.nodeDOM,YF(this.outerDeco,this.node,r),YF(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function pre(t,e,r,n,i){Kre(n,e,t);let s=new qu(void 0,t,e,r,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}var pI=class t extends qu{constructor(e,r,n,i,s,a,o){super(e,r,n,i,s,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,n,i){return this.dirty==al||this.dirty!=ka&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=ka||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=ka,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let i=this.node.cut(e,r),s=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=al)}get domAtom(){return!1}isText(e){return this.node.text==e}},hI=class extends Op{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ka&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},KF=class extends qu{constructor(e,r,n,i,s,a,o,l,c,u){super(e,r,n,i,s,a,o,c,u),this.spec=l}update(e,r,n,i){if(this.dirty==al)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,r,n);return s&&this.updateInner(e,r,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,n,i){this.spec.setSelection?this.spec.setSelection(e,r,n.root):super.setSelection(e,r,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Gre(t,e,r){let n=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let a=e[s],o=a.dom;if(o.parentNode==t){for(;o!=n;)n=hre(n),i=!0;n=n.nextSibling}else i=!0,t.insertBefore(o,n);if(a instanceof Ig){let l=n?n.previousSibling:t.lastChild;Gre(a.contentDOM,a.children,r),n=l?l.nextSibling:t.firstChild}}for(;n;)n=hre(n),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}var Kw=function(t){t&&(this.nodeName=t)};Kw.prototype=Object.create(null);var Pp=[new Kw];function YF(t,e,r){if(t.length==0)return Pp;let n=r?Pp[0]:new Kw,i=[n];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&i.push(n=new Kw(a.nodeName));for(let o in a){let l=a[o];l!=null&&(r&&i.length==1&&i.push(n=new Kw(e.isInline?"span":"div")),o=="class"?n.class=(n.class?n.class+" ":"")+l:o=="style"?n.style=(n.style?n.style+";":"")+l:o!="nodeName"&&(n[o]=l))}}}return i}function Wre(t,e,r,n){if(r==Pp&&n==Pp)return e;let i=e;for(let s=0;s<n.length;s++){let a=n[s],o=r[s];if(s){let l;o&&o.nodeName==a.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==a.nodeName||(l=document.createElement(a.nodeName),l.pmIsDeco=!0,l.appendChild(i),o=Pp[0]),i=l}jFe(i,o||Pp[0],a)}return i}function jFe(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<n.length;s++)i.indexOf(n[s])==-1&&t.classList.remove(n[s]);for(let s=0;s<i.length;s++)n.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)t.style.removeProperty(i[1])}r.style&&(t.style.cssText+=r.style)}}function Kre(t,e,r){return Wre(t,t,Pp,YF(e,r,t.nodeType!=1))}function mI(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function hre(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var XF=class{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=$Fe(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,n){let i=0,s=this.stack.length>>1,a=Math.min(s,e.length);for(;i<a&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=ka,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let o=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){o=l;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let l=Ig.create(this.top,e[s],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,r,n,i){let s=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,r,n))s=this.top.children.indexOf(a,this.index);else for(let o=this.index,l=Math.min(this.top.children.length,o+5);o<l;o++){let c=this.top.children[o];if(c.matchesNode(e,r,n)&&!this.preMatch.matched.has(c)){s=o;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,r,n,i,s){let a=this.top.children[i];return a.dirty==al&&a.dom==a.contentDOM&&(a.dirty=Ap),a.update(e,r,n,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=r}}updateNextNode(e,r,n,i,s,a){for(let o=this.index;o<this.top.children.length;o++){let l=this.top.children[o];if(l instanceof qu){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=al&&mI(r,l.outerDeco));if(!f&&l.update(e,r,n,i))return this.destroyBetween(this.index,o),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,r,n,i,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=Ap,d.updateChildren(i,a+1),d.dirty=ka),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,n,i,s,a){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!mI(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let o=qu.create(this.top,r,n,i,s,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let l of o.children)l.parent=o}return e.destroy(),o}addNode(e,r,n,i,s){let a=qu.create(this.top,e,r,n,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,r,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new fI(this.top,e,r,n);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof Ig;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof pI)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((wi||Zn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new hI(this.top,[],n,null);r!=this.top?r.children.push(i):r.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function $Fe(t,e){let r=e,n=r.children.length,i=t.childCount,s=new Map,a=[];e:for(;i>0;){let o;for(;;)if(n){let c=r.children[n-1];if(c instanceof Ig)r=c,n=c.children.length;else{o=c,n--;break}}else{if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=o.node;if(l){if(l!=t.child(i-1))break;--i,s.set(o,i),a.push(o)}}return{index:i,matched:s,matches:a.reverse()}}function UFe(t,e){return t.type.side-e.type.side}function zFe(t,e,r,n){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);n(u,i,e.forChild(s,u),c),s+=u.nodeSize}return}let a=0,o=[],l=null;for(let c=0;;){let u,d;for(;a<i.length&&i[a].to==s;){let v=i[a++];v.widget&&(u?(d||(d=[u])).push(v):u=v)}if(u)if(d){d.sort(UFe);for(let v=0;v<d.length;v++)r(d[v],c,!!l)}else r(u,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let v=0;v<o.length;v++)o[v].to<=s&&o.splice(v--,1);for(;a<i.length&&i[a].from<=s&&i[a].to>s;)o.push(i[a++]);let h=s+f.nodeSize;if(f.isText){let v=h;a<i.length&&i[a].from<v&&(v=i[a].from);for(let b=0;b<o.length;b++)o[b].to<v&&(v=o[b].to);v<h&&(l=f.cut(v-s),f=f.cut(0,v-s),h=v,p=-1)}else for(;a<i.length&&i[a].to<h;)a++;let m=f.isInline&&!f.isLeaf?o.filter(v=>!v.inline):o.slice();n(f,m,e.forChild(s,f),p),s=h}}function qFe(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function HFe(t,e,r,n){for(let i=0,s=0;i<t.childCount&&s<=n;){let a=t.child(i++),o=s;if(s+=a.nodeSize,!a.isText)continue;let l=a.text;for(;i<t.childCount;){let c=t.child(i++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=r){if(s>=n&&l.slice(n-e.length-o,n-o)==e)return n-e.length;let c=o<n?l.lastIndexOf(e,n-o-1):-1;if(c>=0&&c+e.length+o>=r)return o+c;if(r==n&&l.length>=n+e.length-o&&l.slice(n-o,n-o+e.length)==e)return n}}return-1}function QF(t,e,r,n,i){let s=[];for(let a=0,o=0;a<t.length;a++){let l=t[a],c=o,u=o+=l.size;c>=r||u<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,n)),i&&(s.push(i),i=void 0),u>r&&s.push(l.slice(r-c,l.size,n)))}return s}function l5(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let i=t.docView.nearestDesc(r.focusNode),s=i&&i.size==0,a=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(a<0)return null;let o=n.resolve(a),l,c;if(SI(r)){for(l=a;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&_e.isSelectable(d)&&i.parent&&!(d.isInline&&xFe(r.focusNode,r.focusOffset,i.dom))){let f=i.posBefore;c=new _e(a==f?o:n.resolve(f))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let d=a,f=a;for(let p=0;p<r.rangeCount;p++){let h=r.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,a]=f==t.state.selection.anchor?[f,d]:[d,f],o=n.resolve(a)}else l=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let u=n.resolve(l);if(!c){let d=e=="pointer"||t.state.selection.head<o.pos&&!s?1:-1;c=c5(t,u,o,d)}return c}function Yre(t){return t.editable?t.hasFocus():Qre(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function vc(t,e=!1){let r=t.state.selection;if(Xre(t,r),!!Yre(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Zn){let n=t.domSelectionRange(),i=t.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&_p(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)WFe(t);else{let{anchor:n,head:i}=r,s,a;mre&&!(r instanceof Ze)&&(r.$from.parent.inlineContent||(s=gre(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(a=gre(t,r.to))),t.docView.setSelection(n,i,t,e),mre&&(s&&yre(s),a&&yre(a)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&GFe(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}var mre=wi||Zn&&Vre<63;function gre(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),i=n<r.childNodes.length?r.childNodes[n]:null,s=n?r.childNodes[n-1]:null;if(wi&&i&&i.contentEditable=="false")return VF(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return VF(i);if(s)return VF(s)}}function VF(t){return t.contentEditable="true",wi&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function yre(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function GFe(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,i=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Yre(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function WFe(t){let e=t.domSelection(),r=document.createRange();if(!e)return;let n=t.cursorWrapper.dom,i=n.nodeName=="IMG";i?r.setStart(n.parentNode,On(n)+1):r.setStart(n,0),r.collapse(!0),e.removeAllRanges(),e.addRange(r),!i&&!t.state.selection.visible&&Yi&&zu<=11&&(n.disabled=!0,n.disabled=!1)}function Xre(t,e){if(e instanceof _e){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(vre(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else vre(t)}function vre(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function c5(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||Ze.between(e,r,n)}function bre(t){return t.editable&&!t.hasFocus()?!1:Qre(t)}function Qre(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function KFe(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return _p(e.node,e.offset,r.anchorNode,r.anchorOffset)}function ZF(t,e){let{$anchor:r,$head:n}=t.selection,i=e>0?r.max(n):r.min(n),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&Fe.findFrom(s,e)}function $u(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function xre(t,e,r){let n=t.state.selection;if(n instanceof Ze)if(r.indexOf("s")>-1){let{$head:i}=n,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return $u(t,new Ze(n.$anchor,a))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=ZF(t.state,e);return i&&i instanceof _e?$u(t,i):!1}else if(!(xa&&r.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let o=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=t.docView.descAt(o))&&!a.contentDOM?_e.isSelectable(s)?$u(t,new _e(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):e1?$u(t,new Ze(t.state.doc.resolve(e<0?o:o+s.nodeSize))):!1:!1}}else return!1;else{if(n instanceof _e&&n.node.isInline)return $u(t,new Ze(e>0?n.$to:n.$from));{let i=ZF(t.state,e);return i?$u(t,i):!1}}}function gI(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Yw(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function kg(t,e){return e<0?YFe(t):XFe(t)}function YFe(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,s,a=!1;for(mo&&r.nodeType==1&&n<gI(r)&&Yw(r.childNodes[n],-1)&&(a=!0);;)if(n>0){if(r.nodeType!=1)break;{let o=r.childNodes[n-1];if(Yw(o,-1))i=r,s=--n;else if(o.nodeType==3)r=o,n=r.nodeValue.length;else break}}else{if(Zre(r))break;{let o=r.previousSibling;for(;o&&Yw(o,-1);)i=r.parentNode,s=On(o),o=o.previousSibling;if(o)r=o,n=gI(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}a?JF(t,r,n):i&&JF(t,i,s)}function XFe(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=gI(r),s,a;for(;;)if(n<i){if(r.nodeType!=1)break;let o=r.childNodes[n];if(Yw(o,1))s=r,a=++n;else break}else{if(Zre(r))break;{let o=r.nextSibling;for(;o&&Yw(o,1);)s=o.parentNode,a=On(o)+1,o=o.nextSibling;if(o)r=o,n=0,i=gI(r);else{if(r=r.parentNode,r==t.dom)break;n=i=0}}}s&&JF(t,s,a)}function Zre(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function QFe(t,e){for(;t&&e==t.childNodes.length&&!Jw(t);)e=On(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0}}function ZFe(t,e){for(;t&&!e&&!Jw(t);)e=On(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length}}function JF(t,e,r){if(e.nodeType!=3){let s,a;(a=QFe(e,r))?(e=a,r=0):(s=ZFe(e,r))&&(e=s,r=s.nodeValue.length)}let n=t.domSelection();if(!n)return;if(SI(n)){let s=document.createRange();s.setEnd(e,r),s.setStart(e,r),n.removeAllRanges(),n.addRange(s)}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&vc(t)},50)}function wre(t,e){let r=t.state.doc.resolve(e);if(!(Zn||SFe)&&r.parent.inlineContent){let i=t.coordsAtPos(e);if(e>r.start()){let s=t.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<r.end()){let s=t.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function kre(t,e,r){let n=t.state.selection;if(n instanceof Ze&&!n.empty||r.indexOf("s")>-1||xa&&r.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=ZF(t.state,e);if(a&&a instanceof _e)return $u(t,a)}if(!i.parent.inlineContent){let a=e<0?i:s,o=n instanceof Xn?Fe.near(a,e):Fe.findFrom(a,e);return o?$u(t,o):!1}return!1}function Sre(t,e){if(!(t.state.selection instanceof Ze))return!0;let{$head:r,$anchor:n,empty:i}=t.state.selection;if(!r.sameParent(n))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){let a=t.state.tr;return e<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function Cre(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function JFe(t){if(!wi||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Cre(t,n,"true"),setTimeout(()=>Cre(t,n,"false"),20)}return!1}function e5e(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function t5e(t,e){let r=e.keyCode,n=e5e(e);if(r==8||xa&&r==72&&n=="c")return Sre(t,-1)||kg(t,-1);if(r==46&&!e.shiftKey||xa&&r==68&&n=="c")return Sre(t,1)||kg(t,1);if(r==13||r==27)return!0;if(r==37||xa&&r==66&&n=="c"){let i=r==37?wre(t,t.state.selection.from)=="ltr"?-1:1:-1;return xre(t,i,n)||kg(t,i)}else if(r==39||xa&&r==70&&n=="c"){let i=r==39?wre(t,t.state.selection.from)=="ltr"?1:-1:1;return xre(t,i,n)||kg(t,i)}else{if(r==38||xa&&r==80&&n=="c")return kre(t,-1,n)||kg(t,-1);if(r==40||xa&&r==78&&n=="c")return JFe(t)||kre(t,1,n)||kg(t,1);if(n==(xa?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function u5(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let r=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let a=t.someProp("clipboardSerializer")||Ps.fromSchema(t.state.schema),o=ine(),l=o.createElement("div");l.appendChild(a.serializeFragment(n,{document:o}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=nne[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=o.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
`);return{dom:l,text:f,slice:e}}function Jre(t,e,r,n,i){let s=i.parent.type.spec.code,a,o;if(!r&&!e)return null;let l=e&&(n||s||!r);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,s||n,t)}),s)return e?new oe(se.from(t.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0):oe.empty;let d=t.someProp("clipboardTextParser",f=>f(e,i,n,t));if(d)o=d;else{let f=i.marks(),{schema:p}=t.state,h=Ps.fromSchema(p);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let v=a.appendChild(document.createElement("p"));m&&v.appendChild(h.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{r=d(r,t)}),a=s5e(r),e1&&a5e(a);let c=a&&a.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=a.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;a=f}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||Cp.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!r5e.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)o=o5e(Tre(o,+u[1],+u[2]),u[4]);else if(o=oe.maxOpen(n5e(o.content,i),!0),o.openStart||o.openEnd){let d=0,f=0;for(let p=o.content.firstChild;d<o.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=o.content.lastChild;f<o.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);o=Tre(o,d,f)}return t.someProp("transformPasted",d=>{o=d(o,t)}),o}var r5e=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function n5e(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let i=e.node(r).contentMatchAt(e.index(r)),s,a=[];if(t.forEach(o=>{if(!a)return;let l=i.findWrapping(o.type),c;if(!l)return a=null;if(c=a.length&&s.length&&tne(l,s,o,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=rne(a[a.length-1],s.length));let u=ene(o,l);a.push(u),i=i.matchType(u.type),s=l}}),a)return se.from(a)}return t}function ene(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,se.from(t));return t}function tne(t,e,r,n,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=tne(t,e,r,n.lastChild,i+1);if(s)return n.copy(n.content.replaceChild(n.childCount-1,s));if(n.contentMatchAt(n.childCount).matchType(i==t.length-1?r.type:t[i+1]))return n.copy(n.content.append(se.from(ene(r,t,i+1))))}}function rne(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,rne(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(se.empty,!0);return t.copy(r.append(n))}function e5(t,e,r,n,i,s){let a=e<0?t.firstChild:t.lastChild,o=a.content;return t.childCount>1&&(s=0),i<n-1&&(o=e5(o,e,r,n,i+1,s)),i>=r&&(o=e<0?a.contentMatchAt(0).fillBefore(o,s<=i).append(o):o.append(a.contentMatchAt(a.childCount).fillBefore(se.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(o))}function Tre(t,e,r){return e<t.openStart&&(t=new oe(e5(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new oe(e5(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}var nne={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Ere=null;function ine(){return Ere||(Ere=document.implementation.createHTMLDocument("title"))}var jF=null;function i5e(t){let e=window.trustedTypes;return e?(jF||(jF=e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),jF.createHTML(t)):t}function s5e(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=ine().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),i;if((i=n&&nne[n[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=i5e(t),i)for(let s=0;s<i.length;s++)r=r.querySelector(i[s])||r;return r}function a5e(t){let e=t.querySelectorAll(Zn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent=="\xA0"&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function o5e(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:a}=t;for(let o=n.length-2;o>=0;o-=2){let l=r.nodes[n[o]];if(!l||l.hasRequiredAttrs())break;i=se.from(l.create(n[o+1],i)),s++,a++}return new oe(i,s,a)}var ki={},Si={},l5e={touchstart:!0,touchmove:!0},t5=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function c5e(t){for(let e in ki){let r=ki[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{d5e(t,n)&&!d5(t,n)&&(t.editable||!(n.type in Si))&&r(t,n)},l5e[e]?{passive:!0}:void 0)}wi&&t.dom.addEventListener("input",()=>null),r5(t)}function Uu(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function u5e(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function r5(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>d5(t,n))})}function d5(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function d5e(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function f5e(t,e){!d5(t,e)&&ki[e.type]&&(t.editable||!(e.type in Si))&&ki[e.type](t,e)}Si.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!ane(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(yc&&Zn&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),Eg&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",i=>i(t,Ip(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||t5e(t,r)?r.preventDefault():Uu(t,"key")};Si.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Si.keypress=(t,e)=>{let r=e;if(ane(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||xa&&r.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof Ze)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(r.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,n.$from.pos,n.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),r.preventDefault()}};function CI(t){return{left:t.clientX,top:t.clientY}}function p5e(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function f5(t,e,r,n,i){if(n==-1)return!1;let s=t.state.doc.resolve(n);for(let a=s.depth+1;a>0;a--)if(t.someProp(e,o=>a>s.depth?o(t,r,s.nodeAfter,s.before(a),i,!0):o(t,r,s.node(a),s.before(a),i,!1)))return!0;return!1}function Cg(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);r=="pointer"&&n.setMeta("pointer",!0),t.dispatch(n)}function h5e(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&_e.isSelectable(n)?(Cg(t,new _e(r),"pointer"),!0):!1}function m5e(t,e){if(e==-1)return!1;let r=t.state.selection,n,i;r instanceof _e&&(n=r.node);let s=t.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let o=a>s.depth?s.nodeAfter:s.node(a);if(_e.isSelectable(o)){n&&r.$from.depth>0&&a>=r.$from.depth&&s.before(r.$from.depth+1)==r.$from.pos?i=s.before(r.$from.depth):i=s.before(a);break}}return i!=null?(Cg(t,_e.create(t.state.doc,i),"pointer"),!0):!1}function g5e(t,e,r,n,i){return f5(t,"handleClickOn",e,r,n)||t.someProp("handleClick",s=>s(t,e,n))||(i?m5e(t,r):h5e(t,r))}function y5e(t,e,r,n){return f5(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function v5e(t,e,r,n){return f5(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||b5e(t,r,n)}function b5e(t,e,r){if(r.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(Cg(t,Ze.create(n,0,n.content.size),"pointer"),!0):!1;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),o=i.before(s);if(a.inlineContent)Cg(t,Ze.create(n,o+1,o+1+a.content.size),"pointer");else if(_e.isSelectable(a))Cg(t,_e.create(n,o),"pointer");else continue;return!0}}function p5(t){return yI(t)}var sne=xa?"metaKey":"ctrlKey";ki.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=p5(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&p5e(r,t.input.lastClick)&&!r[sne]&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:r.clientX,y:r.clientY,type:s};let a=t.posAtCoords(CI(r));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new n5(t,a,r,!!n)):(s=="doubleClick"?y5e:v5e)(t,a.pos,a.inside,r)?r.preventDefault():Uu(t,"pointer"))};var n5=class{constructor(e,r,n,i){this.view=e,this.pos=r,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[sne],this.allowDefault=n.shiftKey;let s,a;if(r.inside>-1)s=e.state.doc.nodeAt(r.inside),a=r.inside;else{let u=e.state.doc.resolve(r.pos);s=u.parent,a=u.depth?u.before():0}let o=i?null:n.target,l=o?e.docView.nearestDesc(o,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof _e&&c.from<=a&&c.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&mo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Uu(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>vc(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(CI(e))),this.updateAllowDefault(e),this.allowDefault||!r?Uu(this.view,"pointer"):g5e(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||wi&&this.mightDrag&&!this.mightDrag.node.isAtom||Zn&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Cg(this.view,Fe.near(this.view.state.doc.resolve(r.pos)),"pointer"),e.preventDefault()):Uu(this.view,"pointer")}move(e){this.updateAllowDefault(e),Uu(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};ki.touchstart=t=>{t.input.lastTouch=Date.now(),p5(t),Uu(t,"pointer")};ki.touchmove=t=>{t.input.lastTouch=Date.now(),Uu(t,"pointer")};ki.contextmenu=t=>p5(t);function ane(t,e){return t.composing?!0:wi&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var x5e=yc?5e3:-1;Si.compositionstart=Si.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof Ze&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||r.marks(),yI(t,!0),t.markCursor=null;else if(yI(t,!e.selection.empty),mo&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let o=t.domSelection();o&&o.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}t.input.composing=!0}one(t,x5e)};Si.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,one(t,20))};function one(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>yI(t),e))}function lne(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=k5e());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function w5e(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=vFe(e.focusNode,e.focusOffset),n=bFe(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let i=n.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(r==s||n==s)return s;if(!i||!i.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let a=r.pmViewDesc;if(!(!a||!a.isText(r.nodeValue)))return n}}return r||n}function k5e(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function yI(t,e=!1){if(!(yc&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),lne(t),e||t.docView&&t.docView.dirty){let r=l5(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function S5e(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}var Xw=Yi&&zu<15||Eg&&CFe<604;ki.copy=Si.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let s=Xw?null:r.clipboardData,a=n.content(),{dom:o,text:l}=u5(t,a);s?(r.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",l)):S5e(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function C5e(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function T5e(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?Qw(t,n.value,null,i,e):Qw(t,n.textContent,n.innerHTML,i,e)},50)}function Qw(t,e,r,n,i){let s=Jre(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||oe.empty)))return!0;if(!s)return!1;let a=C5e(s),o=a?t.state.tr.replaceSelectionWith(a,n):t.state.tr.replaceSelection(s);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function cne(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}Si.paste=(t,e)=>{let r=e;if(t.composing&&!yc)return;let n=Xw?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&Qw(t,cne(n),n.getData("text/html"),i,r)?r.preventDefault():T5e(t,r)};var vI=class{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}},une=xa?"altKey":"ctrlKey";ki.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(CI(r)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof _e?i.to-1:i.to))){if(n&&n.mightDrag)a=_e.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let d=t.docView.nearestDesc(r.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(a=_e.create(t.state.doc,d.posBefore))}}let o=(a||t.state.selection).content(),{dom:l,text:c,slice:u}=u5(t,o);(!r.dataTransfer.files.length||!Zn||Vre>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(Xw?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",Xw||r.dataTransfer.setData("text/plain",c),t.dragging=new vI(u,!r[une],a)};ki.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Si.dragover=Si.dragenter=(t,e)=>e.preventDefault();Si.drop=(t,e)=>{let r=e,n=t.dragging;if(t.dragging=null,!r.dataTransfer)return;let i=t.posAtCoords(CI(r));if(!i)return;let s=t.state.doc.resolve(i.pos),a=n&&n.slice;a?t.someProp("transformPasted",h=>{a=h(a,t)}):a=Jre(t,cne(r.dataTransfer),Xw?null:r.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&!r[une]);if(t.someProp("handleDrop",h=>h(t,r,a||oe.empty,o))){r.preventDefault();return}if(!a)return;r.preventDefault();let l=a?cI(t.state.doc,s.pos,a):s.pos;l==null&&(l=s.pos);let c=t.state.tr;if(o){let{node:h}=n;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,a.content.firstChild):c.replaceRange(u,u,a),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&_e.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new _e(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,v,b,y)=>h=y),c.setSelection(c5(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};ki.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&vc(t)},20))};ki.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};ki.beforeinput=(t,e)=>{if(Zn&&yc&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,Ip(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Si)ki[t]=Si[t];function Zw(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}var bI=class t{constructor(e,r){this.toDOM=e,this.spec=r||Lp,this.side=this.spec.side||0}map(e,r,n,i){let{pos:s,deleted:a}=e.mapResult(r.from+i,this.side<0?-1:1);return a?null:new Zr(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Zw(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Rp=class t{constructor(e,r){this.attrs=e,this.spec=r||Lp}map(e,r,n,i){let s=e.map(r.from+i,this.spec.inclusiveStart?-1:1)-n,a=e.map(r.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=a?null:new Zr(s,a,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof t&&Zw(this.attrs,e.attrs)&&Zw(this.spec,e.spec)}static is(e){return e.type instanceof t}destroy(){}},i5=class t{constructor(e,r){this.attrs=e,this.spec=r||Lp}map(e,r,n,i){let s=e.mapResult(r.from+i,1);if(s.deleted)return null;let a=e.mapResult(r.to+i,-1);return a.deleted||a.pos<=s.pos?null:new Zr(s.pos-n,a.pos-n,this)}valid(e,r){let{index:n,offset:i}=e.content.findIndex(r.from),s;return i==r.from&&!(s=e.child(n)).isText&&i+s.nodeSize==r.to}eq(e){return this==e||e instanceof t&&Zw(this.attrs,e.attrs)&&Zw(this.spec,e.spec)}destroy(){}},Zr=class t{constructor(e,r,n){this.from=e,this.to=r,this.type=n}copy(e,r){return new t(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new t(e,e,new bI(r,n))}static inline(e,r,n,i){return new t(e,r,new Rp(n,i))}static node(e,r,n,i){return new t(e,r,new i5(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Rp}get widget(){return this.type instanceof bI}},Sg=[],Lp={},kr=class t{constructor(e,r){this.local=e.length?e:Sg,this.children=r.length?r:Sg}static create(e,r){return r.length?wI(r,e,0,Lp):Qn}find(e,r,n){let i=[];return this.findInner(e??0,r??1e9,i,0,n),i}findInner(e,r,n,i,s){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=r&&o.to>=e&&(!s||s(o.spec))&&n.push(o.copy(o.from+i,o.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<r&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,r-o,n,i+o,s)}}map(e,r,n){return this==Qn||e.maps.length==0?this:this.mapInner(e,r,0,0,n||Lp)}mapInner(e,r,n,i,s){let a;for(let o=0;o<this.local.length;o++){let l=this.local[o].map(e,n,i);l&&l.type.valid(r,l)?(a||(a=[])).push(l):s.onRemove&&s.onRemove(this.local[o].spec)}return this.children.length?E5e(this.children,a||[],e,r,n,i,s):a?new t(a.sort(Mp),Sg):Qn}add(e,r){return r.length?this==Qn?t.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let i,s=0;e.forEach((o,l)=>{let c=l+n,u;if(u=fne(r,o,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(o,u,c+1):i.splice(s,0,l,l+o.nodeSize,wI(u,o,c+1,Lp)),s+=3}});let a=dne(s?pne(r):r,-n);for(let o=0;o<a.length;o++)a[o].type.valid(e,a[o])||a.splice(o--,1);return new t(a.length?this.local.concat(a).sort(Mp):this.local,i||this.children)}remove(e){return e.length==0||this==Qn?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,i=this.local;for(let s=0;s<n.length;s+=3){let a,o=n[s]+r,l=n[s+1]+r;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>o&&d.to<l&&(e[u]=null,(a||(a=[])).push(d));if(!a)continue;n==this.children&&(n=this.children.slice());let c=n[s+2].removeInner(a,o+1);c!=Qn?n[s+2]=c:(n.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<e.length;s++)if(a=e[s])for(let o=0;o<i.length;o++)i[o].eq(a,r)&&(i==this.local&&(i=this.local.slice()),i.splice(o--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new t(i,n):Qn}forChild(e,r){if(this==Qn)return this;if(r.isLeaf)return t.empty;let n,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}let s=e+1,a=s+r.content.size;for(let o=0;o<this.local.length;o++){let l=this.local[o];if(l.from<a&&l.to>s&&l.type instanceof Rp){let c=Math.max(s,l.from)-s,u=Math.min(a,l.to)-s;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let o=new t(i.sort(Mp),Sg);return n?new xI([o,n]):o}return n||Qn}eq(e){if(this==e)return!0;if(!(e instanceof t)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return h5(this.localsInner(e))}localsInner(e){if(this==Qn)return Sg;if(e.inlineContent||!this.local.some(Rp.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Rp||r.push(this.local[n]);return r}forEachSet(e){e(this)}};kr.empty=new kr([],[]);kr.removeOverlap=h5;var Qn=kr.empty,xI=class t{constructor(e){this.members=e}map(e,r){let n=this.members.map(i=>i.map(e,r,Lp));return t.from(n)}forChild(e,r){if(r.isLeaf)return kr.empty;let n=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,r);s!=Qn&&(s instanceof t?n=n.concat(s.members):n.push(s))}return t.from(n)}eq(e){if(!(e instanceof t)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,n=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!r)r=s;else{n&&(r=r.slice(),n=!1);for(let a=0;a<s.length;a++)r.push(s[a])}}return r?h5(n?r:r.sort(Mp)):Sg}static from(e){switch(e.length){case 0:return Qn;case 1:return e[0];default:return new t(e.every(r=>r instanceof kr)?e:e.reduce((r,n)=>r.concat(n instanceof kr?n:n.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e)}};function E5e(t,e,r,n,i,s,a){let o=t.slice();for(let c=0,u=s;c<r.maps.length;c++){let d=0;r.maps[c].forEach((f,p,h,m)=>{let v=m-h-(p-f);for(let b=0;b<o.length;b+=3){let y=o[b+1];if(y<0||f>y+u-d)continue;let x=o[b]+u-d;p>=x?o[b+1]=f<=x?-2:-1:f>=u&&v&&(o[b]+=v,o[b+1]+=v)}d+=v}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c<o.length;c+=3)if(o[c+1]<0){if(o[c+1]==-2){l=!0,o[c+1]=-1;continue}let u=r.map(t[c]+s),d=u-i;if(d<0||d>=n.content.size){l=!0;continue}let f=r.map(t[c+1]+s,-1),p=f-i,{index:h,offset:m}=n.content.findIndex(d),v=n.maybeChild(h);if(v&&m==d&&m+v.nodeSize==p){let b=o[c+2].mapInner(r,v,u+1,t[c]+s+1,a);b!=Qn?(o[c]=d,o[c+1]=p,o[c+2]=b):(o[c+1]=-2,l=!0)}else l=!0}if(l){let c=I5e(o,t,e,r,i,s,a),u=wI(c,n,0,a);e=u.local;for(let d=0;d<o.length;d+=3)o[d+1]<0&&(o.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<o.length&&o[f]<p;)f+=3;o.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new kr(e.sort(Mp),o)}function dne(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(new Zr(i.from+e,i.to+e,i.type))}return r}function I5e(t,e,r,n,i,s,a){function o(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(n,i,c);d?r.push(d):a.onRemove&&a.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)o(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&o(t[l+2],e[l]+s+1);return r}function fne(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,i=null;for(let s=0,a;s<t.length;s++)(a=t[s])&&a.from>r&&a.to<n&&((i||(i=[])).push(a),t[s]=null);return i}function pne(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function wI(t,e,r,n){let i=[],s=!1;e.forEach((o,l)=>{let c=fne(t,o,l+r);if(c){s=!0;let u=wI(c,o,r+l+1,n);u!=Qn&&i.push(l,l+o.nodeSize,u)}});let a=dne(s?pne(t):t,-r).sort(Mp);for(let o=0;o<a.length;o++)a[o].type.valid(e,a[o])||(n.onRemove&&n.onRemove(a[o].spec),a.splice(o--,1));return a.length||i.length?new kr(a,i):Qn}function Mp(t,e){return t.from-e.from||t.to-e.to}function h5(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let i=r+1;i<e.length;i++){let s=e[i];if(s.from==n.from){s.to!=n.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,n.to),Ire(e,i+1,s.copy(n.to,s.to)));continue}else{s.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,s.from),Ire(e,i,n.copy(s.from,n.to)));break}}}return e}function Ire(t,e,r){for(;e<t.length&&Mp(r,t[e])>0;)e++;t.splice(e,0,r)}function $F(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=Qn&&e.push(n)}),t.cursorWrapper&&e.push(kr.create(t.state.doc,[t.cursorWrapper.deco])),xI.from(e)}var A5e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},P5e=Yi&&zu<=11,s5=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},a5=class{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new s5,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);Yi&&zu<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),P5e&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,A5e)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(bre(this.view)){if(this.suppressingSelectionUpdates)return vc(this.view);if(Yi&&zu<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&_p(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r=new Set,n;for(let s=e.focusNode;s;s=Tg(s))r.add(s);for(let s=e.anchorNode;s;s=Tg(s))if(r.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&bre(e)&&!this.ignoreSelectionChange(n),s=-1,a=-1,o=!1,l=[];if(e.editable)for(let u=0;u<r.length;u++){let d=this.registerMutation(r[u],l);d&&(s=s<0?d.from:Math.min(d.from,s),a=a<0?d.to:Math.max(d.to,a),d.typeOver&&(o=!0))}if(mo&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||M5e(e,d)!=p)&&f.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&SI(n)&&(c=l5(e))&&c.eq(Fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,vc(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,a),R5e(e)),this.handleDOMChange(s,a,o,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||vc(e),this.currentSelection.set(n))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];r.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,s=e.nextSibling;if(Yi&&zu<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let a=i&&i.parentNode==e.target?On(i)+1:0,o=n.localPosFromDOM(e.target,a,-1),l=s&&s.parentNode==e.target?On(s):e.target.childNodes.length,c=n.localPosFromDOM(e.target,l,1);return{from:o,to:c}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},Are=new WeakMap,Pre=!1;function R5e(t){if(!Are.has(t)&&(Are.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=mo,Pre)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Pre=!0}}function Rre(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return _p(a.node,a.offset,i,s)&&([r,n,i,s]=[i,s,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:s}}function L5e(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Rre(t,i)}let r;function n(i){i.preventDefault(),i.stopImmediatePropagation(),r=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?Rre(t,r):null}function M5e(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function _5e(t,e,r){let{node:n,fromOffset:i,toOffset:s,from:a,to:o}=t.docView.parseRange(e,r),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],SI(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Zn&&t.input.lastKeyCode===8)for(let v=s;v>i;v--){let b=n.childNodes[v-1],y=b.pmViewDesc;if(b.nodeName=="BR"&&!y){s=v;break}if(!y||y.size)break}let d=t.state.doc,f=t.someProp("domParser")||Cp.fromSchema(t.state.schema),p=d.resolve(a),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:O5e,context:p});if(c&&c[0].pos!=null){let v=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=v),h={anchor:v+a,head:b+a}}return{doc:m,sel:h,from:a,to:o}}function O5e(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(wi&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||wi&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var D5e=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function N5e(t,e,r,n,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let E=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=l5(t,E);if(P&&!t.state.selection.eq(P)){if(Zn&&yc&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",I=>I(t,Ip(13,"Enter"))))return;let R=t.state.tr.setSelection(P);E=="pointer"?R.setMeta("pointer",!0):E=="key"&&R.scrollIntoView(),s&&R.setMeta("composition",s),t.dispatch(R)}return}let a=t.state.doc.resolve(e),o=a.sharedDepth(r);e=a.before(o+1),r=t.state.doc.resolve(r).after(o+1);let l=t.state.selection,c=_5e(t,e,r),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=V5e(d.content,c.doc.content,c.from,f,p);if(h&&t.input.domChangeCount++,(Eg&&t.input.lastIOSEnter>Date.now()-225||yc)&&i.some(E=>E.nodeType==1&&!D5e.test(E.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",E=>E(t,Ip(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof Ze&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let E=Lre(t,t.state.doc,c.sel);if(E&&!E.eq(t.state.selection)){let P=t.state.tr.setSelection(E);s&&P.setMeta("composition",s),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof Ze&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Yi&&zu<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)==" \xA0"&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),v=c.doc.resolveNoCache(h.endB-c.from),b=u.resolve(h.start),y=m.sameParent(v)&&m.parent.inlineContent&&b.end()>=h.endA,x;if((Eg&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!y&&m.pos<c.doc.content.size&&!m.sameParent(v)&&(x=Fe.findFrom(c.doc.resolve(m.pos+1),1,!0))&&x.head==v.pos)&&t.someProp("handleKeyDown",E=>E(t,Ip(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&B5e(u,h.start,h.endA,m,v)&&t.someProp("handleKeyDown",E=>E(t,Ip(8,"Backspace")))){yc&&Zn&&t.domObserver.suppressSelectionUpdates();return}Zn&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),yc&&!y&&m.start()!=v.start()&&v.parentOffset==0&&m.depth==v.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,v=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(E){return E(t,Ip(13,"Enter"))})},20));let w=h.start,C=h.endA,O,S,T;if(y){if(m.pos==v.pos)Yi&&zu<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>vc(t),20)),O=t.state.tr.delete(w,C),S=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(T=F5e(m.parent.content.cut(m.parentOffset,v.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))O=t.state.tr,T.type=="add"?O.addMark(w,C,T.mark):O.removeMark(w,C,T.mark);else if(m.parent.child(m.index()).isText&&m.index()==v.index()-(v.textOffset?0:1)){let E=m.parent.textBetween(m.parentOffset,v.parentOffset);if(t.someProp("handleTextInput",P=>P(t,w,C,E)))return;O=t.state.tr.insertText(E,w,C)}}if(O||(O=t.state.tr.replace(w,C,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let E=Lre(t,O.doc,c.sel);E&&!(Zn&&t.composing&&E.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(E.head==w||E.head==O.mapping.map(C)-1)||Yi&&E.empty&&E.head==w)&&O.setSelection(E)}S&&O.ensureMarks(S),s&&O.setMeta("composition",s),t.dispatch(O.scrollIntoView())}function Lre(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:c5(t,e.resolve(r.anchor),e.resolve(r.head))}function F5e(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,i=r,s=n,a,o,l;for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);for(let u=0;u<r.length;u++)s=r[u].removeFromSet(s);if(i.length==1&&s.length==0)o=i[0],a="add",l=u=>u.mark(o.addToSet(u.marks));else if(i.length==0&&s.length==1)o=s[0],a="remove",l=u=>u.mark(o.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(se.from(c).eq(t))return{mark:o,type:a}}function B5e(t,e,r,n,i){if(r-e<=i.pos-n.pos||UF(n,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!n.parent.isTextblock){let o=s.nodeAfter;return o!=null&&r==e+o.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let a=t.resolve(UF(s,!0,!0));return!a.parent.isTextblock||a.pos>r||UF(a,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(a.parent.content)}function UF(t,e,r){let n=t.depth,i=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,i++,e=!1;if(r){let s=t.node(n).maybeChild(t.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function V5e(t,e,r,n,i){let s=t.findDiffStart(e,r);if(s==null)return null;let{a,b:o}=t.findDiffEnd(e,r+t.size,r+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(a,o));n-=a+l-s}if(a<s&&t.size<e.size){let l=n<=s&&n>=a?s-n:0;s-=l,s&&s<e.size&&Mre(e.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}else if(o<s){let l=n<=s&&n>=o?s-n:0;s-=l,s&&s<t.size&&Mre(t.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}return{start:s,endA:a,endB:o}}function Mre(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}var kI=class{constructor(e,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new t5,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Fre),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Dre(this),Ore(this),this.nodeViews=Nre(this),this.docView=pre(this.state.doc,_re(this),$F(this),this.dom,this),this.domObserver=new a5(this,(n,i,s,a)=>N5e(this,n,i,s,a)),this.domObserver.start(),c5e(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&r5(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Fre),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var n;let i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(lne(this),a=!0),this.state=e;let o=i.plugins!=e.plugins||this._props.plugins!=r.plugins;if(o||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let p=Nre(this);$5e(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(o||r.handleDOMEvents!=this._props.handleDOMEvents)&&r5(this),this.editable=Dre(this),Ore(this);let l=$F(this),c=_re(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(i.selection))&&(a=!0);let f=u=="preserve"&&a&&this.dom.style.overflowAnchor==null&&IFe(this);if(a){this.domObserver.stop();let p=d&&(Yi||Zn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&j5e(i.selection,e.selection);if(d){let h=Zn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=w5e(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=pre(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&KFe(this))?vc(this,p):(Xre(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&AFe(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof _e){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&ore(this,r.getBoundingClientRect(),e)}else ore(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e)}}updateDraggedNode(e,r){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let s=n.from+(this.state.doc.content.size-r.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==n.node&&(i=s)}this.dragging=new vI(e.slice,e.move,i<0?void 0:_e.create(this.state.doc,i))}someProp(e,r){let n=this._props&&this._props[e],i;if(n!=null&&(i=r?r(n):n))return i;for(let a=0;a<this.directPlugins.length;a++){let o=this.directPlugins[a].props[e];if(o!=null&&(i=r?r(o):o))return i}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let o=s[a].props[e];if(o!=null&&(i=r?r(o):o))return i}}hasFocus(){if(Yi){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&PFe(this.dom),vc(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null}posAtCoords(e){return OFe(this,e)}coordsAtPos(e,r=1){return qre(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let i=this.docView.posFromDOM(e,r,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,r){return VFe(this,r||this.state,e)}pasteHTML(e,r){return Qw(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return Qw(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return u5(this,e)}destroy(){this.docView&&(u5e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$F(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,gFe())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return f5e(this,e)}dispatch(e){let r=this._props.dispatchTransaction;r?r.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?wi&&this.root.nodeType===11&&wFe(this.dom.ownerDocument)==this.dom&&L5e(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function _re(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),e.translate||(e.translate="no"),[Zr.node(0,t.state.doc.content.size,e)]}function Ore(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Zr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Dre(t){return!t.someProp("editable",e=>e(t.state)===!1)}function j5e(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function Nre(t){let e=Object.create(null);function r(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function $5e(t,e){let r=0,n=0;for(let i in t){if(t[i]!=e[i])return!0;r++}for(let i in e)n++;return r!=n}function Fre(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var t1=U5e;function U5e(t,e){for(var r={},n=Object.keys(t),i=n.length,s=0;s<i;s++){var a=n[s];r[a]=e(t[a],a,t)}return r}var Xi=class extends Error{},m5=class extends Xi{constructor(){super("Unable to find editor. Pass it as an argument or call this function inside a ProseKit component.")}},hne=class extends Xi{constructor(){super("Unable to find browser Document. When not in the browser environment, you need to pass a DOM Document.")}};function n1(t,e){if(typeof e=="string"){let r=t.marks[e];if(!r)throw new Xi(`Cannot find mark type "${e}"`);return r}return e}function gn(t,e="Assertion failed"){if(!t)throw new Xi(e)}function i1(t,e){if(typeof e=="string"){let r=t.nodes[e];if(!r)throw new Xi(`Cannot find ProseMirror node type "${e}"`);return r}return e}var z5e=0,mne=class{constructor(t,e,r,n){this._reducer=r,this._reduce=n,this.index=z5e++,gn((n||r)&&!(n&&r)),this.parent=t,this.singleton=e,this.path=t?[...t.path,this.index]:[]}get reducer(){return this._reducer??this._reduce?.()}};function Jr(t){return new mne(t.parent,t.singleton??!1,t.reducer,t.reduce)}function EI(t){return t instanceof As}function gne(t){return t instanceof Fe}function Ls(t){return t!=null}function q5e(t){let e,r,n,i;for(let a of t)e=a.schema||e,r=a.commands||r,n=a.state||n,i=a.view||i;let s=e&&(n?.({schema:e})??{schema:e});return{schema:e,state:s,commands:r,view:i}}var II=new mne(null,!0,q5e),g5=Jr({reducer:t=>{gn(t.length<=1);let e=t[0];return{schema:e?new rI(e):null}},parent:II,singleton:!0}),yne=class{constructor(){this.trees=[null,null,null,null,null]}getTree(t){var e;let r=t??this.priority??2;return(e=this.trees)[r]||(e[r]=this.createTree(r))}findFacetOutput(t){let e=this.getTree();for(let r of t.path)e=e?.children.get(r);return e?.getOutput()??null}get schema(){return this.findFacetOutput(g5)?.find(Boolean)?.schema??null}};function vne(t,e){let r=[...t];for(let n of e)r.includes(n)||r.push(n);return r}function H5e(t,e){return t.filter(r=>!e.includes(r))}function y5(t){return t.toReversed?.()??[...t].reverse()}function bne(t,e,r){return[r(t[0],e[0]),r(t[1],e[1]),r(t[2],e[2]),r(t[3],e[3]),r(t[4],e[4])]}function G5e(t,e){return!t&&!e?null:vne(t??[],e??[])}function W5e(t,e){return t?e?H5e(t,e):[...t]:null}function K5e(t,e){let r=new Map(t);for(let[n,i]of e.entries()){let s=t.get(n);r.set(n,s?v5(s,i):i)}return r}function Y5e(t,e){let r=new Map(t);for(let[n,i]of e.entries()){let s=t.get(n);s&&r.set(n,xne(s,i))}return r}function v5(t,e){return gn(t.facet===e.facet),new TI(t.facet,bne(t.inputs,e.inputs,G5e),K5e(t.children,e.children),t.reducers)}function xne(t,e){return gn(t.facet===e.facet),new TI(t.facet,bne(t.inputs,e.inputs,W5e),Y5e(t.children,e.children),t.reducers)}var TI=class{constructor(t,e=[null,null,null,null,null],r=new Map,n=[null,null,null,null,null]){this.facet=t,this.inputs=e,this.children=r,this.reducers=n,this.output=null}calcOutput(){var t,e,r;let n=[null,null,null,null,null],i=[null,null,null,null,null];for(let s=0;s<5;s++){let a=this.inputs[s];a&&(n[s]=[...a])}for(let s of this.children.values()){let a=s.getOutput();for(let o=0;o<5;o++)a[o]&&(n[o]||(n[o]=[])).push(a[o])}if(this.facet.singleton){let s=(t=this.reducers)[e=2]||(t[e]=this.facet.reducer),a=n.filter(Ls).flat();i[2]=s(a)}else for(let s=0;s<5;s++){let a=n[s];if(a){let o=(r=this.reducers)[s]||(r[s]=this.facet.reducer);i[s]=o(a)}}return i}getOutput(){return this.output||(this.output=this.calcOutput()),this.output}getSingletonOutput(){return gn(this.facet.singleton),this.getOutput()[2]}getRootOutput(){gn(this.isRoot());let t=this.getSingletonOutput();return gn(t),t}isRoot(){return!this.facet.parent}},X5e=class extends yne{constructor(t,e){super(),this.facet=t,this.payloads=e}createTree(t){let e=this.priority??t,r=[null,null,null,null,null];r[e]=[...this.payloads];let n=new TI(this.facet,r);for(;n.facet.parent;){let i=new Map([[n.facet.index,n]]);n=new TI(n.facet.parent,void 0,i)}return n}};function Ms(t,e){return new X5e(t,e)}function Q5e(t){return typeof t=="object"&&t!=null}var Z5e=1;function s1(t){return Q5e(t)&&t.nodeType===Z5e&&typeof t.nodeName=="string"}function J5e(){if(typeof document<"u")return document;if(typeof globalThis<"u"&&globalThis.document)return globalThis.document}function wne(){if(typeof window<"u")return window;if(typeof globalThis<"u"&&globalThis.window)return globalThis.window}function kne(t){return t?.document??J5e()??wne()?.document}function e8e(t){return t?.document?.defaultView??wne()??kne(t)?.defaultView??void 0}function t8e(t){let e=kne(t);if(e)return e;throw new hne}function r8e(t){let e=e8e(t);if(e)return e;throw new hne}function a1(t){return t.toJSON()}function Sne(t,e){let{DOMParser:r,schema:n,...i}=e;return(r||Cp).fromSchema(n).parse(t,i)}function Cne(t,e){let r=e?.DOMSerializer||Ps,n=t8e(e),i=t.type.schema,s=r.fromSchema(i);return i.topNodeType!==t.type?s.serializeNode(t,{document:n}):s.serializeFragment(t.content,{document:n},n.createElement("div"))}function n8e(t,e){let r=r8e(e);return new r.DOMParser().parseFromString(`<body><div>${t}</div></body>`,"text/html").body.firstElementChild}function Tne(t,e){return Cne(t,e).outerHTML}function Ene(t,e){return a1(Sne(t,e))}function Ine(t,e){return Ene(n8e(t,e),e)}var b5=Jr({reduce:()=>{let t=[],e=r=>{let n=t.map(s=>s(r)),i={schema:r.schema,storedMarks:[],plugins:[]};for(let s of n)i.schema=i.schema??s.schema,i.doc=i.doc??s.doc,i.selection=i.selection??s.selection,i.storedMarks=[...i.storedMarks,...s.storedMarks??[]],i.plugins=vne(i.plugins??[],s.plugins??[]);return gn(i.doc||i.schema,"Can't create state without a schema nor a document"),i.doc&&(i.schema=void 0),i};return function(n){return t=n,{state:e}}},singleton:!0,parent:II});function Ane(t,e){return typeof e=="string"?Ine(e,{schema:t}):s1(e)?Ene(e,{schema:t}):e}function i8e(t,e){return EI(e)?e:t.nodeFromJSON(Ane(t,e))}function s8e(t,e){let r=i8e(t,e);return gn(r.type.schema===t,"Document schema does not match editor schema"),gn(r.type===t.topNodeType,`Document type does not match editor top node type. Expected ${t.topNodeType.name}, got ${r.type.name}`),r}function a8e(t,e){return gne(e)?(gn(e.$head.doc===t,"Selection and doc do not match"),e):e==="start"?Fe.atStart(t):e==="end"?Fe.atEnd(t):Fe.fromJSON(t,e)}function Pne({defaultSelection:t,defaultContent:e,defaultDoc:r,defaultHTML:n}){let i=e||r||n;return Ms(b5,[({schema:s})=>{let a={};if(i){let o=Ane(s,i);a.doc=s.nodeFromJSON(o),t&&(a.selection=Fe.fromJSON(a.doc,t))}return a}])}function o8e(t,e){return Object.keys(t).every(r=>t[r]===e[r])}function Rne(t,e,r){return r=r||{},t.some(n=>n.type===e&&o8e(r,n.attrs))}function AI(t,e,r,n,i){let s=!1,a=!1;return t.nodesBetween(e,r,(o,l,c)=>{if(s)return!1;c?.type.allowsMarkType(n)&&!o.marks.some(d=>d.type!==n&&d.type.excludes(n))&&(a=!0,Rne(o.marks,n,i)||(s=!0))}),a?s:!0}function Lne(t,e,r){let{from:n,$from:i,to:s,empty:a}=t.selection,o=n1(t.schema,e);if(a){let l=t.storedMarks||i.marks();return Rne(l,o,r)}else return!AI(t.doc,n,s,o,r)}var l8e=class extends yne{constructor(t=[]){super(),this.extension=t}createTree(t){let e=this.priority??t,r=[...this.extension];r.sort((s,a)=>(s.priority??e)-(a.priority??e));let n=r.map(s=>s.getTree(e));gn(n.length>0);let i=n[0];for(let s=1;s<n.length;s++)i=v5(i,n[s]);return i}};function _s(...t){let e=t.flat();return gn(e.length>0,"At least one extension is required"),new l8e(e)}function r1(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&t.every((r,n)=>r1(r,e[n]));if(t instanceof Is&&e instanceof Is)return t.size===e.size&&r1(t.toObject(),e.toObject());if(typeof t=="object"&&typeof e=="object"){let r=Object.keys(t),n=Object.keys(e);return r.length===n.length&&r.every(i=>r1(t[i],e[i]))}return!1}function c8e(t,e){let r=t.attrs;for(let[n,i]of Object.entries(e))if(r[n]!==i)return!1;return!0}function Mne(t,e,r){let n=t.selection.$from,i=i1(t.schema,e);for(let s=n.depth;s>=0;s--){let a=n.node(s);if(a.type===i&&(!r||c8e(a,r)))return!0}return!1}function u8e(t,e,r=y8e){return t1(t.nodes,n=>d8e(n,e,r))}function d8e(t,e,r){let n=(...i)=>g8e(t,i,r);return n.isActive=i=>{let s=e();return s?Mne(s,t,i):!1},n}function f8e(t,e,r=m8e){return t1(t.marks,n=>p8e(n,e,r))}function p8e(t,e,r){let n=(...i)=>h8e(t,i,r);return n.isActive=i=>{let s=e();return s?Lne(s,t,i):!1},n}function h8e(t,e,r){let[n,i]=_ne(e),s=t.create(n);return r(s,x5(t.schema,i))}var m8e=(t,e)=>e.map(r=>r.mark(t.addToSet(r.marks)));function g8e(t,e,r){let[n,i]=_ne(e);return r(t,n,x5(t.schema,i))}var y8e=(t,e,r)=>{let n=t.createAndFill(e,r);return gn(n,`Failed to create node ${t.name}`),n};function x5(t,e){let r=[];for(let n of e)if(typeof n=="string")n&&r.push(t.text(n,null));else if(Array.isArray(n))r.push(...x5(t,n));else if(EI(n))r.push(n);else throw new Xi(`Invalid node child: ${typeof n}`);return r}function _ne(t){let[e,...r]=t;return v8e(e)?(r.unshift(e),[null,r]):typeof e=="object"?[e,r]:[null,r]}function v8e(t){return t?typeof t=="string"||Array.isArray(t)||EI(t):!1}function b8e(t){return t.defaultContent||t.defaultDoc||t.defaultHTML?_s(t.extension,Pne(t)):t.extension}function w5(t){let e=b8e(t),r=new One(e);return new Dne(r)}var One=class{constructor(t){this.view=null,this.commands={},this.afterMounted=[],this.getState=()=>this.view?.state||this.directEditorProps.state,this.dispatch=s=>{this.view?this.view.dispatch(s):this.directEditorProps.state=this.directEditorProps.state.apply(s)},this.getDocJSON=()=>{let s=this.getState();return a1(s.doc)},this.getDocHTML=s=>{let a=this.getProp("clipboardSerializer"),o=a?{fromSchema:()=>a}:void 0,l=this.getDoc();return Tne(l,{...s,DOMSerializer:o})},this.tree=t.getTree();let e=this.tree.getRootOutput(),r=e.schema,n=e.state;gn(r&&n,"Schema must be defined");let i=Gw.create(n);if(e.commands)for(let[s,a]of Object.entries(e.commands))this.defineCommand(s,a);this.nodes=u8e(i.schema,this.getState),this.marks=f8e(i.schema,this.getState),this.schema=i.schema,this.directEditorProps={state:i,...e.view}}getDoc(){return this.getState().doc}getProp(t){return this.view?.someProp(t)??this.directEditorProps[t]}updateState(t){this.view?this.view.updateState(t):this.directEditorProps.state=t}setContent(t,e){let r=s8e(this.schema,t);r.check();let n=a8e(r,e||"start"),i=this.getState();if(r.eq(i.doc)&&(!e||n.eq(i.selection)))return;let s=Gw.create({doc:r,selection:n,plugins:i.plugins});this.updateState(s)}updateExtension(t,e){let r=this.view;if(!r||r.isDestroyed)return;let n=t.getTree(),i=n.getRootOutput();if(i?.schema)throw new Xi("Schema cannot be changed");if(i?.view)throw new Xi("View cannot be changed");let s=this.tree.getRootOutput(),a=[...r.state?.plugins??[]];this.tree=e?v5(this.tree,n):xne(this.tree,n);let o=this.tree.getRootOutput(),l=[...o?.state?.plugins??[]];if(!r1(a,l)){let c=r.state.reconfigure({plugins:l});r.updateState(c)}if(o?.commands&&!r1(s?.commands,o?.commands)){let c=o.commands,u=Object.keys(c);for(let d of u)this.defineCommand(d,c[d])}}use(t){if(!this.mounted){let e=!1,r=null,n=()=>{e||(r=this.use(t))};return this.afterMounted.push(n),()=>{e=!0,r?.()}}return this.updateExtension(t,!0),()=>this.updateExtension(t,!1)}mount(t){if(this.view)throw new Xi("Editor is already mounted");this.view=new kI({mount:t},this.directEditorProps),this.afterMounted.forEach(e=>e())}unmount(){this.view&&(this.directEditorProps.state=this.view.state,this.view.destroy(),this.view=null)}get mounted(){return!!this.view&&!this.view.isDestroyed}get assertView(){if(!this.view)throw new Xi("Editor is not mounted");return this.view}definePlugins(t){let e=this.assertView,r=e.state,n=[...t,...r.plugins],i=r.reconfigure({plugins:n});e.setProps({state:i})}removePlugins(t){let e=this.view;if(!e)return;let r=e.state,n=r.plugins.filter(s=>!t.includes(s)),i=r.reconfigure({plugins:n});e.setProps({state:i})}exec(t){let e=this.getState();return t(e,this.dispatch,this.view??void 0)}canExec(t){let e=this.getState();return t(e,void 0,this.view??void 0)}defineCommand(t,e){let r=(...i)=>{let s=e(...i);return this.exec(s)},n=(...i)=>{let s=e(...i);return this.canExec(s)};r.canApply=n,r.canExec=n,this.commands[t]=r}removeCommand(t){delete this.commands[t]}},Dne=class{constructor(t){if(this.mount=e=>{e?this.instance.mount(e):this.instance.unmount()},this.unmount=()=>{this.instance.unmount()},this.focus=()=>{this.instance.view?.focus()},this.blur=()=>{this.instance.view?.dom.blur()},this.use=e=>this.instance.use(e),this.updateState=e=>{this.instance.updateState(e)},this.setContent=(e,r)=>this.instance.setContent(e,r),this.getDocJSON=()=>this.instance.getDocJSON(),this.getDocHTML=e=>this.instance.getDocHTML(e),this.exec=e=>this.instance.exec(e),this.canExec=e=>this.instance.canExec(e),!(t instanceof One))throw new TypeError("Invalid EditorInstance");this.instance=t}get mounted(){return this.instance.mounted}get view(){return this.instance.assertView}get schema(){return this.instance.schema}get state(){return this.instance.getState()}get focused(){return this.instance.view?.hasFocus()??!1}get commands(){return this.instance.commands}get nodes(){return this.instance.nodes}get marks(){return this.instance.marks}};var PI=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Fne(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}var x8e=(t,e,r)=>{let n=Fne(t,r);if(!n)return!1;let i=C5(n);if(!i){let a=n.blockRange(),o=a&&lI(a);return o==null?!1:(e&&e(t.tr.lift(a,o).scrollIntoView()),!0)}let s=i.nodeBefore;if(jne(t,i,e,-1))return!0;if(n.parent.content.size==0&&(Ag(s,"end")||_e.isSelectable(s)))for(let a=n.depth;;a--){let o=qw(t.doc,n.before(a),n.after(a),oe.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(Ag(s,"end")?Fe.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):_e.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(a==1||n.node(a-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},Bne=(t,e,r)=>{let n=Fne(t,r);if(!n)return!1;let i=C5(n);return i?w8e(t,i,e):!1};function w8e(t,e,r){let n=e.nodeBefore,i=n,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let a=e.nodeAfter,o=a,l=e.pos+1;for(;!o.isTextblock;l++){if(o.type.spec.isolating)return!1;let u=o.firstChild;if(!u)return!1;o=u}let c=qw(t.doc,s,l,oe.empty);if(!c||c.from!=s||c instanceof Ki&&c.slice.size>=l-s)return!1;if(r){let u=t.tr.step(c);u.setSelection(Ze.create(u.doc,s)),r(u.scrollIntoView())}return!0}function Ag(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}var S5=(t,e,r)=>{let{$head:n,empty:i}=t.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;s=C5(n)}let a=s&&s.nodeBefore;return!a||!_e.isSelectable(a)?!1:(e&&e(t.tr.setSelection(_e.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function C5(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function k8e(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}var S8e=(t,e,r)=>{let n=k8e(t,r);if(!n)return!1;let i=Vne(n);if(!i)return!1;let s=i.nodeAfter;if(jne(t,i,e,1))return!0;if(n.parent.content.size==0&&(Ag(s,"start")||_e.isSelectable(s))){let a=qw(t.doc,n.before(),n.after(),oe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let o=t.tr.step(a);o.setSelection(Ag(s,"start")?Fe.findFrom(o.doc.resolve(o.mapping.map(i.pos)),1):_e.create(o.doc,o.mapping.map(i.pos))),e(o.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},C8e=(t,e,r)=>{let{$head:n,empty:i}=t.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;s=Vne(n)}let a=s&&s.nodeAfter;return!a||!_e.isSelectable(a)?!1:(e&&e(t.tr.setSelection(_e.create(t.doc,s.pos)).scrollIntoView()),!0)};function Vne(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}var o1=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
`).scrollIntoView()),!0)};function T5(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}var T8e=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let i=r.node(-1),s=r.indexAfter(-1),a=T5(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let o=r.after(),l=t.tr.replaceWith(o,o,a.createAndFill());l.setSelection(Fe.near(l.doc.resolve(o),1)),e(l.scrollIntoView())}return!0},l1=(t,e)=>{let r=t.selection,{$from:n,$to:i}=r;if(r instanceof Xn||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=T5(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,o=t.tr.insert(a,s.createAndFill());o.setSelection(Ze.create(o.doc,a+1)),e(o.scrollIntoView())}return!0},c1=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let s=r.before();if(hc(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let n=r.blockRange(),i=n&&lI(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)};function E5(t){return(e,r)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof _e&&e.selection.node.isBlock)return!n.parentOffset||!hc(e.doc,n.pos)?!1:(r&&r(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],a,o,l=!1,c=!1;for(let p=n.depth;;p--)if(n.node(p).isBlock){l=n.end(p)==n.pos+(n.depth-p),c=n.start(p)==n.pos-(n.depth-p),o=T5(n.node(p-1).contentMatchAt(n.indexAfter(p-1)));let m=t&&t(i.parent,l,n);s.unshift(m||(l&&o?{type:o}:null)),a=p;break}else{if(p==1)return!1;s.unshift(null)}let u=e.tr;(e.selection instanceof Ze||e.selection instanceof Xn)&&u.deleteSelection();let d=u.mapping.map(n.pos),f=hc(u.doc,d,s.length,s);if(f||(s[0]=o?{type:o}:null,f=hc(u.doc,d,s.length,s)),u.split(d,s.length,s),!l&&c&&n.node(a).type!=o){let p=u.mapping.map(n.before(a)),h=u.doc.resolve(p);o&&n.node(a-1).canReplaceWith(h.index(),h.index()+1,o)&&u.setNodeMarkup(u.mapping.map(n.before(a)),o)}return r&&r(u.scrollIntoView()),!0}}var E8e=E5();var I8e=(t,e)=>(e&&e(t.tr.setSelection(new Xn(t.doc))),!0);function A8e(t,e,r){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||_F(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function jne(t,e,r,n){let i=e.nodeBefore,s=e.nodeAfter,a,o,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&A8e(t,e,r))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(a=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(a[0]||s.type).validEnd){if(r){let p=e.pos+s.nodeSize,h=se.empty;for(let b=a.length-1;b>=0;b--)h=se.from(a[b].create(null,h));h=se.from(i.copy(h));let m=t.tr.step(new Rs(e.pos-1,p,e.pos,p,new oe(h,1,0),a.length,!0)),v=m.doc.resolve(p+2*a.length);v.nodeAfter&&v.nodeAfter.type==i.type&&_F(m.doc,v.pos)&&m.join(v.pos),r(m.scrollIntoView())}return!0}let u=s.type.spec.isolating||n>0&&l?null:Fe.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&lI(d);if(f!=null&&f>=e.depth)return r&&r(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&Ag(s,"start",!0)&&Ag(i,"end")){let p=i,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=s,v=1;for(;!m.isTextblock;m=m.firstChild)v++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(r){let b=se.empty;for(let x=h.length-1;x>=0;x--)b=se.from(h[x].copy(b));let y=t.tr.step(new Rs(e.pos-h.length,e.pos+s.nodeSize,e.pos+v,e.pos+s.nodeSize-v,new oe(b,h.length,0),0,!0));r(y.scrollIntoView())}return!0}}return!1}function $ne(t){return function(e,r){let n=e.selection,i=t<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(r&&r(e.tr.setSelection(Ze.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}var P8e=$ne(-1),R8e=$ne(1);function L8e(t,e,r,n){for(let i=0;i<e.length;i++){let{$from:s,$to:a}=e[i],o=s.depth==0?t.inlineContent&&t.type.allowsMarkType(r):!1;if(t.nodesBetween(s.pos,a.pos,(l,c)=>{if(o||!n&&l.isAtom&&l.isInline&&c>=s.pos&&c+l.nodeSize<=a.pos)return!1;o=l.inlineContent&&l.type.allowsMarkType(r)}),o)return!0}return!1}function M8e(t){let e=[];for(let r=0;r<t.length;r++){let{$from:n,$to:i}=t[r];n.doc.nodesBetween(n.pos,i.pos,(s,a)=>{if(s.isAtom&&s.content.size&&s.isInline&&a>=n.pos&&a+s.nodeSize<=i.pos)return a+1>n.pos&&e.push(new xg(n,n.doc.resolve(a+1))),n=n.doc.resolve(a+1+s.content.size),!1}),n.pos<i.pos&&e.push(new xg(n,i))}return e}function Une(t,e=null,r){let n=(r&&r.removeWhenPresent)!==!1,i=(r&&r.enterInlineAtoms)!==!1,s=!(r&&r.includeWhitespace);return function(a,o){let{empty:l,$cursor:c,ranges:u}=a.selection;if(l&&!c||!L8e(a.doc,u,t,i))return!1;if(o)if(c)t.isInSet(a.storedMarks||c.marks())?o(a.tr.removeStoredMark(t)):o(a.tr.addStoredMark(t.create(e)));else{let d,f=a.tr;i||(u=M8e(u)),n?d=!u.some(p=>a.doc.rangeHasMark(p.$from.pos,p.$to.pos,t)):d=!u.every(p=>{let h=!1;return f.doc.nodesBetween(p.$from.pos,p.$to.pos,(m,v,b)=>{if(h)return!1;h=!t.isInSet(m.marks)&&!!b&&b.type.allowsMarkType(t)&&!(m.isText&&/^\s*$/.test(m.textBetween(Math.max(0,p.$from.pos-v),Math.min(m.nodeSize,p.$to.pos-v))))}),!h});for(let p=0;p<u.length;p++){let{$from:h,$to:m}=u[p];if(!d)f.removeMark(h.pos,m.pos,t);else{let v=h.pos,b=m.pos,y=h.nodeAfter,x=m.nodeBefore,w=s&&y&&y.isText?/^\s*/.exec(y.text)[0].length:0,C=s&&x&&x.isText?/\s*$/.exec(x.text)[0].length:0;v+w<b&&(v+=w,b-=C),f.addMark(v,b,t.create(e))}}o(f.scrollIntoView())}return!0}}function ol(...t){return function(e,r,n){for(let i=0;i<t.length;i++)if(t[i](e,r,n))return!0;return!1}}var k5=ol(PI,x8e,S5),Nne=ol(PI,S8e,C8e),bc={Enter:ol(o1,l1,c1,E8e),"Mod-Enter":T8e,Backspace:k5,"Mod-Backspace":k5,"Shift-Backspace":k5,Delete:Nne,"Mod-Delete":Nne,"Mod-a":I8e},zne={"Ctrl-h":bc.Backspace,"Alt-Backspace":bc["Mod-Backspace"],"Ctrl-d":bc.Delete,"Ctrl-Alt-Backspace":bc["Mod-Delete"],"Alt-Delete":bc["Mod-Delete"],"Alt-d":bc["Mod-Delete"],"Ctrl-a":P8e,"Ctrl-e":R8e};for(let t in bc)zne[t]=bc[t];var _8e=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,qne=_8e?zne:bc;var RI=u1;function u1(t){let e=t;var r={}.toString.call(t).slice(8,-1);if(r=="Set")return new Set([...t].map(i=>u1(i)));if(r=="Map")return new Map([...t].map(i=>[u1(i[0]),u1(i[1])]));if(r=="Date")return new Date(t.getTime());if(r=="RegExp")return RegExp(t.source,O8e(t));if(r=="Array"||r=="Object"){e=Array.isArray(t)?[]:{};for(var n in t)e[n]=u1(t[n])}return e}function O8e(t){if(typeof t.source.flags=="string")return t.source.flags;var e=[];return t.global&&e.push("g"),t.ignoreCase&&e.push("i"),t.multiline&&e.push("m"),t.sticky&&e.push("y"),t.unicode&&e.push("u"),e.join("")}var LI=200,Dn=function(){};Dn.prototype.append=function(e){return e.length?(e=Dn.from(e),!this.length&&e||e.length<LI&&this.leafAppend(e)||this.length<LI&&e.leafPrepend(this)||this.appendInner(e)):this};Dn.prototype.prepend=function(e){return e.length?Dn.from(e).append(this):this};Dn.prototype.appendInner=function(e){return new D8e(this,e)};Dn.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?Dn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};Dn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Dn.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};Dn.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},r,n),i};Dn.from=function(e){return e instanceof Dn?e:e&&e.length?new Hne(e):Dn.empty};var Hne=function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,o){for(var l=s;l<a;l++)if(i(this.values[l],o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,o){for(var l=s-1;l>=a;l--)if(i(this.values[l],o+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=LI)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=LI)return new e(i.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(Dn);Dn.empty=new Hne([]);var D8e=function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,s,a){var o=this.left.length;if(i<o&&this.left.forEachInner(n,i,Math.min(s,o),a)===!1||s>o&&this.right.forEachInner(n,Math.max(i-o,0),Math.min(this.length,s)-o,a+o)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(n,i-o,Math.max(s,o)-o,a+o)===!1||s<o&&this.left.forEachInvertedInner(n,Math.min(i,o),s,a)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(n,i):n>=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Dn),I5=Dn;var N8e=500,Np=class t{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;r&&(i=this.remapping(n,this.items.length),s=i.maps.length);let a=e.tr,o,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(n,f+1),s=i.maps.length),s--,u.push(d);return}if(i){u.push(new ll(d.map));let p=d.step.map(i.slice(s)),h;p&&a.maybeStep(p).doc&&(h=a.mapping.maps[a.mapping.maps.length-1],c.push(new ll(h,void 0,void 0,c.length+u.length))),s--,h&&i.appendMap(h,s)}else a.maybeStep(d.step);if(d.selection)return o=i?d.selection.map(i.slice(s)):d.selection,l=new t(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:a,selection:o}}addTransform(e,r,n,i){let s=[],a=this.eventCount,o=this.items,l=!i&&o.length?o.get(o.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new ll(e.mapping.maps[u],d,r),p;(p=l&&l.merge(f))&&(f=p,u?s.pop():o=o.slice(0,o.length-1)),s.push(f),r&&(a++,r=void 0),i||(l=f)}let c=a-n.depth;return c>B8e&&(o=F8e(o,c),a-=c),new t(o.append(s),a)}remapping(e,r){let n=new jw;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,a)},e,r),n}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(r=>new ll(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-r),s=e.mapping,a=e.steps.length,o=this.eventCount;this.items.forEach(f=>{f.selection&&o--},i);let l=r;this.items.forEach(f=>{let p=s.getMirror(--l);if(p==null)return;a=Math.min(a,p);let h=s.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),v=f.selection&&f.selection.map(s.slice(l+1,p));v&&o++,n.push(new ll(h,m,v))}else n.push(new ll(h))},i);let c=[];for(let f=r;f<a;f++)c.push(new ll(s.maps[f]));let u=this.items.slice(0,i).append(c).append(n),d=new t(u,o);return d.emptyItemCount()>N8e&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,i=[],s=0;return this.items.forEach((a,o)=>{if(o>=e)i.push(a),a.selection&&s++;else if(a.step){let l=a.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=a.selection&&a.selection.map(r.slice(n));u&&s++;let d=new ll(c.invert(),l,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else a.map&&n--},this.items.length,0),new t(I5.from(i.reverse()),s)}};Np.empty=new Np(I5.empty,0);function F8e(t,e){let r;return t.forEach((n,i)=>{if(n.selection&&e--==0)return r=i,!1}),t.slice(r)}var ll=class t{constructor(e,r,n,i){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new t(r.getMap().invert(),r,this.selection)}}},cl=class{constructor(e,r,n,i,s){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}},B8e=20;function V8e(t,e,r,n){let i=r.getMeta(Dp),s;if(i)return i.historyState;r.getMeta(U8e)&&(t=new cl(t.done,t.undone,null,0,-1));let a=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(a&&a.getMeta(Dp))return a.getMeta(Dp).redo?new cl(t.done.addTransform(r,void 0,n,MI(e)),t.undone,Gne(r.mapping.maps),t.prevTime,t.prevComposition):new cl(t.done,t.undone.addTransform(r,void 0,n,MI(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=r.getMeta("composition"),l=t.prevTime==0||!a&&t.prevComposition!=o&&(t.prevTime<(r.time||0)-n.newGroupDelay||!j8e(r,t.prevRanges)),c=a?A5(t.prevRanges,r.mapping):Gne(r.mapping.maps);return new cl(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,MI(e)),Np.empty,c,r.time,o??t.prevComposition)}else return(s=r.getMeta("rebased"))?new cl(t.done.rebased(r,s),t.undone.rebased(r,s),A5(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new cl(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),A5(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function j8e(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,i)=>{for(let s=0;s<e.length;s+=2)n<=e[s+1]&&i>=e[s]&&(r=!0)}),r}function Gne(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,i,s,a)=>e.push(s,a));return e}function A5(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let i=e.map(t[n],1),s=e.map(t[n+1],-1);i<=s&&r.push(i,s)}return r}function $8e(t,e,r){let n=MI(e),i=Dp.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,n);if(!s)return null;let a=s.selection.resolve(s.transform.doc),o=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,n),l=new cl(r?o:s.remaining,r?s.remaining:o,null,0,-1);return s.transform.setSelection(a).setMeta(Dp,{redo:r,historyState:l})}var P5=!1,Wne=null;function MI(t){let e=t.plugins;if(Wne!=e){P5=!1,Wne=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){P5=!0;break}}return P5}var Dp=new ut("history"),U8e=new ut("closeHistory");function Kne(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ve({key:Dp,state:{init(){return new cl(Np.empty,Np.empty,null,0,-1)},apply(e,r,n){return V8e(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,i=n=="historyUndo"?OI:n=="historyRedo"?d1:null;return i?(r.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function _I(t,e){return(r,n)=>{let i=Dp.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let s=$8e(i,r,t);s&&n(e?s.scrollIntoView():s)}return!0}}var OI=_I(!1,!0),d1=_I(!0,!0),g0t=_I(!1,!1),y0t=_I(!0,!1);var xc={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},NI={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},z8e=typeof navigator<"u"&&/Mac/.test(navigator.platform),q8e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Ur=0;Ur<10;Ur++)xc[48+Ur]=xc[96+Ur]=String(Ur);var Ur;for(Ur=1;Ur<=24;Ur++)xc[Ur+111]="F"+Ur;var Ur;for(Ur=65;Ur<=90;Ur++)xc[Ur]=String.fromCharCode(Ur+32),NI[Ur]=String.fromCharCode(Ur);var Ur;for(DI in xc)NI.hasOwnProperty(DI)||(NI[DI]=xc[DI]);var DI;function Yne(t){var e=z8e&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||q8e&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?NI:xc)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}var H8e=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function G8e(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,i,s,a;for(let o=0;o<e.length-1;o++){let l=e[o];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))H8e?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(r="Alt-"+r),i&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function W8e(t){let e=Object.create(null);for(let r in t)e[G8e(r)]=t[r];return e}function R5(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function FI(t){let e=W8e(t);return function(r,n){let i=Yne(n),s,a=e[R5(i,n)];if(a&&a(r.state,r.dispatch,r))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let o=e[R5(i,n,!1)];if(o&&o(r.state,r.dispatch,r))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(s=xc[n.keyCode])&&s!=i){let o=e[R5(s,n)];if(o&&o(r.state,r.dispatch,r))return!0}}return!1}}var Qne=K8e((t,e,r)=>{if(!e)return null;let n=r.depth==0?null:Zne(r.node(-1).contentMatchAt(r.indexAfter(-1)));if(!n)return null;let i=Y8e(t,n);return i?{type:n,attrs:i}:null});function K8e(t){return(e,r)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof _e&&e.selection.node.isBlock)return!n.parentOffset||!hc(e.doc,n.pos)?!1:(r&&r(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(r){let s=i.parentOffset==i.parent.content.size,a=e.tr;(e.selection instanceof Ze||e.selection instanceof Xn)&&a.deleteSelection();let o=n.depth==0?null:Zne(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=t&&t(i.parent,s,n),c=l?[l]:s&&o?[{type:o}]:void 0,u=hc(a.doc,a.mapping.map(n.pos),1,c);if(!c&&!u&&hc(a.doc,a.mapping.map(n.pos),1,o?[{type:o}]:void 0)&&(o&&(c=[{type:o}]),u=!0),u&&(a.split(a.mapping.map(n.pos),1,c),!s&&!n.parentOffset&&n.parent.type!=o)){let d=a.mapping.map(n.before()),f=a.doc.resolve(d);o&&n.node(-1).canReplaceWith(f.index(),f.index()+1,o)&&a.setNodeMarkup(a.mapping.map(n.before()),o)}r(a.scrollIntoView())}return!0}}function Y8e(t,e){let r=Xne(t.type,!0),n=Xne(e,!0),i=r.filter(s=>n.includes(s));return i.length===0?null:Object.fromEntries(i.map(s=>[s,t.attrs[s]]))}function Xne(t,e){var r;let n=[];for(let[i,s]of Object.entries((r=t.spec.attrs)!=null?r:{}))s.splittable===e&&n.push(i);return n}function Zne(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function Gu({type:t,attrs:e,removeWhenPresent:r=!1,enterInlineAtoms:n=!0}){return(i,s,a)=>Une(n1(i.schema,t),e,{removeWhenPresent:r,enterInlineAtoms:n})(i,s,a)}function rie(t,e){let r=_s(t);return r.priority=e,r}function Ci(t){if(t instanceof Ve||Array.isArray(t)&&t.every(e=>e instanceof Ve))return Jne(()=>t);if(typeof t=="function")return Jne(t);throw new TypeError("Invalid plugin")}function Jne(t){return Ms(Sa,[t])}var Sa=Jr({reducer:t=>({schema:e})=>{let r=[];for(let n of t)if(n instanceof Ve)r.push(n);else if(Array.isArray(n)&&n.every(i=>i instanceof Ve))r.push(...n);else if(typeof n=="function")r.push(...[n({schema:e})].flat());else throw new Xi("Invalid plugin");return r.reverse(),{plugins:r}},parent:b5});function BI(t){return e=>t.filter(Ls).reduce((r,n)=>n(r),e)}function VI(t,e){return e?e(t):t}var X8e=class extends Ps{constructor(t,e,r,n){super(t,e),this.serializeFragmentWrapper=r,this.serializeNodeWrapper=n}serializeFragment(...t){return VI((...r)=>super.serializeFragment(...r),this.serializeFragmentWrapper)(...t)}serializeNode(...t){return VI((...r)=>super.serializeNode(...r),this.serializeNodeWrapper)(...t)}};function Q8e(t,e){let r=(...a)=>Ps.nodesFromSchema(...a),n=(...a)=>Ps.marksFromSchema(...a),i=VI(r,e.nodesFromSchemaWrapper)(t),s=VI(n,e.marksFromSchemaWrapper)(t);return new X8e(i,s,e.serializeFragmentWrapper,e.serializeNodeWrapper)}var H0t=Jr({reducer:t=>{let e={serializeFragmentWrapper:BI(t.map(r=>r.serializeFragmentWrapper)),serializeNodeWrapper:BI(t.map(r=>r.serializeNodeWrapper)),nodesFromSchemaWrapper:BI(t.map(r=>r.nodesFromSchemaWrapper)),marksFromSchemaWrapper:BI(t.map(r=>r.marksFromSchemaWrapper))};return({schema:r})=>{let n=Q8e(r,e);return[new Ve({key:new ut("prosekit-clipboard-serializer"),props:{clipboardSerializer:n}})]}},singleton:!0,parent:Sa});var Z8e=Jr({reducer:t=>({commands:Object.assign({},...t)}),parent:II,singleton:!0});function ul(t){return Ms(Z8e,[t])}var nie=Jr({reducer:t=>{let e=Is.from({}),r=Is.from({}),n;for(let i of t)e=e.append(i.nodes),r=r.append(i.marks??{}),n=n??i.topNode;return{nodes:e,marks:r,topNode:n}},parent:g5,singleton:!0});function iie(t,e){let r={};for(let n of t){let i=e(n);(r[i]||(r[i]=[])).push(n)}return r}function sie(t){let e={};for(let[r,n]of t)(e[r]||(e[r]=[])).push(n);return e}function J8e(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r]=n);return e}function eie(...t){let e=t.filter(Ls).map(J8e);return Object.assign({},...e)}function aie(t,e){let r={},n=new Set([...Object.keys(t.attrs??{}),...Object.keys(e.attrs??{})]);for(let s of n){let a=t.attrs?.[s],o=e.attrs?.[s],l=eie(a,o);l&&(r[s]=l)}let i=[...t.parseDOM??[],...e.parseDOM??[]];return eie(t,e,{attrs:r,parseDOM:i})}function oie(t,e){return(r,...n)=>{let i=t(r,...n),s=e.map(a=>a.toDOM?.(r.attrs[a.attr])).filter(Ls);return e9e(i,s)}}function lie(t,e){let r=t.getAttrs,n=t.attrs;return{...t,getAttrs:i=>{let s=r?.(i)??n??{};if(s===!1||!i||!s1(i))return s??null;let a={};for(let o of e)o.parseDOM&&(a[o.attr]=o.parseDOM(i));return{...s,...a}}}}function e9e(t,e){if(!t)return t;if(Array.isArray(t)){let r=t.slice(1),n;r.length>0&&(r[0]==null||typeof r[0]=="object")?n=r.shift():n={};let i=t9e(n,e);return[t[0],i,...r]}return s1(t)?tie(t,e):typeof t=="object"&&"dom"in t&&s1(t.dom)?{...t,dom:tie(t.dom,e)}:t}function t9e(t,e){t={...t};for(let[r,n]of e){let i=t[r],s=r==="style"?cie(n,typeof i=="string"?i:""):n;t[r]=s}return t}function tie(t,e){t=t.cloneNode(!0);for(let[r,n]of e){let i=t.getAttribute(r),s=r==="style"?cie(n,typeof i=="string"?i:""):n;t.setAttribute(r,s)}return t}function cie(...t){return t.map(e=>e.trim().replace(/;$/,"")).filter(Boolean).join("; ")}function Pg(t){return Ms(r9e,[[t,void 0]])}var r9e=Jr({reducer:t=>{let e=Is.from({}),r,n=t.map(a=>a[0]).filter(Ls),i=t.map(a=>a[1]).filter(Ls);for(let{name:a,topNode:o,...l}of n){o&&(r=a);let c=e.get(a);c?e=e.update(a,aie(c,l)):e=e.addToStart(a,l)}let s=iie(i,a=>a.type);for(let[a,o]of Object.entries(s)){if(!o)continue;let l=e.get(a);gn(l,`Node type ${a} must be defined`);let c=RI(l);c.attrs||(c.attrs={});for(let u of o)c.attrs[u.attr]={default:u.default,validate:u.validate,splittable:u.splittable};c.toDOM&&(c.toDOM=oie(c.toDOM,o)),c.parseDOM&&(c.parseDOM=c.parseDOM.map(u=>lie(u,o))),e=e.update(a,c)}return{nodes:e,topNode:r}},parent:nie,singleton:!0});function uie(){return Pg({name:"doc",content:"block+",topNode:!0})}function die(t){return fie(["mount",t])}function L5(t){return fie(["update",t])}function fie(t){return Ms(n9e,[t])}var n9e=Jr({reduce:()=>{let t=[],e=[],r=[],n=new Ve({key:i9e,view:s=>(t.forEach(a=>a(s)),{update:(a,o)=>{e.forEach(l=>l(a,o))},destroy:()=>{r.forEach(a=>a())}})}),i=s=>{t=[],e=[],r=[];for(let a of s)switch(a[0]){case"mount":t.push(a[1]);break;case"update":e.push(a[1]);break;case"unmount":r.push(a[1]);break}};return function(a){return i(a),n}},parent:Sa,singleton:!0}),i9e=new ut("prosekit-plugin-view-handler");function pie(t){return L5((e,r)=>{e.state.doc.eq(r.doc)||t(e,r)})}function Os(){let t=[];function e(n){t=y5(n)}function r(...n){for(let i of t)if(i(...n))return!0;return!1}return[e,r]}var Q0t=Jr({reduce:()=>{let t={},e={},r,n=i=>{let s=!1;for(let[o]of i)if(!t[o]){s=!0;let[l,c]=Os();t[o]=l;let u=(d,f)=>c(d,f);e[o]=u}let a=sie(i);for(let[o,l]of Object.entries(t)){let c=a[o]??[];l(c)}s&&(r=new Ve({key:new ut("prosekit-dom-event-handler"),props:{handleDOMEvents:e}}))};return function(s){return n(s),r??[]}},parent:Sa,singleton:!0});function s9e(t){return Ms(a9e,[t])}function hie(t){return s9e(["clickOn",t])}var a9e=Jr({reduce:()=>{let[t,e]=o9e();return r=>(t(r),e)},parent:Sa,singleton:!0});function o9e(){let[t,e]=Os(),[r,n]=Os(),[i,s]=Os(),[a,o]=Os(),[l,c]=Os(),[u,d]=Os(),[f,p]=Os(),[h,m]=Os(),[v,b]=Os(),[y,x]=Os(),[w,C]=Os(),[O,S]=Os(),T=P=>{let R=sie(P);t(R.keyDown??[]),r(R.keyPress??[]),i(R.textInput??[]),a(R.clickOn??[]),l(R.click??[]),u(R.doubleClickOn??[]),f(R.doubleClick??[]),h(R.tripleClickOn??[]),v(R.tripleClick??[]),y(R.paste??[]),w(R.drop??[]),O(R.scrollToSelection??[])},E=new Ve({key:new ut("prosekit-editor-event"),props:{handleKeyDown:e,handleKeyPress:n,handleTextInput:s,handleClickOn:o,handleClick:c,handleDoubleClickOn:d,handleDoubleClick:p,handleTripleClickOn:m,handleTripleClick:b,handlePaste:x,handleDrop:C,handleScrollToSelection:S}});return[T,E]}var M5=typeof navigator<"u"?/Mac|iP(hone|[ao]d)/.test(navigator.platform):!1;function Fp(t){return Ms(l9e,[t])}var l9e=Jr({reduce:()=>{let t,e=(n,i)=>t?t(n,i):!1,r=new Ve({key:d9e,props:{handleKeyDown:e}});return n=>(t=FI(c9e(y5(n))),r)},parent:Sa,singleton:!0});function c9e(t){let e={};for(let r of t)for(let[n,i]of Object.entries(r))(e[n]||(e[n]=[])).push(i);return t1(e,u9e)}function u9e(t){return ol(...t)}var d9e=new ut("prosekit-keymap"),mie={"Mod-z":OI,"Shift-Mod-z":d1};M5||(mie["Mod-y"]=d1);var f9e={undo:()=>OI,redo:()=>d1};function gie({depth:t=200,newGroupDelay:e=250}={}){return _s(Ci(Kne({depth:t,newGroupDelay:e})),Fp(mie),ul(f9e))}var p9e=ol(o1,l1,c1,Qne),h9e=ol(PI,Bne,S5),axt={...qne,Enter:p9e,Backspace:h9e};function jI(t){return Ms(m9e,[[t,void 0]])}var m9e=Jr({reducer:t=>{let e=Is.from({}),r=t.map(s=>s[0]).filter(Ls),n=t.map(s=>s[1]).filter(Ls);for(let{name:s,...a}of r){let o=e.get(s);o?e=e.update(s,aie(o,a)):e=e.addToStart(s,a)}let i=iie(n,s=>s.type);for(let[s,a]of Object.entries(i)){if(!a)continue;let o=e.get(s);gn(o,`Mark type ${s} must be defined`);let l=RI(o);l.attrs||(l.attrs={});for(let c of a)l.attrs[c.attr]={default:c.default,validate:c.validate};l.toDOM&&(l.toDOM=oie(l.toDOM,a)),l.parseDOM&&(l.parseDOM=l.parseDOM.map(c=>g9e(c,a))),e=e.update(s,l)}return{marks:e,nodes:{}}},parent:nie,singleton:!0});function g9e(t,e){return t.tag?lie(t,e):t}var uxt=Jr({reducer:t=>{let e={};for(let r of t)e[r.name]||(e[r.name]=r.constructor);return()=>[new Ve({key:new ut("prosekit-mark-view"),props:{markViews:e}})]},parent:Sa});function yie(t){return Ms(v9e,[[t,null]])}var y9e=typeof window>"u",v9e=Jr({reducer:t=>{if(y9e)return[];let e={},r=t.map(i=>i[0]).filter(Ls),n=t.map(i=>i[1]).filter(Ls);for(let{group:i,name:s,args:a}of n){let o=r.find(l=>l.group===i);o&&(e[s]=o.factory(a))}return()=>[new Ve({key:new ut("prosekit-mark-view-effect"),props:{markViews:e}})]},parent:Sa});var pxt=Jr({reducer:t=>{let e={};for(let r of t)e[r.name]||(e[r.name]=r.constructor);return()=>[new Ve({key:new ut("prosekit-node-view"),props:{nodeViews:e}})]},parent:Sa});function vie(t){return Ms(x9e,[[t,null]])}var b9e=typeof window>"u",x9e=Jr({reducer:t=>{if(b9e)return[];let e={},r=t.map(i=>i[0]).filter(Ls),n=t.map(i=>i[1]).filter(Ls);for(let{group:i,name:s,args:a}of n){let o=r.find(l=>l.group===i);o&&(e[s]=o.factory(a))}return()=>[new Ve({key:new ut("prosekit-node-view-effect"),props:{nodeViews:e}})]},parent:Sa});function bie(){return Pg({name:"text",group:"inline"})}function w9e(t){let e;return()=>(e===void 0&&(e=t()),e)}var $I=w9e(()=>{try{return"ab".replace(new RegExp("(?<=a)b","g"),"c")==="ac"}catch{return!1}});function xie(t,...e){return typeof t=="function"?t(...e):t}var UI=Z(Te(),1),wie=(0,UI.createContext)(null);function _5(){return(0,UI.useContext)(wie)}var kie=wie.Provider;var Ke=Z(Te(),1);var Sie=t=>{throw TypeError(t)},k9e=(t,e,r)=>e.has(t)||Sie("Cannot "+r),F5=(t,e,r)=>e.has(t)?Sie("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),f1=(t,e,r)=>(k9e(t,e,"access private method"),r),zI,O5,HI=class{constructor({mark:e,view:r,inline:n,options:i}){F5(this,zI),this.shouldIgnoreMutation=s=>!this.dom||!this.contentDOM?!0:s.type==="selection"?!1:this.contentDOM===s.target&&s.type==="attributes"?!0:!this.contentDOM.contains(s.target),this.ignoreMutation=s=>{if(!this.dom||!this.contentDOM)return!0;let a,o=this.options.ignoreMutation;return o&&(a=o(s)),typeof a!="boolean"&&(a=this.shouldIgnoreMutation(s)),a},this.destroy=()=>{var s,a;(a=(s=this.options).destroy)==null||a.call(s),this.dom.remove(),this.contentDOM.remove()},this.mark=e,this.view=r,this.inline=n,this.options=i,this.dom=this.createDOM(i.as),this.contentDOM=this.createContentDOM(i.contentAs),this.dom.setAttribute("data-mark-view-root","true"),this.contentDOM.setAttribute("data-mark-view-content","true"),this.contentDOM.style.whiteSpace="inherit"}createDOM(e){return f1(this,zI,O5).call(this,e)}createContentDOM(e){return f1(this,zI,O5).call(this,e)}get component(){return this.options.component}};zI=new WeakSet,O5=function(t){let{inline:e,mark:r}=this;return t==null?document.createElement(e?"span":"div"):t instanceof HTMLElement?t:t instanceof Function?t(r):document.createElement(t)};var qI,D5,GI=class{constructor({node:e,view:r,getPos:n,decorations:i,innerDecorations:s,options:a}){F5(this,qI),this.selected=!1,this.selectNode=()=>{var o,l;this.selected=!0,(l=(o=this.options).selectNode)==null||l.call(o)},this.deselectNode=()=>{var o,l;this.selected=!1,(l=(o=this.options).deselectNode)==null||l.call(o)},this.shouldUpdate=o=>!(o.type!==this.node.type||o.sameMarkup(this.node)&&o.content.eq(this.node.content)),this.update=(o,l,c)=>{var u,d;let f=this.options.update,p;return f&&(p=f(o,l,c)),typeof p!="boolean"&&(p=this.shouldUpdate(o)),this.node=o,this.decorations=l,this.innerDecorations=c,p&&((d=(u=this.options).onUpdate)==null||d.call(u)),p},this.shouldIgnoreMutation=o=>!this.dom||!this.contentDOM||this.node.isLeaf||this.node.isAtom?!0:o.type==="selection"?!1:this.contentDOM===o.target&&o.type==="attributes"?!0:!this.contentDOM.contains(o.target),this.ignoreMutation=o=>{if(!this.dom||!this.contentDOM)return!0;let l,c=this.options.ignoreMutation;return c&&(l=c(o)),typeof l!="boolean"&&(l=this.shouldIgnoreMutation(o)),l},this.destroy=()=>{var o,l,c;(l=(o=this.options).destroy)==null||l.call(o),this.dom.remove(),(c=this.contentDOM)==null||c.remove()},this.setAttrs=o=>{let{dispatch:l,state:c}=this.view,u=this.getPos();if(typeof u=="number")return l(c.tr.setNodeMarkup(u,void 0,{...this.node.attrs,...o}))},this.node=e,this.view=r,this.getPos=n,this.decorations=i,this.innerDecorations=s,this.options=a,this.dom=this.createDOM(a.as),this.contentDOM=e.isLeaf?null:this.createContentDOM(a.contentAs),this.dom.setAttribute("data-node-view-root","true"),this.contentDOM&&(this.contentDOM.setAttribute("data-node-view-content","true"),this.contentDOM.style.whiteSpace="inherit"),this.setSelection=a.setSelection,this.stopEvent=a.stopEvent}createDOM(e){return f1(this,qI,D5).call(this,e)}createContentDOM(e){return f1(this,qI,D5).call(this,e)}get component(){return this.options.component}};qI=new WeakSet,D5=function(t){let{node:e}=this;return t==null?document.createElement(e.isInline?"span":"div"):t instanceof HTMLElement?t:t instanceof Function?t(e):document.createElement(t)};var WI=class{constructor(e){this.view=e.view,this.options=e.options}get component(){return this.options.component}get root(){var e,r;let n=(r=(e=this.options).root)==null?void 0:r.call(e,this.view.dom);return n||(n=this.view.dom.parentElement??document.body),n}update(e,r){var n,i;this.view=e,this.prevState=r,(i=(n=this.options).update)==null||i.call(n,e,r)}destroy(){var e,r;(r=(e=this.options).destroy)==null||r.call(e)}},N5,Cie,KI=class{constructor({pos:e,spec:r,options:n}){F5(this,N5),this.pos=e,this.options=n,this.spec=r,this.dom=f1(this,N5,Cie).call(this,n.as),this.dom.setAttribute("data-widget-view-root","true")}bind(e,r){this.view=e,this.getPos=r}get component(){return this.options.component}};N5=new WeakSet,Cie=function(t){return t instanceof HTMLElement?t:document.createElement(t)};var Bp=Z(Af(),1);var S9e=(0,Ke.createContext)({contentRef:()=>{},view:null,mark:null});var Tie=(0,Ke.createContext)(t=>{throw new Error("No ProsemirrorAdapterProvider detected, maybe you need to wrap the component with the Editor with ProsemirrorAdapterProvider?")}),Eie=()=>(0,Ke.useContext)(Tie),B5=class extends HI{constructor(){super(...arguments),this.key=Xr(),this.context={contentRef:e=>{e&&this.contentDOM&&e.firstChild!==this.contentDOM&&e.appendChild(this.contentDOM)},view:this.view,mark:this.mark},this.updateContext=()=>{Object.assign(this.context,{mark:this.mark})},this.render=()=>{let e=this.component;return(0,Bp.createPortal)(Ke.default.createElement(S9e.Provider,{value:this.context},Ke.default.createElement(e,null)),this.dom,this.key)}}},C9e=(0,Ke.createContext)({contentRef:()=>{},view:null,getPos:()=>0,setAttrs:()=>{},node:null,selected:!1,decorations:[],innerDecorations:null});var Iie=(0,Ke.createContext)(t=>{throw new Error("No ProsemirrorAdapterProvider detected, maybe you need to wrap the component with the Editor with ProsemirrorAdapterProvider?")}),Aie=()=>(0,Ke.useContext)(Iie),V5=class extends GI{constructor(){super(...arguments),this.key=Xr(),this.context={contentRef:e=>{e&&this.contentDOM&&e.firstChild!==this.contentDOM&&e.appendChild(this.contentDOM)},view:this.view,getPos:this.getPos,setAttrs:this.setAttrs,node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations},this.updateContext=()=>{Object.assign(this.context,{node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations})},this.render=()=>{let e=this.component;return(0,Bp.createPortal)(Ke.default.createElement(C9e.Provider,{value:this.context},Ke.default.createElement(e,null)),this.dom,this.key)}}},T9e=(0,Ke.createContext)({view:null});var E9e=(0,Ke.createContext)(t=>{throw new Error("out of scope")});var j5=class extends WI{constructor(){super(...arguments),this.key=Xr(),this.context={view:this.view,prevState:this.prevState},this.updateContext=()=>{Object.assign(this.context,{view:this.view,prevState:this.prevState})},this.render=()=>{let e=this.component;return(0,Bp.createPortal)(Ke.default.createElement(T9e.Provider,{value:this.context},Ke.default.createElement(e,null)),this.root,this.key)}}};function I9e(t,e){return(0,Ke.useCallback)(r=>(n,i,s)=>{let a=new B5({mark:n,view:i,inline:s,options:{...r,destroy(){var o;(o=r.destroy)==null||o.call(r),e(a)}}});return t(a,!1),a},[e,t])}function A9e(t,e){return(0,Ke.useCallback)(r=>(n,i,s,a,o)=>{let l=new V5({node:n,view:i,getPos:s,decorations:a,innerDecorations:o,options:{...r,onUpdate(){var c;(c=r.onUpdate)==null||c.call(r),t(l)},selectNode(){var c;(c=r.selectNode)==null||c.call(r),t(l)},deselectNode(){var c;(c=r.deselectNode)==null||c.call(r),t(l)},destroy(){var c;(c=r.destroy)==null||c.call(r),e(l)}}});return t(l,!1),l},[e,t])}function P9e(t,e){return(0,Ke.useCallback)(r=>n=>{let i=new j5({view:n,options:{...r,update:(s,a)=>{var o;(o=r.update)==null||o.call(r,s,a),t(i)},destroy:()=>{var s;(s=r.destroy)==null||s.call(r),e(i)}}});return t(i,!1),i},[e,t])}function R9e(){let[t,e]=(0,Ke.useState)({}),r=(0,Ke.useRef)(!1);(0,Ke.useEffect)(()=>(requestAnimationFrame(()=>{r.current=!0}),()=>{r.current=!1}),[]);let n=(0,Ke.useCallback)(a=>{r.current?(0,Bp.flushSync)(a):a()},[]),i=(0,Ke.useCallback)((a,o=!0)=>{n(()=>{o&&a.updateContext(),e(l=>({...l,[a.key]:a.render()}))})},[n]),s=(0,Ke.useCallback)(a=>{n(()=>{e(o=>{let l={...o};return delete l[a.key],l})})},[n]);return{portals:t,renderReactRenderer:i,removeReactRenderer:s}}var L9e=(0,Ke.createContext)({view:null,getPos:()=>{}});var M9e=(0,Ke.createContext)(t=>{throw new Error("out of scope")});var $5=class extends KI{constructor(){super(...arguments),this.key=Xr(),this.context={view:this.view,getPos:this.getPos,spec:this.spec},this.updateContext=()=>{Object.assign(this.context,{view:this.view,getPos:this.getPos,spec:this.spec})},this.render=()=>{let e=this.component;return(0,Bp.createPortal)(Ke.default.createElement(L9e.Provider,{value:this.context},Ke.default.createElement(e,null)),this.dom,this.key)}}};function _9e(t,e){return(0,Ke.useCallback)(r=>(n,i={})=>{let s=new $5({pos:n,options:r}),a={...i,destroy:o=>{var l;(l=i.destroy)==null||l.call(i,o),e(s)}};return s.spec=a,Zr.widget(n,(o,l)=>(s.bind(o,l),t(s),s.dom),a)},[e,t])}var Pie=({children:t})=>{let{renderReactRenderer:e,removeReactRenderer:r,portals:n}=R9e(),i=A9e(e,r),s=I9e(e,r),a=P9e(e,r),o=_9e(e,r),l=(0,Ke.useMemo)(()=>Object.values(n),[n]);return Ke.default.createElement(Iie.Provider,{value:i},Ke.default.createElement(Tie.Provider,{value:s},Ke.default.createElement(E9e.Provider,{value:a},Ke.default.createElement(M9e.Provider,{value:o},t,l))))};var p1=Z(Te(),1);var U5=Z(Te(),1);var Rie=Z(Te(),1);var Lie=Z(Te(),1);var z5=Z(Te(),1);var _ie=Z(Te(),1);var YI=Z(Te(),1);var $9e=Z(Te(),1);var U9e=Z(Te(),1);function O9e(t,e){if(!t)throw new m5;(0,Rie.useEffect)(()=>{if(e)return t.use(e)},[t,e])}function D9e(t,e){return(0,Lie.useMemo)(()=>t&&e?rie(t,e):t,[t,e])}function Vp(t,e){let r=_5();O9e(e?.editor||r,D9e(t,e?.priority))}var N9e=()=>{let t=Eie(),e=(0,U5.useMemo)(()=>F9e(t),[t]);return Vp(e),null};function F9e(t){return yie({group:"react",factory:t})}var B9e=()=>{let t=Aie(),e=(0,z5.useMemo)(()=>V9e(t),[t]);return Vp(e),null};function V9e(t){return vie({group:"react",factory:t})}var Mie=t=>{let{editor:e,children:r}=t;return(0,p1.createElement)(Pie,null,(0,p1.createElement)(kie,{value:e},(0,p1.createElement)(B9e),(0,p1.createElement)(N9e),r))};function Oie(t,e){let r=(0,_ie.useMemo)(()=>pie(n=>t(n.state.doc)),[t]);return Vp(r,e)}function q5(t){let e=t?.update??!1,r=_5();if(!r)throw new Xi("useEditor must be used within the ProseKit component");let n=j9e();return(0,YI.useEffect)(()=>{if(e){let i=_s(die(n),L5(n));return r.use(i)}},[r,e,n]),r}function j9e(){let[,t]=(0,YI.useReducer)(e=>e+1,0);return t}var m1=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&!(this.regexp&&!G9e(this.search)),this.wholeWord=!!e.wholeWord,this.filter=e.filter||null,this.impl=this.valid?this.regexp?new W5(this):new G5(this):z9e}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}findNext(e,r=0,n=e.doc.content.size){for(;;){if(r>=n)return null;let i=this.impl.findNext(e,r,n);if(!i||this.checkResult(e,i))return i;r=i.from+1}}findPrev(e,r=e.doc.content.size,n=0){for(;;){if(r<=n)return null;let i=this.impl.findPrev(e,r,n);if(!i||this.checkResult(e,i))return i;r=i.to-1}}checkResult(e,r){return(!this.wholeWord||Nie(e,r.from)&&Nie(e,r.to))&&(!this.filter||this.filter(e,r))}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?`
`:n=="r"?"\r":n=="t"?" ":"\\")}getReplacements(e,r){let n=e.doc.resolve(r.from),i=n.marksAcross(e.doc.resolve(r.to)),s=[],a=se.empty,o=r.from,{match:l}=r,c=l?q9e(l):[[0,r.to-r.from]],u=H9e(this.unquote(this.replace)),d;for(let f of u)if(typeof f=="string")a=a.addToEnd(e.schema.text(f,i));else if(d=c[f.group]){let p=n.depth;for(;p>0&&n.node(p).isInline;)p--;let h=n.start(p)+d[0],m=n.start(p)+d[1];f.copy?a=a.append(e.doc.slice(h,m).content):((a!=se.empty||h>o)&&(s.push({from:o,to:h,insert:new oe(a,0,0)}),a=se.empty),o=m)}return(a!=se.empty||o<r.to)&&s.push({from:o,to:r.to,insert:new oe(a,0,0)}),s}},z9e=new class{findNext(){return null}findPrev(){return null}},G5=class{constructor(e){this.query=e;let r=e.unquote(e.search);e.caseSensitive||(r=r.toLowerCase()),this.string=r}findNext(e,r,n){return Lg(e.doc,r,n,(i,s)=>{let a=Math.max(r,s),o=g1(i).slice(a-s,Math.min(i.content.size,n-s)),l=(this.query.caseSensitive?o:o.toLowerCase()).indexOf(this.string);return l<0?null:{from:a+l,to:a+l+this.string.length,match:null}})}findPrev(e,r,n){return Lg(e.doc,r,n,(i,s)=>{let a=Math.max(s,n),o=g1(i).slice(a-s,Math.min(i.content.size,r-s));this.query.caseSensitive||(o=o.toLowerCase());let l=o.lastIndexOf(this.string);return l<0?null:{from:a+l,to:a+l+this.string.length,match:null}})}},Fie="g"+(/x/.unicode==null?"":"u")+(/x/.hasIndices==null?"":"d"),W5=class{constructor(e){this.query=e,this.regexp=new RegExp(e.search,Fie+(e.caseSensitive?"":"i"))}findNext(e,r,n){return Lg(e.doc,r,n,(i,s)=>{let a=g1(i).slice(0,Math.min(i.content.size,n-s));this.regexp.lastIndex=r-s;let o=this.regexp.exec(a);return o?{from:s+o.index,to:s+o.index+o[0].length,match:o}:null})}findPrev(e,r,n){return Lg(e.doc,r,n,(i,s)=>{let a=g1(i).slice(0,Math.min(i.content.size,r-s)),o;for(let l=0;;){this.regexp.lastIndex=l;let c=this.regexp.exec(a);if(!c)break;o=c,l=c.index+1}return o?{from:s+o.index,to:s+o.index+o[0].length,match:o}:null})}};function q9e(t){if(t.indices)return t.indices;let e=[[0,t[0].length]];for(let r=1,n=0;r<t.length;r++){let i=t[r]?t[0].indexOf(t[r],n):-1;e.push(i<0?void 0:[i,n=i+t[r].length])}return e}function H9e(t){let e=[],r=-1;function n(i){let s=e.length-1;s>-1&&typeof e[s]=="string"?e[s]+=i:e.push(i)}for(;t.length;){let i=/\$([$&\d+])/.exec(t);if(!i)return n(t),e;if(i.index>0&&n(t.slice(0,i.index+(i[1]=="$"?1:0))),i[1]!="$"){let s=i[1]=="&"?0:+i[1];r>=s?e.push({group:s,copy:!0}):(r=s||1e3,e.push({group:s,copy:!1}))}t=t.slice(i.index+i[0].length)}return e}function G9e(t){try{return new RegExp(t,Fie),!0}catch{return!1}}var Die=new WeakMap;function g1(t){let e=Die.get(t);if(e)return e;let r="";for(let n=0;n<t.childCount;n++){let i=t.child(n);i.isText?r+=i.text:i.isLeaf?r+="\uFFFC":r+=" "+g1(i)+" "}return Die.set(t,r),r}function Lg(t,e,r,n,i=0){if(t.inlineContent)return n(t,i);if(!t.isLeaf)if(e>r)for(let s=t.childCount-1,a=i+t.content.size;s>=0&&a>r;s--){let o=t.child(s);if(a-=o.nodeSize,a<e){let l=Lg(o,e,r,n,a+1);if(l!=null)return l}}else for(let s=0,a=i;s<t.childCount&&a<r;s++){let o=t.child(s),l=a;if(a+=o.nodeSize,a>e){let c=Lg(o,e,r,n,l+1);if(c!=null)return c}}return null}function Nie(t,e){let r=t.doc.resolve(e),n=r.nodeBefore,i=r.nodeAfter;return!n||!i||!n.isText||!i.isText?!0:!/\p{L}$/u.test(n.text)||!/^\p{L}/u.test(i.text)}var h1=class{constructor(e,r,n){this.query=e,this.range=r,this.deco=n}};function H5(t,e,r){if(!e.valid)return kr.empty;let n=[],i=t.selection;for(let s=r?r.from:0,a=r?r.to:t.doc.content.size;;){let o=e.findNext(t,s,a);if(!o)break;let l=o.from==i.from&&o.to==i.to?"ProseMirror-active-search-match":"ProseMirror-search-match";n.push(Zr.inline(o.from,o.to,{class:l})),s=o.to}return kr.create(t.doc,n)}var Rg=new ut("search");function Bie(t={}){return new Ve({key:Rg,state:{init(e,r){let n=t.initialQuery||new m1({search:""}),i=t.initialRange||null;return new h1(n,i,H5(r,n,i))},apply(e,r,n,i){let s=e.getMeta(Rg);if(s)return new h1(s.query,s.range,H5(i,s.query,s.range));if(e.docChanged||e.selectionSet){let a=r.range;if(a){let o=e.mapping.map(a.from,1),l=e.mapping.map(a.to,-1);a=o<l?{from:o,to:l}:null}r=new h1(r.query,a,H5(i,r.query,a))}return r}},props:{decorations:e=>Rg.getState(e).deco}})}function K5(t,e,r,n,i){let s=t.range||{from:0,to:e.doc.content.size},a=t.query.findNext(e,Math.max(i,s.from),s.to);return!a&&r&&(a=t.query.findNext(e,s.from,Math.min(n,s.to))),a}function W9e(t,e,r,n,i){let s=t.range||{from:0,to:e.doc.content.size},a=t.query.findPrev(e,Math.min(n,s.to),s.from);return!a&&r&&(a=t.query.findPrev(e,s.to,Math.max(i,s.from))),a}function XI(t,e){return(r,n)=>{let i=Rg.getState(r);if(!i||!i.query.valid)return!1;let{from:s,to:a}=r.selection,o=e>0?K5(i,r,t,s,a):W9e(i,r,t,s,a);if(!o)return!1;let l=Ze.create(r.doc,o.from,o.to);return n&&n(r.tr.setSelection(l).scrollIntoView()),!0}}var Vie=XI(!0,1),jie=XI(!1,1),$ie=XI(!0,-1),Uie=XI(!1,-1);function Y5(t,e){return(r,n)=>{let i=Rg.getState(r);if(!i||!i.query.valid)return!1;let{from:s}=r.selection,a=K5(i,r,t,s,s);if(!a)return!1;if(!n)return!0;if(r.selection.from==a.from&&r.selection.to==a.to){let o=r.tr,l=i.query.getReplacements(r,a);for(let u=l.length-1;u>=0;u--){let{from:d,to:f,insert:p}=l[u];o.replace(d,f,p)}let c=e&&K5(i,r,t,a.from,a.to);c?o.setSelection(Ze.create(o.doc,o.mapping.map(c.from,1),o.mapping.map(c.to,-1))):o.setSelection(Ze.create(o.doc,a.from,o.mapping.map(a.to,1))),n(o.scrollIntoView())}else if(e)n(r.tr.setSelection(Ze.create(r.doc,a.from,a.to)).scrollIntoView());else return!1;return!0}}var zie=Y5(!0,!0),qie=Y5(!1,!0),Hie=Y5(!1,!1),Gie=(t,e)=>{let r=Rg.getState(t);if(!r)return!1;let n=[],i=r.range||{from:0,to:t.doc.content.size};for(let s=i.from;;){let a=r.query.findNext(t,s,i.to);if(!a)break;n.push(a),s=a.to}if(e){let s=t.tr;for(let a=n.length-1;a>=0;a--){let o=n[a],l=r.query.getReplacements(t,o);for(let c=l.length-1;c>=0;c--){let{from:u,to:d,insert:f}=l[c];s.replace(u,d,f)}}e(s)}return!0};function Wie(t){let e=new m1(t);return Ci(Bie({initialQuery:e}))}function K9e(t){if(t.isDestroyed)return;t.dom.querySelector(".ProseMirror-active-search-match")?.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}function Wu(t){return(e,r,n)=>{let i=t(e,r,n);return i&&r&&n&&setTimeout(()=>K9e(n),50),i}}function Kie(){return ul({findNext:()=>Wu(Vie),findPrev:()=>Wu($ie),findNextNoWrap:()=>Wu(jie),findPrevNoWrap:()=>Wu(Uie),replaceNext:()=>Wu(zie),replaceNextNoWrap:()=>Wu(qie),replaceCurrent:()=>Wu(Hie),replaceAll:()=>Wu(Gie)})}var dl=class{constructor(e,r,n={}){this.match=e,this.match=e,this.handler=typeof r=="string"?Y9e(r):r,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function Y9e(t){return function(e,r,n,i){let s=t;if(r[1]){let a=r[0].lastIndexOf(r[1]);s+=r[0].slice(a+r[1].length),n+=a;let o=n-i;o>0&&(s=r[0].slice(a-o,a)+s,n=i)}return e.tr.insertText(s,n,i)}}var X9e=500;function Xie({rules:t}){let e=new Ve({state:{init(){return null},apply(r,n){let i=r.getMeta(this);return i||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,i,s){return Yie(r,n,i,s,t,e)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&Yie(r,n.pos,n.pos,"",t,e)})}}},isInputRules:!0});return e}function Yie(t,e,r,n,i,s){if(t.composing)return!1;let a=t.state,o=a.doc.resolve(e),l=o.parent.textBetween(Math.max(0,o.parentOffset-X9e),o.parentOffset,null,"\uFFFC")+n;for(let c=0;c<i.length;c++){let u=i[c];if(!u.inCodeMark&&o.marks().some(p=>p.type.spec.code))continue;if(o.parent.type.spec.code){if(!u.inCode)continue}else if(u.inCode==="only")continue;let d=u.match.exec(l),f=d&&d[0].length>=n.length&&u.handler(a,d,e-(d[0].length-n.length),r);if(f)return u.undoable&&f.setMeta(s,{transform:f,from:e,to:r,text:n}),t.dispatch(f),!0}return!1}var Kxt=new dl(/--$/,"\u2014",{inCodeMark:!1}),Yxt=new dl(/\.\.\.$/,"\u2026",{inCodeMark:!1}),Xxt=new dl(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C",{inCodeMark:!1}),Qxt=new dl(/"$/,"\u201D",{inCodeMark:!1}),Zxt=new dl(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018",{inCodeMark:!1}),Jxt=new dl(/'$/,"\u2019",{inCodeMark:!1});function Q9e(t){return J9e(()=>t)}function Z9e({regex:t,type:e,attrs:r=null}){return new dl(t,(i,s,a,o)=>{let{tr:l,schema:c}=i,[u,d]=s;if(!d)return null;let f=a+u.indexOf(d),p=f+d.length;if(!(a<=f&&f<p&&p<=o))return null;let h=n1(c,e),m=h.create(xie(r,s));if(!AI(l.doc,f,p,h,r))return null;let v=l.storedMarks??[];return l.addMark(f,p,m),p<o&&l.delete(p,o),a<f&&l.delete(a,f),l.setStoredMarks(v),l})}function QI(t){return Q9e(Z9e(t))}function J9e(t){return Ms(e7e,[t])}var e7e=Jr({reducer:t=>e=>{let r=t.flatMap(n=>n(e));return[Xie({rules:r})]},parent:Sa});function t7e(){return ul({toggleBold:()=>Gu({type:"bold"})})}function r7e(){return QI({regex:$I()?/(?<=\s|^)\*\*([^\s*]|[^\s*][^*]*[^\s*])\*\*$/:/\*\*([^\s*]|[^\s*][^*]*[^\s*])\*\*$/,type:"bold"})}function n7e(){return Fp({"Mod-b":Gu({type:"bold"})})}function i7e(){return jI({name:"bold",parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>typeof t!="string"&&t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>typeof t=="string"&&/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong",0]}})}function Qie(){return _s(i7e(),t7e(),n7e(),r7e())}function Zie(t={}){return new Ve({view(e){return new X5(e,t)}})}var X5=class{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n;if(r){let o=e.nodeBefore,l=e.nodeAfter;if(o||l){let c=this.editorView.nodeDOM(this.cursorPos-(o?o.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=o?u.bottom:u.top;o&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),n={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!n){let o=this.editorView.coordsAtPos(this.cursorPos);n={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let s,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,a=-pageYOffset;else{let o=i.getBoundingClientRect();s=o.left-i.scrollLeft,a=o.top-i.scrollTop}this.element.style.left=n.left-s+"px",this.element.style.top=n.top-a+"px",this.element.style.width=n.right-n.left+"px",this.element.style.height=n.bottom-n.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,r,e):i;if(r&&!s){let a=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=cI(this.editorView.state.doc,a,this.editorView.dragging.slice);o!=null&&(a=o)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};function Jie(t){return Ci(()=>Zie(t))}var Jn=class t extends Fe{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return t.valid(n)?new t(n):Fe.near(n)}content(){return oe.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(r.pos))}getBookmark(){return new Q5(this.anchor)}static valid(e){let r=e.parent;if(r.isTextblock||!s7e(e)||!a7e(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let i=r.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&t.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let o=e.node(a);if(r>0?e.indexAfter(a)<o.childCount:e.index(a)>0){s=o.child(r>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=r;let l=e.doc.resolve(i);if(t.valid(l))return l}for(;;){let a=r>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!_e.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*r),n=!1;continue e}break}s=a,i+=r;let o=e.doc.resolve(i);if(t.valid(o))return o}return null}}};Jn.prototype.visible=!1;Jn.findFrom=Jn.findGapCursorFrom;Fe.jsonID("gapcursor",Jn);var Q5=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return Jn.valid(r)?new Jn(r):Fe.near(r)}};function s7e(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function a7e(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(r);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function ese(){return new Ve({props:{decorations:u7e,createSelectionBetween(t,e,r){return e.pos==r.pos&&Jn.valid(r)?new Jn(r):null},handleClick:l7e,handleKeyDown:o7e,handleDOMEvents:{beforeinput:c7e}}})}var o7e=FI({ArrowLeft:ZI("horiz",-1),ArrowRight:ZI("horiz",1),ArrowUp:ZI("vert",-1),ArrowDown:ZI("vert",1)});function ZI(t,e){let r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let a=n.selection,o=e>0?a.$to:a.$from,l=a.empty;if(a instanceof Ze){if(!s.endOfTextblock(r)||o.depth==0)return!1;l=!1,o=n.doc.resolve(e>0?o.after():o.before())}let c=Jn.findGapCursorFrom(o,e,l);return c?(i&&i(n.tr.setSelection(new Jn(c))),!0):!1}}function l7e(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!Jn.valid(n))return!1;let i=t.posAtCoords({left:r.clientX,top:r.clientY});return i&&i.inside>-1&&_e.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Jn(n))),!0)}function c7e(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Jn))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let i=se.empty;for(let a=n.length-1;a>=0;a--)i=se.from(n[a].createAndFill(null,i));let s=t.state.tr.replace(r.pos,r.pos,new oe(i,0,0));return s.setSelection(Ze.near(s.doc.resolve(r.pos+1))),t.dispatch(s),!1}function u7e(t){if(!(t.selection instanceof Jn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",kr.create(t.doc,[Zr.widget(t.selection.head,e,{key:"gapcursor"})])}function tse(){return Ci(()=>ese())}function d7e(){return ul({toggleItalic:()=>Gu({type:"italic"})})}function f7e(){return QI({regex:$I()?/(?<=\s|^)\*([^\s*]|[^\s*][^*]*[^\s*])\*$/:/\*([^\s*]|[^\s*][^*]*[^\s*])\*$/,type:"italic"})}function p7e(){return Fp({"Mod-i":Gu({type:"italic"})})}function h7e(){return jI({name:"italic",parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name==="italic"}],toDOM(){return["em",0]}})}function rse(){return _s(h7e(),d7e(),p7e(),f7e())}function nse(){return Ci(new Ve({key:m7e,props:{handleClick:g7e}}))}var m7e=new ut("prosekit-mod-click-prevention");function g7e(t,e,r){return!!r[y7e]}var y7e=M5?"metaKey":"ctrlKey";function sse(){return Ci(x7e)}var JI=new ut("prosekit-virtual-selection");function v7e(t){return t.getMeta(JI)}function ise(t,e){return t.setMeta(JI,e)}function b7e(t){return JI.getState(t)}var x7e=new Ve({key:JI,state:{init:()=>!1,apply:(t,e)=>v7e(t)??e},props:{handleDOMEvents:{focus:t=>{t.dispatch(ise(t.state.tr,!1))},blur:t=>{let{dom:e,root:r}=t;r.activeElement!==e&&t.dispatch(ise(t.state.tr,!0))}},decorations:t=>{let{selection:e,doc:r}=t;return e.empty||!b7e(t)?null:kr.create(r,[Zr.inline(e.from,e.to,{class:"prosekit-virtual-selection"})])}}});var w7e=Math.pow(10,8)*24*60*60*1e3,$wt=-w7e;var ase=864e5,ose=6e4,lse=36e5;var k7e=3600;var cse=k7e*24,Uwt=cse*7,S7e=cse*365.2425,C7e=S7e/12,zwt=C7e*3,Z5=Symbol.for("constructDateFrom");function Ds(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Z5 in t?t[Z5](e):t instanceof Date?new t.constructor(e):new Date(e)}function lr(t,e){return Ds(e||t,t)}function use(t,e,r){let n=lr(t,r?.in);return isNaN(e)?Ds(r?.in||t,NaN):(e&&n.setDate(n.getDate()+e),n)}function dse(t,e,r){let n=lr(t,r?.in);if(isNaN(e))return Ds(r?.in||t,NaN);if(!e)return n;let i=n.getDate(),s=Ds(r?.in||t,n.getTime());s.setMonth(n.getMonth()+e+1,0);let a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}function Mg(t,e,r){let{years:n=0,months:i=0,weeks:s=0,days:a=0,hours:o=0,minutes:l=0,seconds:c=0}=e,u=lr(t,r?.in),d=i||n?dse(u,i+n*12):u,f=a||s?use(d,a+s*7):d,p=l+o*60,m=(c+p*60)*1e3;return Ds(r?.in||t,+f+m)}function fse(t,e,r){return Ds(r?.in||t,+lr(t)+e)}function J5(t){let e=lr(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function ei(t,...e){let r=Ds.bind(null,t||e.find(n=>typeof n=="object"));return e.map(r)}function e8(t,e){let r=lr(t,e?.in);return r.setHours(0,0,0,0),r}function pse(t,e,r){let[n,i]=ei(r?.in,t,e),s=e8(n),a=e8(i),o=+s-J5(s),l=+a-J5(a);return Math.round((o-l)/ase)}function hse(t,e,r){return fse(t,e*1e3,r)}function jp(t,e){let r=+lr(t)-+lr(e);return r<0?-1:r>0?1:r}function mse(t,e,r){let[n,i]=ei(r?.in,t,e),s=n.getFullYear()-i.getFullYear(),a=n.getMonth()-i.getMonth();return s*12+a}function gse(t,e,r){let[n,i]=ei(r?.in,t,e);return n.getFullYear()-i.getFullYear()}function vse(t,e,r){let[n,i]=ei(r?.in,t,e),s=yse(n,i),a=Math.abs(pse(n,i));n.setDate(n.getDate()-s*a);let o=+(yse(n,i)===-s),l=s*(a-o);return l===0?0:l}function yse(t,e){let r=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return r<0?-1:r>0?1:r}function _g(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function bse(t,e,r){let[n,i]=ei(r?.in,t,e),s=(+n-+i)/lse;return _g(r?.roundingMethod)(s)}function eA(t,e){return+lr(t)-+lr(e)}function xse(t,e,r){let n=eA(t,e)/ose;return _g(r?.roundingMethod)(n)}function wse(t,e){let r=lr(t,e?.in);return r.setHours(23,59,59,999),r}function kse(t,e){let r=lr(t,e?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function Sse(t,e){let r=lr(t,e?.in);return+wse(r,e)==+kse(r,e)}function Cse(t,e,r){let[n,i,s]=ei(r?.in,t,t,e),a=jp(i,s),o=Math.abs(mse(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=jp(i,s)===-a;Sse(n)&&o===1&&jp(n,s)===1&&(l=!1);let c=a*(o-+l);return c===0?0:c}function Tse(t,e,r){let n=eA(t,e)/1e3;return _g(r?.roundingMethod)(n)}function Ese(t,e,r){let[n,i]=ei(r?.in,t,e),s=jp(n,i),a=Math.abs(gse(n,i));n.setFullYear(1584),i.setFullYear(1584);let o=jp(n,i)===-s,l=s*(a-+o);return l===0?0:l}function Ise(t,e){let[r,n]=ei(t,e.start,e.end);return{start:r,end:n}}function y1(t,e){let{start:r,end:n}=Ise(e?.in,t),i={},s=Ese(n,r);s&&(i.years=s);let a=Mg(r,{years:i.years}),o=Cse(n,a);o&&(i.months=o);let l=Mg(a,{months:i.months}),c=vse(n,l);c&&(i.days=c);let u=Mg(l,{days:i.days}),d=bse(n,u);d&&(i.hours=d);let f=Mg(u,{hours:i.hours}),p=xse(n,f);p&&(i.minutes=p);let h=Mg(f,{minutes:i.minutes}),m=Tse(n,h);return m&&(i.seconds=m),i}v1();function Qi(t){return!!t&&t.start>=0&&t.end<0}function fl(t){return!!t&&!Qi(t)&&(t.start>=0||t.end>=0)}var w1={main:/^(?<start>[\w:.]*)(?:,(?<end>[\w:.]+))?$/,npt_time:/^(?:npt:)?([\d.:]+)$/,npt_sec:/^\d+(?:\.\d+)?$/,npt_mmss:/^(?<mm>[0-5]\d):(?<ss>[0-5]\d(?:\.\d+)?)$/,npt_hhmmss:/^(?<hh>\d+):(?<mm>[0-5]\d):(?<ss>[0-5]\d(?:\.\d+)?)$/};function Fg(t){if(!t)return null;let e=t.match(w1.main);if(!e)return null;let{start:r,end:n}=e.groups;return rBe(r,n)}function rBe(t,e){let r=t||null,n=e??null,i,s;if(r&&n)i=aA(r),s=n==="e"?Number.POSITIVE_INFINITY:aA(n);else if(r)i=aA(r),s=-1;else if(n)i=-1,s=aA(n);else throw new Error("Missing startTime and endTime");return i===null||s===null||i>=0&&s>=0&&i>=s?null:{start:i,end:s}}function aA(t){let e=t.match(w1.npt_time);if(!e)return null;let r=e[1],n=r.match(w1.npt_sec);if(n)return Number(n[0]);let i=r.match(w1.npt_mmss);if(i){let{mm:a,ss:o}=i.groups;return Number(a)*60+Number(o)}let s=r.match(w1.npt_hhmmss);if(s){let{hh:a,mm:o,ss:l}=s.groups;return Number(a)*60*60+Number(o)*60+Number(l)}return null}function Use(t){if(t===0)return"DT0S";let e=y1({start:0,end:t*1e3}),{years:r,months:n,days:i,hours:s,minutes:a,seconds:o}=e,l="P";if(r&&(l+=`${r}Y`),n&&(l+=`${n}M`),i&&(l+=`${i}D`),s||a||o){l+="T",s&&(l+=`${s}H`),a&&(l+=`${a}M`);let u=u8(t,{seconds:o});u!=="0"&&(l+=`${u}S`)}return l}function c8(t){if(t===0)return"00:00";let e=y1({start:0,end:t*1e3}),r=e.hours??0,n=e.minutes??0,i=e.seconds??0,s=[n.toString().padStart(2,"0"),i.toString().padStart(2,"0")].join(":");return r>0?`${r}:${s}`:s}function u8(t,e,r={}){let{padStart:n}=r,i=t-Math.floor(t),a=(e.seconds??0).toString();if(n&&(a=a.padStart(n,"0")),i<=0)return a;let o=i.toFixed(2).replace(/^0+\./,"");return`${a}.${o}`}function k1(t){let{start:e,end:r}=t;return Qi(t)?e===0?null:`${oA(e)}`:e<0&&r>0?Number.isFinite(r)?`,${oA(r)}`:null:e>0&&r>0?`${oA(e)},${oA(r)}`:null}function oA(t){if(Number.isNaN(t)||t<0)throw new Error("durationInSecond must be positive");if(t===Number.POSITIVE_INFINITY)return"e";let e=y1({start:0,end:t*1e3}),r=e.hours??0,n=e.minutes??0,i=e.seconds??0,s=[n.toString().padStart(2,"0"),u8(t,{seconds:i},{padStart:2})].join(":");return r>0?`${r}:${s}`:s}var zse="&",d8="=",Bg="t",f8="xywh",Vg=class t{#e;constructor(e){if(typeof e=="string"){this.#e=[];let r=e.replace(/^[#?]+/,"").split(zse);for(let n of r){let i=n.indexOf(d8),s;if(i<0)s=[n,""];else{if(i===0)continue;s=[n.substring(0,i),n.substring(i+1)]}let[a,o]=s.map(decodeURIComponent);(a!==Bg||Fg(o))&&this.#e.push([a,o])}}else if(e instanceof t)this.#e=[...e.#e];else{if(this.#e=[],!e)return;let r=Array.isArray(e)?e:Object.entries(e);for(let[n,i]of r)n&&i&&this.#e.push([n,i])}}get temporal(){let e=this.get("t");if(e)return Fg(e)??void 0}get(e){return this.#e.filter(([r])=>r===e).at(-1)?.[1]}getAll(e){return this.#e.filter(([r])=>r===e).map(([,r])=>r)}setTemporal(e){if(!e)return this.delete(Bg),!0;let r=k1(e);return r?(this.#t(Bg,r),!0):!1}#t(e,r){let n=this.#e.filter(([i])=>i!==e);n.push([e,r]),this.#e=n}set(e,r){if(e===Bg||e===f8)throw new Error("t is a special key and cannot be set");this.#t(e,r)}delete(e){this.#e=this.#e.filter(([r])=>r!==e)}has(e){return this.#e.some(([r])=>r===e)}append(e,r){if(e===Bg||e===f8)throw new Error("t is a special key and cannot be appended");this.#e.push([e,r])}get size(){return this.#e.length}entries(){return this.#e.values()}*keys(){for(let[e]of this.#e)yield e}*values(){for(let[,e]of this.#e)yield e}[Symbol.iterator](){return this.entries()}forEach(e){for(let[r,n]of this.entries())e(n,r)}sort(){this.#e.sort(([e],[r])=>e<r?-1:e>r?1:0)}toString({renderFlag:e=!0}={}){return this.#e.map(([r,n])=>r===Bg||r===f8?[r,encodeURI(n)].join(d8):!n&&e?encodeURIComponent(r):[r,n].map(encodeURIComponent).join(d8)).join(zse)}};function Xu(t,e,r){return Hn(e,(n,i)=>{let s=r?.[i];return s?qse(t,s):qse(t,n)})}var qse=(t,e)=>{if(typeof e=="string")return t[e];let r=e.find(n=>n in t);if(r)return t[r]};function jg(t,e,{mappings:r}={}){let n={};for(let[i,s]of Object.entries(t)){let a=s;if(!(typeof a>"u"))if(i in e){let o=lA(i,e,r);n[o]=a}else n[i]=a}return n}var lA=(t,e,r)=>{let n=r?.[t]??e[t];if(Array.isArray(n)){let i=n[0];if(!i)throw new Error(`Mapping for ${t} is empty`);return i}return n};function Qu(t){return An(Hn(t,e=>Vt(ks(e),void 0)))}var cA=Ee(ke(),gi(),gD(({dataset:t,addIssue:e,NEVER:r})=>{let[n,i]=t.value.split(/[/:]/).map(l=>l.trim());if(!n||!i)return e({message:"Aspect ratio must be in the format of <width>/<height>"}),r;let s=Number.parseFloat(n),a=Number.parseFloat(i);if(Number.isNaN(s)||Number.isNaN(a))return e({message:"Aspect ratio x or y must be a number"}),r;let o=pl(s,a);return o||(e({message:"Aspect ratio cannot be reduced to lowest terms"}),r)}));function pl(t,e){if(t<=0||e<=0)return null;let r=nBe(t,e),n=t/r,i=e/r;return{width:n,height:i,syntax:`${n} / ${i}`}}function nBe(t,e){let r=t,n=e;for(;n!==0;){let i=n;n=r%n,r=i}return r}var iBe=Ee(Zo([Ee(ke(),gi()),Qo(!0)]),aa(t=>t==="use-credentials"?"use-credentials":"anonymous")),uA=Zo([iBe,Qo(!1)]);function dA(t){return t==="use-credentials"?"use-credentials":t==="anonymous"?!0:null}var $p=Pt(["horizontal","vertical","both","none"]);var wc=Ee(hr(),Gl(0),xs(4),Hl("audioGain"));var Up=Pt(["play","eager"]);var Hse=Pt(["video","audio"]);var zp=Ee(hr(),Gl(0),Hl("playbackRate"));var yo=Ee(hr(),c0(),Xa(0),xs(100),Hl("volume"));var kc={regular:{type:"as",title:"title",volume:"vol",aspectRatio:"ratio",crossOrigin:"crossorigin",flip:"flip",audioGain:"gain",playbackRate:"speed",embedLoadStrategy:"load"},flag:{enable:{loop:"loop",muted:"mute",autoPlay:"autoplay",showControls:"controls",preservePitch:"keep_pitch"},disable:{loop:"no_loop",muted:"no_mute",autoPlay:"no_autoplay",showControls:["no_controls","noctrl"],preservePitch:"no_pitch"}}},sBe=Ee(ke(),Qa(),gi()),h8=Ee(ks(ke()),aa(t=>t==="true"||t==="1"||t===""?!0:void 0)),p8=t=>Ee(ke(),aa(e=>Number.parseFloat(e)),t),Gse=Qu({type:Hse,title:sBe,aspectRatio:cA,crossOrigin:uA,flip:$p,volume:p8(yo),audioGain:p8(wc),playbackRate:p8(zp),embedLoadStrategy:Up});function Wse(t){let e=typeof t.crossOrigin<"u"&&t.crossOrigin!==null?dA(t.crossOrigin):t.crossOrigin;return{aspectRatio:t.aspectRatio&&t.aspectRatio.syntax,crossOrigin:e===!0?"":e,flip:t.flip,audioGain:t.audioGain,playbackRate:t.playbackRate,title:t.title,type:t.type,volume:t.volume,tempFragment:t.tempFragment,embedLoadStrategy:t.embedLoadStrategy}}function m8(t){let e=new Vg(t),r=Object.fromEntries(e),n={flagEnabled:Xu(r,kc.flag.enable),flagDisabled:Xu(r,kc.flag.disable),fields:Xu(r,kc.regular)},i=Hn(n.flagEnabled,(o,l)=>{let c=Pn(h8,n.flagDisabled[l]),u=Pn(h8,n.flagEnabled[l]);if(c.success&&c.output===!0)return!1;if(u.success&&u.output===!0)return!0}),s=Pn(Gse,n.fields),a;return s.success?a={tempFragment:e.temporal,...i,...s.output}:(console.warn("fallback parsing failed for hash fields",s.issues),a={tempFragment:e.temporal,...i}),{props:YT(a,o=>typeof o<"u"),input:t.replace(/^#+/,"")}}function Zu(t,e){let r=new Vg(e);for(let a of Object.keys(kc.flag.enable)){let o=a,l=lA(o,kc.flag.enable),c=lA(o,kc.flag.disable);t[o]===!0?(r.set(l,""),r.delete(c)):t[o]===!1?(r.set(c,""),r.delete(l)):t[o]===null&&(r.delete(l),r.delete(c))}let{tempFragment:n,...i}=Wse(t);typeof n<"u"&&r.setTemporal(n);let s=jg(i,kc.regular);for(let[a,o]of Object.entries(s))o===null?r.delete(a):r.set(a,String(o));return r}function $g(t){return typeof t=="object"&&t!==null}var aBe=vD(Ee(ke(),gi(),aa(t=>Fg(t)))),Kse=Ee(aBe,Pm(t=>!Qi(t)));var fA={loop:"loop",muted:"muted",autoPlay:["auto_play","autoplay"],volume:"volume",aspectRatio:"aspect_ratio",crossOrigin:"cross_origin",flip:"flip",audioGain:"audio_gain",playbackRate:["playback_rate","speed"],tempFragment:"time_range",preservePitch:"preserve_pitch"},Yse=Ee(Qu({loop:wr(),muted:wr(),autoPlay:wr(),volume:yo,aspectRatio:cA,crossOrigin:uA,flip:$p,audioGain:wc,playbackRate:zp,tempFragment:Kse,preservePitch:wr()}));function Xse(t){return{loop:t.loop,muted:t.muted,autoPlay:t.autoPlay,volume:t.volume,aspectRatio:t.aspectRatio&&t.aspectRatio.syntax,crossOrigin:typeof t.crossOrigin<"u"&&t.crossOrigin!==null?dA(t.crossOrigin):t.crossOrigin,flip:t.flip,audioGain:t.audioGain,playbackRate:t.playbackRate,tempFragment:t.tempFragment&&(k1(t.tempFragment)??void 0),preservePitch:t.preservePitch}}function g8(t){if(!$g(t))return{};let e=Pn(Yse,Xu(t,fA));return e.success?{...e.output}:(console.warn("fallback parsing failed for fm control",e.issues),{})}function y8(t){let e=Xse(t);return jg(e,fA)}var S1=Ee(hr(),Gl(0),Hl("duration"));var Ju=Ee(ke(),Qa(),gi()),pA=Ee(hr(),c0(),Gl(0)),oBe=Ee(Zo([Ee(ke(),pD()),Ee(ke(),hD()),Ee(ke(),mD())]),aa(t=>new Date(t))),Qse=Qu({title:Ju,cover:Ju,duration:S1,description:Ju,creator:Ju,album:Ju,albumArtist:Ju,trackNumber:pA,tracksTotal:pA,discNumber:pA,discsTotal:pA,genre:Ju,mediaDate:oBe,comment:Ju});var hA={title:"title",cover:"cover",duration:"duration",description:"description",creator:"creator",album:"album",albumArtist:"album_artist",trackNumber:"track_number",tracksTotal:"tracks_total",discNumber:"disc_number",discsTotal:"discs_total",genre:"genre",mediaDate:"date",comment:"comment"};function Zse(t){return Hn(t,(e,r)=>r==="mediaDate"&&e instanceof Date?e.toISOString().split("T")[0]:e instanceof Date?e.toISOString():typeof e=="number"?Math.round(e*100)/100:e)}function v8(t,e){if(!$g(t))return{};let r=Pn(Qse,Xu(t,hA,e));return r.success?{...r.output}:(console.warn("fallback parsing failed for fm metadata",r.issues),{})}function b8(t,e){let r=Zse(t);return jg(r,hA,{mappings:e})}var x8=Ee(ke(),Qa(),gi()),lBe=Ee(An({video:ks(x8),audio:ks(x8),media:ks(x8)}),aa(t=>t.video?{src:t.video,type:"video"}:t.audio?{src:t.audio,type:"audio"}:t.media?{src:t.media,type:void 0}:null));function mA(t){if(!$g(t))return null;let e=Pn(lBe,t);return e.success?e.output:null}var cBe=Object.defineProperty,Jse=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),eae=t=>{throw TypeError(t)},uBe=(t,e,r)=>e in t?cBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gA=(t,e,r)=>uBe(t,typeof e!="symbol"?e+"":e,r),tae=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&eae("Object expected");var n,i;r&&(n=e[Jse("asyncDispose")]),n===void 0&&(n=e[Jse("dispose")],r&&(i=n)),typeof n!="function"&&eae("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},rae=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,l,c){return c=Error(l),c.name="SuppressedError",c.error=a,c.suppressed=o,c},i=a=>e=r?new n(a,e,"An error was suppressed during disposal"):(r=!0,a),s=a=>{for(;a=t.pop();)try{var o=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(o).then(s,l=>(i(l),s()))}catch(l){i(l)}if(r)throw e};return s()},nae={exports:{}},C1={};var iae;function dBe(){if(iae)return C1;iae=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var o in i)o!=="key"&&(s[o]=i[o])}else s=i;return i=s.ref,{$$typeof:t,type:n,key:a,ref:i!==void 0?i:null,props:s}}return C1.Fragment=e,C1.jsx=r,C1.jsxs=r,C1}var sae;function fBe(){return sae||(sae=1,nae.exports=dBe()),nae.exports}var g=fBe();function pBe(t,e){let r=0;for(let n of t)e(n)&&(t[r]=n,r+=1);return t.splice(r),t}function hBe(t,e,r){return coe(t,e,new Set,r)}function coe(t,e,r,n){let i={},s=new Set([...cae(t),...cae(e)]);for(let a of s){if(a==="__proto__")continue;let o=t[a];if(!Object.hasOwn(e,a)){i[a]=o;continue}let l=e[a];if(lae(o)&&lae(l)&&!r.has(o)&&!r.has(l)){r.add(o),r.add(l),i[a]=mBe(o,l,r,n);continue}i[a]=l}return i}function mBe(t,e,r,n={arrays:"merge",sets:"merge",maps:"merge"}){if(aae(t)&&aae(e))return coe(t,e,r,n);if(oae(t)&&oae(e)){if(Array.isArray(t)&&Array.isArray(e))return n.arrays==="merge"?t.concat(e):e;if(t instanceof Map&&e instanceof Map)return n.maps==="merge"?new Map([...t,...e]):e;if(t instanceof Set&&e instanceof Set)return n.sets==="merge"?new Set([...t,...e]):e}return e}function aae(t){return Object.getPrototypeOf(t)===Object.prototype}function oae(t){return typeof t[Symbol.iterator]=="function"}function lae(t){return t!==null&&typeof t=="object"}function cae(t){let e=Object.getOwnPropertySymbols(t);return pBe(e,r=>Object.prototype.propertyIsEnumerable.call(t,r)),e.push(...Object.keys(t)),e}function gBe(t,e){let r={},n=Object.entries(t);for(let[i,s]of n)e(s)&&(r[i]=s);return r}function yBe(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}var B1=t=>t.type==="checkbox",Hp=t=>t instanceof Date,Ei=t=>t==null,uoe=t=>typeof t=="object",Mr=t=>!Ei(t)&&!Array.isArray(t)&&uoe(t)&&!Hp(t),doe=t=>Mr(t)&&t.target?B1(t.target)?t.target.checked:t.target.value:t,vBe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,foe=(t,e)=>t.has(vBe(e)),bBe=t=>{let e=t.constructor&&t.constructor.prototype;return Mr(e)&&e.hasOwnProperty("isPrototypeOf")},i9=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function yn(t){let e,r=Array.isArray(t),n=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(i9&&(t instanceof Blob||n))&&(r||Mr(t)))if(e=r?[]:{},!r&&!bBe(t))e=t;else for(let i in t)t.hasOwnProperty(i)&&(e[i]=yn(t[i]));else return t;return e}var BA=t=>/^\w*$/.test(t),Sr=t=>t===void 0,s9=t=>Array.isArray(t)?t.filter(Boolean):[],a9=t=>s9(t.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(t,e,r)=>{if(!e||!Mr(t))return r;let n=(BA(e)?[e]:a9(e)).reduce((i,s)=>Ei(i)?i:i[s],t);return Sr(n)||n===t?Sr(t[e])?r:t[e]:n},Fs=t=>typeof t=="boolean",It=(t,e,r)=>{let n=-1,i=BA(e)?[e]:a9(e),s=i.length,a=s-1;for(;++n<s;){let o=i[n],l=r;if(n!==a){let c=t[o];l=Mr(c)||Array.isArray(c)?c:isNaN(+i[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=l,t=t[o]}},IA={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},bo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Sc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},o9=$.default.createContext(null);o9.displayName="HookFormContext";var VA=()=>$.default.useContext(o9),xBe=t=>{let{children:e,...r}=t;return $.default.createElement(o9.Provider,{value:r},e)},poe=(t,e,r,n=!0)=>{let i={defaultValues:e._defaultValues};for(let s in t)Object.defineProperty(i,s,{get:()=>{let a=s;return e._proxyFormState[a]!==bo.all&&(e._proxyFormState[a]=!n||bo.all),r&&(r[a]=!0),t[a]}});return i},l9=typeof window<"u"?N.useLayoutEffect:N.useEffect;function hoe(t){let e=VA(),{control:r=e.control,disabled:n,name:i,exact:s}=t||{},[a,o]=$.default.useState(r._formState),l=$.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return l9(()=>r._subscribe({name:i,formState:l.current,exact:s,callback:c=>{!n&&o({...r._formState,...c})}}),[i,n,s]),$.default.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),$.default.useMemo(()=>poe(a,r,l.current,!1),[a,r])}var ml=t=>typeof t=="string",moe=(t,e,r,n,i)=>ml(t)?(n&&e.watch.add(t),ae(r,t,i)):Array.isArray(t)?t.map(s=>(n&&e.watch.add(s),ae(r,s))):(n&&(e.watchAll=!0),r);function c9(t){let e=VA(),{control:r=e.control,name:n,defaultValue:i,disabled:s,exact:a}=t||{},o=$.default.useRef(i),[l,c]=$.default.useState(r._getWatch(n,o.current));return l9(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:u=>!s&&c(moe(n,r._names,u.values||r._formValues,!1,o.current))}),[n,r,s,a]),$.default.useEffect(()=>r._removeUnmounted()),l}function wBe(t){let e=VA(),{name:r,disabled:n,control:i=e.control,shouldUnregister:s}=t,a=foe(i._names.array,r),o=c9({control:i,name:r,defaultValue:ae(i._formValues,r,ae(i._defaultValues,r,t.defaultValue)),exact:!0}),l=hoe({control:i,name:r,exact:!0}),c=$.default.useRef(t),u=$.default.useRef(i.register(r,{...t.rules,value:o,...Fs(t.disabled)?{disabled:t.disabled}:{}})),d=$.default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ae(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!ae(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ae(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ae(l.validatingFields,r)},error:{enumerable:!0,get:()=>ae(l.errors,r)}}),[l,r]),f=$.default.useCallback(v=>u.current.onChange({target:{value:doe(v),name:r},type:IA.CHANGE}),[r]),p=$.default.useCallback(()=>u.current.onBlur({target:{value:ae(i._formValues,r),name:r},type:IA.BLUR}),[r,i._formValues]),h=$.default.useCallback(v=>{let b=ae(i._fields,r);b&&v&&(b._f.ref={focus:()=>v.focus&&v.focus(),select:()=>v.select&&v.select(),setCustomValidity:y=>v.setCustomValidity(y),reportValidity:()=>v.reportValidity()})},[i._fields,r]),m=$.default.useMemo(()=>({name:r,value:o,...Fs(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:f,onBlur:p,ref:h}),[r,n,l.disabled,f,p,h,o]);return $.default.useEffect(()=>{let v=i._options.shouldUnregister||s;i.register(r,{...c.current.rules,...Fs(c.current.disabled)?{disabled:c.current.disabled}:{}});let b=(y,x)=>{let w=ae(i._fields,y);w&&w._f&&(w._f.mount=x)};if(b(r,!0),v){let y=yn(ae(i._options.defaultValues,r));It(i._defaultValues,r,y),Sr(ae(i._formValues,r))&&It(i._formValues,r,y)}return!a&&i.register(r),()=>{(a?v&&!i._state.action:v)?i.unregister(r):b(r,!1)}},[r,i,a,s]),$.default.useEffect(()=>{i._setDisabledField({disabled:n,name:r})},[n,r,i]),$.default.useMemo(()=>({field:m,formState:l,fieldState:d}),[m,l,d])}var kBe=t=>t.render(wBe(t)),goe=(t,e,r,n,i)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:i||!0}}:{},D1=t=>Array.isArray(t)?t:[t],uae=()=>{let t=[];return{get observers(){return t},next:e=>{for(let r of t)r.next&&r.next(e)},subscribe:e=>(t.push(e),{unsubscribe:()=>{t=t.filter(r=>r!==e)}}),unsubscribe:()=>{t=[]}}},D8=t=>Ei(t)||!uoe(t);function id(t,e,r=new WeakSet){if(D8(t)||D8(e))return t===e;if(Hp(t)&&Hp(e))return t.getTime()===e.getTime();let n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(let s of n){let a=t[s];if(!i.includes(s))return!1;if(s!=="ref"){let o=e[s];if(Hp(a)&&Hp(o)||Mr(a)&&Mr(o)||Array.isArray(a)&&Array.isArray(o)?!id(a,o,r):a!==o)return!1}}return!0}var Ji=t=>Mr(t)&&!Object.keys(t).length,u9=t=>t.type==="file",xo=t=>typeof t=="function",AA=t=>{if(!i9)return!1;let e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},yoe=t=>t.type==="select-multiple",d9=t=>t.type==="radio",SBe=t=>d9(t)||B1(t),w8=t=>AA(t)&&t.isConnected;function CBe(t,e){let r=e.slice(0,-1).length,n=0;for(;n<r;)t=Sr(t)?n++:t[e[n++]];return t}function TBe(t){for(let e in t)if(t.hasOwnProperty(e)&&!Sr(t[e]))return!1;return!0}function zr(t,e){let r=Array.isArray(e)?e:BA(e)?[e]:a9(e),n=r.length===1?t:CBe(t,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(Mr(n)&&Ji(n)||Array.isArray(n)&&TBe(n))&&zr(t,r.slice(0,-1)),t}var voe=t=>{for(let e in t)if(xo(t[e]))return!0;return!1};function PA(t,e={}){let r=Array.isArray(t);if(Mr(t)||r)for(let n in t)Array.isArray(t[n])||Mr(t[n])&&!voe(t[n])?(e[n]=Array.isArray(t[n])?[]:{},PA(t[n],e[n])):Ei(t[n])||(e[n]=!0);return e}function boe(t,e,r){let n=Array.isArray(t);if(Mr(t)||n)for(let i in t)Array.isArray(t[i])||Mr(t[i])&&!voe(t[i])?Sr(e)||D8(r[i])?r[i]=Array.isArray(t[i])?PA(t[i],[]):{...PA(t[i])}:boe(t[i],Ei(e)?{}:e[i],r[i]):r[i]=!id(t[i],e[i]);return r}var T1=(t,e)=>boe(t,e,PA(e)),dae={value:!1,isValid:!1},fae={value:!0,isValid:!0},xoe=t=>{if(Array.isArray(t)){if(t.length>1){let e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Sr(t[0].attributes.value)?Sr(t[0].value)||t[0].value===""?fae:{value:t[0].value,isValid:!0}:fae:dae}return dae},woe=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:n})=>Sr(t)?t:e?t===""?NaN:t&&+t:r&&ml(t)?new Date(t):n?n(t):t,pae={isValid:!1,value:null},koe=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,pae):pae;function hae(t){let e=t.ref;return u9(e)?e.files:d9(e)?koe(t.refs).value:yoe(e)?[...e.selectedOptions].map(({value:r})=>r):B1(e)?xoe(t.refs).value:woe(Sr(e.value)?t.ref.value:e.value,t)}var EBe=(t,e,r,n)=>{let i={};for(let s of t){let a=ae(e,s);a&&It(i,s,a._f)}return{criteriaMode:r,names:[...t],fields:i,shouldUseNativeValidation:n}},RA=t=>t instanceof RegExp,E1=t=>Sr(t)?t:RA(t)?t.source:Mr(t)?RA(t.value)?t.value.source:t.value:t,mae=t=>({isOnSubmit:!t||t===bo.onSubmit,isOnBlur:t===bo.onBlur,isOnChange:t===bo.onChange,isOnAll:t===bo.all,isOnTouch:t===bo.onTouched}),gae="AsyncFunction",IBe=t=>!!t&&!!t.validate&&!!(xo(t.validate)&&t.validate.constructor.name===gae||Mr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===gae)),ABe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),yae=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(n=>t.startsWith(n)&&/^\.\w+/.test(t.slice(n.length)))),N1=(t,e,r,n)=>{for(let i of r||Object.keys(t)){let s=ae(t,i);if(s){let{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],i)&&!n||a.ref&&e(a.ref,a.name)&&!n)return!0;if(N1(o,e))break}else if(Mr(o)&&N1(o,e))break}}};function vae(t,e,r){let n=ae(t,r);if(n||BA(r))return{error:n,name:r};let i=r.split(".");for(;i.length;){let s=i.join("."),a=ae(e,s),o=ae(t,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(o&&o.type)return{name:s,error:o};if(o&&o.root&&o.root.type)return{name:`${s}.root`,error:o.root};i.pop()}return{name:r}}var PBe=(t,e,r,n)=>{r(t);let{name:i,...s}=t;return Ji(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(a=>e[a]===(!n||bo.all))},RBe=(t,e,r)=>!t||!e||t===e||D1(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),LBe=(t,e,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(e||t):(r?n.isOnBlur:i.isOnBlur)?!t:(r?n.isOnChange:i.isOnChange)?t:!0,MBe=(t,e)=>!s9(ae(t,e)).length&&zr(t,e),_Be=(t,e,r)=>{let n=D1(ae(t,r));return It(n,"root",e[r]),It(t,r,n),t},SA=t=>ml(t);function bae(t,e,r="validate"){if(SA(t)||Array.isArray(t)&&t.every(SA)||Fs(t)&&!t)return{type:r,message:SA(t)?t:"",ref:e}}var Ug=t=>Mr(t)&&!RA(t)?t:{value:t,message:""},xae=async(t,e,r,n,i,s)=>{let{ref:a,refs:o,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:p,validate:h,name:m,valueAsNumber:v,mount:b}=t._f,y=ae(r,m);if(!b||e.has(m))return{};let x=o?o[0]:a,w=I=>{i&&x.reportValidity&&(x.setCustomValidity(Fs(I)?"":I||""),x.reportValidity())},C={},O=d9(a),S=B1(a),T=O||S,E=(v||u9(a))&&Sr(a.value)&&Sr(y)||AA(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,P=goe.bind(null,m,n,C),R=(I,B,M,z=Sc.maxLength,G=Sc.minLength)=>{let V=I?B:M;C[m]={type:I?z:G,message:V,ref:a,...P(I?z:G,V)}};if(s?!Array.isArray(y)||!y.length:l&&(!T&&(E||Ei(y))||Fs(y)&&!y||S&&!xoe(o).isValid||O&&!koe(o).isValid)){let{value:I,message:B}=SA(l)?{value:!!l,message:l}:Ug(l);if(I&&(C[m]={type:Sc.required,message:B,ref:x,...P(Sc.required,B)},!n))return w(B),C}if(!E&&(!Ei(d)||!Ei(f))){let I,B,M=Ug(f),z=Ug(d);if(!Ei(y)&&!isNaN(y)){let G=a.valueAsNumber||y&&+y;Ei(M.value)||(I=G>M.value),Ei(z.value)||(B=G<z.value)}else{let G=a.valueAsDate||new Date(y),V=Me=>new Date(new Date().toDateString()+" "+Me),K=a.type=="time",de=a.type=="week";ml(M.value)&&y&&(I=K?V(y)>V(M.value):de?y>M.value:G>new Date(M.value)),ml(z.value)&&y&&(B=K?V(y)<V(z.value):de?y<z.value:G<new Date(z.value))}if((I||B)&&(R(!!I,M.message,z.message,Sc.max,Sc.min),!n))return w(C[m].message),C}if((c||u)&&!E&&(ml(y)||s&&Array.isArray(y))){let I=Ug(c),B=Ug(u),M=!Ei(I.value)&&y.length>+I.value,z=!Ei(B.value)&&y.length<+B.value;if((M||z)&&(R(M,I.message,B.message),!n))return w(C[m].message),C}if(p&&!E&&ml(y)){let{value:I,message:B}=Ug(p);if(RA(I)&&!y.match(I)&&(C[m]={type:Sc.pattern,message:B,ref:a,...P(Sc.pattern,B)},!n))return w(B),C}if(h){if(xo(h)){let I=await h(y,r),B=bae(I,x);if(B&&(C[m]={...B,...P(Sc.validate,B.message)},!n))return w(B.message),C}else if(Mr(h)){let I={};for(let B in h){if(!Ji(I)&&!n)break;let M=bae(await h[B](y,r),x,B);M&&(I={...M,...P(B,M.message)},w(M.message),n&&(C[m]=I))}if(!Ji(I)&&(C[m]={ref:x,...I},!n))return C}}return w(!0),C},OBe={mode:bo.onSubmit,reValidateMode:bo.onChange,shouldFocusError:!0};function DBe(t={}){let e={...OBe,...t},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:xo(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},n={},i=Mr(e.defaultValues)||Mr(e.values)?yn(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:yn(i),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u},f={array:uae(),state:uae()},p=e.criteriaMode===bo.all,h=_=>k=>{clearTimeout(c),c=setTimeout(_,k)},m=async _=>{if(!e.disabled&&(u.isValid||d.isValid||_)){let k=e.resolver?Ji((await S()).errors):await E(n,!0);k!==r.isValid&&f.state.next({isValid:k})}},v=(_,k)=>{!e.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((_||Array.from(o.mount)).forEach(A=>{A&&(k?It(r.validatingFields,A,k):zr(r.validatingFields,A))}),f.state.next({validatingFields:r.validatingFields,isValidating:!Ji(r.validatingFields)}))},b=(_,k=[],A,D,q=!0,j=!0)=>{if(D&&A&&!e.disabled){if(a.action=!0,j&&Array.isArray(ae(n,_))){let H=A(ae(n,_),D.argA,D.argB);q&&It(n,_,H)}if(j&&Array.isArray(ae(r.errors,_))){let H=A(ae(r.errors,_),D.argA,D.argB);q&&It(r.errors,_,H),MBe(r.errors,_)}if((u.touchedFields||d.touchedFields)&&j&&Array.isArray(ae(r.touchedFields,_))){let H=A(ae(r.touchedFields,_),D.argA,D.argB);q&&It(r.touchedFields,_,H)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=T1(i,s)),f.state.next({name:_,isDirty:R(_,k),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else It(s,_,k)},y=(_,k)=>{It(r.errors,_,k),f.state.next({errors:r.errors})},x=_=>{r.errors=_,f.state.next({errors:r.errors,isValid:!1})},w=(_,k,A,D)=>{let q=ae(n,_);if(q){let j=ae(s,_,Sr(A)?ae(i,_):A);Sr(j)||D&&D.defaultChecked||k?It(s,_,k?j:hae(q._f)):M(_,j),a.mount&&m()}},C=(_,k,A,D,q)=>{let j=!1,H=!1,ne={name:_};if(!e.disabled){if(!A||D){(u.isDirty||d.isDirty)&&(H=r.isDirty,r.isDirty=ne.isDirty=R(),j=H!==ne.isDirty);let ve=id(ae(i,_),k);H=!!ae(r.dirtyFields,_),ve?zr(r.dirtyFields,_):It(r.dirtyFields,_,!0),ne.dirtyFields=r.dirtyFields,j=j||(u.dirtyFields||d.dirtyFields)&&H!==!ve}if(A){let ve=ae(r.touchedFields,_);ve||(It(r.touchedFields,_,A),ne.touchedFields=r.touchedFields,j=j||(u.touchedFields||d.touchedFields)&&ve!==A)}j&&q&&f.state.next(ne)}return j?ne:{}},O=(_,k,A,D)=>{let q=ae(r.errors,_),j=(u.isValid||d.isValid)&&Fs(k)&&r.isValid!==k;if(e.delayError&&A?(l=h(()=>y(_,A)),l(e.delayError)):(clearTimeout(c),l=null,A?It(r.errors,_,A):zr(r.errors,_)),(A?!id(q,A):q)||!Ji(D)||j){let H={...D,...j&&Fs(k)?{isValid:k}:{},errors:r.errors,name:_};r={...r,...H},f.state.next(H)}},S=async _=>{v(_,!0);let k=await e.resolver(s,e.context,EBe(_||o.mount,n,e.criteriaMode,e.shouldUseNativeValidation));return v(_),k},T=async _=>{let{errors:k}=await S(_);if(_)for(let A of _){let D=ae(k,A);D?It(r.errors,A,D):zr(r.errors,A)}else r.errors=k;return k},E=async(_,k,A={valid:!0})=>{for(let D in _){let q=_[D];if(q){let{_f:j,...H}=q;if(j){let ne=o.array.has(j.name),ve=q._f&&IBe(q._f);ve&&u.validatingFields&&v([D],!0);let Qe=await xae(q,o.disabled,s,p,e.shouldUseNativeValidation&&!k,ne);if(ve&&u.validatingFields&&v([D]),Qe[j.name]&&(A.valid=!1,k))break;!k&&(ae(Qe,j.name)?ne?_Be(r.errors,Qe,j.name):It(r.errors,j.name,Qe[j.name]):zr(r.errors,j.name))}!Ji(H)&&await E(H,k,A)}}return A.valid},P=()=>{for(let _ of o.unMount){let k=ae(n,_);k&&(k._f.refs?k._f.refs.every(A=>!w8(A)):!w8(k._f.ref))&&lt(_)}o.unMount=new Set},R=(_,k)=>!e.disabled&&(_&&k&&It(s,_,k),!id(Me(),i)),I=(_,k,A)=>moe(_,o,{...a.mount?s:Sr(k)?i:ml(_)?{[_]:k}:k},A,k),B=_=>s9(ae(a.mount?s:i,_,e.shouldUnregister?ae(i,_,[]):[])),M=(_,k,A={})=>{let D=ae(n,_),q=k;if(D){let j=D._f;j&&(!j.disabled&&It(s,_,woe(k,j)),q=AA(j.ref)&&Ei(k)?"":k,yoe(j.ref)?[...j.ref.options].forEach(H=>H.selected=q.includes(H.value)):j.refs?B1(j.ref)?j.refs.forEach(H=>{(!H.defaultChecked||!H.disabled)&&(Array.isArray(q)?H.checked=!!q.find(ne=>ne===H.value):H.checked=q===H.value||!!q)}):j.refs.forEach(H=>H.checked=H.value===q):u9(j.ref)?j.ref.value="":(j.ref.value=q,j.ref.type||f.state.next({name:_,values:yn(s)})))}(A.shouldDirty||A.shouldTouch)&&C(_,q,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&de(_)},z=(_,k,A)=>{for(let D in k){if(!k.hasOwnProperty(D))return;let q=k[D],j=_+"."+D,H=ae(n,j);(o.array.has(_)||Mr(q)||H&&!H._f)&&!Hp(q)?z(j,q,A):M(j,q,A)}},G=(_,k,A={})=>{let D=ae(n,_),q=o.array.has(_),j=yn(k);It(s,_,j),q?(f.array.next({name:_,values:yn(s)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&A.shouldDirty&&f.state.next({name:_,dirtyFields:T1(i,s),isDirty:R(_,j)})):D&&!D._f&&!Ei(j)?z(_,j,A):M(_,j,A),yae(_,o)&&f.state.next({...r}),f.state.next({name:a.mount?_:void 0,values:yn(s)})},V=async _=>{a.mount=!0;let k=_.target,A=k.name,D=!0,q=ae(n,A),j=ve=>{D=Number.isNaN(ve)||Hp(ve)&&isNaN(ve.getTime())||id(ve,ae(s,A,ve))},H=mae(e.mode),ne=mae(e.reValidateMode);if(q){let ve,Qe,En=k.type?hae(q._f):doe(_),hs=_.type===IA.BLUR||_.type===IA.FOCUS_OUT,$o=!ABe(q._f)&&!e.resolver&&!ae(r.errors,A)&&!q._f.deps||LBe(hs,ae(r.touchedFields,A),r.isSubmitted,ne,H),eb=yae(A,o,hs);It(s,A,En),hs?(q._f.onBlur&&q._f.onBlur(_),l&&l(0)):q._f.onChange&&q._f.onChange(_);let wf=C(A,En,hs),tb=!Ji(wf)||eb;if(!hs&&f.state.next({name:A,type:_.type,values:yn(s)}),$o)return(u.isValid||d.isValid)&&(e.mode==="onBlur"?hs&&m():hs||m()),tb&&f.state.next({name:A,...eb?{}:wf});if(!hs&&eb&&f.state.next({...r}),e.resolver){let{errors:fC}=await S([A]);if(j(En),D){let pC=vae(r.errors,n,A),hC=vae(fC,n,pC.name||A);ve=hC.error,A=hC.name,Qe=Ji(fC)}}else v([A],!0),ve=(await xae(q,o.disabled,s,p,e.shouldUseNativeValidation))[A],v([A]),j(En),D&&(ve?Qe=!1:(u.isValid||d.isValid)&&(Qe=await E(n,!0)));D&&(q._f.deps&&de(q._f.deps),O(A,Qe,ve,wf))}},K=(_,k)=>{if(ae(r.errors,k)&&_.focus)return _.focus(),1},de=async(_,k={})=>{let A,D,q=D1(_);if(e.resolver){let j=await T(Sr(_)?_:q);A=Ji(j),D=_?!q.some(H=>ae(j,H)):A}else _?(D=(await Promise.all(q.map(async j=>{let H=ae(n,j);return await E(H&&H._f?{[j]:H}:H)}))).every(Boolean),!(!D&&!r.isValid)&&m()):D=A=await E(n);return f.state.next({...!ml(_)||(u.isValid||d.isValid)&&A!==r.isValid?{}:{name:_},...e.resolver||!_?{isValid:A}:{},errors:r.errors}),k.shouldFocus&&!D&&N1(n,K,_?q:o.mount),D},Me=_=>{let k={...a.mount?s:i};return Sr(_)?k:ml(_)?ae(k,_):_.map(A=>ae(k,A))},pt=(_,k)=>({invalid:!!ae((k||r).errors,_),isDirty:!!ae((k||r).dirtyFields,_),error:ae((k||r).errors,_),isValidating:!!ae(r.validatingFields,_),isTouched:!!ae((k||r).touchedFields,_)}),At=_=>{_&&D1(_).forEach(k=>zr(r.errors,k)),f.state.next({errors:_?r.errors:{}})},Ue=(_,k,A)=>{let D=(ae(n,_,{_f:{}})._f||{}).ref,q=ae(r.errors,_)||{},{ref:j,message:H,type:ne,...ve}=q;It(r.errors,_,{...ve,...k,ref:D}),f.state.next({name:_,errors:r.errors,isValid:!1}),A&&A.shouldFocus&&D&&D.focus&&D.focus()},Gt=(_,k)=>xo(_)?f.state.subscribe({next:A=>_(I(void 0,k),A)}):I(_,k,!0),Kr=_=>f.state.subscribe({next:k=>{RBe(_.name,k.name,_.exact)&&PBe(k,_.formState||u,h_,_.reRenderRoot)&&_.callback({values:{...s},...r,...k})}}).unsubscribe,Di=_=>(a.mount=!0,d={...d,..._.formState},Kr({..._,formState:d})),lt=(_,k={})=>{for(let A of _?D1(_):o.mount)o.mount.delete(A),o.array.delete(A),k.keepValue||(zr(n,A),zr(s,A)),!k.keepError&&zr(r.errors,A),!k.keepDirty&&zr(r.dirtyFields,A),!k.keepTouched&&zr(r.touchedFields,A),!k.keepIsValidating&&zr(r.validatingFields,A),!e.shouldUnregister&&!k.keepDefaultValue&&zr(i,A);f.state.next({values:yn(s)}),f.state.next({...r,...k.keepDirty?{isDirty:R()}:{}}),!k.keepIsValid&&m()},ps=({disabled:_,name:k})=>{(Fs(_)&&a.mount||_||o.disabled.has(k))&&(_?o.disabled.add(k):o.disabled.delete(k))},Ir=(_,k={})=>{let A=ae(n,_),D=Fs(k.disabled)||Fs(e.disabled);return It(n,_,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:_}},name:_,mount:!0,...k}}),o.mount.add(_),A?ps({disabled:Fs(k.disabled)?k.disabled:e.disabled,name:_}):w(_,!0,k.value),{...D?{disabled:k.disabled||e.disabled}:{},...e.progressive?{required:!!k.required,min:E1(k.min),max:E1(k.max),minLength:E1(k.minLength),maxLength:E1(k.maxLength),pattern:E1(k.pattern)}:{},name:_,onChange:V,onBlur:V,ref:q=>{if(q){Ir(_,k),A=ae(n,_);let j=Sr(q.value)&&q.querySelectorAll&&q.querySelectorAll("input,select,textarea")[0]||q,H=SBe(j),ne=A._f.refs||[];if(H?ne.find(ve=>ve===j):j===A._f.ref)return;It(n,_,{_f:{...A._f,...H?{refs:[...ne.filter(w8),j,...Array.isArray(ae(i,_))?[{}]:[]],ref:{type:j.type,name:_}}:{ref:j}}}),w(_,!1,void 0,j)}else A=ae(n,_,{}),A._f&&(A._f.mount=!1),(e.shouldUnregister||k.shouldUnregister)&&!(foe(o.array,_)&&a.action)&&o.unMount.add(_)}}},Ar=()=>e.shouldFocusError&&N1(n,K,o.mount),Zs=_=>{Fs(_)&&(f.state.next({disabled:_}),N1(n,(k,A)=>{let D=ae(n,A);D&&(k.disabled=D._f.disabled||_,Array.isArray(D._f.refs)&&D._f.refs.forEach(q=>{q.disabled=D._f.disabled||_}))},0,!1))},ui=(_,k)=>async A=>{let D;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let q=yn(s);if(f.state.next({isSubmitting:!0}),e.resolver){let{errors:j,values:H}=await S();r.errors=j,q=yn(H)}else await E(n);if(o.disabled.size)for(let j of o.disabled)zr(q,j);if(zr(r.errors,"root"),Ji(r.errors)){f.state.next({errors:{}});try{await _(q,A)}catch(j){D=j}}else k&&await k({...r.errors},A),Ar(),setTimeout(Ar);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ji(r.errors)&&!D,submitCount:r.submitCount+1,errors:r.errors}),D)throw D},xf=(_,k={})=>{ae(n,_)&&(Sr(k.defaultValue)?G(_,yn(ae(i,_))):(G(_,k.defaultValue),It(i,_,yn(k.defaultValue))),k.keepTouched||zr(r.touchedFields,_),k.keepDirty||(zr(r.dirtyFields,_),r.isDirty=k.defaultValue?R(_,yn(ae(i,_))):R()),k.keepError||(zr(r.errors,_),u.isValid&&m()),f.state.next({...r}))},Fl=(_,k={})=>{let A=_?yn(_):i,D=yn(A),q=Ji(_),j=q?i:D;if(k.keepDefaultValues||(i=A),!k.keepValues){if(k.keepDirtyValues){let H=new Set([...o.mount,...Object.keys(T1(i,s))]);for(let ne of Array.from(H))ae(r.dirtyFields,ne)?It(j,ne,ae(s,ne)):G(ne,ae(j,ne))}else{if(i9&&Sr(_))for(let H of o.mount){let ne=ae(n,H);if(ne&&ne._f){let ve=Array.isArray(ne._f.refs)?ne._f.refs[0]:ne._f.ref;if(AA(ve)){let Qe=ve.closest("form");if(Qe){Qe.reset();break}}}}for(let H of o.mount){let ne=ae(j,H,ae(i,H));Sr(ne)||(It(j,H,ne),G(H,ae(j,H)))}}s=yn(j),f.array.next({values:{...j}}),f.state.next({values:{...j}})}o={mount:k.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!k.keepIsValid||!!k.keepDirtyValues,a.watch=!!e.shouldUnregister,f.state.next({submitCount:k.keepSubmitCount?r.submitCount:0,isDirty:q?!1:k.keepDirty?r.isDirty:!!(k.keepDefaultValues&&!id(_,i)),isSubmitted:k.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:q?{}:k.keepDirtyValues?k.keepDefaultValues&&s?T1(i,s):r.dirtyFields:k.keepDefaultValues&&_?T1(i,_):k.keepDirty?r.dirtyFields:{},touchedFields:k.keepTouched?r.touchedFields:{},errors:k.keepErrors?r.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},cu=(_,k)=>Fl(xo(_)?_(s):_,k),Uh=(_,k={})=>{let A=ae(n,_),D=A&&A._f;if(D){let q=D.refs?D.refs[0]:D.ref;q.focus&&(q.focus(),k.shouldSelect&&xo(q.select)&&q.select())}},h_=_=>{r={...r,..._}},m_={control:{register:Ir,unregister:lt,getFieldState:pt,handleSubmit:ui,setError:Ue,_subscribe:Kr,_runSchema:S,_focusError:Ar,_getWatch:I,_getDirty:R,_setValid:m,_setFieldArray:b,_setDisabledField:ps,_setErrors:x,_getFieldArray:B,_reset:Fl,_resetDefaultValues:()=>xo(e.defaultValues)&&e.defaultValues().then(_=>{cu(_,e.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:Zs,_subjects:f,_proxyFormState:u,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(_){a=_},get _defaultValues(){return i},get _names(){return o},set _names(_){o=_},get _formState(){return r},get _options(){return e},set _options(_){e={...e,..._}}},subscribe:Di,trigger:de,register:Ir,handleSubmit:ui,watch:Gt,setValue:G,getValues:Me,reset:cu,resetField:xf,clearErrors:At,unregister:lt,setError:Ue,setFocus:Uh,getFieldState:pt};return{...m_,formControl:m_}}function f9(t={}){let e=$.default.useRef(void 0),r=$.default.useRef(void 0),[n,i]=$.default.useState({isDirty:!1,isValidating:!1,isLoading:xo(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:xo(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!xo(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{let{formControl:a,...o}=DBe(t);e.current={...o,formState:n}}let s=e.current.control;return s._options=t,l9(()=>{let a=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0});return i(o=>({...o,isReady:!0})),s._formState.isReady=!0,a},[s]),$.default.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),$.default.useEffect(()=>{t.mode&&(s._options.mode=t.mode),t.reValidateMode&&(s._options.reValidateMode=t.reValidateMode)},[s,t.mode,t.reValidateMode]),$.default.useEffect(()=>{t.errors&&(s._setErrors(t.errors),s._focusError())},[s,t.errors]),$.default.useEffect(()=>{t.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,t.shouldUnregister]),$.default.useEffect(()=>{if(s._proxyFormState.isDirty){let a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),$.default.useEffect(()=>{t.values&&!id(t.values,r.current)?(s._reset(t.values,s._options.resetOptions),r.current=t.values,i(a=>({...a}))):s._resetDefaultValues()},[s,t.values]),$.default.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),e.current.formState=poe(n,s),e.current}function wae(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function p9(...t){return e=>{let r=!1,n=t.map(i=>{let s=wae(i,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){let s=n[i];typeof s=="function"?s():wae(t[i],null)}}}}function od(...t){return N.useCallback(p9(...t),t)}function NBe(t){let e=FBe(t),r=N.forwardRef((n,i)=>{let{children:s,...a}=n,o=N.Children.toArray(s),l=o.find(VBe);if(l){let c=l.props.children,u=o.map(d=>d===l?N.Children.count(c)>1?N.Children.only(null):N.isValidElement(c)?c.props.children:null:d);return g.jsx(e,{...a,ref:i,children:N.isValidElement(c)?N.cloneElement(c,void 0,u):null})}return g.jsx(e,{...a,ref:i,children:s})});return r.displayName=`${t}.Slot`,r}var jA=NBe("Slot");function FBe(t){let e=N.forwardRef((r,n)=>{let{children:i,...s}=r;if(N.isValidElement(i)){let a=$Be(i),o=jBe(s,i.props);return i.type!==N.Fragment&&(o.ref=n?p9(n,a):a),N.cloneElement(i,o)}return N.Children.count(i)>1?N.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var BBe=Symbol("radix.slottable");function VBe(t){return N.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===BBe}function jBe(t,e){let r={...e};for(let n in e){let i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function $Be(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}function kae(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Soe(...t){return e=>{let r=!1,n=t.map(i=>{let s=kae(i,e);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){let s=n[i];typeof s=="function"?s():kae(t[i],null)}}}}function Qg(...t){return N.useCallback(Soe(...t),t)}var LA=N.forwardRef((t,e)=>{let{children:r,...n}=t,i=N.Children.toArray(r),s=i.find(zBe);if(s){let a=s.props.children,o=i.map(l=>l===s?N.Children.count(a)>1?N.Children.only(null):N.isValidElement(a)?a.props.children:null:l);return g.jsx(N8,{...n,ref:e,children:N.isValidElement(a)?N.cloneElement(a,void 0,o):null})}return g.jsx(N8,{...n,ref:e,children:r})});LA.displayName="Slot";var N8=N.forwardRef((t,e)=>{let{children:r,...n}=t;if(N.isValidElement(r)){let i=HBe(r),s=qBe(n,r.props);return r.type!==N.Fragment&&(s.ref=e?Soe(e,i):i),N.cloneElement(r,s)}return N.Children.count(r)>1?N.Children.only(null):null});N8.displayName="SlotClone";var UBe=({children:t})=>g.jsx(g.Fragment,{children:t});function zBe(t){return N.isValidElement(t)&&t.type===UBe}function qBe(t,e){let r={...e};for(let n in e){let i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function HBe(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var GBe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],wo=GBe.reduce((t,e)=>{let r=N.forwardRef((n,i)=>{let{asChild:s,...a}=n,o=s?LA:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(o,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),WBe="Label",Coe=N.forwardRef((t,e)=>g.jsx(wo.label,{...t,ref:e,onMouseDown:r=>{var n;r.target.closest("button, input, select, textarea")||((n=t.onMouseDown)==null||n.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Coe.displayName=WBe;var KBe=Coe;function Toe(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=Toe(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Eoe(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=Toe(t))&&(n&&(n+=" "),n+=e);return n}var h9="-",YBe=t=>{let e=QBe(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:i=>{let s=i.split(h9);return s[0]===""&&s.length!==1&&s.shift(),Ioe(s,e)||XBe(i)},getConflictingClassGroupIds:(i,s)=>{let a=r[i]||[];return s&&n[i]?[...a,...n[i]]:a}}},Ioe=(t,e)=>{var r;if(t.length===0)return e.classGroupId;let n=t[0],i=e.nextPart.get(n),s=i?Ioe(t.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;let a=t.join(h9);return(r=e.validators.find(({validator:o})=>o(a)))==null?void 0:r.classGroupId},Sae=/^\[(.+)\]$/,XBe=t=>{if(Sae.test(t)){let e=Sae.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},QBe=t=>{let{theme:e,classGroups:r}=t,n={nextPart:new Map,validators:[]};for(let i in r)F8(r[i],n,i,e);return n},F8=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){let s=i===""?e:Cae(e,i);s.classGroupId=r;return}if(typeof i=="function"){if(ZBe(i)){F8(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,a])=>{F8(a,Cae(e,s),r,n)})})},Cae=(t,e)=>{let r=t;return e.split(h9).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},ZBe=t=>t.isThemeGetter,JBe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map,i=(s,a)=>{r.set(s,a),e++,e>t&&(e=0,n=r,r=new Map)};return{get(s){let a=r.get(s);if(a!==void 0)return a;if((a=n.get(s))!==void 0)return i(s,a),a},set(s,a){r.has(s)?r.set(s,a):i(s,a)}}},B8="!",V8=":",eVe=V8.length,tVe=t=>{let{prefix:e,experimentalParseClassName:r}=t,n=i=>{let s=[],a=0,o=0,l=0,c;for(let h=0;h<i.length;h++){let m=i[h];if(a===0&&o===0){if(m===V8){s.push(i.slice(l,h)),l=h+eVe;continue}if(m==="/"){c=h;continue}}m==="["?a++:m==="]"?a--:m==="("?o++:m===")"&&o--}let u=s.length===0?i:i.substring(l),d=rVe(u),f=d!==u,p=c&&c>l?c-l:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}};if(e){let i=e+V8,s=n;n=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(r){let i=n;n=s=>r({className:s,parseClassName:i})}return n},rVe=t=>t.endsWith(B8)?t.substring(0,t.length-1):t.startsWith(B8)?t.substring(1):t,nVe=t=>{let e=Object.fromEntries(t.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;let n=[],i=[];return r.forEach(s=>{s[0]==="["||e[s]?(n.push(...i.sort(),s),i=[]):i.push(s)}),n.push(...i.sort()),n}},iVe=t=>({cache:JBe(t.cacheSize),parseClassName:tVe(t),sortModifiers:nVe(t),...YBe(t)}),sVe=/\s+/,aVe=(t,e)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],o=t.trim().split(sVe),l="";for(let c=o.length-1;c>=0;c-=1){let u=o[c],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}=r(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!m,b=n(v?h.substring(0,m):h);if(!b){if(!v){l=u+(l.length>0?" "+l:l);continue}if(b=n(h),!b){l=u+(l.length>0?" "+l:l);continue}v=!1}let y=s(f).join(":"),x=p?y+B8:y,w=x+b;if(a.includes(w))continue;a.push(w);let C=i(b,v);for(let O=0;O<C.length;++O){let S=C[O];a.push(x+S)}l=u+(l.length>0?" "+l:l)}return l};function oVe(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=Aoe(e))&&(n&&(n+=" "),n+=r);return n}var Aoe=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Aoe(t[n]))&&(r&&(r+=" "),r+=e);return r};function lVe(t,...e){let r,n,i,s=a;function a(l){let c=e.reduce((u,d)=>d(u),t());return r=iVe(c),n=r.cache.get,i=r.cache.set,s=o,o(l)}function o(l){let c=n(l);if(c)return c;let u=aVe(l,r);return i(l,u),u}return function(){return s(oVe.apply(null,arguments))}}var en=t=>{let e=r=>r[t]||[];return e.isThemeGetter=!0,e},Poe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Roe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cVe=/^\d+\/\d+$/,uVe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dVe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fVe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pVe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hVe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zg=t=>cVe.test(t),Je=t=>!!t&&!Number.isNaN(Number(t)),ed=t=>!!t&&Number.isInteger(Number(t)),k8=t=>t.endsWith("%")&&Je(t.slice(0,-1)),Cc=t=>uVe.test(t),mVe=()=>!0,gVe=t=>dVe.test(t)&&!fVe.test(t),Loe=()=>!1,yVe=t=>pVe.test(t),vVe=t=>hVe.test(t),bVe=t=>!pe(t)&&!he(t),xVe=t=>Jg(t,Ooe,Loe),pe=t=>Poe.test(t),qp=t=>Jg(t,Doe,gVe),S8=t=>Jg(t,TVe,Je),Tae=t=>Jg(t,Moe,Loe),wVe=t=>Jg(t,_oe,vVe),yA=t=>Jg(t,Noe,yVe),he=t=>Roe.test(t),I1=t=>ey(t,Doe),kVe=t=>ey(t,EVe),Eae=t=>ey(t,Moe),SVe=t=>ey(t,Ooe),CVe=t=>ey(t,_oe),vA=t=>ey(t,Noe,!0),Jg=(t,e,r)=>{let n=Poe.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},ey=(t,e,r=!1)=>{let n=Roe.exec(t);return n?n[1]?e(n[1]):r:!1},Moe=t=>t==="position"||t==="percentage",_oe=t=>t==="image"||t==="url",Ooe=t=>t==="length"||t==="size"||t==="bg-size",Doe=t=>t==="length",TVe=t=>t==="number",EVe=t=>t==="family-name",Noe=t=>t==="shadow",IVe=()=>{let t=en("color"),e=en("font"),r=en("text"),n=en("font-weight"),i=en("tracking"),s=en("leading"),a=en("breakpoint"),o=en("container"),l=en("spacing"),c=en("radius"),u=en("shadow"),d=en("inset-shadow"),f=en("text-shadow"),p=en("drop-shadow"),h=en("blur"),m=en("perspective"),v=en("aspect"),b=en("ease"),y=en("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...w(),he,pe],O=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],T=()=>[he,pe,l],E=()=>[zg,"full","auto",...T()],P=()=>[ed,"none","subgrid",he,pe],R=()=>["auto",{span:["full",ed,he,pe]},ed,he,pe],I=()=>[ed,"auto",he,pe],B=()=>["auto","min","max","fr",he,pe],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...T()],V=()=>[zg,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],K=()=>[t,he,pe],de=()=>[...w(),Eae,Tae,{position:[he,pe]}],Me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],pt=()=>["auto","cover","contain",SVe,xVe,{size:[he,pe]}],At=()=>[k8,I1,qp],Ue=()=>["","none","full",c,he,pe],Gt=()=>["",Je,I1,qp],Kr=()=>["solid","dashed","dotted","double"],Di=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],lt=()=>[Je,k8,Eae,Tae],ps=()=>["","none",h,he,pe],Ir=()=>["none",Je,he,pe],Ar=()=>["none",Je,he,pe],Zs=()=>[Je,he,pe],ui=()=>[zg,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cc],breakpoint:[Cc],color:[mVe],container:[Cc],"drop-shadow":[Cc],ease:["in","out","in-out"],font:[bVe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Cc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Cc],shadow:[Cc],spacing:["px",Je],text:[Cc],"text-shadow":[Cc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zg,pe,he,v]}],container:["container"],columns:[{columns:[Je,pe,he,o]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[ed,"auto",he,pe]}],basis:[{basis:[zg,"full","auto",o,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Je,zg,"auto","initial","none",pe]}],grow:[{grow:["",Je,he,pe]}],shrink:[{shrink:["",Je,he,pe]}],order:[{order:[ed,"first","last","none",he,pe]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[o,"screen",...V()]}],"min-w":[{"min-w":[o,"screen","none",...V()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",r,I1,qp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,he,S8]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",k8,pe]}],"font-family":[{font:[kVe,pe,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,he,pe]}],"line-clamp":[{"line-clamp":[Je,"none",he,S8]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",he,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Kr(),"wavy"]}],"text-decoration-thickness":[{decoration:[Je,"from-font","auto",he,qp]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[Je,"auto",he,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:Me()}],"bg-size":[{bg:pt()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ed,he,pe],radial:["",he,pe],conic:[ed,he,pe]},CVe,wVe]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:At()}],"gradient-via-pos":[{via:At()}],"gradient-to-pos":[{to:At()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:Ue()}],"rounded-s":[{"rounded-s":Ue()}],"rounded-e":[{"rounded-e":Ue()}],"rounded-t":[{"rounded-t":Ue()}],"rounded-r":[{"rounded-r":Ue()}],"rounded-b":[{"rounded-b":Ue()}],"rounded-l":[{"rounded-l":Ue()}],"rounded-ss":[{"rounded-ss":Ue()}],"rounded-se":[{"rounded-se":Ue()}],"rounded-ee":[{"rounded-ee":Ue()}],"rounded-es":[{"rounded-es":Ue()}],"rounded-tl":[{"rounded-tl":Ue()}],"rounded-tr":[{"rounded-tr":Ue()}],"rounded-br":[{"rounded-br":Ue()}],"rounded-bl":[{"rounded-bl":Ue()}],"border-w":[{border:Gt()}],"border-w-x":[{"border-x":Gt()}],"border-w-y":[{"border-y":Gt()}],"border-w-s":[{"border-s":Gt()}],"border-w-e":[{"border-e":Gt()}],"border-w-t":[{"border-t":Gt()}],"border-w-r":[{"border-r":Gt()}],"border-w-b":[{"border-b":Gt()}],"border-w-l":[{"border-l":Gt()}],"divide-x":[{"divide-x":Gt()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Gt()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Kr(),"hidden","none"]}],"divide-style":[{divide:[...Kr(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...Kr(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Je,he,pe]}],"outline-w":[{outline:["",Je,I1,qp]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",u,vA,yA]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",d,vA,yA]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:Gt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[Je,qp]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":Gt()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",f,vA,yA]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[Je,he,pe]}],"mix-blend":[{"mix-blend":[...Di(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Di()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Je]}],"mask-image-linear-from-pos":[{"mask-linear-from":lt()}],"mask-image-linear-to-pos":[{"mask-linear-to":lt()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":lt()}],"mask-image-t-to-pos":[{"mask-t-to":lt()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":lt()}],"mask-image-r-to-pos":[{"mask-r-to":lt()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":lt()}],"mask-image-b-to-pos":[{"mask-b-to":lt()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":lt()}],"mask-image-l-to-pos":[{"mask-l-to":lt()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":lt()}],"mask-image-x-to-pos":[{"mask-x-to":lt()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":lt()}],"mask-image-y-to-pos":[{"mask-y-to":lt()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[he,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":lt()}],"mask-image-radial-to-pos":[{"mask-radial-to":lt()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[Je]}],"mask-image-conic-from-pos":[{"mask-conic-from":lt()}],"mask-image-conic-to-pos":[{"mask-conic-to":lt()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:Me()}],"mask-size":[{mask:pt()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,pe]}],filter:[{filter:["","none",he,pe]}],blur:[{blur:ps()}],brightness:[{brightness:[Je,he,pe]}],contrast:[{contrast:[Je,he,pe]}],"drop-shadow":[{"drop-shadow":["","none",p,vA,yA]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",Je,he,pe]}],"hue-rotate":[{"hue-rotate":[Je,he,pe]}],invert:[{invert:["",Je,he,pe]}],saturate:[{saturate:[Je,he,pe]}],sepia:[{sepia:["",Je,he,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,pe]}],"backdrop-blur":[{"backdrop-blur":ps()}],"backdrop-brightness":[{"backdrop-brightness":[Je,he,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Je,he,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Je,he,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Je,he,pe]}],"backdrop-invert":[{"backdrop-invert":["",Je,he,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Je,he,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Je,he,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Je,he,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Je,"initial",he,pe]}],ease:[{ease:["linear","initial",b,he,pe]}],delay:[{delay:[Je,he,pe]}],animate:[{animate:["none",y,he,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,he,pe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:Ir()}],"rotate-x":[{"rotate-x":Ir()}],"rotate-y":[{"rotate-y":Ir()}],"rotate-z":[{"rotate-z":Ir()}],scale:[{scale:Ar()}],"scale-x":[{"scale-x":Ar()}],"scale-y":[{"scale-y":Ar()}],"scale-z":[{"scale-z":Ar()}],"scale-3d":["scale-3d"],skew:[{skew:Zs()}],"skew-x":[{"skew-x":Zs()}],"skew-y":[{"skew-y":Zs()}],transform:[{transform:[he,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ui()}],"translate-x":[{"translate-x":ui()}],"translate-y":[{"translate-y":ui()}],"translate-z":[{"translate-z":ui()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,pe]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[Je,I1,qp,S8]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Foe=lVe(IVe);function Ce(...t){return Foe(Eoe(t))}function AVe({className:t,...e}){return g.jsx(KBe,{"data-slot":"label",className:Ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}var $A=xBe,Boe=N.createContext({}),Xt=({...t})=>g.jsx(Boe.Provider,{value:{name:t.name},children:g.jsx(kBe,{...t})}),UA=()=>{let t=N.useContext(Boe),e=N.useContext(Voe),{getFieldState:r}=VA(),n=hoe({name:t.name}),i=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");let{id:s}=e;return{id:s,name:t.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},Voe=N.createContext({});function Bs({className:t,...e}){return g.jsx(V1,{className:Ce("grid gap-2",t),...e})}function V1({className:t,...e}){let r=N.useId();return g.jsx(Voe.Provider,{value:{id:r},children:g.jsx("div",{"data-slot":"form-item",className:t,...e})})}function Fn({className:t,...e}){let{error:r,formItemId:n}=UA();return g.jsx(AVe,{"data-slot":"form-label","data-error":!!r,className:Ce("data-[error=true]:text-destructive",t),htmlFor:n,...e})}function qr({...t}){let{error:e,formItemId:r,formDescriptionId:n,formMessageId:i}=UA();return g.jsx(jA,{"data-slot":"form-control",id:r,"aria-describedby":e?`${n} ${i}`:`${n}`,"aria-invalid":!!e,...t})}function gl({className:t,...e}){let{formDescriptionId:r}=UA();return g.jsx("p",{"data-slot":"form-description",id:r,className:Ce("text-muted-foreground text-sm",t),...e})}function Ii({className:t,...e}){let{error:r,formMessageId:n}=UA(),i=r?String(r?.message??""):e.children;return i?g.jsx("p",{"data-slot":"form-message",id:n,className:Ce("text-destructive text-sm",t),...e,children:i}):null}function ti({className:t,type:e,...r}){return g.jsx("input",{type:e,"data-slot":"input",className:Ce("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}function j8({value:t,onChange:e,...r}){let[n,i]=(0,$.useState)(String(t??""));return g.jsx(ti,{type:"number",value:t??n,onChange:s=>{i(s.target.value);let a=s.target.valueAsNumber;Number.isNaN(a)?e(null):e(a)},...r})}var Iae=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Aae=Eoe,Xp=(t,e)=>r=>{var n;if(e?.variants==null)return Aae(t,r?.class,r?.className);let{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(c=>{let u=r?.[c],d=s?.[c];if(u===null)return null;let f=Iae(u)||Iae(d);return i[c][f]}),o=r&&Object.entries(r).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(h=>{let[m,v]=h;return Array.isArray(v)?v.includes({...s,...o}[m]):{...s,...o}[m]===v})?[...c,d,f]:c},[]);return Aae(t,a,l,r?.class,r?.className)},joe=({variant:t,onReset:e})=>t==="override"?g.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[g.jsx("span",{className:"flex size-2 bg-primary/70 rounded-full",title:"Modified from default"}),g.jsx("button",{type:"button",onClick:e,className:"pointer-fine:opacity-0 group-hover/item:opacity-100 p-1 -m-1 rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-all",title:"Reset to default",children:g.jsx(Iu,{className:"size-3.5"})})]}):null,PVe=Xp("font-medium",{variants:{variant:{default:"text-muted-foreground",override:"text-foreground"}},defaultVariants:{variant:"default"}}),$oe=({icon:t,label:e,description:r,variant:n,onReset:i,className:s})=>g.jsxs("div",{className:Ce("min-w-48 max-w-72 pr-6 self-start",s),children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"text-muted-foreground flex-shrink-0",children:g.jsx(t,{className:"size-4"})}),g.jsx(Fn,{className:PVe({variant:n}),children:e}),g.jsx(joe,{variant:n,onReset:i})]}),g.jsx(gl,{className:"text-xs mt-1 ml-6",children:r})]}),Hg=({children:t,className:e})=>g.jsxs(Bs,{className:Ce("group/item p-4",e),children:[g.jsx("div",{className:"flex items-center justify-between",children:t}),g.jsx(Ii,{className:"ml-6"})]});function RVe({form:t,icon:e,label:r,onReset:n,description:i}){return g.jsx(Xt,{control:t.control,name:"aspectRatio",render:({field:{value:s,name:a,onBlur:o,onChange:l,disabled:c}})=>g.jsxs(Hg,{children:[g.jsx($oe,{icon:e,label:r,description:i,variant:s!=null&&s.width||s!=null&&s.height?"override":"default",onReset:n}),g.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 flex-wrap",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(j8,{type:"number",min:1,step:1,onBlur:o,disabled:c,name:`${a}.width`,value:s?.width??"",onChange:u=>l(s!=null&&s.width||u?{...s,width:u}:null),placeholder:"W",className:"w-16 h-8"}),g.jsx("span",{className:"text-muted-foreground text-sm",children:":"}),g.jsx(j8,{type:"number",min:1,step:1,onBlur:o,disabled:c,name:`${a}.height`,value:s?.height??"",onChange:u=>l(s!=null&&s.height||u?{...s,height:u}:null),placeholder:"H",className:"w-16 h-8"})]})})]})})}var qg;function Uoe(t){return{lang:t?.lang??qg?.lang,message:t?.message,abortEarly:t?.abortEarly??qg?.abortEarly,abortPipeEarly:t?.abortPipeEarly??qg?.abortPipeEarly}}var Pae;function LVe(t){return Pae?.get(t)}var Rae;function MVe(t){return Rae?.get(t)}var Lae;function _Ve(t,e){var r;return(r=Lae?.get(t))==null?void 0:r.get(e)}function ld(t){var e,r;let n=typeof t;return n==="string"?`"${t}"`:n==="number"||n==="bigint"||n==="boolean"?`${t}`:n==="object"||n==="function"?(t&&((r=(e=Object.getPrototypeOf(t))==null?void 0:e.constructor)==null?void 0:r.name))??"null":n}function Bn(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,a=i?.expected??t.expects??null,o=i?.received??ld(s),l={kind:t.kind,type:t.type,input:s,expected:a,received:o,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${o}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",u=i?.message??t.message??_Ve(t.reference,l.lang)??(c?MVe(l.lang):null)??n.message??LVe(l.lang);u!==void 0&&(l.message=typeof u=="function"?u(l):u),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function Ea(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Uoe())}}}function OVe(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function zoe(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}function DVe(t){if(t.path){let e="";for(let r of t.path)if(typeof r.key=="string"||typeof r.key=="number")e?e+=`.${r.key}`:e+=r.key;else return null;return e}return null}function Yg(t,e){return{kind:"validation",type:"check",reference:Yg,async:!1,expects:null,requirement:t,message:e,"~run"(r,n){return r.typed&&!this.requirement(r.value)&&Bn(this,"input",r,n),r}}}function $8(t,e){return{kind:"validation",type:"gt_value",reference:$8,async:!1,expects:`>${t instanceof Date?t.toJSON():ld(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value>this.requirement)&&Bn(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():ld(r.value)}),r}}}function Gp(t){return{kind:"validation",type:"integer",reference:Gp,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&Bn(this,"integer",e,r),e}}}function CA(t,e){return{kind:"validation",type:"lt_value",reference:CA,async:!1,expects:`<${t instanceof Date?t.toJSON():ld(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value<this.requirement)&&Bn(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():ld(r.value)}),r}}}function M1(t,e){return{kind:"validation",type:"min_value",reference:M1,async:!1,expects:`>=${t instanceof Date?t.toJSON():ld(t)}`,requirement:t,message:e,"~run"(r,n){return r.typed&&!(r.value>=this.requirement)&&Bn(this,"value",r,n,{received:r.value instanceof Date?r.value.toJSON():ld(r.value)}),r}}}function m9(t){return{kind:"transformation",type:"transform",reference:m9,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function qoe(t){return{kind:"validation",type:"url",reference:qoe,async:!1,expects:null,requirement(e){try{return new URL(e),!0}catch{return!1}},message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&Bn(this,"URL",e,r),e}}}function NVe(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function g9(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function hl(t){return{kind:"schema",type:"boolean",reference:hl,expects:"boolean",async:!1,message:t,get"~standard"(){return Ea(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:Bn(this,"type",e,r),e}}}function Hoe(t){return{kind:"schema",type:"file",reference:Hoe,expects:"File",async:!1,message:t,get"~standard"(){return Ea(this)},"~run"(e,r){return e.value instanceof File?e.typed=!0:Bn(this,"type",e,r),e}}}function tn(t,e){return{kind:"schema",type:"nullish",reference:tn,expects:`(${t.expects} | null | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Ea(this)},"~run"(r,n){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=g9(this,r,n)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Wp(t){return{kind:"schema",type:"number",reference:Wp,expects:"number",async:!1,message:t,get"~standard"(){return Ea(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Bn(this,"type",e,r),e}}}function cd(t,e){return{kind:"schema",type:"object",reference:cd,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return Ea(this)},"~run"(r,n){var i;let s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(let a in this.entries){let o=this.entries[a];if(a in s||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let l=a in s?s[a]:g9(o),c=o["~run"]({value:l},n);if(c.issues){let u={type:"object",origin:"value",input:s,key:a,value:l};for(let d of c.issues)d.path?d.path.unshift(u):d.path=[u],(i=r.issues)==null||i.push(d);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),r.value[a]=c.value}else if(o.fallback!==void 0)r.value[a]=NVe(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(Bn(this,"key",r,n,{input:void 0,expected:`"${a}"`,path:[{type:"object",origin:"key",input:s,key:a,value:s[a]}]}),n.abortEarly))break}}else Bn(this,"type",r,n);return r}}}function Ic(t,e){return{kind:"schema",type:"optional",reference:Ic,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Ea(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=g9(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Zg(t,e){return{kind:"schema",type:"picklist",reference:Zg,expects:zoe(t.map(ld),"|"),async:!1,options:t,message:e,get"~standard"(){return Ea(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:Bn(this,"type",r,n),r}}}function Goe(t,e,r){return{kind:"schema",type:"record",reference:Goe,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return Ea(this)},"~run"(n,i){var s,a;let o=n.value;if(o&&typeof o=="object"){n.typed=!0,n.value={};for(let l in o)if(OVe(o,l)){let c=o[l],u=this.key["~run"]({value:l},i);if(u.issues){let f={type:"object",origin:"key",input:o,key:l,value:c};for(let p of u.issues)p.path=[f],(s=n.issues)==null||s.push(p);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}let d=this.value["~run"]({value:c},i);if(d.issues){let f={type:"object",origin:"value",input:o,key:l,value:c};for(let p of d.issues)p.path?p.path.unshift(f):p.path=[f],(a=n.issues)==null||a.push(p);if(n.issues||(n.issues=d.issues),i.abortEarly){n.typed=!1;break}}(!u.typed||!d.typed)&&(n.typed=!1),u.typed&&(n.value[u.value]=d.value)}}else Bn(this,"type",n,i);return n}}}function yl(t){return{kind:"schema",type:"string",reference:yl,expects:"string",async:!1,message:t,get"~standard"(){return Ea(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:Bn(this,"type",e,r),e}}}function Woe(t){return{kind:"schema",type:"undefined",reference:Woe,expects:"undefined",async:!1,message:t,get"~standard"(){return Ea(this)},"~run"(e,r){return e.value===void 0?e.typed=!0:Bn(this,"type",e,r),e}}}function Mae(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function y9(t,e){return{kind:"schema",type:"union",reference:y9,expects:zoe(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return Ea(this)},"~run"(r,n){let i,s,a;for(let o of this.options){let l=o["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else a?a.push(l):a=[l]}if(i)return i;if(s){if(s.length===1)return s[0];Bn(this,"type",r,n,{issues:Mae(s)}),r.typed=!0}else{if(a?.length===1)return a[0];Bn(this,"type",r,n,{issues:Mae(a)})}return r}}}function Ta(...t){return{...t[0],pipe:t,get"~standard"(){return Ea(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}async function FVe(t,e,r){let n=await t["~run"]({value:e},Uoe(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var U8=cd({hours:Ta(Wp(),Gp(),M1(0)),minutes:Ta(Wp(),Gp(),M1(0),CA(60)),seconds:Ta(Wp(),Gp(),M1(0),CA(60)),milliseconds:Ta(Wp(),Gp(),M1(0),CA(1e3))}),j1={hours:0,minutes:0,seconds:0,milliseconds:0};function BVe(t){let e=Number.parseInt(t,10);return!Number.isNaN(e)&&e>=0&&e<=99}function VVe(t){let e=Number.parseInt(t,10);return!Number.isNaN(e)&&e>=0&&e<=59}function jVe(t){let e=Number.parseInt(t,10);return!Number.isNaN(e)&&e>=0&&e<=59}function $Ve(t){let e=Number.parseInt(t,10);return!Number.isNaN(e)&&e>=0&&e<=999}function Ca(t,e){return t.toString().padStart(e,"0")}function zA(t,e,r,n){let i=Number.parseInt(t,10);if(Number.isNaN(i))return Ca(e,n);let s=Math.min(Math.max(i,e),r);return Ca(s,n)}function UVe(t){return zA(t,0,99,2)}function zVe(t){return zA(t,0,59,2)}function qVe(t){return zA(t,0,59,2)}function HVe(t){return zA(t,0,999,3)}function qA(t,e,r,n,i,s=!0){let a=Number.parseInt(t,10);if(Number.isNaN(a))return Ca(r,i);let o=a+e;return s?o>n?o=r+(o-n-1):o<r&&(o=n-(r-o-1)):o=Math.min(Math.max(o,r),n),Ca(o,i)}function GVe(t,e,r=!1){return qA(t,e,0,99,2,r)}function WVe(t,e,r=!0){return qA(t,e,0,59,2,r)}function KVe(t,e,r=!0){return qA(t,e,0,59,2,r)}function YVe(t,e,r=!0){return qA(t,e,0,999,3,r)}function HA(t){let e=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),n=Math.floor(t%6e4/1e3),i=t%1e3;return{hours:e,minutes:r,seconds:n,milliseconds:i}}function Yp(t){return t.hours*36e5+t.minutes*6e4+t.seconds*1e3+t.milliseconds}function z8(t){let e=t.hours,r=t.minutes,n=t.seconds;return e===0?`${r}:${n.toString().padStart(2,"0")}`:`${e}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`}function XVe(t,e,r){if(!e&&!t)return;let n=z8(t??j1),i=r?"Video End":e?z8(e):"?";return`${n} \u2192 ${i}`}var QVe=Ta(U8,Yg(t=>Gg(t),"Specify a time for the timestamp")),ZVe=Ta(cd({start:Ic(U8),end:Ic(U8),playToEnd:Ic(hl())}),Yg(t=>!(_ae(t.start)&&(t.playToEnd||_ae(t.end))),"Specify either a start time or an end time for the media clip"),Yg(t=>!(Gg(t.start)&&Gg(t.end)&&!t.playToEnd)||Yp(t.start)<Yp(t.end),"Start time must be before end time"),Yg(t=>!(Gg(t.start)&&!Gg(t.end)&&!t.playToEnd),"Specify an end time for the media clip or choose to play to the end")),JVe=Ta(Zg(["anonymous","use-credentials","disabled"])),eje=Ta(cd({width:tn(Ta(Wp(),Gp(),$8(0))),height:tn(Ta(Wp(),Gp(),$8(0)))}),Yg(t=>typeof t.width=="number"&&typeof t.height=="number"||!t.width&&!t.height,"Both width and height must be specified"),m9(t=>t.width&&t.height?{width:t.width,height:t.height}:null)),tje=Zg(["video","audio","media"]),GA=cd({loop:tn(hl()),autoPlay:tn(hl()),showControls:tn(hl()),muted:tn(hl()),volume:tn(yo),audioGain:tn(wc),playbackRate:tn(zp),preservePitch:tn(hl()),aspectRatio:tn(eje),flip:tn($p),title:tn(yl()),crossOrigin:tn(JVe),type:tn(tje),play:tn(Up),timestamp:tn(QVe),clip:Ta(tn(y9([Goe(yl(),Woe()),ZVe])),m9(t=>v9(t)?t:void 0))});function v9(t){return!!(t!=null&&t.start||t!=null&&t.end||t?.playToEnd!==void 0)}function Gg(t){return!!t&&Yp(t)>0}function _ae(t){return!Gg(t)}var rje=Xp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9",iconSm:"size-6",iconSubtitle:"size-8"}},defaultVariants:{variant:"default",size:"default"}});function Cr({className:t,variant:e,size:r,asChild:n=!1,...i}){let s=n?jA:"button";return g.jsx(s,{"data-slot":"button",className:Ce(rje({variant:e,size:r,className:t})),...i})}function $1(t,e=[]){let r=[];function n(s,a){let o=N.createContext(a),l=r.length;r=[...r,a];let c=d=>{var f;let{scope:p,children:h,...m}=d,v=((f=p?.[t])==null?void 0:f[l])||o,b=N.useMemo(()=>m,Object.values(m));return g.jsx(v.Provider,{value:b,children:h})};c.displayName=s+"Provider";function u(d,f){var p;let h=((p=f?.[t])==null?void 0:p[l])||o,m=N.useContext(h);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,u]}let i=()=>{let s=r.map(a=>N.createContext(a));return function(a){let o=a?.[t]||s;return N.useMemo(()=>({[`__scope${t}`]:{...a,[t]:o}}),[a,o])}};return i.scopeName=t,[n,nje(i,...e)]}function nje(...t){let e=t[0];if(t.length===1)return e;let r=()=>{let n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(i){let s=n.reduce((a,{useScope:o,scopeName:l})=>{let c=o(i)[`__scope${l}`];return{...a,...c}},{});return N.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return r.scopeName=e.scopeName,r}function vl(t,e,{checkForDefaultPrevented:r=!0}={}){return function(n){if(t?.(n),r===!1||!n.defaultPrevented)return e?.(n)}}function b9(t){let e=N.useRef(t);return N.useEffect(()=>{e.current=t}),N.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function ty({prop:t,defaultProp:e,onChange:r=()=>{}}){let[n,i]=ije({defaultProp:e,onChange:r}),s=t!==void 0,a=s?t:n,o=b9(r),l=N.useCallback(c=>{if(s){let u=typeof c=="function"?c(t):c;u!==t&&o(u)}else i(c)},[s,t,i,o]);return[a,l]}function ije({defaultProp:t,onChange:e}){let r=N.useState(t),[n]=r,i=N.useRef(n),s=b9(e);return N.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function Koe(t){let e=N.useRef({value:t,previous:t});return N.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var MA=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{};function Yoe(t){let[e,r]=N.useState(void 0);return MA(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});let n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;let s=i[0],a,o;if("borderBoxSize"in s){let l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=t.offsetWidth,o=t.offsetHeight;r({width:a,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function sje(t,e){return N.useReducer((r,n)=>e[r][n]??r,t)}var Xoe=t=>{let{present:e,children:r}=t,n=aje(e),i=typeof r=="function"?r({present:n.isPresent}):N.Children.only(r),s=Qg(n.ref,oje(i));return typeof r=="function"||n.isPresent?N.cloneElement(i,{ref:s}):null};Xoe.displayName="Presence";function aje(t){let[e,r]=N.useState(),n=N.useRef({}),i=N.useRef(t),s=N.useRef("none"),a=t?"mounted":"unmounted",[o,l]=sje(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{let c=bA(n.current);s.current=o==="mounted"?c:"none"},[o]),MA(()=>{let c=n.current,u=i.current;if(u!==t){let d=s.current,f=bA(c);t?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&d!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),MA(()=>{if(e){let c,u=e.ownerDocument.defaultView??window,d=p=>{let h=bA(n.current).includes(p.animationName);if(p.target===e&&h&&(l("ANIMATION_END"),!i.current)){let m=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=m)})}},f=p=>{p.target===e&&(s.current=bA(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:N.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function bA(t){return t?.animationName||"none"}function oje(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var x9="Checkbox",[lje,QCt]=$1(x9),[cje,uje]=lje(x9),Qoe=N.forwardRef((t,e)=>{let{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,p]=N.useState(null),h=Qg(e,w=>p(w)),m=N.useRef(!1),v=f?u||!!f.closest("form"):!0,[b=!1,y]=ty({prop:i,defaultProp:s,onChange:c}),x=N.useRef(b);return N.useEffect(()=>{let w=f?.form;if(w){let C=()=>y(x.current);return w.addEventListener("reset",C),()=>w.removeEventListener("reset",C)}},[f,y]),g.jsxs(cje,{scope:r,state:b,disabled:o,children:[g.jsx(wo.button,{type:"button",role:"checkbox","aria-checked":ad(b)?"mixed":b,"aria-required":a,"data-state":ele(b),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:h,onKeyDown:vl(t.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:vl(t.onClick,w=>{y(C=>ad(C)?!0:!C),v&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),v&&g.jsx(dje,{control:f,bubbles:!m.current,name:n,value:l,checked:b,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"},defaultChecked:ad(s)?!1:s})]})});Qoe.displayName=x9;var Zoe="CheckboxIndicator",Joe=N.forwardRef((t,e)=>{let{__scopeCheckbox:r,forceMount:n,...i}=t,s=uje(Zoe,r);return g.jsx(Xoe,{present:n||ad(s.state)||s.state===!0,children:g.jsx(wo.span,{"data-state":ele(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});Joe.displayName=Zoe;var dje=t=>{let{control:e,checked:r,bubbles:n=!0,defaultChecked:i,...s}=t,a=N.useRef(null),o=Koe(r),l=Yoe(e);N.useEffect(()=>{let u=a.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==r&&f){let p=new Event("click",{bubbles:n});u.indeterminate=ad(r),f.call(u,ad(r)?!1:r),u.dispatchEvent(p)}},[o,r,n]);let c=N.useRef(ad(r)?!1:r);return g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...s,tabIndex:-1,ref:a,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ad(t){return t==="indeterminate"}function ele(t){return ad(t)?"indeterminate":t?"checked":"unchecked"}var fje=Qoe,pje=Joe;function tle({className:t,...e}){return g.jsx(fje,{"data-slot":"checkbox",className:Ce("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:g.jsx(pje,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:g.jsx(Zf,{className:"size-3.5"})})})}var w9=({value:t,onChange:e,onBlur:r,disabled:n,className:i,...s})=>{let a=t??j1,[o,l]=(0,$.useState)(Ca(a.hours,2)),[c,u]=(0,$.useState)(Ca(a.minutes,2)),[d,f]=(0,$.useState)(Ca(a.seconds,2)),[p,h]=(0,$.useState)(Ca(a.milliseconds,3)),m=(0,$.useRef)(null),v=(0,$.useRef)(null),b=(0,$.useRef)(null),y=(0,$.useRef)(null);(0,$.useEffect)(()=>{l(Ca(a.hours,2)),u(Ca(a.minutes,2)),f(Ca(a.seconds,2)),h(Ca(a.milliseconds,3))},[a]);let x=(0,$.useCallback)((M,z)=>{let G=Number.parseInt(z,10)||0,V={hours:Number.parseInt(o,10),minutes:Number.parseInt(c,10),seconds:Number.parseInt(d,10),milliseconds:Number.parseInt(p,10),[M]:G};e(V)},[o,c,d,p,e]),w=(0,$.useCallback)(M=>{![m,v,b,y].some(z=>z.current===M.relatedTarget)&&r&&r()},[r]),C=M=>{var z,G;let V=M.target.value.replace(/\D/g,"").slice(0,2);l(V),V.length===2&&BVe(V)&&(x("hours",V),(z=v.current)==null||z.focus(),(G=v.current)==null||G.select())},O=M=>{var z,G;let V=M.target.value.replace(/\D/g,"").slice(0,2);u(V),V.length===2&&VVe(V)&&(x("minutes",V),(z=b.current)==null||z.focus(),(G=b.current)==null||G.select())},S=M=>{var z,G;let V=M.target.value.replace(/\D/g,"").slice(0,2);f(V),V.length===2&&jVe(V)&&(x("seconds",V),(z=y.current)==null||z.focus(),(G=y.current)==null||G.select())},T=M=>{let z=M.target.value.replace(/\D/g,"").slice(0,3);h(z),z.length===3&&$Ve(z)&&x("milliseconds",z)},E=M=>{var z;let G=((z=M?.currentTarget)==null?void 0:z.value)??o,V=UVe(G);l(V),x("hours",V),M&&w(M)},P=M=>{var z;let G=((z=M?.currentTarget)==null?void 0:z.value)??c,V=zVe(G);u(V),x("minutes",V),M&&w(M)},R=M=>{var z;let G=((z=M?.currentTarget)==null?void 0:z.value)??d,V=qVe(G);f(V),x("seconds",V),M&&w(M)},I=M=>{var z;let G=((z=M?.currentTarget)==null?void 0:z.value)??p,V=HVe(G);h(V),x("milliseconds",V),M&&w(M)},B=(M,z)=>{var G,V,K,de,Me,pt;if(M.key==="ArrowUp"||M.key==="ArrowDown"){M.preventDefault();let At=M.key==="ArrowUp"?1:-1;switch(z){case"hours":{let Ue=GVe(o,At,!1);l(Ue),x("hours",Ue);break}case"minutes":{let Ue=WVe(c,At,!0);u(Ue),x("minutes",Ue);break}case"seconds":{let Ue=KVe(d,At,!0);f(Ue),x("seconds",Ue);break}case"milliseconds":{let Ue=YVe(p,At,!0);h(Ue),x("milliseconds",Ue);break}}}else if(M.key==="ArrowLeft")switch(M.preventDefault(),z){case"minutes":(G=m.current)==null||G.focus();break;case"seconds":(V=v.current)==null||V.focus();break;case"milliseconds":(K=b.current)==null||K.focus();break}else if(M.key==="ArrowRight")switch(M.preventDefault(),z){case"hours":(de=v.current)==null||de.focus();break;case"minutes":(Me=b.current)==null||Me.focus();break;case"seconds":(pt=y.current)==null||pt.focus();break}};return g.jsxs("div",{...s,className:Ce("flex items-center gap-1 flex-shrink-0",i),children:[g.jsx(ti,{ref:m,type:"text",inputMode:"numeric",value:o,onChange:C,onBlur:E,onKeyDown:M=>B(M,"hours"),onFocus:M=>M.target.select(),className:"w-10 h-8 px-1 text-center font-mono",placeholder:"00",maxLength:2,"aria-label":"Hours",disabled:n}),g.jsx("span",{className:"text-muted-foreground",children:":"}),g.jsx(ti,{ref:v,type:"text",inputMode:"numeric",value:c,onChange:O,onBlur:P,onKeyDown:M=>B(M,"minutes"),onFocus:M=>M.target.select(),className:"w-10 h-8 px-1 text-center font-mono",placeholder:"00",maxLength:2,"aria-label":"Minutes",disabled:n}),g.jsx("span",{className:"text-muted-foreground",children:":"}),g.jsx(ti,{ref:b,type:"text",inputMode:"numeric",value:d,onChange:S,onBlur:R,onKeyDown:M=>B(M,"seconds"),onFocus:M=>M.target.select(),className:"w-10 h-8 px-1 text-center font-mono",placeholder:"00",maxLength:2,"aria-label":"Seconds",disabled:n}),g.jsx("span",{className:"text-muted-foreground",children:"."}),g.jsx(ti,{ref:y,type:"text",inputMode:"numeric",value:p,onChange:T,onBlur:I,onKeyDown:M=>B(M,"milliseconds"),onFocus:M=>M.target.select(),className:"w-12 h-8 px-1 text-center font-mono",placeholder:"000",maxLength:3,"aria-label":"Milliseconds",disabled:n})]})},hje=Xp("font-medium text-sm",{variants:{variant:{default:"text-muted-foreground",override:"text-foreground"}},defaultVariants:{variant:"default"}});function rle({title:t,subtitle:e,icon:r,variant:n,onReset:i,rightSlot:s}){return g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 h-8",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"text-muted-foreground flex-shrink-0",children:g.jsx(r,{className:"size-4"})}),g.jsx("span",{className:hje({variant:n}),children:t}),e&&g.jsx("span",{className:"text-xs text-muted-foreground",children:e}),g.jsx(joe,{variant:n,onReset:i})]}),s&&g.jsx("div",{className:"flex-shrink-0",children:s})]})}function nle({form:t,onReset:e,onSwitchMode:r,className:n}){return g.jsx(Xt,{control:t.control,name:"clip",render:({field:{value:i,onBlur:s,onChange:a,disabled:o}})=>{let{start:l,end:c,playToEnd:u}=i??{};return g.jsxs("div",{className:Ce("p-4 space-y-2 group/item",n),children:[g.jsx(rle,{title:"Media Clip",icon:zm,subtitle:XVe(l,c,u??!1),variant:v9({start:l,end:c,playToEnd:u})?"override":"default",onReset:e,rightSlot:r&&g.jsxs(Cr,{type:"button",variant:"outline",onClick:()=>r("timestamp"),className:"h-7 px-2.5 text-xs gap-1.5",children:[g.jsx(Tu,{className:"size-3.5"}),"Timestamp"]})}),g.jsxs("div",{className:"ml-6 flex flex-wrap gap-y-3 gap-x-6",children:[g.jsx(mje,{form:t,value:l,onBlur:s,onChange:d=>a({start:d,end:c,playToEnd:u}),disabled:o}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(yje,{form:t,value:c,onBlur:s,onChange:d=>a({start:l,end:d,playToEnd:u}),disabled:o}),g.jsx(gje,{form:t,value:u,onBlur:s,onChange:d=>a({start:l,end:c,playToEnd:d}),disabled:o})]})]}),g.jsx(Ii,{className:"ml-6"})]})}})}function mje({form:t,value:e,onBlur:r,onChange:n,disabled:i}){return g.jsx(Xt,{control:t.control,name:"clip.start",render:()=>g.jsxs(V1,{className:"flex flex-col gap-1",children:[g.jsx(Fn,{children:"Start"}),g.jsx(qr,{children:g.jsx(w9,{value:e??j1,onChange:s=>n(s),onBlur:r,disabled:i})}),g.jsx(Ii,{})]})})}function gje({form:t,value:e,onBlur:r,onChange:n,disabled:i}){return g.jsx(Xt,{control:t.control,name:"clip.playToEnd",render:()=>g.jsxs(V1,{className:"flex flex-col gap-1 flex-1",children:[g.jsxs("div",{className:"flex flex-row items-center gap-2",children:[g.jsx(qr,{children:g.jsx(tle,{checked:e??!1,onCheckedChange:s=>n(s===!0),onBlur:r,disabled:i})}),g.jsx(Fn,{children:"Play to video end"})]}),g.jsx(Ii,{})]})})}function yje({form:t,value:e,onBlur:r,onChange:n,disabled:i}){let s=c9({control:t.control,name:"clip.playToEnd"});return g.jsx(Xt,{control:t.control,name:"clip.end",render:()=>g.jsxs(V1,{className:"flex flex-col gap-1 flex-1",children:[g.jsx(Fn,{children:"End"}),s&&g.jsx("p",{className:"flex h-8 items-center text-xs text-muted-foreground italic",children:"(will play to video end)"}),g.jsx(qr,{className:Ce(s&&"hidden"),children:g.jsx(w9,{value:e??j1,onChange:a=>n(a),onBlur:r,disabled:i})}),g.jsx(Ii,{})]})})}function ile({form:t,onReset:e,onSwitchMode:r,className:n}){return g.jsx(Xt,{control:t.control,name:"timestamp",render:({field:i})=>{let s=i.value?z8(i.value):"this timestamp";return g.jsxs(V1,{className:Ce("p-4 pb-6 space-y-2 group/item",n),children:[g.jsx(rle,{title:"Timestamp",icon:Tu,variant:i.value===void 0||i.value===null?"default":"override",onReset:e}),g.jsxs("div",{className:"ml-6 flex flex-wrap gap-x-6 gap-y-3 items-end",children:[g.jsxs("div",{className:"space-y-1 min-w-[180px]",children:[g.jsx(Fn,{children:"Time"}),g.jsx(qr,{children:g.jsx(w9,{value:i.value??j1,onChange:a=>i.onChange(a),onBlur:i.onBlur,disabled:i.disabled})})]}),g.jsxs("div",{className:"flex flex-col gap-2 pb-1",children:[g.jsxs(gl,{className:"flex items-start gap-1.5",children:[g.jsx(Fm,{className:"size-3.5 flex-shrink-0 mt-0.5"}),"The link will jump to ",s," when opened"]}),r&&g.jsxs("button",{type:"button",onClick:()=>r("clip"),className:"text-sm text-primary hover:text-primary/80 transition-colors flex items-center gap-1.5",children:[g.jsx($m,{className:"size-3.5"}),"Set end time to create media clip"]})]})]}),g.jsx(Ii,{className:"ml-6"})]})}})}function vje({form:t,className:e,onReset:r,defaultMode:n}){let[i,s]=(0,$.useState)(n),a=(0,$.useCallback)(o=>{s(o);let l=t.getValues("clip"),c=t.getValues("timestamp");o==="clip"?(t.setValue("timestamp",null),t.setValue("clip",c?{start:c}:null)):o==="timestamp"&&(t.setValue("clip",null),t.setValue("timestamp",l?.start??null))},[t]);return i==="clip"?g.jsx(nle,{form:t,onReset:r,onSwitchMode:a,className:e}):g.jsx(ile,{form:t,onReset:r,onSwitchMode:a,className:e})}var bje=Xp("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function sle({className:t,variant:e,asChild:r=!1,...n}){let i=r?jA:"span";return g.jsx(i,{"data-slot":"badge",className:Ce(bje({variant:e}),t),...n})}function ale(t,[e,r]){return Math.min(r,Math.max(e,t))}function Wg(t,e,{checkForDefaultPrevented:r=!0}={}){return function(n){if(t?.(n),r===!1||!n.defaultPrevented)return e?.(n)}}function ole(t,e=[]){let r=[];function n(s,a){let o=N.createContext(a),l=r.length;r=[...r,a];let c=d=>{var f;let{scope:p,children:h,...m}=d,v=((f=p?.[t])==null?void 0:f[l])||o,b=N.useMemo(()=>m,Object.values(m));return g.jsx(v.Provider,{value:b,children:h})};c.displayName=s+"Provider";function u(d,f){var p;let h=((p=f?.[t])==null?void 0:p[l])||o,m=N.useContext(h);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,u]}let i=()=>{let s=r.map(a=>N.createContext(a));return function(a){let o=a?.[t]||s;return N.useMemo(()=>({[`__scope${t}`]:{...a,[t]:o}}),[a,o])}};return i.scopeName=t,[n,xje(i,...e)]}function xje(...t){let e=t[0];if(t.length===1)return e;let r=()=>{let n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(i){let s=n.reduce((a,{useScope:o,scopeName:l})=>{let c=o(i)[`__scope${l}`];return{...a,...c}},{});return N.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return r.scopeName=e.scopeName,r}var lle=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},wje=N[" useInsertionEffect ".trim().toString()]||lle;function cle({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){let[i,s,a]=kje({defaultProp:e,onChange:r}),o=t!==void 0,l=o?t:i;{let u=N.useRef(t!==void 0);N.useEffect(()=>{let d=u.current;d!==o&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=o},[o,n])}let c=N.useCallback(u=>{var d;if(o){let f=Sje(u)?u(t):u;f!==t&&((d=a.current)==null||d.call(a,f))}else s(u)},[o,t,s,a]);return[l,c]}function kje({defaultProp:t,onChange:e}){let[r,n]=N.useState(t),i=N.useRef(r),s=N.useRef(e);return wje(()=>{s.current=e},[e]),N.useEffect(()=>{var a;i.current!==r&&((a=s.current)==null||a.call(s,r),i.current=r)},[r,i]),[r,n,s]}function Sje(t){return typeof t=="function"}var Cje=N.createContext(void 0);function Tje(t){let e=N.useContext(Cje);return t||e||"ltr"}function Eje(t){let e=N.useRef({value:t,previous:t});return N.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function Ije(t){let[e,r]=N.useState(void 0);return lle(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});let n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;let s=i[0],a,o;if("borderBoxSize"in s){let l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=t.offsetWidth,o=t.offsetHeight;r({width:a,height:o})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function q8(t){let e=Aje(t),r=N.forwardRef((n,i)=>{let{children:s,...a}=n,o=N.Children.toArray(s),l=o.find(Rje);if(l){let c=l.props.children,u=o.map(d=>d===l?N.Children.count(c)>1?N.Children.only(null):N.isValidElement(c)?c.props.children:null:d);return g.jsx(e,{...a,ref:i,children:N.isValidElement(c)?N.cloneElement(c,void 0,u):null})}return g.jsx(e,{...a,ref:i,children:s})});return r.displayName=`${t}.Slot`,r}function Aje(t){let e=N.forwardRef((r,n)=>{let{children:i,...s}=r;if(N.isValidElement(i)){let a=Mje(i),o=Lje(s,i.props);return i.type!==N.Fragment&&(o.ref=n?p9(n,a):a),N.cloneElement(i,o)}return N.Children.count(i)>1?N.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Pje=Symbol("radix.slottable");function Rje(t){return N.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Pje}function Lje(t,e){let r={...e};for(let n in e){let i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{let o=s(...a);return i(...a),o}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}function Mje(t){var e,r;let n=(e=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:e.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?t.props.ref:t.props.ref||t.ref)}var _je=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],U1=_je.reduce((t,e)=>{let r=q8(`Primitive.${e}`),n=N.forwardRef((i,s)=>{let{asChild:a,...o}=i,l=a?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Oje(t){let e=t+"CollectionProvider",[r,n]=ole(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),a=m=>{let{scope:v,children:b}=m,y=$.default.useRef(null),x=$.default.useRef(new Map).current;return g.jsx(i,{scope:v,itemMap:x,collectionRef:y,children:b})};a.displayName=e;let o=t+"CollectionSlot",l=q8(o),c=$.default.forwardRef((m,v)=>{let{scope:b,children:y}=m,x=s(o,b),w=od(v,x.collectionRef);return g.jsx(l,{ref:w,children:y})});c.displayName=o;let u=t+"CollectionItemSlot",d="data-radix-collection-item",f=q8(u),p=$.default.forwardRef((m,v)=>{let{scope:b,children:y,...x}=m,w=$.default.useRef(null),C=od(v,w),O=s(u,b);return $.default.useEffect(()=>(O.itemMap.set(w,{ref:w,...x}),()=>void O.itemMap.delete(w))),g.jsx(f,{[d]:"",ref:C,children:y})});p.displayName=u;function h(m){let v=s(t+"CollectionConsumer",m);return $.default.useCallback(()=>{let b=v.collectionRef.current;if(!b)return[];let y=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((x,w)=>y.indexOf(x.ref.current)-y.indexOf(w.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:c,ItemSlot:p},h,n]}var ule=["PageUp","PageDown"],dle=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],fle={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ry="Slider",[H8,Dje,Nje]=Oje(ry),[ple,ZCt]=ole(ry,[Nje]),[Fje,WA]=ple(ry),hle=N.forwardRef((t,e)=>{let{name:r,min:n=0,max:i=100,step:s=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[n],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:h,...m}=t,v=N.useRef(new Set),b=N.useRef(0),y=a==="horizontal"?Bje:Vje,[x=[],w]=cle({prop:u,defaultProp:c,onChange:P=>{var R;(R=[...v.current][b.current])==null||R.focus(),d(P)}}),C=N.useRef(x);function O(P){let R=qje(x,P);E(P,R)}function S(P){E(P,b.current)}function T(){let P=C.current[b.current];x[b.current]!==P&&f(x)}function E(P,R,{commit:I}={commit:!1}){let B=Kje(s),M=Yje(Math.round((P-n)/s)*s+n,B),z=ale(M,[n,i]);w((G=[])=>{let V=Uje(G,z,R);if(Wje(V,l*s)){b.current=V.indexOf(z);let K=String(V)!==String(G);return K&&I&&f(V),K?V:G}else return G})}return g.jsx(Fje,{scope:t.__scopeSlider,name:r,disabled:o,min:n,max:i,valueIndexToChangeRef:b,thumbs:v.current,values:x,orientation:a,form:h,children:g.jsx(H8.Provider,{scope:t.__scopeSlider,children:g.jsx(H8.Slot,{scope:t.__scopeSlider,children:g.jsx(y,{"aria-disabled":o,"data-disabled":o?"":void 0,...m,ref:e,onPointerDown:Wg(m.onPointerDown,()=>{o||(C.current=x)}),min:n,max:i,inverted:p,onSlideStart:o?void 0:O,onSlideMove:o?void 0:S,onSlideEnd:o?void 0:T,onHomeKeyDown:()=>!o&&E(n,0,{commit:!0}),onEndKeyDown:()=>!o&&E(i,x.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:R})=>{if(!o){let I=ule.includes(P.key)||P.shiftKey&&dle.includes(P.key)?10:1,B=b.current,M=x[B],z=s*I*R;E(M+z,B,{commit:!0})}}})})})})});hle.displayName=ry;var[mle,gle]=ple(ry,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Bje=N.forwardRef((t,e)=>{let{min:r,max:n,dir:i,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=t,[d,f]=N.useState(null),p=od(e,x=>f(x)),h=N.useRef(void 0),m=Tje(i),v=m==="ltr",b=v&&!s||!v&&s;function y(x){let w=h.current||d.getBoundingClientRect(),C=[0,w.width],O=k9(C,b?[r,n]:[n,r]);return h.current=w,O(x-w.left)}return g.jsx(mle,{scope:t.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:g.jsx(yle,{dir:m,"data-orientation":"horizontal",...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{let w=y(x.clientX);a?.(w)},onSlideMove:x=>{let w=y(x.clientX);o?.(w)},onSlideEnd:()=>{h.current=void 0,l?.()},onStepKeyDown:x=>{let w=fle[b?"from-left":"from-right"].includes(x.key);c?.({event:x,direction:w?-1:1})}})})}),Vje=N.forwardRef((t,e)=>{let{min:r,max:n,inverted:i,onSlideStart:s,onSlideMove:a,onSlideEnd:o,onStepKeyDown:l,...c}=t,u=N.useRef(null),d=od(e,u),f=N.useRef(void 0),p=!i;function h(m){let v=f.current||u.current.getBoundingClientRect(),b=[0,v.height],y=k9(b,p?[n,r]:[r,n]);return f.current=v,y(m-v.top)}return g.jsx(mle,{scope:t.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:g.jsx(yle,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{let v=h(m.clientY);s?.(v)},onSlideMove:m=>{let v=h(m.clientY);a?.(v)},onSlideEnd:()=>{f.current=void 0,o?.()},onStepKeyDown:m=>{let v=fle[p?"from-bottom":"from-top"].includes(m.key);l?.({event:m,direction:v?-1:1})}})})}),yle=N.forwardRef((t,e)=>{let{__scopeSlider:r,onSlideStart:n,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:l,...c}=t,u=WA(ry,r);return g.jsx(U1.span,{...c,ref:e,onKeyDown:Wg(t.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(o(d),d.preventDefault()):ule.concat(dle).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:Wg(t.onPointerDown,d=>{let f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():n(d)}),onPointerMove:Wg(t.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:Wg(t.onPointerUp,d=>{let f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),s(d))})})}),vle="SliderTrack",ble=N.forwardRef((t,e)=>{let{__scopeSlider:r,...n}=t,i=WA(vle,r);return g.jsx(U1.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:e})});ble.displayName=vle;var G8="SliderRange",xle=N.forwardRef((t,e)=>{let{__scopeSlider:r,...n}=t,i=WA(G8,r),s=gle(G8,r),a=N.useRef(null),o=od(e,a),l=i.values.length,c=i.values.map(f=>Sle(f,i.min,i.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return g.jsx(U1.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...n,ref:o,style:{...t.style,[s.startEdge]:u+"%",[s.endEdge]:d+"%"}})});xle.displayName=G8;var W8="SliderThumb",wle=N.forwardRef((t,e)=>{let r=Dje(t.__scopeSlider),[n,i]=N.useState(null),s=od(e,o=>i(o)),a=N.useMemo(()=>n?r().findIndex(o=>o.ref.current===n):-1,[r,n]);return g.jsx(jje,{...t,ref:s,index:a})}),jje=N.forwardRef((t,e)=>{let{__scopeSlider:r,index:n,name:i,...s}=t,a=WA(W8,r),o=gle(W8,r),[l,c]=N.useState(null),u=od(e,y=>c(y)),d=l?a.form||!!l.closest("form"):!0,f=Ije(l),p=a.values[n],h=p===void 0?0:Sle(p,a.min,a.max),m=zje(n,a.values.length),v=f?.[o.size],b=v?Hje(v,h,o.direction):0;return N.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),g.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${h}% + ${b}px)`},children:[g.jsx(H8.ItemSlot,{scope:t.__scopeSlider,children:g.jsx(U1.span,{role:"slider","aria-label":t["aria-label"]||m,"aria-valuemin":a.min,"aria-valuenow":p,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:u,style:p===void 0?{display:"none"}:t.style,onFocus:Wg(t.onFocus,()=>{a.valueIndexToChangeRef.current=n})})}),d&&g.jsx(kle,{name:i??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:p},n)]})});wle.displayName=W8;var $je="RadioBubbleInput",kle=N.forwardRef(({__scopeSlider:t,value:e,...r},n)=>{let i=N.useRef(null),s=od(i,n),a=Eje(e);return N.useEffect(()=>{let o=i.current;if(!o)return;let l=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&c){let u=new Event("input",{bubbles:!0});c.call(o,e),o.dispatchEvent(u)}},[a,e]),g.jsx(U1.input,{style:{display:"none"},...r,ref:s,defaultValue:e})});kle.displayName=$je;function Uje(t=[],e,r){let n=[...t];return n[r]=e,n.sort((i,s)=>i-s)}function Sle(t,e,r){let n=100/(r-e)*(t-e);return ale(n,[0,100])}function zje(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function qje(t,e){if(t.length===1)return 0;let r=t.map(i=>Math.abs(i-e)),n=Math.min(...r);return r.indexOf(n)}function Hje(t,e,r){let n=t/2,i=k9([0,50],[0,n]);return(n-i(e)*r)*r}function Gje(t){return t.slice(0,-1).map((e,r)=>t[r+1]-e)}function Wje(t,e){if(e>0){let r=Gje(t);return Math.min(...r)>=e}return!0}function k9(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];let n=(e[1]-e[0])/(t[1]-t[0]);return e[0]+n*(r-t[0])}}function Kje(t){return(String(t).split(".")[1]||"").length}function Yje(t,e){let r=Math.pow(10,e);return Math.round(t*r)/r}var Xje=hle,Qje=ble,Zje=xle,Jje=wle;function e$e({className:t,defaultValue:e,value:r,min:n=0,max:i=100,...s}){let a=N.useMemo(()=>Array.isArray(r)?r:Array.isArray(e)?e:[n,i],[r,e,n,i]);return g.jsxs(Xje,{"data-slot":"slider",defaultValue:e,value:r,min:n,max:i,className:Ce("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...s,children:[g.jsx(Qje,{"data-slot":"slider-track",className:Ce("bg-(--slider-track-background) relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:g.jsx(Zje,{"data-slot":"slider-range",className:Ce("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(o,l)=>g.jsx(Jje,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}var S9="Switch",[t$e,JCt]=$1(S9),[r$e,n$e]=t$e(S9),Cle=N.forwardRef((t,e)=>{let{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,p]=N.useState(null),h=Qg(e,x=>p(x)),m=N.useRef(!1),v=f?u||!!f.closest("form"):!0,[b=!1,y]=ty({prop:i,defaultProp:s,onChange:c});return g.jsxs(r$e,{scope:r,checked:b,disabled:o,children:[g.jsx(wo.button,{type:"button",role:"switch","aria-checked":b,"aria-required":a,"data-state":Ile(b),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:h,onClick:vl(t.onClick,x=>{y(w=>!w),v&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),v&&g.jsx(i$e,{control:f,bubbles:!m.current,name:n,value:l,checked:b,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});Cle.displayName=S9;var Tle="SwitchThumb",Ele=N.forwardRef((t,e)=>{let{__scopeSwitch:r,...n}=t,i=n$e(Tle,r);return g.jsx(wo.span,{"data-state":Ile(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});Ele.displayName=Tle;var i$e=t=>{let{control:e,checked:r,bubbles:n=!0,...i}=t,s=N.useRef(null),a=Koe(r),o=Yoe(e);return N.useEffect(()=>{let l=s.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==r&&u){let d=new Event("click",{bubbles:n});u.call(l,r),l.dispatchEvent(d)}},[a,r,n]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:s,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ile(t){return t?"checked":"unchecked"}var s$e=Cle,a$e=Ele;function Ale({className:t,...e}){return g.jsx(s$e,{"data-slot":"switch",className:Ce("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:g.jsx(a$e,{"data-slot":"switch-thumb",className:Ce("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function K8(){return K8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},K8.apply(null,arguments)}function o$e(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var l$e=$.useLayoutEffect,c$e=function(t){var e=$.default.useRef(t);return l$e(function(){e.current=t}),e},Oae=function(t,e){if(typeof t=="function"){t(e);return}t.current=e},u$e=function(t,e){var r=$.default.useRef();return $.default.useCallback(function(n){t.current=n,r.current&&Oae(r.current,null),r.current=e,e&&Oae(e,n)},[e])},Dae={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},d$e=function(t){Object.keys(Dae).forEach(function(e){t.style.setProperty(e,Dae[e],"important")})},Nae=d$e,Ti=null,Fae=function(t,e){var r=t.scrollHeight;return e.sizingStyle.boxSizing==="border-box"?r+e.borderSize:r-e.paddingSize};function f$e(t,e,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),Ti||(Ti=document.createElement("textarea"),Ti.setAttribute("tabindex","-1"),Ti.setAttribute("aria-hidden","true"),Nae(Ti)),Ti.parentNode===null&&document.body.appendChild(Ti);var i=t.paddingSize,s=t.borderSize,a=t.sizingStyle,o=a.boxSizing;Object.keys(a).forEach(function(f){var p=f;Ti.style[p]=a[p]}),Nae(Ti),Ti.value=e;var l=Fae(Ti,t);Ti.value=e,l=Fae(Ti,t),Ti.value="x";var c=Ti.scrollHeight-i,u=c*r;o==="border-box"&&(u=u+i+s),l=Math.max(u,l);var d=c*n;return o==="border-box"&&(d=d+i+s),l=Math.min(d,l),[l,c]}var Bae=function(){},p$e=function(t,e){return t.reduce(function(r,n){return r[n]=e[n],r},{})},h$e=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],m$e=!!document.documentElement.currentStyle,g$e=function(t){var e=window.getComputedStyle(t);if(e===null)return null;var r=p$e(h$e,e),n=r.boxSizing;if(n==="")return null;m$e&&n==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:s}},y$e=g$e;function C9(t,e,r){var n=c$e(r);N.useLayoutEffect(function(){var i=function(s){return n.current(s)};if(t)return t.addEventListener(e,i),function(){return t.removeEventListener(e,i)}},[])}var v$e=function(t,e){C9(document.body,"reset",function(r){t.current.form===r.target&&e(r)})},b$e=function(t){C9(window,"resize",t)},x$e=function(t){C9(document.fonts,"loadingdone",t)},w$e=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],k$e=function(t,e){var r=t.cacheMeasurements,n=t.maxRows,i=t.minRows,s=t.onChange,a=s===void 0?Bae:s,o=t.onHeightChange,l=o===void 0?Bae:o,c=o$e(t,w$e),u=c.value!==void 0,d=N.useRef(null),f=u$e(d,e),p=N.useRef(0),h=N.useRef(),m=function(){var b=d.current,y=r&&h.current?h.current:y$e(b);if(y){h.current=y;var x=f$e(y,b.value||b.placeholder||"x",i,n),w=x[0],C=x[1];p.current!==w&&(p.current=w,b.style.setProperty("height",w+"px","important"),l(w,{rowHeight:C}))}},v=function(b){u||m(),a(b)};return N.useLayoutEffect(m),v$e(d,function(){if(!u){var b=d.current.value;requestAnimationFrame(function(){var y=d.current;y&&b!==y.value&&m()})}}),b$e(m),x$e(m),N.createElement("textarea",K8({},c,{onChange:v,ref:f}))},S$e=N.forwardRef(k$e),C$e=Xp("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content w-full rounded-md border bg-transparent text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",{variants:{size:{default:"min-h-16 px-3 py-2",sm:"min-h-8 px-3 py-2 text-xs",lg:"min-h-20 px-4 py-3"}},defaultVariants:{size:"default"}});function T$e({className:t,size:e,...r}){return g.jsx(S$e,{"data-slot":"textarea",className:Ce(C$e({size:e,className:t})),...r})}var E$e={clip:{label:"Media Clip",description:"Clip the media to a specific time range",icon:zm},timestamp:{label:"Timestamp",description:"Set the timestamp for the media",icon:Tu},muted:{label:"Muted",description:"Mute the media",icon:Gm},volume:{label:"Volume",description:"Volume level",icon:Hm},autoPlay:{label:"Auto Play",description:"Start playing automatically",icon:Eu},loop:{label:"Loop",description:"Restart playback when it ends",icon:z0},showControls:{label:"Controls",description:"Display player controls",icon:Nm},title:{label:"Title",description:"Custom title for the media",icon:Y0,placeholder:"Enter title"},audioGain:{label:"Audio Gain",description:"Audio amplification multiplier",icon:w0,min:0,max:5,step:.1},playbackRate:{label:"Playback Rate",description:"Playback speed multiplier",icon:L0,min:.25,max:8,step:.1},preservePitch:{label:"Preserve Pitch",description:"Maintain audio pitch when changing speed",icon:Vm},aspectRatio:{label:"Aspect Ratio",description:"Video aspect ratio (e.g., 16:9)",icon:O0},flip:{label:"Flip",description:"Mirror video horizontally or vertically",icon:Au,options:[{value:"none",label:"None"},{value:"horizontal",label:"Horizontal"},{value:"vertical",label:"Vertical"}]},crossOrigin:{label:"Cross Origin",description:"CORS policy for media loading",icon:M0,options:[{value:"disabled",label:"Disabled"},{value:"anonymous",label:"Anonymous"},{value:"use-credentials",label:"Use Credentials"}]},type:{label:"Media Type",description:"Force media type interpretation",icon:ex,options:[{value:"video",label:"Video"},{value:"audio",label:"Audio"},{value:"media",label:"Auto detect"}]},play:{label:"Load Strategy",description:"When to start loading the media",icon:rx,options:[{value:"eager",label:"Eager"},{value:"play",label:"On Play"}]}};function KA({form:t,defaultValues:e={clip:{}},fallbackValues:r,onSubmit:n,onError:i,settingItems:s,fields:a={},description:o,submitLabel:l="Apply"}){let c=hBe(E$e,a,{arrays:"replace"}),u=y=>{t.setValue(y,null),t.clearErrors(y)},d=y=>e[y]!==void 0&&e[y]!==null,f=s.toSorted((y,x)=>d(y)?-1:d(x)?1:0),p=y=>{if(y==="aspectRatio")return g.jsx(RVe,{form:t,icon:c[y].icon,label:c[y].label,description:c[y].description,onReset:()=>u(y)},y);let x=w=>g.jsx($oe,{icon:c[y].icon,label:c[y].label,description:c[y].description,variant:w.value===void 0||w.value===null?"default":"override",onReset:()=>u(y)});switch(y){case"muted":case"autoPlay":case"loop":case"showControls":case"preservePitch":return g.jsx(Xt,{control:t.control,name:y,render:({field:w})=>g.jsxs(Hg,{children:[x(w),g.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:g.jsx(qr,{children:g.jsx(Ale,{checked:w.value??r[y],onCheckedChange:C=>w.onChange(C)})})})]})},y);case"title":return g.jsx(Xt,{control:t.control,name:y,render:({field:w})=>g.jsxs(Hg,{children:[x(w),g.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:g.jsx(qr,{children:g.jsx(T$e,{...w,value:w.value??r[y],placeholder:c[y].placeholder,className:"w-60 resize-none",size:"sm",minRows:1,maxRows:5})})})]})},y);case"audioGain":case"playbackRate":return g.jsx(Xt,{control:t.control,name:y,render:({field:w})=>g.jsxs(Hg,{children:[x(w),g.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:g.jsx(qr,{children:g.jsx(j8,{...w,value:w.value??"",placeholder:r[y].toString(),min:c[y].min,max:c[y].max,step:c[y].step,className:"w-20 h-8"})})})]})},y);case"volume":return g.jsx(Xt,{control:t.control,name:y,render:({field:w})=>g.jsxs(Hg,{children:[x(w),g.jsxs("div",{className:"flex items-center gap-2 flex-1 flex-wrap max-w-40",children:[g.jsx(qr,{children:g.jsx(e$e,{min:0,max:100,value:[w.value??r[y]],onValueChange:C=>w.onChange(C[0]??0)})}),g.jsxs("span",{className:"text-xs text-muted-foreground",children:[w.value??r[y],"%"]})]})]})},y);case"flip":case"crossOrigin":case"type":case"play":return g.jsx(Xt,{control:t.control,name:y,render:({field:w})=>g.jsxs(Hg,{children:[x(w),g.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:g.jsx(qr,{children:g.jsx("select",{...w,value:w.value??r[y],className:Ce("border-input data-placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50","w-40 rounded-md border bg-transparent px-3 py-0 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow]","outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 h-8","appearance-none pr-8","mx-html-dropdown"),children:c[y].options.map(C=>g.jsx("option",{value:C.value,children:C.label},C.value))})})})]})},y);default:return null}},h=f.indexOf("clip"),m=f.indexOf("timestamp"),v=()=>{u("clip"),u("timestamp")},b=f.map(p).filter(y=>y!==null);return g.jsx($A,{...t,children:g.jsx("form",{onSubmit:t.handleSubmit(y=>{let x=yBe(y,s),w=gBe(x,C=>C!=null);n?.(w)},i),noValidate:!0,className:"flex flex-col h-full",children:g.jsxs("div",{className:"@container flex flex-col min-h-0 flex-1",children:[g.jsx("div",{className:"flex min-h-0 flex-1",children:g.jsxs("div",{className:"bg-card border border-border rounded-md overflow-hidden flex flex-col flex-1",children:[g.jsxs("div",{className:"flex-shrink-0",children:[o&&g.jsxs("div",{className:"px-4 py-2.5 bg-primary/10 border-b border-primary/20 flex items-start gap-2",children:[g.jsx(Fm,{className:"size-4 text-primary flex-shrink-0"}),g.jsx("p",{className:"text-xs text-primary",children:o})]}),g.jsx("div",{className:"pl-4 pr-2 py-2 bg-muted/50 border-b border-border",children:g.jsx(I$e,{form:t,fields:c,onResetAll:()=>{t.reset(e)},onReset:y=>{u(y)}})})]}),g.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[h>=0&&m>=0?g.jsx(vje,{className:"border-b border-border",form:t,onReset:v,defaultMode:e.clip?"clip":e.timestamp?"timestamp":h<m?"clip":"timestamp"}):h>=0?g.jsx(nle,{className:"border-b border-border",form:t,onReset:v}):m>=0?g.jsx(ile,{className:"border-b border-border",form:t,onReset:v}):null,g.jsx("div",{className:Ce("grid @4xl:grid-cols-2 border-border","@4xl:[&>*:nth-child(even)]:border-l","[&>*]:border-b","[&>*:last-child]:border-b-0",b.length%2===0&&"@4xl:[&>*:nth-last-child(-n+2)]:border-b-0"),children:b})]})]})}),g.jsx("div",{className:"mt-4 flex justify-end flex-shrink-0",children:g.jsx(Cr,{type:"submit",children:l})})]})})})}function I$e({form:t,onResetAll:e,onReset:r,fields:n}){let i=c9({control:t.control}),s=Object.keys(i).filter(a=>{let o=a;if(i[o]==null)return!1;if(o==="clip"){let c=i.clip;return v9(c)}return o in n});return g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("div",{className:"flex flex-wrap gap-1.5 min-h-[24px] items-center flex-1",children:s.length>0?s.map(a=>{let o=n[a].icon;return g.jsxs(sle,{className:"gap-1.5 pr-1",children:[g.jsx(o,{className:"size-3"}),g.jsxs("div",{className:"flex items-center gap-0.5",children:[g.jsx("span",{className:"text-xs",children:n[a].label}),g.jsx("button",{type:"button",onClick:()=>r(a),className:"size-4 rounded-sm hover:bg-primary-foreground/20 flex items-center justify-center transition-colors","aria-label":`Reset ${n[a].label}`,children:g.jsx(el,{className:"size-3"})})]})]},a)}):g.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No custom settings applied"})}),g.jsxs(Cr,{type:"button",variant:"ghost",onClick:e,className:"h-auto text-xs px-2 py-1 text-destructive hover:text-destructive hover:bg-destructive/10 flex-shrink-0",children:[g.jsx(Iu,{className:"size-3"}),"Reset to current"]})]})}var _1={},Vae=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,jae=t=>"init"in t,C8=t=>!!t.write,$ae=t=>"v"in t||"e"in t,xA=t=>{if("e"in t)throw t.e;if((_1?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},_A=new WeakMap,Uae=t=>{var e;return OA(t)&&!!((e=_A.get(t))!=null&&e[0])},A$e=t=>{let e=_A.get(t);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(r=>r()))},Ple=(t,e)=>{let r=_A.get(t);if(!r){r=[!0,new Set],_A.set(t,r);let n=()=>{r[0]=!1};t.then(n,n)}r[1].add(e)},OA=t=>typeof t?.then=="function",Rle=(t,e,r)=>{r.p.has(t)||(r.p.add(t),e.then(()=>{r.p.delete(t)},()=>{r.p.delete(t)}))},T8=(t,e,r)=>{let n=r(t),i="v"in n,s=n.v;if(OA(e))for(let a of n.d.keys())Rle(t,e,r(a));n.v=e,delete n.e,(!i||!Object.is(s,n.v))&&(++n.n,OA(s)&&A$e(s))},zae=(t,e,r)=>{var n;let i=new Set;for(let s of((n=r.get(t))==null?void 0:n.t)||[])r.has(s)&&i.add(s);for(let s of e.p)i.add(s);return i},P$e=()=>{let t=new Set,e=()=>{t.forEach(r=>r())};return e.add=r=>(t.add(r),()=>{t.delete(r)}),e},E8=()=>{let t={},e=new WeakMap,r=n=>{var i,s;(i=e.get(t))==null||i.forEach(a=>a(n)),(s=e.get(n))==null||s.forEach(a=>a())};return r.add=(n,i)=>{let s=n||t,a=(e.has(s)?e:e.set(s,new Set)).get(s);return a.add(i),()=>{a?.delete(i),a.size||e.delete(s)}},r},R$e=t=>(t.c||(t.c=E8()),t.m||(t.m=E8()),t.u||(t.u=E8()),t.f||(t.f=P$e()),t),L$e=Symbol(),M$e=(t=new WeakMap,e=new WeakMap,r=new WeakMap,n=new Set,i=new Set,s=new Set,a={},o=(f,...p)=>f.read(...p),l=(f,...p)=>f.write(...p),c=(f,p)=>{var h;return(h=f.unstable_onInit)==null?void 0:h.call(f,p)},u=(f,p)=>{var h;return(h=f.onMount)==null?void 0:h.call(f,p)},...d)=>{let f=d[0]||(S=>{if((_1?"production":void 0)!=="production"&&!S)throw new Error("Atom is undefined or null");let T=t.get(S);return T||(T={d:new Map,p:new Set,n:0},t.set(S,T),c?.(S,O)),T}),p=d[1]||(()=>{let S=[],T=E=>{try{E()}catch(P){S.push(P)}};do{a.f&&T(a.f);let E=new Set,P=E.add.bind(E);n.forEach(R=>{var I;return(I=e.get(R))==null?void 0:I.l.forEach(P)}),n.clear(),s.forEach(P),s.clear(),i.forEach(P),i.clear(),E.forEach(T),n.size&&h()}while(n.size||s.size||i.size);if(S.length)throw new AggregateError(S)}),h=d[2]||(()=>{let S=[],T=new WeakSet,E=new WeakSet,P=Array.from(n);for(;P.length;){let R=P[P.length-1],I=f(R);if(E.has(R)){P.pop();continue}if(T.has(R)){if(r.get(R)===I.n)S.push([R,I]);else if((_1?"production":void 0)!=="production"&&r.has(R))throw new Error("[Bug] invalidated atom exists");E.add(R),P.pop();continue}T.add(R);for(let B of zae(R,I,e))T.has(B)||P.push(B)}for(let R=S.length-1;R>=0;--R){let[I,B]=S[R],M=!1;for(let z of B.d.keys())if(z!==I&&n.has(z)){M=!0;break}M&&(m(I),y(I)),r.delete(I)}}),m=d[3]||(S=>{var T;let E=f(S);if($ae(E)&&(e.has(S)&&r.get(S)!==E.n||Array.from(E.d).every(([V,K])=>m(V).n===K)))return E;E.d.clear();let P=!0,R=()=>{e.has(S)&&(y(S),h(),p())},I=V=>{var K;if(Vae(S,V)){let Me=f(V);if(!$ae(Me))if(jae(V))T8(V,V.init,f);else throw new Error("no atom init");return xA(Me)}let de=m(V);try{return xA(de)}finally{E.d.set(V,de.n),Uae(E.v)&&Rle(S,E.v,de),(K=e.get(V))==null||K.t.add(S),P||R()}},B,M,z={get signal(){return B||(B=new AbortController),B.signal},get setSelf(){return(_1?"production":void 0)!=="production"&&!C8(S)&&console.warn("setSelf function cannot be used with read-only atom"),!M&&C8(S)&&(M=(...V)=>{if((_1?"production":void 0)!=="production"&&P&&console.warn("setSelf function cannot be called in sync"),!P)try{return b(S,...V)}finally{h(),p()}}),M}},G=E.n;try{let V=o(S,I,z);return T8(S,V,f),OA(V)&&(Ple(V,()=>B?.abort()),V.then(R,R)),E}catch(V){return delete E.v,E.e=V,++E.n,E}finally{P=!1,G!==E.n&&r.get(S)===G&&(r.set(S,E.n),n.add(S),(T=a.c)==null||T.call(a,S))}}),v=d[4]||(S=>{let T=[S];for(;T.length;){let E=T.pop(),P=f(E);for(let R of zae(E,P,e)){let I=f(R);r.set(R,I.n),T.push(R)}}}),b=d[5]||((S,...T)=>{let E=!0,P=I=>xA(m(I)),R=(I,...B)=>{var M;let z=f(I);try{if(Vae(S,I)){if(!jae(I))throw new Error("atom not writable");let G=z.n,V=B[0];T8(I,V,f),y(I),G!==z.n&&(n.add(I),(M=a.c)==null||M.call(a,I),v(I));return}else return b(I,...B)}finally{E||(h(),p())}};try{return l(S,P,R,...T)}finally{E=!1}}),y=d[6]||(S=>{var T;let E=f(S),P=e.get(S);if(P&&!Uae(E.v)){for(let[R,I]of E.d)if(!P.d.has(R)){let B=f(R);x(R).t.add(S),P.d.add(R),I!==B.n&&(n.add(R),(T=a.c)==null||T.call(a,R),v(R))}for(let R of P.d||[])if(!E.d.has(R)){P.d.delete(R);let I=w(R);I?.t.delete(S)}}}),x=d[7]||(S=>{var T;let E=f(S),P=e.get(S);if(!P){m(S);for(let R of E.d.keys())x(R).t.add(S);if(P={l:new Set,d:new Set(E.d.keys()),t:new Set},e.set(S,P),(T=a.m)==null||T.call(a,S),C8(S)){let R=()=>{let I=!0,B=(...M)=>{try{return b(S,...M)}finally{I||(h(),p())}};try{let M=u(S,B);M&&(P.u=()=>{I=!0;try{M()}finally{I=!1}})}finally{I=!1}};i.add(R)}}return P}),w=d[8]||(S=>{var T;let E=f(S),P=e.get(S);if(P&&!P.l.size&&!Array.from(P.t).some(R=>{var I;return(I=e.get(R))==null?void 0:I.d.has(S)})){P.u&&s.add(P.u),P=void 0,e.delete(S),(T=a.u)==null||T.call(a,S);for(let R of E.d.keys()){let I=w(R);I?.t.delete(S)}return}return P}),C=[t,e,r,n,i,s,a,o,l,c,u,f,p,h,m,v,b,y,x,w],O={get:S=>xA(m(S)),set:(S,...T)=>{try{return b(S,...T)}finally{h(),p()}},sub:(S,T)=>{let E=x(S).l;return E.add(T),p(),()=>{E.delete(T),w(S),p()}}};return Object.defineProperty(O,L$e,{value:C}),O},Lle=M$e,_$e=R$e,qae=Ple,T9={},O$e=0;function sd(t,e){let r=`atom${++O$e}`,n={toString(){return(T9?"production":void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof t=="function"?n.read=t:(n.init=t,n.read=D$e,n.write=N$e),e&&(n.write=e),n}function D$e(t){return t(this)}function N$e(t,e,r){return e(this,typeof r=="function"?r(t(this)):r)}var F$e=()=>{let t=0,e=_$e({}),r=new WeakMap,n=new WeakMap,i=Lle(r,n,void 0,void 0,void 0,void 0,e,void 0,(a,o,l,...c)=>t?l(a,...c):a.write(o,l,...c)),s=new Set;return e.m.add(void 0,a=>{s.add(a);let o=r.get(a);o.m=n.get(a)}),e.u.add(void 0,a=>{s.delete(a);let o=r.get(a);delete o.m}),Object.assign(i,{dev4_get_internal_weak_map:()=>r,dev4_get_mounted_atoms:()=>s,dev4_restore_atoms:a=>{let o={read:()=>null,write:(l,c)=>{++t;try{for(let[u,d]of a)"init"in u&&c(u,d)}finally{--t}}};i.set(o)}})};function Mle(){return(T9?"production":void 0)!=="production"?F$e():Lle()}var A1;function B$e(){return A1||(A1=Mle(),(T9?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=A1),globalThis.__JOTAI_DEFAULT_STORE__!==A1&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),A1}var V$e={},_le=(0,$.createContext)(void 0);function YA(t){return(0,$.useContext)(_le)||B$e()}function j$e({children:t,store:e}){let r=(0,$.useRef)(void 0);return!e&&!r.current&&(r.current=Mle()),(0,$.createElement)(_le.Provider,{value:e||r.current},t)}var Ole=t=>typeof t?.then=="function",$$e=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},U$e=$.default.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:($$e(t),t)}),I8=new WeakMap,z$e=(t,e)=>{let r=I8.get(t);return r||(r=new Promise((n,i)=>{let s=t,a=c=>u=>{s===c&&n(u)},o=c=>u=>{s===c&&i(u)},l=()=>{try{let c=e();Ole(c)?(I8.set(c,r),s=c,c.then(a(c),o(c)),qae(c,l)):n(c)}catch(c){i(c)}};t.then(a(t),o(t)),qae(t,l)}),I8.set(t,r)),r};function E9(t,e){let r=YA(),[[n,i,s],a]=(0,$.useReducer)(l=>{let c=r.get(t);return Object.is(l[0],c)&&l[1]===r&&l[2]===t?l:[c,r,t]},void 0,()=>[r.get(t),r,t]),o=n;if((i!==r||s!==t)&&(a(),o=r.get(t)),(0,$.useEffect)(()=>{let l=r.sub(t,()=>{a()});return a(),l},[r,t,void 0]),(0,$.useDebugValue)(o),Ole(o)){let l=z$e(o,()=>r.get(t));return U$e(l)}return o}function Y8(t,e){let r=YA();return(0,$.useCallback)((...n)=>{if((V$e?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return r.set(t,...n)},[r,t])}function q$e(t,e){return[E9(t),Y8(t)]}function H$e(t){let e=sd(0),r=sd(()=>({i:0}),(l,c)=>{let u=l(r);return Object.assign(u,{m:!0,peek:l,set:c}),c(e,d=>d+1),()=>{u.m=!1,a(u),o(u)}});r.onMount=l=>l();let n=sd(l=>{l(e);let c=l(r);if(!c.m||c.irc||c.i&&!c.irf)return c.p;o(c);let u=new Map,d=m=>{let v=l(m);return u.set(m,v),v};d.peek=c.peek;let f=(...m)=>{try{return++c.i,c.set(...m)}finally{Array.from(u.keys(),l),--c.i}};f.recurse=(m,...v)=>{if(!c.fc)try{return c.irc=!0,c.set(m,...v)}finally{c.irc=!1,Array.from(u).some(p)&&s(c)}};function p([m,v]){return l(m)!==v}++c.i;function h(){try{if(c.irf=!1,!c.m)return;a(c),c.c=i.effect(d,f)}catch(m){c.e=m,s(c)}finally{c.p=void 0,--c.i}}return c.irf?h():c.p=Promise.resolve().then(h)}),i=sd(l=>void l(n));return i.effect=t,i;function s(l){try{l.irf=!0,l.set(e,c=>c+1)}finally{l.irf=!1}}function a(l){if(typeof l.c=="function")try{l.fc=!0,l.c()}finally{l.fc=!1,l.c=void 0}}function o(l){if("e"in l){let c=l.e;throw delete l.e,c}}}function X8(t){let e=t.getBoundingClientRect();return e.width===0?1:t.width/e.width}function A8(t,e){let r=e.getBoundingClientRect(),n=e.width/r.width,i=e.height/r.height,s,a;if(t instanceof TouchEvent){let o=t.touches[0]||t.changedTouches[0];if(!o)throw new Error("Touch event without touch data");s=o.clientX,a=o.clientY}else s=t.clientX,a=t.clientY;return{x:(s-r.left)*n,y:(a-r.top)*i}}function G$e(t,e,{format:r="image/png",quality:n}={}){let i=Math.abs(e.width),s=Math.abs(e.height),a=document.createElement("canvas");a.width=i,a.height=s;let o=a.getContext("2d");return{blob:new Promise(l=>{if(!o){l(null);return}o.drawImage(t,e.x,e.y,e.width,e.height,0,0,e.width,e.height),a.toBlob(c=>{l(c)},r,n)}),rect:e}}function W$e({canvas:t,image:e,selection:r,scale:n}){let i=t.getContext("2d");if(i&&(i.clearRect(0,0,t.width,t.height),i.drawImage(e,0,0),r)){i.fillStyle="rgba(0, 0, 0, 0.5)",i.fillRect(0,0,t.width,t.height),i.clearRect(r.x,r.y,r.width,r.height),i.drawImage(e,r.x,r.y,r.width,r.height,r.x,r.y,r.width,r.height);let s=l=>l*n;i.strokeStyle="#ffffff",i.lineWidth=s(3),i.strokeRect(r.x,r.y,r.width,r.height),i.strokeStyle="#3b82f6",i.lineWidth=s(1),i.strokeRect(r.x,r.y,r.width,r.height);let a=s(10),o=[{x:r.x-a/2,y:r.y-a/2},{x:r.x+r.width-a/2,y:r.y-a/2},{x:r.x-a/2,y:r.y+r.height-a/2},{x:r.x+r.width-a/2,y:r.y+r.height-a/2},{x:r.x+r.width/2-a/2,y:r.y-a/2},{x:r.x+r.width/2-a/2,y:r.y+r.height-a/2},{x:r.x-a/2,y:r.y+r.height/2-a/2},{x:r.x+r.width-a/2,y:r.y+r.height/2-a/2}];i.fillStyle="#ffffff";for(let l of o)i.fillRect(l.x,l.y,a,a);i.strokeStyle="#3b82f6",i.lineWidth=2;for(let l of o)i.strokeRect(l.x,l.y,a,a)}}function K$e(t){switch(t){case"topLeft":case"bottomRight":return"nwse-resize";case"topRight":case"bottomLeft":return"nesw-resize";case"topCenter":case"bottomCenter":case"topEdge":case"bottomEdge":return"ns-resize";case"leftCenter":case"rightCenter":case"leftEdge":case"rightEdge":return"ew-resize";default:return"crosshair"}}function Hae(t,e,r,n){if(!r)return null;let i=l=>l*n,s=i(10)/2,a=i(8),o=[{type:"topLeft",x:r.x,y:r.y},{type:"topRight",x:r.x+r.width,y:r.y},{type:"bottomLeft",x:r.x,y:r.y+r.height},{type:"bottomRight",x:r.x+r.width,y:r.y+r.height},{type:"topCenter",x:r.x+r.width/2,y:r.y},{type:"bottomCenter",x:r.x+r.width/2,y:r.y+r.height},{type:"leftCenter",x:r.x,y:r.y+r.height/2},{type:"rightCenter",x:r.x+r.width,y:r.y+r.height/2}];for(let l of o)if(Math.abs(t-l.x)<=s&&Math.abs(e-l.y)<=s)return l.type;return t>=r.x&&t<=r.x+r.width&&Math.abs(e-r.y)<=a?"topEdge":t>=r.x&&t<=r.x+r.width&&Math.abs(e-(r.y+r.height))<=a?"bottomEdge":e>=r.y&&e<=r.y+r.height&&Math.abs(t-r.x)<=a?"leftEdge":e>=r.y&&e<=r.y+r.height&&Math.abs(t-(r.x+r.width))<=a?"rightEdge":null}function Gae(t,e,r){return r?t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height:!1}var Dle=(0,$.createContext)(null);function Y$e(){let t=(0,$.use)(Dle);if(!t)throw new Error("ImageClipper components must be used within ImageClipper.Root");return t}var Kp=sd(null),I9=sd(null),Kg=sd(null),X$e=H$e(t=>{let e=t(Kg),r=t(I9),n=t(Kp);if(e&&r){e.width=r.naturalWidth,e.height=r.naturalHeight;let i=X8(e);W$e({selection:n,canvas:e,image:r,scale:i})}}),TA=sd("crosshair");function Q$e(){let t=YA(),e=(0,$.useRef)({mode:"none",handle:null,startX:0,startY:0});return(0,$.useMemo)(()=>{let r=(i,s)=>{let a=t.get(Kp),o=t.get(Kg);if(!o)return;let l=X8(o),c=Hae(i,s,a,l);c?t.set(TA,K$e(c)):Gae(i,s,a)?t.set(TA,"move"):t.set(TA,"crosshair")},n=i=>{t.set(Kp,i)};return{handleInteractionStart:i=>{i.preventDefault();let s=t.get(Kg),a=t.get(Kp);if(!s)return;let o=A8(i.nativeEvent,s),l=X8(s),c=Hae(o.x,o.y,a,l);e.current.startX=o.x,e.current.startY=o.y,c?(e.current.mode="resizing",e.current.handle=c):Gae(o.x,o.y,a)?e.current.mode="moving":(e.current.mode="drawing",n({x:o.x,y:o.y,width:0,height:0}))},handleInteractionMove:i=>{i.preventDefault();let s=t.get(Kg),a=t.get(Kp);if(!s||e.current.mode==="none")return;let o=A8(i.nativeEvent,s),{mode:l,handle:c,startX:u,startY:d}=e.current;if(l==="drawing")n(f=>{let p=e.current.startX,h=e.current.startY,m=Math.min(p,o.x),v=Math.min(h,o.y),b=Math.max(p,o.x),y=Math.max(h,o.y);return{x:m,y:v,width:b-m,height:y-v}});else if(l==="moving"&&a){let f=o.x-u,p=o.y-d;n(h=>h?{...h,x:Math.max(0,Math.min(s.width-h.width,h.x+f)),y:Math.max(0,Math.min(s.height-h.height,h.y+p))}:null),e.current.startX=o.x,e.current.startY=o.y}else l==="resizing"&&c&&a&&n(f=>{if(!f)return null;let p={...f};switch(c){case"topLeft":p.width+=p.x-o.x,p.height+=p.y-o.y,p.x=o.x,p.y=o.y;break;case"topRight":p.width=o.x-p.x,p.height+=p.y-o.y,p.y=o.y;break;case"bottomLeft":p.width+=p.x-o.x,p.height=o.y-p.y,p.x=o.x;break;case"bottomRight":p.width=o.x-p.x,p.height=o.y-p.y;break;case"topCenter":case"topEdge":p.height+=p.y-o.y,p.y=o.y;break;case"bottomCenter":case"bottomEdge":p.height=o.y-p.y;break;case"leftCenter":case"leftEdge":p.width+=p.x-o.x,p.x=o.x;break;case"rightCenter":case"rightEdge":p.width=o.x-p.x;break}return p.width<0&&(p.x+=p.width,p.width=-p.width),p.height<0&&(p.y+=p.height,p.height=-p.height),p})},handleInteractionEnd:i=>{i.preventDefault(),e.current.mode="none",e.current.handle=null,n(s=>!s||s.width===0||s.height===0?null:s)},handleMouseHover:i=>{if(e.current.mode==="none"){let s=t.get(Kg);if(!s)return;let a=A8(i.nativeEvent,s);r(a.x,a.y)}}}},[t])}var Z$e=({className:t,onMouseDown:e,onMouseMove:r,onMouseUp:n,onTouchStart:i,onTouchMove:s,onTouchEnd:a,style:o,...l})=>{q$e(X$e);let c=Y8(I9),u=Y8(Kg),{imageBlob:d}=Y$e(),{handleInteractionStart:f,handleInteractionMove:p,handleInteractionEnd:h,handleMouseHover:m}=Q$e(),v=E9(TA);return(0,$.useEffect)(()=>{if(!d)return;let b=new Image,y=URL.createObjectURL(d);return b.onload=()=>{c(b)},b.src=y,()=>{URL.revokeObjectURL(y)}},[d,c]),g.jsx("canvas",{ref:u,className:t,style:{cursor:v,touchAction:"none",...o},onMouseDown:b=>{e?.(b),f(b)},onMouseMove:b=>{r?.(b),p(b),m(b)},onMouseUp:b=>{n?.(b),h(b)},onTouchStart:b=>{i?.(b),f(b)},onTouchMove:b=>{s?.(b),p(b)},onTouchEnd:b=>{a?.(b),h(b)},...l})},Wae=({onClip:t,type:e="button",onClick:r,className:n,format:i,quality:s,...a})=>{let o=YA(),l=E9(Kp),c=(0,$.useCallback)(async u=>{r?.(u);let d=o.get(Kp),f=o.get(I9);!d||!f||t==null||t(u,G$e(f,d,{format:i,quality:s}))},[o,r,t,i,s]);return g.jsx(Cr,{type:e,onClick:c,disabled:!l,className:n,...a})},J$e=({children:t,format:e,imageBlob:r})=>g.jsx(j$e,{children:g.jsx(Dle.Provider,{value:{imageBlob:r,format:e},children:t})});function Nle({imageBlob:t,onCopy:e,onSave:r,outputSpec:n,copyLoading:i=!1,saveLoading:s=!1}){return g.jsx("div",{className:"flex flex-col h-full max-h-[80vh] w-full",children:g.jsxs(J$e,{imageBlob:t,children:[g.jsx("div",{className:"flex-1 flex items-center justify-center pb-4 overflow-hidden bg-muted/20",children:g.jsx("div",{className:"relative max-w-full max-h-full",children:g.jsx(Z$e,{className:"max-w-full max-h-full object-contain border border-border/20 rounded-md shadow-sm"})})}),g.jsxs("div",{"data-slot":"bottom-toolbar",className:"flex items-center justify-end gap-2 pt-3 border-t bg-background/50 backdrop-blur-sm",children:[e&&g.jsxs(Wae,{size:"sm",variant:"outline",onClip:(a,o)=>e?.(a,o),disabled:i,...n,children:[i?g.jsx(to,{className:"size-4 animate-spin"}):g.jsx(Dm,{className:"size-4"}),"Copy"]}),r&&g.jsxs(Wae,{variant:"default",size:"sm",onClip:r,disabled:s,...n,children:[s?g.jsx(to,{className:"size-4 animate-spin"}):g.jsx(Um,{className:"size-4"}),"Save"]})]})]})})}var Kae=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Zi=t=>!t||typeof t!="object"||Object.keys(t).length===0,eUe=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function Fle(t,e){t.forEach(function(r){Array.isArray(r)?Fle(r,e):e.push(r)})}function Ble(t){let e=[];return Fle(t,e),e}var Vle=(...t)=>Ble(t).filter(Boolean),jle=(t,e)=>{let r={},n=Object.keys(t),i=Object.keys(e);for(let s of n)if(i.includes(s)){let a=t[s],o=e[s];Array.isArray(a)||Array.isArray(o)?r[s]=Vle(o,a):typeof a=="object"&&typeof o=="object"?r[s]=jle(a,o):r[s]=o+" "+a}else r[s]=t[s];for(let s of i)n.includes(s)||(r[s]=e[s]);return r},Yae=t=>!t||typeof t!="string"?t:t.replace(/\s+/g," ").trim(),A9="-",tUe=t=>{let e=nUe(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:i=>{let s=i.split(A9);return s[0]===""&&s.length!==1&&s.shift(),$le(s,e)||rUe(i)},getConflictingClassGroupIds:(i,s)=>{let a=r[i]||[];return s&&n[i]?[...a,...n[i]]:a}}},$le=(t,e)=>{var r;if(t.length===0)return e.classGroupId;let n=t[0],i=e.nextPart.get(n),s=i?$le(t.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;let a=t.join(A9);return(r=e.validators.find(({validator:o})=>o(a)))==null?void 0:r.classGroupId},Xae=/^\[(.+)\]$/,rUe=t=>{if(Xae.test(t)){let e=Xae.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},nUe=t=>{let{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return sUe(Object.entries(t.classGroups),r).forEach(([i,s])=>{Q8(s,n,i,e)}),n},Q8=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){let s=i===""?e:Qae(e,i);s.classGroupId=r;return}if(typeof i=="function"){if(iUe(i)){Q8(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,a])=>{Q8(a,Qae(e,s),r,n)})})},Qae=(t,e)=>{let r=t;return e.split(A9).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},iUe=t=>t.isThemeGetter,sUe=(t,e)=>e?t.map(([r,n])=>{let i=n.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[e+a,o])):s);return[r,i]}):t,aUe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map,i=(s,a)=>{r.set(s,a),e++,e>t&&(e=0,n=r,r=new Map)};return{get(s){let a=r.get(s);if(a!==void 0)return a;if((a=n.get(s))!==void 0)return i(s,a),a},set(s,a){r.has(s)?r.set(s,a):i(s,a)}}},Ule="!",oUe=t=>{let{separator:e,experimentalParseClassName:r}=t,n=e.length===1,i=e[0],s=e.length,a=o=>{let l=[],c=0,u=0,d;for(let v=0;v<o.length;v++){let b=o[v];if(c===0){if(b===i&&(n||o.slice(v,v+s)===e)){l.push(o.slice(u,v)),u=v+s;continue}if(b==="/"){d=v;continue}}b==="["?c++:b==="]"&&c--}let f=l.length===0?o:o.substring(u),p=f.startsWith(Ule),h=p?f.substring(1):f,m=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}};return r?o=>r({className:o,parseClassName:a}):a},lUe=t=>{if(t.length<=1)return t;let e=[],r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},cUe=t=>({cache:aUe(t.cacheSize),parseClassName:oUe(t),...tUe(t)}),uUe=/\s+/,dUe=(t,e)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=e,s=[],a=t.trim().split(uUe),o="";for(let l=a.length-1;l>=0;l-=1){let c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(c),h=!!p,m=n(h?f.substring(0,p):f);if(!m){if(!h){o=c+(o.length>0?" "+o:o);continue}if(m=n(f),!m){o=c+(o.length>0?" "+o:o);continue}h=!1}let v=lUe(u).join(":"),b=d?v+Ule:v,y=b+m;if(s.includes(y))continue;s.push(y);let x=i(m,h);for(let w=0;w<x.length;++w){let C=x[w];s.push(b+C)}o=c+(o.length>0?" "+o:o)}return o};function fUe(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=zle(e))&&(n&&(n+=" "),n+=r);return n}var zle=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=zle(t[n]))&&(r&&(r+=" "),r+=e);return r};function Z8(t,...e){let r,n,i,s=a;function a(l){let c=e.reduce((u,d)=>d(u),t());return r=cUe(c),n=r.cache.get,i=r.cache.set,s=o,o(l)}function o(l){let c=n(l);if(c)return c;let u=dUe(l,r);return i(l,u),u}return function(){return s(fUe.apply(null,arguments))}}var tr=t=>{let e=r=>r[t]||[];return e.isThemeGetter=!0,e},qle=/^\[(?:([a-z-]+):)?(.+)\]$/i,pUe=/^\d+\/\d+$/,hUe=new Set(["px","full","screen"]),mUe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gUe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yUe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vUe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bUe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tc=t=>Xg(t)||hUe.has(t)||pUe.test(t),td=t=>ny(t,"length",IUe),Xg=t=>!!t&&!Number.isNaN(Number(t)),P8=t=>ny(t,"number",Xg),P1=t=>!!t&&Number.isInteger(Number(t)),xUe=t=>t.endsWith("%")&&Xg(t.slice(0,-1)),Ye=t=>qle.test(t),rd=t=>mUe.test(t),wUe=new Set(["length","size","percentage"]),kUe=t=>ny(t,wUe,Hle),SUe=t=>ny(t,"position",Hle),CUe=new Set(["image","url"]),TUe=t=>ny(t,CUe,PUe),EUe=t=>ny(t,"",AUe),R1=()=>!0,ny=(t,e,r)=>{let n=qle.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},IUe=t=>gUe.test(t)&&!yUe.test(t),Hle=()=>!1,AUe=t=>vUe.test(t),PUe=t=>bUe.test(t),J8=()=>{let t=tr("colors"),e=tr("spacing"),r=tr("blur"),n=tr("brightness"),i=tr("borderColor"),s=tr("borderRadius"),a=tr("borderSpacing"),o=tr("borderWidth"),l=tr("contrast"),c=tr("grayscale"),u=tr("hueRotate"),d=tr("invert"),f=tr("gap"),p=tr("gradientColorStops"),h=tr("gradientColorStopPositions"),m=tr("inset"),v=tr("margin"),b=tr("opacity"),y=tr("padding"),x=tr("saturate"),w=tr("scale"),C=tr("sepia"),O=tr("skew"),S=tr("space"),T=tr("translate"),E=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",Ye,e],I=()=>[Ye,e],B=()=>["",Tc,td],M=()=>["auto",Xg,Ye],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],de=()=>["","0",Ye],Me=()=>["auto","avoid","all","avoid-page","page","left","right","column"],pt=()=>[Xg,Ye];return{cacheSize:500,separator:":",theme:{colors:[R1],spacing:[Tc,td],blur:["none","",rd,Ye],brightness:pt(),borderColor:[t],borderRadius:["none","","full",rd,Ye],borderSpacing:I(),borderWidth:B(),contrast:pt(),grayscale:de(),hueRotate:pt(),invert:de(),gap:I(),gradientColorStops:[t],gradientColorStopPositions:[xUe,td],inset:R(),margin:R(),opacity:pt(),padding:I(),saturate:pt(),scale:pt(),sepia:de(),skew:pt(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[rd]}],"break-after":[{"break-after":Me()}],"break-before":[{"break-before":Me()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),Ye]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",P1,Ye]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:de()}],shrink:[{shrink:de()}],order:[{order:["first","last","none",P1,Ye]}],"grid-cols":[{"grid-cols":[R1]}],"col-start-end":[{col:["auto",{span:["full",P1,Ye]},Ye]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[R1]}],"row-start-end":[{row:["auto",{span:[P1,Ye]},Ye]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,e]}],"min-w":[{"min-w":[Ye,e,"min","max","fit"]}],"max-w":[{"max-w":[Ye,e,"none","full","min","max","fit","prose",{screen:[rd]},rd]}],h:[{h:[Ye,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,e,"auto","min","max","fit"]}],"font-size":[{text:["base",rd,td]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",P8]}],"font-family":[{font:[R1]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",Xg,P8]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Tc,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Tc,td]}],"underline-offset":[{"underline-offset":["auto",Tc,Ye]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),SUe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kUe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},TUe]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:G()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Tc,Ye]}],"outline-w":[{outline:[Tc,td]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Tc,td]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",rd,EUe]}],"shadow-color":[{shadow:[R1]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",rd,Ye]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:pt()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:pt()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[P1,Ye]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Tc,td,P8]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},RUe=(t,{cacheSize:e,prefix:r,separator:n,experimentalParseClassName:i,extend:s={},override:a={}})=>{O1(t,"cacheSize",e),O1(t,"prefix",r),O1(t,"separator",n),O1(t,"experimentalParseClassName",i);for(let o in a)LUe(t[o],a[o]);for(let o in s)MUe(t[o],s[o]);return t},O1=(t,e,r)=>{r!==void 0&&(t[e]=r)},LUe=(t,e)=>{if(e)for(let r in e)O1(t,r,e[r])},MUe=(t,e)=>{if(e)for(let r in e){let n=e[r];n!==void 0&&(t[r]=(t[r]||[]).concat(n))}},_Ue=(t,...e)=>typeof t=="function"?Z8(J8,t,...e):Z8(()=>RUe(J8(),t),...e),OUe=Z8(J8),DUe={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},Gle=t=>t||void 0,F1=(...t)=>Gle(Ble(t).filter(Boolean).join(" ")),R8=null,Ec={},e9=!1,L1=(...t)=>e=>e.twMerge?((!R8||e9)&&(e9=!1,R8=Zi(Ec)?OUe:_Ue({...Ec,extend:{theme:Ec.theme,classGroups:Ec.classGroups,conflictingClassGroupModifiers:Ec.conflictingClassGroupModifiers,conflictingClassGroups:Ec.conflictingClassGroups,...Ec.extend}})),Gle(R8(F1(t)))):F1(t),Zae=(t,e)=>{for(let r in e)t.hasOwnProperty(r)?t[r]=F1(t[r],e[r]):t[r]=e[r];return t},Qp=(t,e)=>{let{extend:r=null,slots:n={},variants:i={},compoundVariants:s=[],compoundSlots:a=[],defaultVariants:o={}}=t,l={...DUe,...e},c=r!=null&&r.base?F1(r.base,t?.base):t?.base,u=r!=null&&r.variants&&!Zi(r.variants)?jle(i,r.variants):i,d=r!=null&&r.defaultVariants&&!Zi(r.defaultVariants)?{...r.defaultVariants,...o}:o;!Zi(l.twMergeConfig)&&!eUe(l.twMergeConfig,Ec)&&(e9=!0,Ec=l.twMergeConfig);let f=Zi(r?.slots),p=Zi(n)?{}:{base:F1(t?.base,f&&r?.base),...n},h=f?p:Zae({...r?.slots},Zi(p)?{base:t?.base}:p),m=Zi(r?.compoundVariants)?s:Vle(r?.compoundVariants,s),v=y=>{if(Zi(u)&&Zi(n)&&f)return L1(c,y?.class,y?.className)(l);if(m&&!Array.isArray(m))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof m}`);if(a&&!Array.isArray(a))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof a}`);let x=(I,B,M=[],z)=>{let G=M;if(typeof B=="string")G=G.concat(Yae(B).split(" ").map(V=>`${I}:${V}`));else if(Array.isArray(B))G=G.concat(B.reduce((V,K)=>V.concat(`${I}:${K}`),[]));else if(typeof B=="object"&&typeof z=="string"){for(let V in B)if(B.hasOwnProperty(V)&&V===z){let K=B[V];if(K&&typeof K=="string"){let de=Yae(K);G[z]?G[z]=G[z].concat(de.split(" ").map(Me=>`${I}:${Me}`)):G[z]=de.split(" ").map(Me=>`${I}:${Me}`)}else Array.isArray(K)&&K.length>0&&(G[z]=K.reduce((de,Me)=>de.concat(`${I}:${Me}`),[]))}}return G},w=(I,B=u,M=null,z=null)=>{var G;let V=B[I];if(!V||Zi(V))return null;let K=(G=z?.[I])!=null?G:y?.[I];if(K===null)return null;let de=Kae(K),Me=Array.isArray(l.responsiveVariants)&&l.responsiveVariants.length>0||l.responsiveVariants===!0,pt=d?.[I],At=[];if(typeof de=="object"&&Me)for(let[Kr,Di]of Object.entries(de)){let lt=V[Di];if(Kr==="initial"){pt=Di;continue}Array.isArray(l.responsiveVariants)&&!l.responsiveVariants.includes(Kr)||(At=x(Kr,lt,At,M))}let Ue=de!=null&&typeof de!="object"?de:Kae(pt),Gt=V[Ue||"false"];return typeof At=="object"&&typeof M=="string"&&At[M]?Zae(At,Gt):At.length>0?(At.push(Gt),M==="base"?At.join(" "):At):Gt},C=()=>u?Object.keys(u).map(I=>w(I,u)):null,O=(I,B)=>{if(!u||typeof u!="object")return null;let M=new Array;for(let z in u){let G=w(z,u,I,B),V=I==="base"&&typeof G=="string"?G:G&&G[I];V&&(M[M.length]=V)}return M},S={};for(let I in y)y[I]!==void 0&&(S[I]=y[I]);let T=(I,B)=>{var M;let z=typeof y?.[I]=="object"?{[I]:(M=y[I])==null?void 0:M.initial}:{};return{...d,...S,...z,...B}},E=(I=[],B)=>{let M=[];for(let{class:z,className:G,...V}of I){let K=!0;for(let[de,Me]of Object.entries(V)){let pt=T(de,B)[de];if(Array.isArray(Me)){if(!Me.includes(pt)){K=!1;break}}else{let At=Ue=>Ue==null||Ue===!1;if(At(Me)&&At(pt))continue;if(pt!==Me){K=!1;break}}}K&&(z&&M.push(z),G&&M.push(G))}return M},P=I=>{let B=E(m,I);if(!Array.isArray(B))return B;let M={};for(let z of B)if(typeof z=="string"&&(M.base=L1(M.base,z)(l)),typeof z=="object")for(let[G,V]of Object.entries(z))M[G]=L1(M[G],V)(l);return M},R=I=>{if(a.length<1)return null;let B={};for(let{slots:M=[],class:z,className:G,...V}of a){if(!Zi(V)){let K=!0;for(let de of Object.keys(V)){let Me=T(de,I)[de];if(Me===void 0||(Array.isArray(V[de])?!V[de].includes(Me):V[de]!==Me)){K=!1;break}}if(!K)continue}for(let K of M)B[K]=B[K]||[],B[K].push([z,G])}return B};if(!Zi(n)||!f){let I={};if(typeof h=="object"&&!Zi(h))for(let B of Object.keys(h))I[B]=M=>{var z,G;return L1(h[B],O(B,M),((z=P(M))!=null?z:[])[B],((G=R(M))!=null?G:[])[B],M?.class,M?.className)(l)};return I}return L1(c,C(),E(m),y?.class,y?.className)(l)},b=()=>{if(!(!u||typeof u!="object"))return Object.keys(u)};return v.variantKeys=b(),v.extend=r,v.base=c,v.slots=h,v.variants=u,v.defaultVariants=d,v.compoundSlots=a,v.compoundVariants=m,v},NUe=Qp({slots:{base:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 [&_svg]:shrink-0 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 focus-visible:ring-4 focus-visible:outline-1 aria-invalid:focus-visible:ring-0"},variants:{variant:{default:{base:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90"},destructive:{base:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90"},outline:{base:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground"},secondary:{base:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80"},ghost:{base:"hover:bg-accent hover:text-accent-foreground"},link:{base:"text-primary underline-offset-4 hover:underline"},controls:{base:"hover:bg-primary/80 hover:text-accent-foreground"}},size:{default:{base:"h-9 px-4 py-2 has-[>svg]:px-3"},sm:{base:"h-8 rounded-md px-3 has-[>svg]:px-2.5"},lg:{base:"h-10 rounded-md px-6 has-[>svg]:px-4"},icon:{base:"size-9"},controls:{base:"size-8 [&_svg:not([class*=size-])]:size-5"},center:{base:"size-10 rounded-full [&_svg:not([class*=size-])]:size-6"},"center-lg":{base:"size-12 rounded-full [&_svg:not([class*=size-])]:size-6"}}},defaultVariants:{variant:"default",size:"default"}}),Ac=Qp({extend:NUe,slots:{base:"relative group shrink-0",icon:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transition-opacity"},variants:{"may-support":{true:{base:"not-data-supported:hidden"}},active:{true:{icon:"group-data-active:opacity-0"}},inactive:{true:{icon:"not-group-data-active:opacity-0"}}},defaultVariants:{size:"controls",variant:"controls"}});function Wle({className:t,variant:e,size:r,...n}){let i=Ac({variant:e,size:r});return g.jsx("button",{className:i.base({className:t}),...n,children:g.jsx(Cu,{className:i.icon()})})}function Kle({className:t,variant:e,size:r,...n}){let i=Ac({variant:e,size:r});return g.jsx("button",{className:i.base({className:t}),...n,children:g.jsx(G0,{className:i.icon()})})}var FUe="Separator",Jae="horizontal",BUe=["horizontal","vertical"],Yle=N.forwardRef((t,e)=>{let{decorative:r,orientation:n=Jae,...i}=t,s=VUe(n)?n:Jae,a=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return g.jsx(wo.div,{"data-orientation":s,...a,...i,ref:e})});Yle.displayName=FUe;function VUe(t){return BUe.includes(t)}var jUe=Yle;function z1({className:t,orientation:e="horizontal",decorative:r=!0,...n}){return g.jsx(jUe,{"data-slot":"separator-root",decorative:r,orientation:e,className:Ce("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...n})}function XA({className:t,variant:e,size:r,...n}){let i=Ac({variant:e,size:r});return g.jsxs(B2,{className:i.base({className:t}),...n,children:[g.jsx(Eu,{className:i.icon({class:"not-group-data-paused:opacity-0"})}),g.jsx(V0,{className:i.icon({class:"group-data-paused:opacity-0"})})]})}function DA({seconds:t=30,className:e,variant:r,size:n,...i}){if(t===0)return null;let s=t>0?$0:Z0,a=Ac({variant:r,size:n});return g.jsx(z2,{className:a.base({className:e}),seconds:t,...i,children:g.jsx(s,{className:a.icon()})})}var q1=(0,$.createContext)({});function Xle({className:t,onTimestamp:e,onScreenshot:r,onTogglePip:n,onResetClip:i,flip:s="none",coverImage:a,creator:o,...l}){return g.jsx(q1.Provider,{value:{onTimestamp:e,onScreenshot:r,onTogglePip:n,onResetClip:i,coverImage:a,creator:o},children:g.jsx(mF,{className:Ce("group/player @container","overflow-hidden","rounded-md font-sans ring-ring data-focus:ring-4","border shadow-sm","**:data-media-provider:!rounded-none",(s==="horizontal"||s==="both")&&"**:data-media-provider:scale-x-[-1]",(s==="vertical"||s==="both")&&"**:data-media-provider:scale-y-[-1]",s&&s!=="none"&&"**:data-media-provider:origin-center",t),...l})})}var $Ue=Qp({slots:{container:"flex items-center justify-center bg-muted rounded-md overflow-hidden",image:"object-cover w-full h-full transition-opacity",fallback:"text-muted-foreground"},variants:{size:{mobile:{container:"size-10 shrink-0",fallback:"size-5"},desktop:{container:"size-12 shrink-0",fallback:"size-6"}}},defaultVariants:{size:"desktop"}});function Qle({size:t,className:e}){let{coverImage:r}=(0,$.useContext)(q1),[n,i]=(0,$.useState)(!1),[s,a]=(0,$.useState)(!1),o=$Ue({size:t}),l=()=>{a(!0)},c=()=>{i(!0)};return g.jsxs("div",{className:o.container({className:e}),children:[r&&!n&&g.jsx("img",{src:r,alt:"Cover art",className:Ce(o.image(),s?"opacity-100":"opacity-0"),onLoad:l,onError:c}),(!r||n||!s)&&g.jsx(Vm,{className:o.fallback()})]})}function UUe(t){let e=getComputedStyle(t);return e.display!=="none"&&Number.parseInt(e.opacity,10)>0}function zUe(t){return!!t&&("checkVisibility"in t?t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):UUe(t))}function ud({className:t,type:e="current",hidden:r=!1,padHours:n=null,padMinutes:i=null,remainder:s=!1,showHours:a=!1,toggle:o=!1}={}){let l=Wi("duration"),c=Wi("currentTime"),u=Wi("bufferedEnd"),[d,f]=(0,$.useState)(null),[p,h]=(0,$.useState)(!0),[m,v]=(0,$.useState)(!0),b=(0,$.useRef)(null),y=(0,$.useCallback)(()=>{switch(e){case"buffered":return u;case"duration":return l;default:return c}},[e,u,l,c]),x=s&&d!==!1,w=y(),C=(0,$.useMemo)(()=>r||!p||!m,[r,p,m]),O=(0,$.useCallback)(()=>{if(!Number.isFinite(w+l))return"LIVE";let P=x?Math.max(0,l-w):w,R=fc(P,{padHrs:n,padMins:i,showHrs:a});return(x?"-":"")+R},[w,l,x,n,i,a]),S=(0,$.useCallback)(P=>{o&&(P.preventDefault(),f(d===null?!s:R=>!R))},[o,s,d]),T=(0,$.useCallback)(P=>{(P.key==="Enter"||P.key===" ")&&S(P)},[S]);(0,$.useEffect)(()=>{if(!b.current)return;let P=new IntersectionObserver(([R])=>{var I;let B=(I=b.current)==null?void 0:I.getBoundingClientRect(),M=B&&B.top>=0&&B.left>=0&&B.bottom<=window.innerHeight&&B.right<=window.innerWidth;v(M??R?.isIntersecting??!0)},{threshold:0});return P.observe(b.current),()=>P.disconnect()},[]),(0,$.useEffect)(()=>{if(!b.current)return;let P,R=!0,I=()=>{R&&(h(zUe(b.current)),P=requestAnimationFrame(I))};return I(),()=>{R=!1,cancelAnimationFrame(P)}},[]);let E=C?"":O();return o?g.jsx("button",{className:Ce("min-h-1 min-w-1",t),ref:b,type:"button","data-type":e,"data-remainder":x,onClick:S,onKeyDown:T,children:E}):g.jsx("div",{className:Ce("min-h-1 min-w-1",t),ref:b,"data-type":e,"data-remainder":x,children:E})}var qUe=Qp({slots:{container:["group flex h-full w-auto flex-row-reverse items-center justify-end gap-2 overflow-hidden px-1 transition-[max-width] @sm:px-2"],sep:"h-2/5 bg-foreground/80",hash:"h-3.5 w-3.5 shrink-0 opacity-80 @sm:h-4 @sm:w-4",h1:["max-w-48 shrink-0 truncate transition-[max-width] hover:max-w-full @xl:text-lg @xl:font-medium","delay-0 hover:delay-200"],"h1-container":["flex flex-col items-start @lg:flex-row @lg:items-center gap-x-4"],creator:["max-w-48 shrink-0 truncate text-xs text-muted-foreground transition-[max-width] hover:max-w-full","delay-0 hover:delay-200"],"h2-container":["group flex shrink-0 grow flex-nowrap items-center gap-1 pr-4"],h2:["w-full max-w-48 shrink-0 truncate text-sm font-medium transition-[max-width] group-hover:max-w-full @xl:text-base @xl:font-normal","delay-0 group-hover:delay-200"]},variants:{variant:{none:{container:"hidden"},"h1-only":{h1:"hidden max-w-72 @sm:block","h1-container":"hidden @sm:flex",creator:"hidden max-w-72 @sm:block",sep:"hidden","h2-container":"hidden",hash:"hidden"},"h2-only":{h1:"hidden","h1-container":"hidden",creator:"hidden",sep:"hidden",h2:"max-w-96",hash:"@sm:flex"},full:{h1:"hidden @sm:block","h1-container":"hidden @sm:flex",creator:"hidden @sm:block",sep:"hidden @sm:flex",h2:"@sm:text-xs",hash:"@sm:hidden"}}}});function QA({className:t,...e}){let r=Wi("title"),n=W2(),{creator:i}=(0,$.useContext)(q1),s=r&&n?"full":r?"h1-only":n?"h2-only":"none",{h1:a,"h1-container":o,creator:l,h2:c,"h2-container":u,hash:d,container:f,sep:p}=qUe({variant:s});return g.jsxs("div",{"data-title":s,className:f({className:t}),...e,children:[g.jsxs("div",{className:u(),children:[g.jsx(_0,{className:d()}),g.jsx("h2",{className:c(),children:n})]}),g.jsx(z1,{orientation:"vertical",className:p()}),g.jsxs("div",{className:o(),children:[g.jsx("h1",{className:a(),children:r}),i&&g.jsx("div",{className:l(),children:i})]})]})}var L8;async function HUe(){if(typeof document>"u"||typeof document.createElement!="function"||typeof HTMLAudioElement>"u")return null;try{let t=document.createElement("audio");return t.volume=.5,await new Promise(e=>{setTimeout(()=>{e(t.volume===.5)},0)})}catch(t){return console.error("Error in detectVolumeSetter:",t),null}}var GUe=async()=>(L8!==void 0||(L8=HUe()),L8);function WUe({className:t,variant:e,size:r,...n}){let i=Ac({variant:e,size:r});return g.jsxs($2,{className:i.base({className:t}),...n,children:[g.jsx(Gm,{className:i.icon({class:"not-group-data-muted:opacity-0"})}),g.jsx(tx,{className:i.icon({class:"group-data-[state=high]:opacity-0 group-data-muted:opacity-0"})}),g.jsx(Hm,{className:i.icon({class:"not-group-data-[state=high]:opacity-0 group-data-muted:opacity-0"})})]})}function KUe(){let[t,e]=N.useState({width:null,height:null}),r=N.useRef(null);return[N.useCallback(n=>{if(r.current&&(r.current.disconnect(),r.current=null),n?.nodeType===Node.ELEMENT_NODE){let i=new ResizeObserver(([s])=>{if(s&&s.borderBoxSize){let{inlineSize:a,blockSize:o}=s.borderBoxSize[0];e({width:a,height:o})}});i.observe(n),r.current=i}},[]),t]}var YUe=Qp({slots:{root:"group relative inline-flex h-5 w-full cursor-pointer touch-none select-none items-center outline-none aria-disabled:cursor-auto aria-hidden:hidden",track:"relative z-0 h-1.5 w-full rounded-full",trackFill:"absolute h-full w-(--slider-fill) rounded-full bg-primary will-change-[width]",thumb:["pointer-events-none absolute left-(--slider-fill) top-1/2 z-20 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full opacity-0 transition-[opacity,box-shadow] ease-in-out will-change-[left] group-data-active:opacity-100","ring-0 ring-transparent ring-offset-1 ring-offset-primary group-data-dragging:ring-2 group-data-dragging:ring-thumb/30","bg-thumb"],preview:["absolute w-max","pointer-events-none items-center px-2","opacity-0 transition-opacity duration-200 group-data-pointing:opacity-100","flex flex-col gap-0.5"]},variants:{focus:{default:{track:"group-data-focus:outline-2 group-data-focus:outline-offset-1 group-data-focus:outline-ring"},none:{track:""}},variant:{default:{track:"bg-secondary/60"},video:{track:"bg-secondary-foreground/20"},audio:{track:"bg-secondary/60",preview:"flex-col-reverse"}},tooltip:{top:"",bottom:""}},defaultVariants:{focus:"default",variant:"default",tooltip:"top"}}),{root:Zle,track:XUe,preview:QUe,trackFill:ZUe,thumb:JUe}=YUe();function Jle({className:t,focus:e,variant:r,tooltip:n,...i}){return g.jsx(Mw.Track,{className:XUe({className:t,variant:r,focus:e,tooltip:n}),...i})}function ece({className:t,variant:e,focus:r,tooltip:n,...i}){return g.jsx(Mw.TrackFill,{className:ZUe({className:t,variant:e,focus:r,tooltip:n}),...i})}function tce({className:t,variant:e,focus:r,tooltip:n,...i}){return g.jsx(Mw.Thumb,{className:JUe({className:t,variant:e,focus:r,tooltip:n}),...i})}function eze({ref:t,children:e,className:r,style:n,variant:i,focus:s,tooltip:a,...o}){let[l,{width:c}]=KUe(),u=c?`calc(var(--slider-pointer) - ${c/2}px)`:"calc(var(--slider-pointer))";return g.jsx("div",{ref:gT([l,t]),className:QUe({className:r,variant:i,focus:s,tooltip:a}),style:{...n,left:u,[a==="bottom"?"top":"bottom"]:"calc(100% + var(--media-slider-preview-offset, 0px))"},...o,children:e})}function tze({className:t,variant:e,...r}){return g.jsxs(dF.Root,{className:Ce("max-w-20",Zle({className:t,variant:e})),...r,children:[g.jsx(Jle,{focus:"default",variant:e,children:g.jsx(ece,{variant:e})}),g.jsx(tce,{variant:e})]})}var rze=Qp({slots:{root:"group/vol-ctrl flex items-center not-data-supported:hidden",slider:"flex w-20 max-w-0 transition-all delay-0 vol-active:max-w-20 vol-active:delay-200"},variants:{direction:{default:{root:"flex-row",slider:"mr-1 vol-active:mr-3 vol-active:pl-2"},reverse:{root:"flex-row-reverse",slider:"ml-1 vol-active:ml-3 vol-active:pr-2"}}},defaultVariants:{direction:"default"}}),{root:nze,slider:ize}=rze();function sze(){let[t,e]=(0,$.useState)(null);return(0,$.useEffect)(()=>{GUe().then(e)},[]),t}function ZA({className:t,direction:e,variant:r,sliderVariant:n,size:i,...s}){let a=sze();return g.jsxs("div",{className:nze({direction:e,className:t}),"data-supported":a===!1?void 0:"",...s,children:[g.jsx(WUe,{className:"peer",variant:r,size:i}),g.jsx("div",{className:ize({direction:e}),children:g.jsx(tze,{className:"h-full w-full",variant:n})})]})}function JA({className:t,variant:e,focus:r,tooltip:n,...i}){let s={variant:e,focus:r,tooltip:n};return g.jsxs(bp.Root,{className:Ce(Zle({className:t}),"rounded-none"),...s,...i,children:[g.jsx(bp.Chapters,{className:Ce("relative flex h-full w-full items-center gap-x-0.5 rounded-[1px] px-px group-data-focus:h-2 group-data-focus:ring-2 group-data-focus:ring-ring"),children:(a,o)=>a.map((l,c,u)=>g.jsx("div",{className:Ce("group/cue relative flex h-full w-full items-center rounded-sm"),style:{contain:"layout style"},ref:o,children:g.jsxs(Jle,{...s,focus:"none",className:Ce("rounded-sm transition-all",u.length>1&&"group-hover/cue:h-2.5 group-hover/cue:max-h-2.5"),children:[g.jsx(ece,{...s,className:Ce("z-10 w-(--chapter-fill) rounded-sm")}),g.jsx(bp.Progress,{className:"absolute h-full w-(--chapter-progress) rounded-sm bg-primary/40 will-change-[width]"})]})},l.startTime))}),g.jsxs(eze,{...s,children:[g.jsx(bp.ChapterTitle,{className:Ce("text-sm",s.variant==="audio"&&"rounded-sm bg-background/90 px-2 py-1")}),g.jsx(bp.Value,{className:"rounded-sm bg-secondary px-2 py-px text-[13px] font-medium text-secondary-foreground"})]}),g.jsx(tce,{...s})]})}function aze({utilsSlot:t}){return g.jsxs("div",{className:"hidden @xl:grid h-full w-full grid-cols-[auto_auto_1fr_auto] grid-rows-2 gap-x-2 p-2",children:[g.jsx(gr.Group,{className:"row-span-2 flex items-center justify-center ml-2",children:g.jsx(Qle,{size:"desktop"})}),g.jsxs(gr.Group,{className:"peer/title col-span-3 flex gap-2 px-1",children:[g.jsx("div",{className:"h-full w-full",children:g.jsx(QA,{})}),g.jsxs("div",{className:"flex items-center gap-x-1.5 pl-2 text-sm font-medium",children:[g.jsx(ud,{type:"current"}),g.jsx(z1,{className:"data-[orientation=vertical]:h-3",orientation:"vertical"}),g.jsx(ud,{type:"duration"})]})]}),g.jsxs(gr.Group,{className:"col-start-2 row-start-2 flex items-center gap-x-1 pl-1",children:[g.jsx(DA,{seconds:-30,variant:"ghost"}),g.jsx(XA,{variant:"ghost"}),g.jsx(DA,{seconds:30,variant:"ghost"})]}),g.jsx(gr.Group,{className:"col-start-3 row-start-2 flex w-full items-center",children:g.jsx("div",{className:"flex h-[6px] w-full items-center",children:g.jsx(JA,{variant:"audio"})})}),g.jsxs(gr.Group,{className:"col-start-4 row-start-2 flex w-full items-center justify-end",children:[g.jsx(ZA,{variant:"ghost",direction:"reverse"}),t]})]})}function oze({utilsSlot:t}){return g.jsxs("div",{className:"@xl:hidden grid h-full w-full grid-cols-3 gap-x-2 p-2",children:[g.jsx(gr.Group,{className:"col-span-3 col-start-1 row-start-1 flex w-full items-center",children:g.jsx("div",{className:"flex h-[6px] w-full items-center",children:g.jsx(JA,{variant:"audio"})})}),g.jsxs(gr.Group,{className:"peer/title col-span-3 mt-2 flex items-center gap-2",children:[g.jsx(Qle,{size:"mobile"}),g.jsx("div",{className:"h-full w-full min-w-0",children:g.jsx(QA,{})}),g.jsxs("div",{className:"flex items-center gap-x-1.5 pl-2 text-sm font-medium",children:[g.jsx(ud,{type:"current"}),g.jsx(z1,{className:"h-3",orientation:"vertical"}),g.jsx(ud,{type:"duration"})]})]}),g.jsx(gr.Group,{className:"col-start-1 row-start-3 flex w-full items-end",children:g.jsx(ZA,{variant:"ghost"})}),g.jsxs(gr.Group,{className:"col-start-2 row-start-3 flex w-full items-end justify-center gap-x-1",children:[g.jsx(DA,{seconds:-30,variant:"ghost"}),g.jsx(XA,{variant:"outline",size:"center"}),g.jsx(DA,{seconds:30,variant:"ghost"})]}),g.jsx(gr.Group,{className:"col-start-3 row-start-3 flex w-full items-end justify-end",children:t})]})}function rce({utilsSlot:t}){return Wi("viewType")!=="audio"?null:g.jsxs(gr.Root,{className:"z-10 h-full w-full opacity-0 transition-opacity media-controls:opacity-100",children:[g.jsx(aze,{utilsSlot:t}),g.jsx(oze,{utilsSlot:t})]})}var lze="_captions_1ihkv_9",cze={captions:lze},uze=Qp({base:"absolute block",variants:{area:{full:"inset-0 z-0 h-full w-full",left:"left-0 top-0 z-10 h-full w-1/5",right:"right-0 top-0 z-10 h-full w-1/5"}}}),wA=(0,$.forwardRef)(function({className:t,area:e,...r},n){return g.jsx(H2,{className:uze({className:t,area:e}),ref:n,...r})});function dze(){return g.jsxs(g.Fragment,{children:[g.jsx(wA,{area:"full",event:"pointerup",action:"toggle:paused"}),g.jsx(wA,{area:"full",event:"dblpointerup",action:"toggle:fullscreen"}),g.jsx(wA,{area:"left",event:"dblpointerup",action:"seek:-10"}),g.jsx(wA,{area:"right",event:"dblpointerup",action:"seek:10"})]})}function nce({className:t,variant:e,size:r,...n}){let i=Ac({variant:e,size:r});return g.jsxs(V2,{className:i.base({className:t,"may-support":!0}),...n,children:[g.jsx(T0,{className:i.icon({active:!0})}),g.jsx(Ql,{className:i.icon({inactive:!0})})]})}function ice({className:t,variant:e,size:r,...n}){let i=Ac({variant:e,size:r});return g.jsxs(j2,{className:i.base({className:t,"may-support":!0}),...n,children:[g.jsx(N0,{className:i.icon({active:!0})}),g.jsx(B0,{className:i.icon({inactive:!0})})]})}function sce({className:t,variant:e,size:r,...n}){let{onTogglePip:i}=(0,$.use)(q1),s=G2(),a=Ac({variant:e,size:r});return i&&s?g.jsx("button",{className:a.base({className:t}),...n,onClick:()=>i(s),children:g.jsx(jm,{className:a.icon({active:!0})})}):g.jsxs(U2,{className:a.base({className:t,"may-support":!0}),...n,children:[g.jsx(jm,{className:a.icon({inactive:!0})}),g.jsx(j0,{className:a.icon({active:!0})})]})}function fze({className:t,variant:e,size:r,asChild:n=!1,...i}){let s=n?jA:"button",a=Ac({variant:e,size:r});return g.jsx(s,{"data-slot":"button",className:a.base({className:t}),...i})}function ace(){let{clipStartTime:t,clipEndTime:e}=F2(),r=G2(),{onResetClip:n}=(0,$.use)(q1);if(!t||!e)return null;let i=t>0?fc(t):"start",s=Number.isFinite(t)&&t>0?fc(e):"end";return g.jsxs("div",{className:"flex items-center gap-0.5",title:`Video clipped from ${i} to ${s}`,children:[g.jsx("div",{className:"flex items-center gap-1 px-2 text-sm",children:g.jsx(Pu,{className:"size-4 text-primary"})}),n&&r&&g.jsx(fze,{type:"button",onClick:()=>n(r),title:"Reset clip",children:g.jsx(Q0,{})})]})}function pze({utilsSlot:t}){return g.jsx(gr.Root,{className:"mx-player-video mx-player hidden @md:block",children:g.jsxs("div",{className:`${Ce("absolute inset-0 z-10 grid h-full w-full opacity-0 transition-[opacity,padding,font-size] media-controls:opacity-100 media-paused:opacity-100","grid-cols-3 grid-rows-[2.5rem_1fr_6px_2rem] gap-y-2 p-2 pb-2","@xl:grid-rows-[2.5rem_1fr_6px_2rem] @xl:px-4 @xl:pt-4")} bg-linear-to-t from-video-overlay/20 from-0% via-transparent via-[4rem_calc(100%-5rem)] to-video-overlay/20 to-100%`,children:[g.jsx("div",{className:"col-span-2",children:g.jsx(QA,{})}),g.jsx(gr.Group,{className:"col-span-1 flex w-full place-content-end items-center overflow-hidden",children:g.jsx(ace,{})}),g.jsx("div",{className:"pointer-events-none col-span-3 flex items-center justify-center"}),g.jsxs(gr.Group,{className:"col-span-2 flex w-full items-center gap-x-0.5 row-start-4 pl-0",children:[g.jsx(XA,{}),g.jsx(ZA,{sliderVariant:"video"}),g.jsxs("div",{className:"ml-2 flex items-center gap-x-1.5 text-sm font-medium",children:[g.jsx(ud,{type:"current"}),g.jsx(z1,{className:"h-3 bg-foreground/80",orientation:"vertical"}),g.jsx(ud,{type:"duration"})]})]}),g.jsxs(gr.Group,{className:"col-span-1 flex w-full flex-row-reverse items-center justify-start gap-0.5 row-start-4",children:[t,g.jsxs("div",{className:"group contents",children:[g.jsx(ice,{className:"peer"}),g.jsx(sce,{className:"max-w-full opacity-100"})]}),g.jsx(nce,{})]}),g.jsx(gr.Group,{className:"col-span-3 flex w-full items-center px-1 row-start-3",children:g.jsx(JA,{variant:"video"})})]})})}function hze({utilsSlot:t}){return g.jsx(gr.Root,{className:"mx-player-video mx-player @md:hidden",children:g.jsxs("div",{className:`${Ce("absolute inset-0 z-10 grid h-full w-full opacity-0 transition-[opacity,padding,font-size] media-controls:opacity-100 media-paused:opacity-100","grid-cols-3 grid-rows-[2rem_1fr_2rem_6px] gap-y-1 p-2 pb-3")} bg-linear-to-t from-video-overlay/20 from-0% via-transparent via-[4rem_calc(100%-5rem)] to-video-overlay/20 to-100%`,children:[g.jsx("div",{className:"col-span-2",children:g.jsx(QA,{})}),g.jsxs(gr.Group,{className:"col-span-1 flex w-full place-content-end items-center overflow-hidden",children:[g.jsx(ace,{}),g.jsx(nce,{}),t]}),g.jsx("div",{className:"pointer-events-none col-span-3 flex items-center justify-center",children:g.jsx(XA,{className:"pointer-events-auto",size:"center"})}),g.jsx(gr.Group,{className:"col-span-2 flex w-full items-center gap-x-0.5 pl-1",children:g.jsxs("div",{className:"ml-2 flex items-center gap-x-1.5 text-sm font-medium",children:[g.jsx(ud,{type:"current"}),g.jsx(z1,{className:"h-3 bg-foreground/80",orientation:"vertical"}),g.jsx(ud,{type:"duration"})]})}),g.jsxs(gr.Group,{className:"col-span-1 flex w-full flex-row-reverse items-center justify-start gap-0.5",children:[g.jsxs("div",{className:"group contents",children:[g.jsx(ice,{className:"peer"}),g.jsx(sce,{className:"max-w-0 opacity-0 focus-visible:max-w-full focus-visible:opacity-100 group-hover:max-w-full group-hover:opacity-100 peer-focus-visible:max-w-full peer-focus-visible:opacity-100 data-enabled:max-w-full data-enabled:opacity-100"})]}),g.jsx(ZA,{direction:"reverse",sliderVariant:"video"})]}),g.jsx(gr.Group,{className:"col-span-3 flex w-full items-center px-1",children:g.jsx(JA,{variant:"video"})})]})})}function oce({utilsSlot:t}){return Wi("viewType")==="audio"?null:g.jsxs(g.Fragment,{children:[g.jsx(dze,{}),g.jsx(K2,{className:Ce(`${cze.captions} absolute inset-0 bottom-2 z-10 select-none break-words opacity-0 transition-[opacity,bottom] duration-300 media-captions:opacity-100 media-controls:bottom-14 media-preview:opacity-0 `)}),g.jsx(hze,{utilsSlot:t}),g.jsx(pze,{utilsSlot:t})]})}function mze({disabled:t,testPattern:e}){let[r,n]=(0,$.useState)(""),[i,s]=(0,$.useState)(null),a=()=>{try{let d=new URL(r),f=e(d);s(f)}catch{s({type:"error",reason:"Invalid URL format"})}},o=()=>{if(!i)return null;switch(i.type){case"matched":return g.jsx(Jl,{className:"size-4 text-success"});case"not-matched":return g.jsx(ku,{className:"size-4 text-warning"});case"invalid-pattern":case"error":return g.jsx(Zl,{className:"size-4 text-destructive"})}},l=()=>{if(!i)return null;switch(i.type){case"matched":return"Pattern matches URL";case"not-matched":return"Pattern does not match URL";case"invalid-pattern":return`Invalid pattern${i.reason?`: ${i.reason}`:""}`;case"error":return`Error: ${i.reason}`}},c=()=>{if(!i)return"";switch(i.type){case"matched":return"text-success";case"not-matched":return"text-warning";case"invalid-pattern":case"error":return"text-destructive"}},u=(0,$.useId)();return g.jsxs("div",{className:"mt-4 p-4 border border-border rounded-md bg-muted/50",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[g.jsx(K0,{className:"size-4"}),g.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Verify URL Pattern"})]}),g.jsxs("div",{className:"space-y-3",children:[g.jsxs(Bs,{children:[g.jsx(Fn,{htmlFor:u,className:"sr-only",children:"Target URL"}),g.jsx(gl,{children:"Enter a link to resource to test if the pattern matches."}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ti,{id:u,type:"text",value:r,onChange:d=>n(d.target.value),className:"flex-1",placeholder:"https://example.com/path",onKeyDown:d=>{d.key==="Enter"&&!t&&r&&a()}}),g.jsx(Cr,{type:"button",onClick:a,disabled:t||!r.trim(),variant:"outline",children:"Test"})]})]}),i&&g.jsxs("div",{className:`flex items-center text-sm ${c()}`,children:[o(),g.jsx("span",{className:"ml-2",children:l()})]})]})]})}function lce({defaultValues:t,resolver:e,onSave:r,onInvalid:n,onCancel:i,testPattern:s}){let a=f9({resolver:e,defaultValues:{...t,pattern:"",username:"",password:""}}),o=a.watch("pattern"),l=c=>s(o||"",c);return g.jsx($A,{...a,children:g.jsxs("form",{onSubmit:a.handleSubmit(r,n),className:"space-y-6",children:[g.jsx(Xt,{control:a.control,name:"pattern",render:({field:c})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Pattern/URL *"}),g.jsx(qr,{children:g.jsx(ti,{placeholder:"https://example.com/*",...c})}),g.jsx(Ii,{})]})}),g.jsx(Xt,{control:a.control,name:"username",render:({field:c})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Username *"}),g.jsx(qr,{children:g.jsx(ti,{placeholder:"Enter username or email",...c})}),g.jsx(Ii,{})]})}),g.jsx(Xt,{control:a.control,name:"password",render:({field:c})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Password *"}),g.jsx(qr,{children:g.jsx(ti,{type:"password",placeholder:"Enter password",...c})}),g.jsx(Ii,{})]})}),g.jsx(mze,{disabled:!o,testPattern:l}),g.jsxs("div",{className:"flex justify-end space-x-3 pt-4 border-t border-border",children:[g.jsxs(Cr,{type:"button",onClick:i,variant:"outline",children:[g.jsx(el,{className:"size-4"}),"Cancel"]}),g.jsxs(Cr,{type:"submit",children:[g.jsx(Um,{className:"size-4"}),"Save"]})]})]})})}function gze(t){var e,r;let{Deno:n,process:i}=globalThis,s=n?.inspect??((r=(e=i?.getBuiltinModule)==null?void 0:e.call(i,"node:util"))==null?void 0:r.inspect);return typeof s=="function"?s(t,{depth:1/0,sorted:!0,trailingComma:!0,compact:!1,iterableLimit:1/0,getters:!0,strAbbreviateSize:1/0}):vze(t)}var yze=[t=>{if(typeof t>"u")return"undefined";if(typeof t=="bigint")return`${t}n`;if(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null||Array.isArray(t)||[null,Object.prototype].includes(Object.getPrototypeOf(t)))return JSON.stringify(t,null,2)},t=>String(t),t=>Object.prototype.toString.call(t)];function vze(t){for(let e of yze)try{let r=e(t);if(typeof r=="string")return r}catch{}return"[[Unable to format value]]"}var t9=class extends Error{constructor(e,r){super(e,r),this.name="AssertionError"}};function r9(t,e){throw new t9(`Expect ${gze(t)} to be of type never`)}function eoe(t,e={}){let{signal:r,persistent:n=!0}=e;return r!=null&&r.aborted?Promise.reject(r.reason):new Promise((i,s)=>{let a=()=>{clearTimeout(+o),s(r?.reason)},o=bze(()=>{r?.removeEventListener("abort",a),i()},t);if(r?.addEventListener("abort",a,{once:!0}),n===!1)try{Deno.unrefTimer(o)}catch(l){if(!(l instanceof ReferenceError))throw l;console.error("`persistent` option is only available in Deno")}})}var toe=2**31-1;function bze(t,e){let r=e=Math.trunc(Math.max(e,0)||0),n=Date.now(),i,s=()=>{r=e-(Date.now()-n),i=r>toe?setTimeout(s,toe):setTimeout(t,r)};return s(),{valueOf:()=>i}}function nd({className:t,...e}){return g.jsx("div",{"data-slot":"skeleton",className:Ce("bg-accent animate-pulse rounded-md",t),...e})}function cce({username:t,password:e,pattern:r,onEdit:n,onDelete:i,disabled:s=!1}){let[a,o]=(0,$.useState)(!1);return g.jsx("li",{className:"@container bg-card border border-border rounded-lg p-3 shadow-xs hover:shadow-md transition-shadow",children:g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("dl",{className:"flex-1 grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4 min-w-0",children:[g.jsxs("div",{className:"min-w-0 @sm:col-span-2 @lg:col-span-1",children:[g.jsx("dt",{className:"text-xs font-medium text-muted-foreground mb-1",children:"URL Pattern"}),g.jsx("dd",{className:"text-sm font-medium text-foreground truncate",children:r})]}),g.jsxs("div",{className:"min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[g.jsx("dt",{className:"text-xs font-medium text-muted-foreground uppercase",children:"Username"}),g.jsx(roe,{value:t,target:"username"})]}),g.jsx("dd",{className:"text-sm text-foreground truncate",children:t})]}),g.jsxs("div",{className:"min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[g.jsx("dt",{className:"text-xs font-medium text-muted-foreground uppercase",children:"Password"}),g.jsx(roe,{value:e,target:"password"})]}),g.jsxs("dd",{className:"flex items-center","data-hidden":a?void 0:"",children:[g.jsx("div",{className:"text-sm text-foreground font-mono truncate",children:a?e:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}),g.jsx("button",{type:"button",onClick:()=>o(!a),className:"ml-2 p-1 text-accent-foreground hover:bg-accent dark:hover:bg-accent/50 rounded-sm transition-colors shrink-0",title:a?"Hide password":"Show password",children:a?g.jsx(A0,{className:"size-3"}):g.jsx(Nm,{className:"size-3"})})]})]})]}),g.jsxs("div",{className:"flex items-center space-x-1 ml-6 shrink-0 self-start @lg:self-center",children:[g.jsxs("button",{type:"button",onClick:n,disabled:s,className:"p-1.5 text-accent-foreground hover:bg-accent dark:hover:bg-accent/50 rounded-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",children:[g.jsx("span",{className:"sr-only",children:"Edit"}),g.jsx(Ui,{className:"size-4"})]}),g.jsxs("button",{type:"button",onClick:i,disabled:s,className:"p-1.5 text-accent-foreground hover:text-destructive hover:bg-destructive/10 rounded-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-accent-foreground",children:[g.jsx("span",{className:"sr-only",children:"Delete"}),g.jsx(X0,{className:"size-4"})]})]})]})})}function uce({children:t}){return g.jsx("ul",{className:"flex flex-col gap-4 h-full",children:t})}function dce({onAdd:t}){return g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-12 text-center",children:[g.jsx(D0,{className:"size-12 text-muted-foreground mb-4"}),g.jsx("p",{className:"text-lg font-medium text-foreground mb-2",children:"No passwords saved"}),g.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance mb-6",children:"Your saved passwords will appear here. Add your first password to get started."}),t&&g.jsxs(Cr,{onClick:t,size:"lg",children:[g.jsx($m,{}),"Add Password"]})]})}function fce(){return g.jsx("div",{className:"flex-1 flex flex-col gap-4",children:Array.from({length:3}).map((t,e)=>g.jsx("li",{className:"@container bg-card border border-border rounded-lg p-3 shadow-xs",children:g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("dl",{className:"flex-1 grid grid-cols-1 @sm:grid-cols-2 @lg:grid-cols-3 gap-4 min-w-0",children:[g.jsxs("div",{className:"min-w-0 @sm:col-span-2 @lg:col-span-1",children:[g.jsx(nd,{className:"h-3 w-16 mb-2"}),g.jsx(nd,{className:"h-4 w-32"})]}),g.jsxs("div",{className:"min-w-0",children:[g.jsx(nd,{className:"h-3 w-12 mb-2"}),g.jsx(nd,{className:"h-4 w-24"})]}),g.jsxs("div",{className:"min-w-0",children:[g.jsx(nd,{className:"h-3 w-12 mb-2"}),g.jsx(nd,{className:"h-4 w-20"})]})]}),g.jsxs("div",{className:"flex items-center space-x-1 ml-6 shrink-0",children:[g.jsx(nd,{className:"h-7 w-7 rounded-sm"}),g.jsx(nd,{className:"h-7 w-7 rounded-sm"})]})]})},`skeleton-${e}`))})}function xze(){let[t,e]=(0,$.useState)("idle");return{copyState:t,copy:(0,$.useCallback)((r,n={})=>{let i=new AbortController;eoe(200,{signal:i.signal}).then(()=>e("copying")).catch(()=>{}),navigator.clipboard.writeText(r).then(()=>e("copied")).catch(()=>e("error")).finally(async()=>{i.abort(),await eoe(n.timeout??2e3),e("idle")})},[])}}function roe({value:t,target:e}){let{copyState:r,copy:n}=xze(),i=r==="idle"?`Copy ${e} to clipboard`:r==="copied"?`Copied ${e} to clipboard`:r==="error"?`Error copying ${e} to clipboard`:r==="copying"?`Copying ${e} to clipboard`:r9(r);return g.jsxs("button",{type:"button","data-copy-state":r,disabled:r!=="idle",onClick:()=>n(t),className:"p-1 text-accent-foreground hover:bg-accent dark:hover:bg-accent/50 rounded-sm transition-colors data-[copy-state=copied]:text-success data-[copy-state=error]:text-destructive data-[copy-state=copying]:text-muted-foreground",children:[g.jsx("span",{className:"sr-only",children:i}),r==="idle"?g.jsx(Dm,{className:"size-3"}):r==="copied"?g.jsx(Zf,{className:"size-3"}):r==="error"?g.jsx(el,{className:"size-3"}):r==="copying"?g.jsx(to,{className:"size-3 animate-spin"}):r9(r)]})}function pce({className:t,...e}){return g.jsx("div",{"data-slot":"card",className:Ce("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...e})}function wze({className:t,...e}){return g.jsx("div",{"data-slot":"card-content",className:Ce("px-6",t),...e})}function hce({value:t,onChange:e,disabled:r}){return g.jsxs(Bs,{className:"flex flex-row items-start space-x-3 space-y-0 rounded-md border p-4",children:[g.jsx(qr,{children:g.jsx(tle,{checked:t,onCheckedChange:e,disabled:r})}),g.jsxs("div",{className:"space-y-1 leading-none",children:[g.jsx(Fn,{children:"Default track"}),g.jsx(gl,{children:t===!0?"This track will be enabled by default during playback.":"This track won't be displayed unless explicitly enabled."})]})]})}var noe=(t,e,r)=>{if(t&&"reportValidity"in t){let n=ae(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},kze=(t,e)=>{for(let r in e.fields){let n=e.fields[r];n&&n.ref&&"reportValidity"in n.ref?noe(n.ref,r,t):n&&n.refs&&n.refs.forEach(i=>noe(i,r,t))}},Sze=(t,e)=>{e.shouldUseNativeValidation&&kze(t,e);let r={};for(let n in t){let i=ae(e.fields,n),s=Object.assign(t[n]||{},{ref:i&&i.ref});if(Cze(e.names||Object.keys(t),n)){let a=Object.assign({},ae(r,n));It(a,"root",s),It(r,n,a)}else It(r,n,s)}return r},Cze=(t,e)=>{let r=ioe(e);return t.some(n=>ioe(n).match(`^${r}\\.\\d+`))};function ioe(t){return t.replace(/\]|\[/g,"")}function mce(t,e,r){return r===void 0&&(r={}),function(n,i,s){try{var a=!s.shouldUseNativeValidation&&s.criteriaMode==="all";return Promise.resolve(FVe(t,n,Object.assign({},e,{abortPipeEarly:!a}))).then(function(o){if(o.issues){for(var l={};o.issues.length;){var c=o.issues[0],u=DVe(c);if(u&&(l[u]||(l[u]={message:c.message,type:c.type}),a)){var d=l[u].types,f=d&&d[c.type];l[u]=goe(u,a,l,c.type,f?[].concat(f,c.message):c.message)}o.issues.shift()}return{values:{},errors:Sze(l,s)}}return{values:r.raw?Object.assign({},n):o.output,errors:{}}})}catch(o){return Promise.reject(o)}}}var Tze=cd({"track-kind":Zg(["captions","subtitles"]),"default-enable":hl(),label:Ic(yl()),language:Ic(yl()),file:y9([Hoe("Please select a text track file."),cd({path:yl(),name:yl()})])}),Eze=cd({"track-kind":Zg(["captions","subtitles"]),"default-enable":hl(),label:Ic(yl()),language:Ic(yl()),url:Ta(yl(),qoe("Please enter a valid URL.")),"should-download":hl(),format:Ic(Zg(["vtt","srt","ass","ssa"]))}),Ize=mce(Eze),Aze=mce(Tze);function Pze(t){let e=t+"CollectionProvider",[r,n]=$1(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),a=p=>{let{scope:h,children:m}=p,v=$.default.useRef(null),b=$.default.useRef(new Map).current;return g.jsx(i,{scope:h,itemMap:b,collectionRef:v,children:m})};a.displayName=e;let o=t+"CollectionSlot",l=$.default.forwardRef((p,h)=>{let{scope:m,children:v}=p,b=s(o,m),y=Qg(h,b.collectionRef);return g.jsx(LA,{ref:y,children:v})});l.displayName=o;let c=t+"CollectionItemSlot",u="data-radix-collection-item",d=$.default.forwardRef((p,h)=>{let{scope:m,children:v,...b}=p,y=$.default.useRef(null),x=Qg(h,y),w=s(c,m);return $.default.useEffect(()=>(w.itemMap.set(y,{ref:y,...b}),()=>void w.itemMap.delete(y))),g.jsx(LA,{[u]:"",ref:x,children:v})});d.displayName=c;function f(p){let h=s(t+"CollectionConsumer",p);return $.default.useCallback(()=>{let m=h.collectionRef.current;if(!m)return[];let v=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(h.itemMap.values()).sort((b,y)=>v.indexOf(b.ref.current)-v.indexOf(y.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,n]}var Rze=N.useId||(()=>{}),Lze=0;function Mze(t){let[e,r]=N.useState(Rze());return MA(()=>{r(n=>n??String(Lze++))},[t]),e?`radix-${e}`:""}var _ze=N.createContext(void 0);function gce(t){let e=N.useContext(_ze);return t||e||"ltr"}var M8="rovingFocusGroup.onEntryFocus",Oze={bubbles:!1,cancelable:!0},eP="RovingFocusGroup",[n9,yce,Dze]=Pze(eP),[Nze,vce]=$1(eP,[Dze]),[Fze,Bze]=Nze(eP),bce=N.forwardRef((t,e)=>g.jsx(n9.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(n9.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx(Vze,{...t,ref:e})})}));bce.displayName=eP;var Vze=N.forwardRef((t,e)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=N.useRef(null),p=Qg(e,f),h=gce(s),[m=null,v]=ty({prop:a,defaultProp:o,onChange:l}),[b,y]=N.useState(!1),x=b9(c),w=yce(r),C=N.useRef(!1),[O,S]=N.useState(0);return N.useEffect(()=>{let T=f.current;if(T)return T.addEventListener(M8,x),()=>T.removeEventListener(M8,x)},[x]),g.jsx(Fze,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:m,onItemFocus:N.useCallback(T=>v(T),[v]),onItemShiftTab:N.useCallback(()=>y(!0),[]),onFocusableItemAdd:N.useCallback(()=>S(T=>T+1),[]),onFocusableItemRemove:N.useCallback(()=>S(T=>T-1),[]),children:g.jsx(wo.div,{tabIndex:b||O===0?-1:0,"data-orientation":n,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:vl(t.onMouseDown,()=>{C.current=!0}),onFocus:vl(t.onFocus,T=>{let E=!C.current;if(T.target===T.currentTarget&&E&&!b){let P=new CustomEvent(M8,Oze);if(T.currentTarget.dispatchEvent(P),!P.defaultPrevented){let R=w().filter(z=>z.focusable),I=R.find(z=>z.active),B=R.find(z=>z.id===m),M=[I,B,...R].filter(Boolean).map(z=>z.ref.current);kce(M,u)}}C.current=!1}),onBlur:vl(t.onBlur,()=>y(!1))})})}),xce="RovingFocusGroupItem",wce=N.forwardRef((t,e)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...a}=t,o=Mze(),l=s||o,c=Bze(xce,r),u=c.currentTabStopId===l,d=yce(r),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return N.useEffect(()=>{if(n)return f(),()=>p()},[n,f,p]),g.jsx(n9.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:g.jsx(wo.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:vl(t.onMouseDown,h=>{n?c.onItemFocus(l):h.preventDefault()}),onFocus:vl(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:vl(t.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){c.onItemShiftTab();return}if(h.target!==h.currentTarget)return;let m=Uze(h,c.orientation,c.dir);if(m!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let v=d().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")v.reverse();else if(m==="prev"||m==="next"){m==="prev"&&v.reverse();let b=v.indexOf(h.currentTarget);v=c.loop?zze(v,b+1):v.slice(b+1)}setTimeout(()=>kce(v))}})})})});wce.displayName=xce;var jze={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $ze(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Uze(t,e,r){let n=$ze(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return jze[n]}function kce(t,e=!1){let r=document.activeElement;for(let n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function zze(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var qze=bce,Hze=wce,Gze="Toggle",Sce=N.forwardRef((t,e)=>{let{pressed:r,defaultPressed:n=!1,onPressedChange:i,...s}=t,[a=!1,o]=ty({prop:r,onChange:i,defaultProp:n});return g.jsx(wo.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...s,ref:e,onClick:vl(t.onClick,()=>{t.disabled||o(!a)})})});Sce.displayName=Gze;var iy="ToggleGroup",[Cce,eTt]=$1(iy,[vce]),Tce=vce(),P9=$.default.forwardRef((t,e)=>{let{type:r,...n}=t;if(r==="single"){let i=n;return g.jsx(Wze,{...i,ref:e})}if(r==="multiple"){let i=n;return g.jsx(Kze,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${iy}\``)});P9.displayName=iy;var[Ece,Ice]=Cce(iy),Wze=$.default.forwardRef((t,e)=>{let{value:r,defaultValue:n,onValueChange:i=()=>{},...s}=t,[a,o]=ty({prop:r,defaultProp:n,onChange:i});return g.jsx(Ece,{scope:t.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:o,onItemDeactivate:$.default.useCallback(()=>o(""),[o]),children:g.jsx(Ace,{...s,ref:e})})}),Kze=$.default.forwardRef((t,e)=>{let{value:r,defaultValue:n,onValueChange:i=()=>{},...s}=t,[a=[],o]=ty({prop:r,defaultProp:n,onChange:i}),l=$.default.useCallback(u=>o((d=[])=>[...d,u]),[o]),c=$.default.useCallback(u=>o((d=[])=>d.filter(f=>f!==u)),[o]);return g.jsx(Ece,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:g.jsx(Ace,{...s,ref:e})})});P9.displayName=iy;var[Yze,Xze]=Cce(iy),Ace=$.default.forwardRef((t,e)=>{let{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:i=!0,orientation:s,dir:a,loop:o=!0,...l}=t,c=Tce(r),u=gce(a),d={role:"group",dir:u,...l};return g.jsx(Yze,{scope:r,rovingFocus:i,disabled:n,children:i?g.jsx(qze,{asChild:!0,...c,orientation:s,dir:u,loop:o,children:g.jsx(wo.div,{...d,ref:e})}):g.jsx(wo.div,{...d,ref:e})})}),NA="ToggleGroupItem",Pce=$.default.forwardRef((t,e)=>{let r=Ice(NA,t.__scopeToggleGroup),n=Xze(NA,t.__scopeToggleGroup),i=Tce(t.__scopeToggleGroup),s=r.value.includes(t.value),a=n.disabled||t.disabled,o={...t,pressed:s,disabled:a},l=$.default.useRef(null);return n.rovingFocus?g.jsx(Hze,{asChild:!0,...i,focusable:!a,active:s,ref:l,children:g.jsx(soe,{...o,ref:e})}):g.jsx(soe,{...o,ref:e})});Pce.displayName=NA;var soe=$.default.forwardRef((t,e)=>{let{__scopeToggleGroup:r,value:n,...i}=t,s=Ice(NA,r),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=s.type==="single"?a:void 0;return g.jsx(Sce,{...o,...i,ref:e,onPressedChange:l=>{l?s.onItemActivate(n):s.onItemDeactivate(n)}})}),Qze=P9,Zze=Pce,Jze=Xp("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Rce=N.createContext({size:"default",variant:"default"});function eqe({className:t,variant:e,size:r,children:n,...i}){return g.jsx(Qze,{"data-slot":"toggle-group","data-variant":e,"data-size":r,className:Ce("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",t),...i,children:g.jsx(Rce.Provider,{value:{variant:e,size:r},children:n})})}function aoe({className:t,children:e,variant:r,size:n,...i}){let s=N.useContext(Rce);return g.jsx(Zze,{"data-slot":"toggle-group-item","data-variant":s.variant||r,"data-size":s.size||n,className:Ce(Jze({variant:s.variant||r,size:s.size||n}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",t),...i,children:e})}function Lce({onChange:t,disabled:e,value:r}){let n=(0,$.useId)();return g.jsxs(wze,{className:"gap-4 flex flex-col px-4",children:[g.jsxs(eqe,{type:"single",onValueChange:i=>t(i),value:r,disabled:e,children:[g.jsxs(aoe,{value:"captions","aria-label":"Caption","aria-describedby":`${n}-caption-desc`,className:"px-4",children:[g.jsx(Ql,{className:"size-4"}),"Caption"]}),g.jsxs(aoe,{value:"subtitles","aria-label":"Subtitle","aria-describedby":`${n}-subtitle-desc`,className:"px-4",children:[g.jsx(Bm,{className:"size-4"}),"Subtitle"]})]}),g.jsx("p",{id:`${n}-caption-desc`,className:Ce("text-sm text-muted-foreground",r==="captions"||"hidden"),children:"This track displays the dialogue in their original language."}),g.jsx("p",{id:`${n}-subtitle-desc`,className:Ce("text-sm text-muted-foreground",r==="subtitles"||"hidden"),children:"This track translates the dialogue into the specified language."})]})}function Mce(){return g.jsxs(gl,{children:["Enter a language code (BCP 47 format recommended). ",g.jsx("br",{}),"See"," ",g.jsx("a",{href:"https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"ISO 639 language codes"})," ","for reference."]})}function _ce({onSubmit:t,renderFilePicker:e,isLoading:r=!1,disabled:n=!1,inferDefaults:i}){let s=f9({resolver:Aze,mode:"onChange",defaultValues:{"track-kind":"captions","default-enable":!1}}),a=l=>{if(!l){s.reset();return}if(!i){s.setValue("file",l),s.trigger("file");return}let c=i(l);s.reset({file:l,...c})},o=async l=>{await t?.(l)};return g.jsx($A,{...s,children:g.jsxs("form",{className:"flex flex-col gap-4",onSubmit:s.handleSubmit(o),children:[g.jsx(Xt,{control:s.control,name:"file",render:({field:{value:l,disabled:c}})=>e({value:l,onChange:a,disabled:c})}),g.jsx(Xt,{control:s.control,name:"language",render:({field:l})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Language"}),g.jsx(qr,{children:g.jsx(ti,{...l,placeholder:"e.g., en, en-US, zh-CN"})}),g.jsx(Mce,{}),g.jsx(Ii,{})]})}),g.jsx(Xt,{control:s.control,name:"label",render:({field:l})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Label"}),g.jsx(qr,{children:g.jsx(ti,{...l,placeholder:"Label will show up in the track selector"})}),g.jsx(gl,{children:"Specify a label to identify this track."}),g.jsx(Ii,{})]})}),g.jsx(pce,{className:"py-4",children:g.jsx(Xt,{control:s.control,name:"track-kind",render:({field:l})=>g.jsx(Lce,{...l})})}),g.jsx(Xt,{control:s.control,name:"default-enable",render:({field:l})=>g.jsx(hce,{...l})}),g.jsx("div",{className:"flex justify-end",children:g.jsxs(Cr,{type:"submit",disabled:r||!s.formState.isValid||n,children:[g.jsx(P0,{className:"size-4"}),r?"Loading...":"Import"]})})]})})}function R9({value:t}){let e=t?.name.split(".").slice(0,-1).join(".")??null,r=t?.name.split(".").pop()??null;return g.jsxs("div",{className:"group flex items-center justify-between py-3 px-4 gap-3 border-2 border-dashed border-border rounded-lg cursor-pointer transition-colors duration-200 hover:border-primary hover:bg-accent/50 has-focus-visible:outline-hidden has-focus-visible:ring-2 has-focus-visible:ring-ring has-focus-visible:ring-offset-2",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[t?g.jsx(Jf,{className:"size-5 text-primary shrink-0"}):g.jsx(J0,{className:"size-5 text-muted-foreground group-hover:text-primary transition-colors shrink-0"}),g.jsxs("div",{className:"flex flex-col gap-1 items-start",children:[g.jsx("div",{className:"text-sm font-medium",children:t?"Text track file selected":"Select text track file"}),g.jsx("div",{className:"text-xs text-muted-foreground",children:"Supports .srt, .vtt, .ass formats"})]})]}),t?g.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[g.jsx("div",{className:"truncate max-w-[200px] font-medium",children:e}),g.jsxs("div",{className:"text-muted-foreground bg-secondary px-2 py-1 rounded text-xs font-mono",children:[".",r]})]}):g.jsx("div",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:"Click to browse"})]})}function Oce({onChange:t,onCancel:e,children:r,disabled:n,...i}){let s=(0,$.useId)(),a=(0,$.useRef)(null);return(0,$.useEffect)(()=>{let o=a.current;if(!o||!e)return;let l=rqe(o);return o.addEventListener("cancel",e),()=>{l?.(),o.removeEventListener("cancel",e)}},[e]),g.jsxs("label",{htmlFor:s,...i,children:[r,g.jsx("input",{disabled:n,id:s,type:"file",tabIndex:0,className:"sr-only",ref:a,onChange:o=>{var l;let c=(l=o.target.files)==null?void 0:l[0];c&&t(c)}})]})}function tqe(){return"oncancel"in HTMLInputElement.prototype}function rqe(t){if(tqe())return;let e=()=>{if(document.hasFocus())window.addEventListener("focus",()=>{var r;((r=t.files)==null?void 0:r.length)===0&&t.dispatchEvent(new Event("cancel"))},{once:!0});else{console.warn("polyfill for input cancel event only works on focused windows, fallback to timeout");let r=window.setTimeout(()=>{var n;((n=t.files)==null?void 0:n.length)===0&&(console.warn("input cancel event timeout, dispatch cancel event"),t.dispatchEvent(new Event("cancel")))},3e4);t.addEventListener("change",()=>{var n;((n=t.files)==null?void 0:n.length)!==0&&window.clearTimeout(r)},{once:!0})}};return t.addEventListener("click",e),()=>{t.removeEventListener("click",e)}}function Dce({onSubmit:t,isLoading:e=!1,disabled:r=!1}){let n=f9({resolver:Ize,mode:"onChange",defaultValues:{"track-kind":"captions","default-enable":!1,"should-download":!0}}),i=async s=>{await t?.(s)};return g.jsx($A,{...n,children:g.jsxs("form",{className:"flex flex-col gap-4",onSubmit:n.handleSubmit(i),children:[g.jsx(Xt,{control:n.control,name:"url",render:({field:s})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Subtitle URL"}),g.jsx(qr,{children:g.jsx(ti,{...s,type:"url",placeholder:"https://example.com/subtitles.srt"})}),g.jsx(gl,{children:"Enter the URL of the subtitle file. Supported formats include SRT, VTT, and ASS."}),g.jsx(Ii,{})]})}),g.jsx(Xt,{control:n.control,name:"language",render:({field:s})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Language"}),g.jsx(qr,{children:g.jsx(ti,{...s,placeholder:"e.g., en, en-US, zh-CN"})}),g.jsx(Mce,{}),g.jsx(Ii,{})]})}),g.jsx(Xt,{control:n.control,name:"label",render:({field:s})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Label"}),g.jsx(qr,{children:g.jsx(ti,{...s,placeholder:"Label will show up in the track selector"})}),g.jsx(gl,{children:"Specify a label to identify this track."}),g.jsx(Ii,{})]})}),g.jsx(pce,{className:"py-4",children:g.jsx(Xt,{control:n.control,name:"track-kind",render:({field:s})=>g.jsx(Lce,{...s})})}),g.jsx(Xt,{control:n.control,name:"default-enable",render:({field:s})=>g.jsx(hce,{...s})}),g.jsx(Xt,{control:n.control,name:"format",render:({field:s})=>g.jsxs(Bs,{children:[g.jsx(Fn,{children:"Format"}),g.jsx(qr,{children:g.jsxs("select",{...s,className:"border-input data-placeholder:text-muted-foreground aria-invalid:border-destructive ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-0",children:[g.jsx("option",{value:"",children:"Infer from URL"}),g.jsx("option",{value:"srt",children:"SRT"}),g.jsx("option",{value:"vtt",children:"VTT"}),g.jsx("option",{value:"ass",children:"ASS"}),g.jsx("option",{value:"ssa",children:"SSA"})]})}),g.jsx(gl,{children:"Select the subtitle format in case it cannot be inferred from the URL."}),g.jsx(Ii,{})]})}),g.jsx(Xt,{control:n.control,name:"should-download",render:({field:{value:s,onChange:a,disabled:o}})=>g.jsxs(Bs,{className:"flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm",children:[g.jsxs("div",{className:"space-y-0.5",children:[g.jsx(Fn,{children:"Download File"}),g.jsx(gl,{children:"Download the subtitle file locally for offline use"})]}),g.jsx(qr,{children:g.jsx(Ale,{checked:s,onCheckedChange:a,disabled:o||r})})]})}),g.jsx("div",{className:"flex justify-end",children:g.jsxs(Cr,{type:"submit",disabled:e||!n.formState.isValid||r,children:[g.jsx(ep,{className:"size-4"}),e?"Loading...":"Import from URL"]})})]})})}function nqe({onClick:t}){return g.jsx(Cr,{type:"button",onClick:t,disabled:!t,size:"iconSubtitle",variant:"ghost",title:"Open in Obsidian",children:g.jsx(Su,{className:"size-4"})})}function iqe({onClick:t}){return g.jsx(Cr,{type:"button",onClick:t,disabled:!t,size:"iconSubtitle",variant:"ghost",title:"Import to Obsidian",children:g.jsx(I0,{className:"size-4"})})}function sqe({onClick:t}){return g.jsx(Cr,{type:"button",onClick:t,size:"iconSubtitle",disabled:!t,variant:"ghost",title:"Retry import",children:g.jsx(U0,{className:"size-4"})})}function aqe(){return g.jsx(Cr,{type:"button",disabled:!0,size:"iconSubtitle",variant:"ghost",title:"Importing...",children:g.jsx(to,{className:"size-4 animate-spin"})})}function oqe({status:t}){return t==="success"?g.jsx(Jl,{className:"size-4 text-green-600"}):t==="error"?g.jsx(Zl,{className:"size-4 text-red-600"}):null}function L9(t){let[e,r,...n]=t.split(/\s*-\s*/);return e===r&&n.length===0&&e?e:t.trim()}function FA(t){let[e,r]=t.split("-");return r&&!r.match(/^[a-z]{2}$/)?e:t}function _8({status:t,name:e,language:r,onImport:n,onOpen:i,onRetry:s,progress:a,type:o}){return g.jsxs("div",{className:"group relative",children:[g.jsx("div",{className:"px-3 py-2 rounded-md border hover:border-blue-300 hover:bg-blue-50 transition-all duration-200 h-14 flex items-center group-hover:shadow-sm",children:g.jsxs("div",{className:"flex items-center justify-between w-full",children:[g.jsx("div",{className:"flex-1 min-h-0 pr-3",children:g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsx("span",{className:"font-medium text-sm group-hover:text-blue-700 transition-colors",children:e?L9(e):r?FA(r):"Unknown"}),o==="upload"&&g.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-full bg-emerald-100 text-emerald-700 border border-emerald-300 hover:bg-emerald-200 transition-colors cursor-help",title:"Creator uploaded",children:g.jsx(qm,{className:"size-3"})}),o==="ast"&&g.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-full bg-orange-100 text-orange-700 border border-orange-300 hover:bg-orange-200 transition-colors cursor-help",title:"Word-level timing available",children:g.jsx(Om,{className:"size-3"})}),r&&e&&g.jsx(sle,{variant:"outline",className:"text-xs",children:FA(r)})]})}),g.jsxs("div",{className:"flex items-center gap-2 opacity-60 group-hover:opacity-100 transition-opacity",children:[g.jsx(oqe,{status:t}),t==="idle"?g.jsx(iqe,{onClick:n}):t==="importing"?g.jsx(aqe,{}):t==="success"?g.jsx(nqe,{onClick:i}):t==="error"?g.jsx(sqe,{onClick:s}):r9(t)]})]})}),g.jsx("div",{className:Ce("absolute bottom-0 left-0 right-0 opacity-0 transition-opacity duration-100 px-2",a&&a>0&&"opacity-100"),children:g.jsx("div",{className:"h-0.5 bg-gray-200 rounded-b-md overflow-hidden",children:g.jsx("div",{className:"h-full bg-blue-500 transition-all duration-300 ease-in-out",style:{width:`${a||0}%`}})})})]})}function ooe({items:t,renderItem:e,maxInitialItems:r=3,isSearching:n=!1}){let[i,s]=(0,$.useState)(!1),a=n||i||t.length<=r?t:t.slice(0,r),o=t.length-r;return g.jsxs("div",{className:"space-y-2",children:[a.map(e),!n&&!i&&o>0&&g.jsxs("button",{type:"button",onClick:()=>s(!0),className:"w-full p-3 text-sm text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded-md border border-dashed border-gray-300 hover:border-blue-300 transition-colors",children:["Show ",o," more..."]})]})}function loe({icon:t,title:e,count:r,description:n}){return g.jsxs("div",{className:"mb-3",children:[g.jsxs("h3",{className:"font-semibold text-lg flex items-center gap-2 mb-1",children:[t,e," ",g.jsxs("span",{className:"text-sm text-gray-500",children:["(",r,")"]})]}),n&&g.jsx("p",{className:"text-sm text-gray-600",children:n})]})}function lqe(t,e){return(0,$.useMemo)(()=>{var r;let n=(r=t.find(({data:o})=>o.ast===!0&&o.lang.includes("-orig")))==null?void 0:r.data,i=t.filter(({data:o})=>n&&o.id===n.id?!0:o.lang===e||o.lang.startsWith(`${e}-`)?!(o.ast===!0&&(n?.lang===e||n!=null&&n.lang.startsWith(`${e}-`))):!1).sort((o,l)=>{let c=o.data.ast,u=l.data.ast;if(c!==u)return c?1:-1;if(c&&u){let m=o.data.lang.includes("-orig"),v=l.data.lang.includes("-orig");if(m!==v)return m?-1:1}let d=!!o.data.name,f=!!l.data.name;if(d!==f)return d?-1:1;let p=o.data.name||o.data.lang,h=l.data.name||l.data.lang;return p.localeCompare(h)}),s=t.filter(o=>!o.data.ast&&!i.includes(o)),a=t.filter(o=>o.data.ast&&!i.includes(o));return{recommended:i,professional:s,timestamped:a}},[t,e])}function O8(t,e){return(0,$.useMemo)(()=>t.filter(({data:r})=>{var n;return((n=r.name)==null?void 0:n.toLowerCase().includes(e.toLowerCase()))||r.lang.toLowerCase().includes(e.toLowerCase())}),[t,e])}function Nce({subtitles:t,userLanguage:e,onImport:r,onOpen:n,onRetry:i}){let[s,a]=(0,$.useState)(""),o=lqe(t,e),l=O8(o.recommended,s),c=O8(o.professional,s),u=O8(o.timestamped,s);return g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsxs("div",{className:"relative",children:[g.jsx(H0,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 size-4"}),g.jsx(ti,{placeholder:"Search languages...",value:s,onChange:d=>a(d.target.value),className:"pl-10"})]}),l.length>0&&g.jsx("div",{className:"space-y-2",children:l.map(({data:d,state:f})=>g.jsx(_8,{status:f.status,name:d.name,language:d.lang,progress:f.status==="importing"?f.progress:void 0,type:d.ast?"ast":"upload",onImport:r?()=>r(d.id):void 0,onOpen:n?()=>n(d.id):void 0,onRetry:i?()=>i(d.id):void 0},d.id))}),c.length>0&&g.jsxs("div",{children:[g.jsx(loe,{icon:g.jsx(qm,{className:"size-4 text-emerald-600"}),title:"Creator Provided",count:c.length,description:"Subtitles uploaded by the video creator"}),g.jsx(ooe,{items:c,isSearching:!!s,renderItem:({data:d,state:f})=>g.jsx(_8,{status:f.status,name:d.name,language:d.lang,progress:f.status==="importing"?f.progress:void 0,onImport:r?()=>r(d.id):void 0,onOpen:n?()=>n(d.id):void 0,onRetry:i?()=>i(d.id):void 0},d.id)})]}),u.length>0&&g.jsxs("div",{children:[g.jsx(loe,{icon:g.jsx(Om,{className:"size-4 text-orange-600"}),title:"Word-Level Timing",count:u.length,description:"Auto-generated with precise word timing, may contain errors"}),g.jsx(ooe,{items:u,isSearching:!!s,renderItem:({data:d,state:f})=>g.jsx(_8,{status:f.status,name:d.name,language:d.lang,progress:f.status==="importing"?f.progress:void 0,onImport:r?()=>r(d.id):void 0,onOpen:n?()=>n(d.id):void 0,onRetry:i?()=>i(d.id):void 0},d.id)})]}),l.length===0&&c.length===0&&u.length===0&&s&&g.jsxs("div",{className:"text-center py-8 text-gray-500",children:[g.jsx(Bm,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),g.jsxs("p",{children:['No subtitles found for "',s,'"']}),g.jsx(Cr,{variant:"ghost",onClick:()=>a(""),className:"mt-2",children:"Clear search"})]})]})}function Fce(t,e){return t.id||`cue-${e}`}function cqe({clipboardTextSerializer:t=i=>i.content.textBetween(0,i.content.size,`
`),clipboardSerializer:e,onCopy:r,transformCopied:n}){return Ci(i=>new Ve({key:new ut("prosekit-clipboard-serializer"),props:{transformCopied:n,clipboardTextSerializer:(s,a)=>{let o=t(s,a);return r?.(o),o},clipboardSerializer:e?.(i)}}))}function uqe(){return Pg({name:"metaTag",priority:1e3,group:"block",content:"",atom:!0,selectable:!1,draggable:!1,parseDOM:[{tag:"meta[name][content]",getAttrs:t=>{let e=t.getAttribute("name"),r=t.getAttribute("content");return{name:e||"",content:r||""}}}],toDOM:t=>["meta",{name:t.attrs.name,content:t.attrs.content,style:"display: none;"}],attrs:{name:{default:"",validate:"string"},content:{default:"",validate:"string"}}})}var dqe=new Ve({key:new ut("webvtt-readonly"),props:{editable:()=>!1}});function fqe(){return Ci(dqe)}var Nn=class t{constructor({hours:e=0,minutes:r=0,seconds:n=0,milliseconds:i=0}={}){if(gA(this,"hours"),gA(this,"minutes"),gA(this,"seconds"),gA(this,"milliseconds"),!Number.isInteger(e)||e<0)throw new Error("Hours must be a non-negative integer");if(!Number.isInteger(r)||r<0||r>59)throw new Error("Minutes must be an integer between 0 and 59");if(!Number.isInteger(n)||n<0||n>59)throw new Error("Seconds must be an integer between 0 and 59");if(!Number.isInteger(i)||i<0||i>999)throw new Error("Milliseconds must be an integer between 0 and 999");this.hours=e,this.minutes=r,this.seconds=n,this.milliseconds=i}static parse(e){if(e instanceof t)return e;if(typeof e!="string")throw new Error("Invalid WebVTT timestamp format");let r=/^(?:(\d{2,}):)?([0-5]\d):([0-5]\d)\.(\d{3})$/,n=e.match(r);if(!n)throw new Error("Invalid WebVTT timestamp format");let[,i,s,a,o]=n,l=i?Number.parseInt(i,10):0,c=Number.parseInt(s,10),u=Number.parseInt(a,10),d=Number.parseInt(o,10);return new t({hours:l,minutes:c,seconds:u,milliseconds:d})}toString(){let e=[this.minutes.toString().padStart(2,"0"),this.seconds.toString().padStart(2,"0")];return this.hours>0&&e.unshift(this.hours.toString().padStart(2,"0")),`${e.join(":")}.${this.milliseconds.toString().padStart(3,"0")}`}toDate(){return new Date(this.hours*3600*1e3+this.minutes*60*1e3+this.seconds*1e3+this.milliseconds)}getTimestamp(){return this.hours*3600+this.minutes*60+this.seconds+this.milliseconds/1e3}static fromTimestamp(e){if(e<0)throw new Error("Seconds must be non-negative");let r=Math.floor(e*1e3),n=Math.floor(r/(3600*1e3)),i=Math.floor(r%(3600*1e3)/(60*1e3)),s=Math.floor(r%(60*1e3)/1e3),a=r%1e3;return new t({hours:n,minutes:i,seconds:s,milliseconds:a})}static fromDate(e){return new t({hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds(),milliseconds:e.getUTCMilliseconds()})}equals(e){return this.hours===e.hours&&this.minutes===e.minutes&&this.seconds===e.seconds&&this.milliseconds===e.milliseconds}compare(e){return this.hours!==e.hours?this.hours<e.hours?-1:1:this.minutes!==e.minutes?this.minutes<e.minutes?-1:1:this.seconds!==e.seconds?this.seconds<e.seconds?-1:1:this.milliseconds!==e.milliseconds?this.milliseconds<e.milliseconds?-1:1:0}isWithinRange(e,r){return this.compare(e)>=0&&this.compare(r)<=0}};function pqe(){return Pg({name:"webvttCue",priority:1e3,group:"block",content:"(inline|top)*",defining:!0,parseDOM:[{tag:"p[data-part='cue']",getAttrs:t=>{let e=t.dataset.id,r=t.dataset.start,n=t.dataset.end;return{id:e,start:Nn.parse(r),end:Nn.parse(n)}}}],toDOM:t=>["p",{"data-part":"cue","data-id":t.attrs.id,"data-start":t.attrs.start.toString(),"data-end":t.attrs.end.toString()},0],attrs:{id:{default:Xr(),validate:"string"},start:{default:Nn.fromTimestamp(0),validate:t=>{Nn.parse(t)}},end:{default:Nn.fromTimestamp(0),validate:t=>{Nn.parse(t)}}}})}var hqe=E5((t,e)=>{if(t.type.name==="webvttCue"){let r=t.attrs;if(!e)return{type:t.type,attrs:{...r}};let n=r.end,i=hse(n.toDate(),1);return{type:t.type,attrs:{...r,start:n,end:Nn.fromDate(i)}}}return null});function mqe(){return Fp({Enter:ol(o1,l1,c1,hqe)})}function*gqe(t){let e=0;for(let r=0;r<t.childCount;r++){let n=t.child(r);if(n.type.name!=="webvttCue")continue;let{start:i,end:s,id:a}=n.attrs;yield[n,{start:i,end:s,id:a,nodePos:e}],e+=n.nodeSize}}function yqe(){return Pg({name:"webvttTimestamp",inline:!0,group:"top",content:"inline*",selectable:!1,defining:!0,parseDOM:[{tag:"span[data-part='timestamp']",getAttrs:t=>{let e=t.dataset.time;return{time:Nn.parse(e||"0")}}}],toDOM:t=>["span",{"data-part":"timestamp","data-time":t.attrs.time.toString()}],attrs:{time:{default:Nn.fromTimestamp(0)}}})}function vqe(){return ul({insertTimestamp:t=>(e,r)=>{if(!r)return!0;let{schema:n,tr:i}=e,s=i1(n,"webvttTimestamp").createChecked({time:t}),a=i.selection.anchor;return i.replaceRange(a,a,new oe(se.from(s),0,0)),r(i),!0}})}function bqe({onTimestampClicked:t}){return hie((e,r,n,i,s,a)=>{if(!t||n.type.name!=="webvttCue")return!1;let o=n,{start:l,end:c,id:u}=o.attrs,d={start:l,end:c,id:u};for(let[f,p]of Bce(o,{nodePos:i,start:l,end:c}))if(f.from<=r&&f.to>=r)return t(s,{timespan:p,cue:d});return t(s,{timespan:null,cue:d})})}function*Bce(t,{start:e,end:r,nodePos:n}){let i=n,s=e,a=n;for(let l=0;l<t.childCount;l++){let c=t.child(l);if(c.type.name!=="webvttTimestamp"){i+=c.nodeSize;continue}let u=c.attrs.time;if(u.compare(e)<0||u.compare(r)>0){i+=c.nodeSize;continue}let d={start:s,end:u};yield[{from:a,to:i+c.nodeSize},d],i+=c.nodeSize,a=i,s=u}let o={start:s,end:r};yield[{from:a,to:n+t.nodeSize},o]}function xqe(){return _s(Ci(EA),ul({dispatchTrackChange:t=>(e,r,n)=>{var i,s;if(!r)return!0;r(e.tr.setMeta(EA,{type:"update",...t}));let a=(i=EA.getState(e))==null?void 0:i.activeCues;if(t.scrollContainer&&t.activeCues&&a&&Vce(a,t.activeCues)){let o=(s=t.activeCues.at(0))==null?void 0:s.id;if(!o)return!0;let l=n?.dom.querySelector(`[data-part="cue"][data-id="${o}"]`);if(!l||!n)return!0;let c=t.scrollContainer,u=Array.from(n.dom.querySelectorAll('[data-part="cue"]')),d=u.indexOf(l),f=0,p=Math.min(3,d);for(let y=d-p;y<d;y++)if(y>=0&&u[y]){let x=u[y].offsetHeight;f+=x}let h=l.getBoundingClientRect(),m=c.getBoundingClientRect(),v=f,b=h.top-m.top+c.scrollTop;c.scrollTo({top:b-v,behavior:"smooth"})}return!0}}))}var EA=new Ve({key:new ut("track-sync"),state:{init:(t,e)=>({decos:kr.create(t.doc??e.doc,[]),activeCues:[],currentTime:0}),apply(t,e){let r=t.getMeta(EA);if(!(r!=null&&r.type)&&!t.docChanged)return e;if(r?.type==="update"){if(!r.activeCues&&!r.currentTime||(!r.activeCues||!Vce(e.activeCues,r.activeCues))&&e.activeCues.length===0)return e;let{activeCues:n=e.activeCues,currentTime:i=e.currentTime}=r;return{decos:kr.create(t.doc,[...wqe(n,i,t.doc)]),activeCues:n,currentTime:i}}return e}},props:{decorations(t){var e;return(e=this.getState(t))==null?void 0:e.decos}}}),kA=(t,e,{className:r,...n}={})=>Zr.inline(t.from,t.to,{...n,class:r??"",nodeName:"span","data-part":"timed","data-start":e.start.toString(),"data-end":e.end.toString()});function*wqe(t,e,r){let n=t.map(s=>s.id),i=Nn.fromTimestamp(e);for(let[s,a]of gqe(r)){let o=[...Bce(s,a)];if(n.includes(a.id)){if(yield Zr.node(a.nodePos,a.nodePos+s.nodeSize,{"data-active":""}),o.length<=1)continue;for(let[l,c]of o)i.compare(c.start)<0?yield kA(l,c,{"data-future":""}):i.compare(c.end)>0?yield kA(l,c,{"data-past":""}):yield kA(l,c,{"data-current":""})}else{if(o.length<=1)continue;for(let[l,c]of o)yield kA(l,c)}}}function Vce(t,e){return t.length!==e.length||t.some(r=>!e.includes(r))}var tP=(0,$.createContext)({emitter:null,remote:null});function kqe({className:t,onKeyDown:e,onClose:r}){let[n,i]=(0,$.useState)(""),s=(0,$.useMemo)(()=>n?Wie({search:n}):null,[n]);Vp(s);let a=q5(),o=(0,$.useCallback)(l=>{e?.(l,a)},[e,a]);return g.jsx("div",{className:Ce("vtt-editor-search-container grid grid-cols-[1fr_min-content] gap-2",t),children:g.jsxs("div",{className:"vtt-editor-search-input flex items-center justify-between max-w-[48ch] w-full mx-auto gap-2",children:[g.jsx(ti,{autoFocus:!0,placeholder:"Search",type:"text",className:"h-8",value:n,onChange:l=>i(l.target.value),onKeyDown:o}),g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx(Cr,{size:"iconSm",variant:"ghost",onClick:a.commands.findPrev,children:g.jsx(x0,{className:"size-4"})}),g.jsx(Cr,{size:"iconSm",variant:"ghost",onClick:a.commands.findNext,children:g.jsx(v0,{className:"size-4"})}),g.jsx(Cr,{size:"iconSm",variant:"ghost",onClick:r,children:g.jsx(el,{className:"size-4"})})]})]})})}function Sqe(t){return t+.001}function Cqe({target:t="start"}={}){let{remote:e}=(0,$.use)(tP);return(0,$.useCallback)((r,{timespan:n,cue:i})=>{if(!e)return!1;let s=(n??i)[t].getTimestamp(),a=i[t].getTimestamp();return s===a?e.seek(Sqe(s),r):e.seek(s,r),!0},[e,t])}function jce({onDocUpdate:t,showSearch:e,editor:r,handleSearchKeyDown:n,onClose:i,...s}){return g.jsx(tP.Provider,{value:s,children:g.jsx(Tqe,{editor:r,showSearch:e,onClose:i,handleSearchKeyDown:n,onDocUpdate:t})})}function Tqe({onDocUpdate:t,showSearch:e,editor:r,handleSearchKeyDown:n,onClose:i}){let s=(0,$.useCallback)(c=>t?.(a1(c)),[t]);Oie(s,{editor:r});let a=(0,$.useRef)(null),[o,l]=(0,$.useState)(0);return(0,$.useEffect)(()=>{let c=a.current;if(!c)return;let u=()=>{let f=c.clientHeight;l(f)};u();let d=new ResizeObserver(u);return d.observe(c),()=>d.disconnect()},[]),g.jsxs(Mie,{editor:r,children:[g.jsxs("div",{className:"vtt-editor-container h-full w-full flex gap-2 flex-col",children:[e&&g.jsx(kqe,{className:"vtt-editor-search",onKeyDown:n,onClose:i}),g.jsx("div",{className:"vtt-editor-container-inner flex-1 overflow-y-auto",ref:a,children:g.jsx("div",{ref:r.mount,className:"pb-[calc(var(--editor-height)-4rem)] select-text vtt-editor mx-auto text-balance ProseMirror box-border prose prose-sm prose-p:my-1 prose-p:hover:bg-muted prose-p:rounded-md prose-p:pl-2.5 prose-p:pr-2 prose-p:py-1 prose-p:text-foreground",style:{"--editor-height":`${o}px`}})})]}),g.jsx(Eqe,{scrollContainerRef:a}),g.jsx(Iqe,{}),g.jsx(Aqe,{})]})}function Eqe({scrollContainerRef:t}){let{emitter:e}=(0,$.use)(tP),r=q5();return(0,$.useEffect)(()=>{var n=[];try{if(!r||!e)return;let a=tae(n,new DisposableStack),o=null;a.defer(()=>{o?.dispose()}),a.defer(e.on("track-change",c=>{var u=[];try{if(!c){o&&(o.dispose(),o=null),r.commands.dispatchTrackChange({activeCues:[]});return}let p=()=>{let m=c.cues,v=c.activeCues.map(b=>({id:Fce(b,m.indexOf(b))}));r.commands.dispatchTrackChange({activeCues:v,scrollContainer:t.current??r.view.dom})};p();let h=tae(u,new DisposableStack);c.addEventListener("cue-change",p),h.defer(()=>{c.removeEventListener("cue-change",p)}),o=h.move()}catch(p){var d=p,f=!0}finally{rae(u,d,f)}})),a.defer(e.on("time-update",c=>{r.commands.dispatchTrackChange({currentTime:c})}));let l=a.move();return()=>l.dispose()}catch(a){var i=a,s=!0}finally{rae(n,i,s)}},[r,e,t]),null}function Iqe(){let t=Cqe(),e=(0,$.useMemo)(()=>bqe({onTimestampClicked:t}),[t]);return Vp(e),null}function Aqe(){let{clipboardTextSerializer:t,clipboardSerializer:e,onCopy:r,transformCopied:n}=(0,$.use)(tP),i=(0,$.useMemo)(()=>cqe({clipboardTextSerializer:t,clipboardSerializer:e,onCopy:r,transformCopied:n}),[t,e,r,n]);return Vp(i),null}function $ce(){return _s(uie(),bie(),gie(),rse(),Qie(),Jie(),tse(),sse(),uqe(),nse(),mqe(),pqe(),vqe(),yqe(),xqe(),fqe(),Kie())}function Uce(t){return t.map((e,r)=>{let n=l8(e);return{type:"webvttCue",attrs:{id:Fce(e,r),start:Nn.fromTimestamp(e.startTime),end:Nn.fromTimestamp(e.endTime)},content:n.flatMap(i=>{let s=a=>a.type==="text"?[{type:"text",text:a.data}]:a.type==="timestamp"?[{type:"webvttTimestamp",attrs:{time:Nn.fromTimestamp(a.time)}},...a.children.flatMap(s)]:a.type==="b"?a.children.flatMap(s).map(o=>({...o,marks:[{type:"bold"}]})):a.type==="i"?a.children.flatMap(s).map(o=>({...o,marks:[{type:"italic"}]})):a.children?a.children.flatMap(s):[];return s(i)})}})}var zce=(0,$.createContext)({show:!0,setShow:()=>{}}),Pqe=({children:t,visible:e,defaultVisible:r=!0,onClose:n,className:i,inset:s=!1,...a})=>{let[o,l]=cle({defaultProp:r,prop:e,onChange:n});return o?g.jsx(zce.Provider,{value:{show:o,setShow:l},children:g.jsx("div",{className:Ce("flex w-full items-center justify-between gap-2 bg-primary px-4 py-2 text-primary-foreground",s&&"rounded-lg",i),...a,children:t})}):null},Rqe=({icon:t,className:e,...r})=>g.jsx("div",{className:Ce("rounded-full border border-background/20 bg-background/10 p-1 shadow-sm",e),...r,children:g.jsx(t,{size:16})}),Lqe=({className:t,...e})=>g.jsx("p",{className:Ce("flex-1 text-sm",t),...e}),Mqe=({variant:t="outline",size:e="sm",className:r,...n})=>g.jsx(Cr,{className:Ce("shrink-0 bg-transparent hover:bg-background/10 hover:text-background",r),size:e,variant:t,...n}),_qe=({variant:t="ghost",size:e="icon",onClick:r,className:n,...i})=>{let{setShow:s}=(0,$.useContext)(zce),a=o=>{s(!1),r?.(o)};return g.jsx(Cr,{className:Ce("shrink-0 bg-transparent hover:bg-background/10 hover:text-background",n),onClick:a,size:e,variant:t,...i,children:g.jsx(el,{size:18})})},Oqe=Xp("group block transition-colors",{variants:{variant:{feature:"rounded-lg py-2 px-3 hover:bg-accent/50",link:"rounded-lg py-4 px-5 space-y-3 hover:bg-accent/30"}},defaultVariants:{variant:"feature"}});function vo({icon:t,title:e,description:r,variant:n,className:i,...s}){let a=s.href?"a":"div";return g.jsx(a,{...s,"data-card":!0,className:Foe(Oqe({variant:n}),"text-card-foreground",i),children:g.jsxs("div",{className:"flex items-start gap-3",children:[t?g.jsx("div",{className:"flex-shrink-0 mt-0.5 w-fit rounded-md bg-muted/50 p-1 text-muted-foreground group-hover:text-primary transition-colors [&_svg]:size-3.5",children:t}):null,g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("h3",{className:"not-prose text-sm font-medium leading-tight mb-1 group-hover:text-primary transition-colors",children:e}),r?g.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r}):null,g.jsx("div",{className:"text-xs text-muted-foreground leading-relaxed prose-no-margin empty:hidden",children:s.children})]})]})})}function qce({onTryExample:t,onOpenNewNote:e,docBaseUrl:r}){let n=o=>new URL(`${r}${o}`).toString(),[i,s]=(0,$.useState)(!0);(0,$.useEffect)(()=>{localStorage.getItem("mx-v4-banner-dismissed")==="true"&&s(!1)},[]);let a=()=>{s(!1),localStorage.setItem("mx-v4-banner-dismissed","true")};return g.jsxs("div",{children:[i&&g.jsxs(Pqe,{inset:!0,onClose:a,children:[g.jsx(Rqe,{icon:q0}),g.jsx(Lqe,{children:"Media Extended v4.0 is here! Major stability improvements and new features"}),g.jsx(Mqe,{asChild:!0,children:g.jsxs("a",{href:n("/blog/v4-release"),target:"_blank",rel:"noopener noreferrer",children:["Learn more",g.jsx(Su,{})]})}),g.jsx(_qe,{})]}),g.jsxs("article",{className:"max-w-4xl mx-auto px-6 py-4 space-y-6",children:[g.jsxs("header",{className:"space-y-4",children:[g.jsx("h1",{className:"text-3xl font-semibold tracking-tight",children:"Welcome to Media Extended"}),g.jsx("p",{className:"text-base text-muted-foreground leading-relaxed max-w-2xl",children:"Media Extended is a Obsidian plugin that integrates, manages, and plays media files directly in your vault."})]}),g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-xs uppercase tracking-wider font-medium text-muted-foreground",children:"Quick Start"}),g.jsx("p",{className:"text-sm text-muted-foreground",children:"Let's get you started with taking timestamped notes on selected video."}),g.jsxs("ol",{className:"space-y-4",children:[g.jsxs("li",{className:"flex items-center gap-4",children:[g.jsx("div",{className:"flex items-center justify-center w-6 h-6 bg-primary text-primary-foreground rounded-full text-xs font-medium flex-shrink-0",children:"1"}),g.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[g.jsx("span",{className:"text-sm",children:"Open a media file to get started"}),g.jsxs(Cr,{size:"sm",variant:"outline",onClick:t,children:["Select media",g.jsx(E0,{})]})]})]}),g.jsxs("li",{className:"flex items-center gap-4",children:[g.jsx("div",{className:"flex items-center justify-center w-6 h-6 bg-primary text-primary-foreground rounded-full text-xs font-medium flex-shrink-0",children:"2"}),g.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[g.jsx("span",{className:"text-sm",children:"Open a new note side-by-side with the player"}),g.jsxs(Cr,{size:"sm",variant:"outline",onClick:e,children:["Open new note",g.jsx(b0,{})]})]})]}),g.jsxs("li",{className:"flex items-start gap-4",children:[g.jsx("div",{className:"flex items-center justify-center w-6 h-6 bg-primary text-primary-foreground rounded-full text-xs font-medium flex-shrink-0",children:"3"}),g.jsxs("span",{className:"text-sm leading-relaxed",children:["Click the"," ",g.jsx("div",{className:"inline-block align-text-bottom px-1",children:g.jsx(W0,{className:"size-4 "})})," ","button (timestamp button) in the top action bar of the player view while playing to add links to your notes"]})]}),g.jsxs("li",{className:"flex items-start gap-4",children:[g.jsx("div",{className:"flex items-center justify-center w-6 h-6 bg-primary text-primary-foreground rounded-full text-xs font-medium flex-shrink-0",children:"4"}),g.jsxs("span",{className:"text-sm leading-relaxed",children:["Take screenshots on the player by clicking"," ",g.jsx("div",{className:"inline-block align-text-bottom px-1",children:g.jsx(_m,{className:"size-4 "})})," ","button (screenshot button) in the top action bar of the player view"]})]})]})]}),g.jsxs("section",{className:"space-y-4 mb-4",children:[g.jsx("h2",{className:"text-xs uppercase tracking-wider font-medium text-muted-foreground",children:"Explore Features"}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[g.jsx(vo,{icon:g.jsx(R0,{}),href:n("/docs/v4/load-media"),title:"Load media",description:"Local files, remote URLs, and media-hosting services."}),g.jsx(vo,{icon:g.jsx(Eu,{}),href:n("/docs/v4/playback"),title:"Playback",description:"Control playback while taking notes"}),g.jsx(vo,{icon:g.jsx(_m,{}),href:n("/docs/v4/screenshot"),title:"Capture screenshots",description:"Capture screenshots with timestamp links"}),g.jsx(vo,{icon:g.jsx(ep,{}),href:n("/docs/v4/media-links"),title:"Links and embeds",description:"Include media links and embeds in your notes"}),g.jsx(vo,{icon:g.jsx(Jf,{}),href:n("/docs/v4/transcript"),title:"Transcripts",description:"Quick navigation using transcript and subtitles"}),g.jsx(vo,{icon:g.jsx(k0,{}),href:n("/docs/v4/template"),title:"Customize templates",description:"Customize timestamp and screenshot formats"}),g.jsx(vo,{icon:g.jsx(F0,{}),href:n("/docs/v4/recording"),title:"Recording",description:"Take notes while recording media"})]})]}),g.jsx("hr",{className:"border-t border-border mb-6"}),g.jsxs("section",{className:"space-y-4",children:[g.jsx("h2",{className:"text-xs uppercase tracking-wider font-medium text-muted-foreground",children:"Learn More"}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-4",children:[g.jsx(vo,{variant:"link",icon:g.jsx(S0,{}),href:n("/docs/v4"),title:"Explore all features",description:"Dive deep into tutorials, guides, and tips to master Media Extended"}),g.jsx(vo,{variant:"link",icon:g.jsx(Iu,{}),href:n("/blog/v4-release"),title:"What's new in v4",description:"Discover new features, improvements, and important changes from v3"}),g.jsx(vo,{variant:"link",icon:g.jsx(Su,{}),href:n("/changelog"),title:"View all updates",description:"Track every update, bug fix, and enhancement across all versions"}),g.jsx(vo,{variant:"link",icon:g.jsx(C0,{}),href:"https://github.com/aidenlx/media-extended/issues",title:"Get help & report bugs",description:"Found a problem? Need help? Let us know on GitHub"})]})]})]})]})}var Vs="subtitles",js="captions",Hce="wid",Gce=An({id:oa(ke()),format:oa(VQ),kind:oa(Pt(["subtitles","captions"])),language:oa(ke()),label:oa(ke()),isDefault:wr(),wid:oa(ke())});function M9(t){return t.type==="internal"?`link:${t.path}`:Ia(t)}function Ia(t){if(t.type==="url")return t.meta.id?`url:#${t.meta.id}`:`url:${t.src.toString()}`;if(t.type==="file")return`file:${t.src.path}`;if(t.type==="internal.resolved")return`internal:${eE(t.src)}`;Be(t)}function rP(t,e){return!t||!e?!1:Ia(t)===Ia(e)}var es=re(null),_9=re(async t=>{let e=t(es),{transcriptLoader:r}=t(Tt);if(!e)return null;let n=await r.loadAndParseTrack(e);return{id:Ia(e),node:{type:"doc",content:Uce(n.cues)}}}),nP=XQ(re(async t=>{let e=await t(_9);return e?w5({extension:$ce(),defaultContent:e.node}):null}),()=>null),H1=re(!1);var iP=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,r){this.keyToValue.set(e,r),this.valueToKey.set(r,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}};var sy=class{constructor(e){this.generateIdentifier=e,this.kv=new iP}register(e,r){this.kv.getByValue(e)||(r||(r=this.generateIdentifier(e)),this.kv.set(r,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}};var sP=class extends sy{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(e,r.allowProps),super.register(e,r.identifier)):super.register(e,r)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function Dqe(t){if("values"in Object)return Object.values(t);let e=[];for(let r in t)t.hasOwnProperty(r)&&e.push(t[r]);return e}function Wce(t,e){let r=Dqe(t);if("find"in r)return r.find(e);let n=r;for(let i=0;i<n.length;i++){let s=n[i];if(e(s))return s}}function Zp(t,e){Object.entries(t).forEach(([r,n])=>e(n,r))}function ay(t,e){return t.indexOf(e)!==-1}function O9(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(e(n))return n}}var aP=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return Wce(this.transfomers,r=>r.isApplicable(e))}findByName(e){return this.transfomers[e]}};var Nqe=t=>Object.prototype.toString.call(t).slice(8,-1),D9=t=>typeof t>"u",Fqe=t=>t===null,Jp=t=>typeof t!="object"||t===null||t===Object.prototype?!1:Object.getPrototypeOf(t)===null?!0:Object.getPrototypeOf(t)===Object.prototype,oP=t=>Jp(t)&&Object.keys(t).length===0,ko=t=>Array.isArray(t),Bqe=t=>typeof t=="string",Vqe=t=>typeof t=="number"&&!isNaN(t),jqe=t=>typeof t=="boolean",Kce=t=>t instanceof RegExp,dd=t=>t instanceof Map,fd=t=>t instanceof Set,N9=t=>Nqe(t)==="Symbol",Yce=t=>t instanceof Date&&!isNaN(t.valueOf()),Xce=t=>t instanceof Error,F9=t=>typeof t=="number"&&isNaN(t),Qce=t=>jqe(t)||Fqe(t)||D9(t)||Vqe(t)||Bqe(t)||N9(t),Zce=t=>typeof t=="bigint",Jce=t=>t===1/0||t===-1/0,eue=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),tue=t=>t instanceof URL;var B9=t=>t.replace(/\./g,"\\."),lP=t=>t.map(String).map(B9).join("."),oy=t=>{let e=[],r="";for(let i=0;i<t.length;i++){let s=t.charAt(i);if(s==="\\"&&t.charAt(i+1)==="."){r+=".",i++;continue}if(s==="."){e.push(r),r="";continue}r+=s}let n=r;return e.push(n),e};function bl(t,e,r,n){return{isApplicable:t,annotation:e,transform:r,untransform:n}}var rue=[bl(D9,"undefined",()=>null,()=>{}),bl(Zce,"bigint",t=>t.toString(),t=>typeof BigInt<"u"?BigInt(t):(console.error("Please add a BigInt polyfill."),t)),bl(Yce,"Date",t=>t.toISOString(),t=>new Date(t)),bl(Xce,"Error",(t,e)=>{let r={name:t.name,message:t.message};return e.allowedErrorProps.forEach(n=>{r[n]=t[n]}),r},(t,e)=>{let r=new Error(t.message);return r.name=t.name,r.stack=t.stack,e.allowedErrorProps.forEach(n=>{r[n]=t[n]}),r}),bl(Kce,"regexp",t=>""+t,t=>{let e=t.slice(1,t.lastIndexOf("/")),r=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,r)}),bl(fd,"set",t=>[...t.values()],t=>new Set(t)),bl(dd,"map",t=>[...t.entries()],t=>new Map(t)),bl(t=>F9(t)||Jce(t),"number",t=>F9(t)?"NaN":t>0?"Infinity":"-Infinity",Number),bl(t=>t===0&&1/t===-1/0,"number",()=>"-0",Number),bl(tue,"URL",t=>t.toString(),t=>new URL(t))];function cP(t,e,r,n){return{isApplicable:t,annotation:e,transform:r,untransform:n}}var nue=cP((t,e)=>N9(t)?!!e.symbolRegistry.getIdentifier(t):!1,(t,e)=>["symbol",e.symbolRegistry.getIdentifier(t)],t=>t.description,(t,e,r)=>{let n=r.symbolRegistry.getValue(e[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),$qe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((t,e)=>(t[e.name]=e,t),{}),iue=cP(eue,t=>["typed-array",t.constructor.name],t=>[...t],(t,e)=>{let r=$qe[e[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(t)});function V9(t,e){return t?.constructor?!!e.classRegistry.getIdentifier(t.constructor):!1}var sue=cP(V9,(t,e)=>["class",e.classRegistry.getIdentifier(t.constructor)],(t,e)=>{let r=e.classRegistry.getAllowedProps(t.constructor);if(!r)return{...t};let n={};return r.forEach(i=>{n[i]=t[i]}),n},(t,e,r)=>{let n=r.classRegistry.getValue(e[1]);if(!n)throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),t)}),aue=cP((t,e)=>!!e.customTransformerRegistry.findApplicable(t),(t,e)=>["custom",e.customTransformerRegistry.findApplicable(t).name],(t,e)=>e.customTransformerRegistry.findApplicable(t).serialize(t),(t,e,r)=>{let n=r.customTransformerRegistry.findByName(e[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(t)}),Uqe=[sue,nue,aue,iue],j9=(t,e)=>{let r=O9(Uqe,i=>i.isApplicable(t,e));if(r)return{value:r.transform(t,e),type:r.annotation(t,e)};let n=O9(rue,i=>i.isApplicable(t,e));if(n)return{value:n.transform(t,e),type:n.annotation}},oue={};rue.forEach(t=>{oue[t.annotation]=t});var lue=(t,e,r)=>{if(ko(e))switch(e[0]){case"symbol":return nue.untransform(t,e,r);case"class":return sue.untransform(t,e,r);case"custom":return aue.untransform(t,e,r);case"typed-array":return iue.untransform(t,e,r);default:throw new Error("Unknown transformation: "+e)}else{let n=oue[e];if(!n)throw new Error("Unknown transformation: "+e);return n.untransform(t,r)}};var ly=(t,e)=>{if(e>t.size)throw new Error("index out of bounds");let r=t.keys();for(;e>0;)r.next(),e--;return r.next().value};function cue(t){if(ay(t,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(ay(t,"prototype"))throw new Error("prototype is not allowed as a property");if(ay(t,"constructor"))throw new Error("constructor is not allowed as a property")}var uue=(t,e)=>{cue(e);for(let r=0;r<e.length;r++){let n=e[r];if(fd(t))t=ly(t,+n);else if(dd(t)){let i=+n,s=+e[++r]==0?"key":"value",a=ly(t,i);switch(s){case"key":t=a;break;case"value":t=t.get(a);break}}else t=t[n]}return t},uP=(t,e,r)=>{if(cue(e),e.length===0)return r(t);let n=t;for(let s=0;s<e.length-1;s++){let a=e[s];if(ko(n)){let o=+a;n=n[o]}else if(Jp(n))n=n[a];else if(fd(n)){let o=+a;n=ly(n,o)}else if(dd(n)){if(s===e.length-2)break;let l=+a,c=+e[++s]==0?"key":"value",u=ly(n,l);switch(c){case"key":n=u;break;case"value":n=n.get(u);break}}}let i=e[e.length-1];if(ko(n)?n[+i]=r(n[+i]):Jp(n)&&(n[i]=r(n[i])),fd(n)){let s=ly(n,+i),a=r(s);s!==a&&(n.delete(s),n.add(a))}if(dd(n)){let s=+e[e.length-2],a=ly(n,s);switch(+i==0?"key":"value"){case"key":{let l=r(a);n.set(l,n.get(a)),l!==a&&n.delete(a);break}case"value":{n.set(a,r(n.get(a)));break}}}return t};function $9(t,e,r=[]){if(!t)return;if(!ko(t)){Zp(t,(s,a)=>$9(s,e,[...r,...oy(a)]));return}let[n,i]=t;i&&Zp(i,(s,a)=>{$9(s,e,[...r,...oy(a)])}),e(n,r)}function due(t,e,r){return $9(e,(n,i)=>{t=uP(t,i,s=>lue(s,n,r))}),t}function fue(t,e){function r(n,i){let s=uue(t,oy(i));n.map(oy).forEach(a=>{t=uP(t,a,()=>s)})}if(ko(e)){let[n,i]=e;n.forEach(s=>{t=uP(t,oy(s),()=>t)}),i&&Zp(i,r)}else Zp(e,r);return t}var zqe=(t,e)=>Jp(t)||ko(t)||dd(t)||fd(t)||V9(t,e);function qqe(t,e,r){let n=r.get(t);n?n.push(e):r.set(t,[e])}function pue(t,e){let r={},n;return t.forEach(i=>{if(i.length<=1)return;e||(i=i.map(o=>o.map(String)).sort((o,l)=>o.length-l.length));let[s,...a]=i;s.length===0?n=a.map(lP):r[lP(s)]=a.map(lP)}),n?oP(r)?[n]:[n,r]:oP(r)?void 0:r}var U9=(t,e,r,n,i=[],s=[],a=new Map)=>{let o=Qce(t);if(!o){qqe(t,i,e);let p=a.get(t);if(p)return n?{transformedValue:null}:p}if(!zqe(t,r)){let p=j9(t,r),h=p?{transformedValue:p.value,annotations:[p.type]}:{transformedValue:t};return o||a.set(t,h),h}if(ay(s,t))return{transformedValue:null};let l=j9(t,r),c=l?.value??t,u=ko(c)?[]:{},d={};Zp(c,(p,h)=>{if(h==="__proto__"||h==="constructor"||h==="prototype")throw new Error(`Detected property ${h}. This is a prototype pollution risk, please remove it from your object.`);let m=U9(p,e,r,n,[...i,h],[...s,t],a);u[h]=m.transformedValue,ko(m.annotations)?d[h]=m.annotations:Jp(m.annotations)&&Zp(m.annotations,(v,b)=>{d[B9(h)+"."+b]=v})});let f=oP(d)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,d]:d};return o||a.set(t,f),f};function dP(t){return Object.prototype.toString.call(t).slice(8,-1)}function z9(t){return dP(t)==="Array"}function hue(t){if(dP(t)!=="Object")return!1;let e=Object.getPrototypeOf(t);return!!e&&e.constructor===Object&&e===Object.prototype}function Hqe(t){return dP(t)==="Null"}function Gqe(t,e,r,n,i){return s=>t(s)||e(s)||!!r&&r(s)||!!n&&n(s)||!!i&&i(s)}function Wqe(t){return dP(t)==="Undefined"}var NTt=Gqe(Hqe,Wqe);function Kqe(t,e,r,n,i){let s={}.propertyIsEnumerable.call(n,e)?"enumerable":"nonenumerable";s==="enumerable"&&(t[e]=r),i&&s==="nonenumerable"&&Object.defineProperty(t,e,{value:r,enumerable:!1,writable:!0,configurable:!0})}function fP(t,e={}){if(z9(t))return t.map(i=>fP(i,e));if(!hue(t))return t;let r=Object.getOwnPropertyNames(t),n=Object.getOwnPropertySymbols(t);return[...r,...n].reduce((i,s)=>{if(z9(e.props)&&!e.props.includes(s))return i;let a=t[s],o=fP(a,e);return Kqe(i,s,o,t,e.nonenumerable),i},{})}var Oe=class{constructor({dedupe:e=!1}={}){this.classRegistry=new sP,this.symbolRegistry=new sy(r=>r.description??""),this.customTransformerRegistry=new aP,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let r=new Map,n=U9(e,r,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta={...i.meta,values:n.annotations});let s=pue(r,this.dedupe);return s&&(i.meta={...i.meta,referentialEqualities:s}),i}deserialize(e){let{json:r,meta:n}=e,i=fP(r);return n?.values&&(i=due(i,n.values,this)),n?.referentialEqualities&&(i=fue(i,n.referentialEqualities)),i}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,r){this.classRegistry.register(e,r)}registerSymbol(e,r){this.symbolRegistry.register(e,r)}registerCustom(e,r){this.customTransformerRegistry.register({name:r,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Oe.defaultInstance=new Oe;Oe.serialize=Oe.defaultInstance.serialize.bind(Oe.defaultInstance);Oe.deserialize=Oe.defaultInstance.deserialize.bind(Oe.defaultInstance);Oe.stringify=Oe.defaultInstance.stringify.bind(Oe.defaultInstance);Oe.parse=Oe.defaultInstance.parse.bind(Oe.defaultInstance);Oe.registerClass=Oe.defaultInstance.registerClass.bind(Oe.defaultInstance);Oe.registerSymbol=Oe.defaultInstance.registerSymbol.bind(Oe.defaultInstance);Oe.registerCustom=Oe.defaultInstance.registerCustom.bind(Oe.defaultInstance);Oe.allowErrorProps=Oe.defaultInstance.allowErrorProps.bind(Oe.defaultInstance);var HTt=Oe.serialize,GTt=Oe.deserialize,WTt=Oe.stringify,KTt=Oe.parse,YTt=Oe.registerClass,XTt=Oe.registerCustom,QTt=Oe.registerSymbol,ZTt=Oe.allowErrorProps;function cy(t){return{mx:Oe.serialize(t)}}function pP(t){try{return Oe.deserialize(t.mx)}catch(e){return console.error("Failed to deserialize media view state",e),null}}var eh=Z(Te(),1),G1=re(null),mt=re(t=>t(G1)?.player??null,(t,e,r)=>{if(!r){e(G1,null);return}let n=t(G1);if(n?.player===r)return;let i=n?.remote??new hp;i.setPlayer(r),i.setTarget(r),e(G1,{player:r,remote:i})});function mue(){let t=Im(mt),e=Xqe();return(0,eh.useCallback)(n=>{t(n),e.current=n},[t,e])}var aEt=re(t=>({current:t(mt)})),Yqe=re({current:null});function Xqe(){return St(Yqe)}function W1(){return St(mt)}var K1=re(t=>t(G1)?.remote);function Qqe(t){let e=(0,eh.useRef)(null);e.current||(e.current=new hp);let r=W1(),n=t&&"current"in t?t.current:t;return(0,eh.useEffect)(()=>{let i=n instanceof gp?n:r,s=e.current;s.setPlayer(i??null),s.setTarget(n??null)},[r,n]),e}function gue(){return Qqe().current}var yue=()=>({emit(t,...e){for(let r=this.events[t]||[],n=0,i=r.length;n<i;n++)r[n](...e)},events:{},on(t,e){return(this.events[t]||=[]).push(e),()=>{this.events[t]=this.events[t]?.filter(r=>e!==r)}}});function th(){let t=yue();return t.once=function(r,n){let i=this.on(r,(...s)=>{i(),n(...s)});return i},t}var hP=Z(Te(),1);var bue=Z(Ge(),1);function vue(){let t=St(_9),e=St(nP),r=gue(),n=Jqe(t?.id),i=Zqe(),[s,a]=sa(H1);return e&&(0,bue.jsx)(jce,{editor:e,remote:r,emitter:n,showSearch:s,onClose:()=>{a(!1)},handleSearchKeyDown:(o,l)=>{o.key==="Enter"&&o.shiftKey?l.commands.findPrev():o.key==="Enter"&&l.commands.findNext()},...i})}function Zqe(){let{trackInfoEncoder:t}=St(Tt),e=St(es);return e?{transformCopied:(r,n)=>{let i=t.encode(e,{sourcePath:""}),s=r.content.addToEnd(n.state.schema.nodes.metaTag.create({name:"mx:track-src",content:i}));return new oe(s,r.openStart,r.openEnd)}}:{}}function Jqe(t){let e=W1(),r=(0,hP.useMemo)(()=>th(),[]);return(0,hP.useEffect)(()=>{var s=[];try{if(!e||!t)return;let n=J(s,new DisposableStack);n.defer(e.subscribe(({textTrack:c})=>{c?.id!==t?r.emit("track-change",null):r.emit("track-change",c)}));n.defer(e.subscribe(({currentTime:c})=>{r.emit("time-update",c)}));n.defer(()=>r.emit("track-change",null));let i=n.move();return()=>i.dispose()}catch(a){var o=a,l=!0}finally{ee(s,o,l)}},[e,r,t]),r}function pd(t,{sep:e="/",urlEncoded:r=!1}={}){let n=r?decodeURI:i=>i;if("basename"in t&&"extension"in t){let i=n(t.basename),s=n(t.extension);return{extension:s,basename:i,name:`${i}.${s}`}}if("name"in t)return xue(n(t.name));if("path"in t)return So(t.path,{sep:e,urlEncoded:r});if("pathname"in t)return So(t.pathname,{sep:e,urlEncoded:r});Be(t)}function xue(t){let e=t.split(".").pop();return e===t?{extension:"",basename:t,name:t}:{extension:e,basename:t.slice(0,-e.length-1),name:t}}function So(t,{sep:e="/",urlEncoded:r=!1}={}){let n=r?decodeURI(t):t,i=n.split(e).pop();return{path:n,parent:n.slice(0,-i.length-1),...xue(i)}}var gP=require("obsidian");var q9=require("obsidian");function wue(t){let e=Sue();e&&e.showItemInFolder(t)}async function kue(t){let e=Sue();if(!e)return;let r=await e.openPath(t);if(r)throw new Error(r)}function Sue(){if(!q9.Platform.isDesktopApp)return null;let t=window.electron;if(t)return q9.Platform.isMacOS?t.remote.shell:t.shell}var Cue=require("obsidian");function mP(t,{onError:e,notice:r}){return async n=>{try{await t(n)}catch(i){let s=i instanceof Error?i.message:String(i);e?.(s,i),r?(console.error(r,i),new Cue.Notice(`${r}: ${s}`)):console.error(i)}}}function yP(t,e){t.addItem(r=>r.setIcon("folder").setTitle(gP.Platform.isMacOS?"Reveal in Finder":"Show in system explorer").setSection("system").onClick(mP(()=>wue(e),{notice:"Failed to open file in file explorer"}))).addItem(r=>r.setIcon("arrow-up-right").setTitle("Open in system default player").setSection("system").onClick(mP(()=>kue(e),{notice:"Failed to open file in system player"}))).addItem(r=>r.setIcon("copy").setTitle("Copy file path").setSection("info").onClick(mP(async()=>{await navigator.clipboard.writeText(e),new gP.Notice("File path copied to clipboard")},{notice:"Failed to copy file path"})))}var $he=Z(zR(),1);function bV({atomValues:t,children:e}){return eZ(new Map(t)),e}var eS=Z(Ge(),1);function tv({children:t,target:e,shadowRootClassName:r,ctx:{store:n,isEmbed:i}={}}){var o=[];try{let s=J(o,new DisposableStack);let a=$he.default.createRoot(e);s.defer(()=>{a.unmount()});n||a.render((0,eS.jsx)(Rf,{className:r,children:t}));a.render((0,eS.jsx)(Rf,{className:r,children:(0,eS.jsx)(RQ,{store:n,children:(0,eS.jsx)(bV,{atomValues:[[wu,i]],children:t})})}));return s.move()}catch(l){var c=l,u=!0}finally{ee(o,c,u)}}var Uhe=require("obsidian");var jd=re(!0),zhe=re(t=>t(jd)?t(mt)!==null:null);function qhe(t,e){t.defer(ca((r,n)=>{var l=[];try{let i=r(es);if(!i){n(mt,null);return}if(!r(jd)){n(mt,null);return}let s=J(l,new DisposableStack);let a=(0,Uhe.debounce)(async()=>{let f=await IWe(i,e);r(mt)!==f&&(f&&EWe(i,f),n(mt,f??null))},200,!0);a();xr(s,e.app.workspace.on("active-leaf-change",a));xr(s,e.app.workspace.on("layout-change",a));let o=s.move();return()=>{o.dispose()}}catch(c){var u=c,d=!0}finally{ee(l,u,d)}},e.store))}function EWe(t,e){let r=Ia(t);e.textTracks.getById(r)?.setMode("showing")}async function IWe(t,e){let r=await e.workspaceFind.findLinkedMediaLeaf(t);return r?.view?r.view.service.player:null}var Hhe=Z(Ge(),1),qR=class{service;constructor(e){this.service=e.service}addActions(e){e.addAction("square-play","Open linked media",()=>{this.service.openLinkedMedia()})}render(e,{isEmbed:r}={}){let n=this.service.store;return tv({ctx:{store:n,isEmbed:r},target:e,shadowRootClassName:"shadow-root",children:(0,Hhe.jsx)(vue,{})})}#e(e){if(!e)return"Transcript";if(e.type==="url"){let r=pd(e.src,{urlEncoded:!0});return e.meta.label||r.name||e.meta.kind}if(e.type==="file"||e.type==="internal.resolved")return e.meta.label||e.src.name||e.meta.kind;Be(e)}registerHeaderUpdater(e){return ca(r=>{let n=r(es);e.leaf.updateHeader(),e.titleEl.setText(this.#e(n))},this.service.store)}getDisplayText(){return this.#e(this.service.store.get(es))}registerScopes(e){var i=[];try{let r=J(i,new DisposableStack);um(r,e,null,"Escape",()=>{this.service.toggleSearch(!1)});um(r,e,null,"F3",()=>{this.service.editor?.commands.findNext()});um(r,e,["Shift"],"F3",()=>{this.service.editor?.commands.findPrev()});let n=r.move();return()=>n.dispose()}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}onPaneMenu(e,r){this.service.playerSyncEnabled?e.addItem(i=>i.setTitle("Stop syncing with player").setSection("view").setIcon("lucide-refresh-cw-off").onClick(()=>{this.service.playerSyncEnabled=!1})):e.addItem(i=>i.setTitle("Sync with active player").setSection("action").setIcon("lucide-refresh-ccw").onClick(()=>{this.service.playerSyncEnabled=!0}));let n=this.service.store.get(es);n?.type==="file"&&yP(e,n.src.path)}addDisconnectAction(e){let r=e.addAction("lucide-refresh-cw-off","Stop syncing with player",()=>{this.service.store.set(jd,!1)});return r.addClass("mx-connect-action"),ca(n=>{n(jd)?r.dataset.active="":delete r.dataset.active,n(zhe)?r.dataset.connected="":delete r.dataset.connected},this.service.store)}};var rv=class{workspace;store;trackParser;trackStringifier;app;helper;#e;constructor(e){var s=[];try{let r=e.createScope();r.register({service:Wf(this),helper:ji(qR).scoped()});let n=r.cradle;this.workspace=n.workspaceOpen;this.trackParser=n.trackInfoParser;this.trackStringifier=n.trackInfoEncoder;this.app=n.app;this.store=n.store;this.store.set(Tt,n);this.helper=n.helper;let i=J(s,new DisposableStack);qhe(i,n);i.defer(()=>r.dispose());this.#e=i.move()}catch(a){var o=a,l=!0}finally{ee(s,o,l)}}[Symbol.dispose](){this.#e.dispose()}async openLinkedMedia(){let e=this.store.get(es);if(!e){new xV.Notice("No track opened");return}await this.workspace.openLinkedMediaForTrack(e,{newLeaf:"split"})||new xV.Notice("No linked media found")}get editor(){return this.store.get(nP)}toggleSearch(e){e===void 0?this.store.set(H1,r=>!r):this.store.set(H1,e)}loadFile(e){let r=this.trackParser.fileToTrack(e,{kind:"subtitles"});if(!r)throw new Error("File is not a track file");this.store.set(es,r)}loadUrl(e){this.store.set(es,r=>{let n=e?this.trackParser.urlToTrack(e,{kind:"subtitles"}):null;return rP(r,n)?r:n})}setUrlState(e){let r=pP(e);this.loadUrl(r?.src)}getUrlState(){let e=this.store.get(es);if(!e||e.type==="internal.resolved")return{};let r=this.trackStringifier.encodeUrlTrack(e);return cy({src:r})}get playerSyncEnabled(){return this.store.get(jd)}set playerSyncEnabled(e){this.store.set(jd,e)}};var wh=class extends HR.EditableFileView{allowNoFile=!1;scope;service;constructor(e,r){super(e),this.contentEl.addClasses(["mx","custom","mx-track-view"]),this.scope=new HR.Scope(this.app.scope),this.service=new rv(r),this.register(()=>this.service[Symbol.dispose]()),this.register(this.service.helper.registerScopes(this.scope)),this.service.helper.addActions(this),this.register(this.service.helper.addDisconnectAction(this))}#e=null;#t(){this.#e?.[Symbol.dispose](),this.#e=null}async onOpen(){await super.onOpen(),this.#t(),this.#e=this.service.helper.render(this.contentEl)}async onClose(){this.#t(),await super.onClose()}async onLoadFile(e){this.service.loadFile(e)}onPaneMenu(e,r){super.onPaneMenu(e,r),this.service.helper.onPaneMenu(e,r)}getIcon(){return"notepad-text"}getViewType(){return h0}canAcceptExtension(e){return ZT({extension:e})}};var GR=require("obsidian");var kh=class extends GR.ItemView{scope;navigation=!0;service;constructor(e,r){super(e),this.contentEl.addClasses(["mx","custom","mx-track-view"]),this.scope=new GR.Scope(this.app.scope),this.service=new rv(r),this.register(()=>this.service[Symbol.dispose]()),this.register(this.service.helper.registerScopes(this.scope)),this.service.helper.addActions(this),this.register(this.service.helper.addDisconnectAction(this)),this.register(this.service.helper.registerHeaderUpdater(this))}#e=null;#t(){this.#e?.[Symbol.dispose](),this.#e=null}async onOpen(){await super.onOpen(),this.#t(),this.#e=this.service.helper.render(this.contentEl)}async onClose(){this.#t(),await super.onClose()}async setState(e,r){await super.setState(e,r),this.service.setUrlState(e)}getState(){return{...super.getState(),...this.service.getUrlState()}}onPaneMenu(e,r){super.onPaneMenu(e,r),this.service.helper.onPaneMenu(e,r)}getViewType(){return Mm}getIcon(){return"notepad-text"}getDisplayText(){return this.service.helper.getDisplayText()}};function Ghe(t){let e=t.commands.commands["editor:open-search"];if(!e||!e.checkCallback)throw new Error("editor:open-search command not found");return pr(e,{checkCallback:r=>function(n){let i=t.workspace.getActiveViewOfType(wh)||t.workspace.getActiveViewOfType(kh);if(!i)return r(n);if(n)return!0;i.service.toggleSearch()}})}var tS=require("obsidian"),AWe=[{id:"flip-video-none",name:"Reset video flip",icon:"rotate-ccw-square",checkCallback(t,{mediaView:e}){if(!e?.player||po(e.player.provider))return!1;if(t)return!0;e.flip="none",new tS.Notice("Video flip reset to default")}},{id:"flip-video-horizontal",name:"Flip video horizontally (mirror)",icon:"flip-horizontal",checkCallback(t,{mediaView:e}){if(!e?.player||po(e.player.provider))return!1;if(t)return!0;e.flip="horizontal",new tS.Notice("Video flipped to horizontal (mirror)")}},{id:"flip-video-vertical",name:"Flip video vertically (upside down)",icon:"flip-vertical",checkCallback(t,{mediaView:e}){if(!e?.player||po(e.player.provider))return!1;if(t)return!0;e.flip="vertical",new tS.Notice("Video flipped to vertical (Upside down)")}},{id:"flip-video-both",name:"Flip video both ways (upside down and mirror)",icon:"rotate-cw-square",checkCallback(t,{mediaView:e}){if(!e?.player||po(e.player.provider))return!1;if(t)return!0;e.flip="both",new tS.Notice("Video flipped to both ways (upside down and mirror)")}}],Whe=AWe;var PWe="__MX_ONLINE__";function Io(){return localStorage.getItem(PWe)==="true"}var RWe=[{id:"take-timestamp",name:"Take timestamp",icon:"star",checkCallback(t,{mediaView:e,insertTarget:r}){if(!e?.player||!r)return!1;if(t)return!0;e.timestampAction.insertTimestamp({note:r})}},...[{clip:!0,idSuffix:"-clip"},{clip:!1,idSuffix:""}].flatMap(({clip:t,idSuffix:e})=>[{id:`take-screenshot${e}`,name:t?"Insert clipped screenshot to note":"Insert screenshot to note",icon:"camera",checkCallback(r,{mediaView:n,insertTarget:i}){if(!n?.supportsScreenshot||!i)return!1;if(r)return!0;n.screenshotAction.insertScreenshotEmbed({note:i,clip:t})}},{id:`copy-screenshot${e}`,name:t?"Copy clipped screenshot":"Copy screenshot",icon:"copy",checkCallback(r,{mediaView:n}){if(!n?.supportsScreenshot)return!1;if(r)return!0;n.screenshotAction.copyScreenshot({clip:t})}},{id:`save-screenshot${e}`,name:t?"Save clipped screenshot":"Save screenshot",icon:"camera",checkCallback(r,{mediaView:n}){if(!n?.supportsScreenshot)return!1;if(r)return!0;n.screenshotAction.saveScreenshot({clip:t})}},{id:`set-cover${e}`,name:t?"Set clipped screenshot as media cover":"Set current screenshot as media cover",icon:"image",checkCallback(r,{mediaView:n}){if(!n?.supportsScreenshot)return!1;if(r)return!0;n.screenshotAction.setAsCover({clip:t})}}]),{id:"reset-clip",name:"Reset media clip",icon:"square-scissors",checkCallback(t,{mediaView:e}){if(!e?.canResetTimestamp)return!1;if(t)return!0;e.resetTimestamp()}}];function wV(){let t=[...RWe];return Io()&&t.push({id:"extract-text",name:"Extract text from screenshot",icon:"text",checkCallback(e,{mediaView:r}){if(!r?.supportsScreenshot)return!1;if(e)return!0;r.screenshotAction.extractTextToClipboard()}}),t}var LWe=[{id:"toggle-play",name:"Play/pause",icon:"play",callback(t){t.remoter.togglePaused()}},{id:"play",name:"Play",icon:"play",callback(t){t.remoter.play()}},{id:"pause",name:"Pause",icon:"pause",callback(t){t.remoter.pause()}},...[.5,1,2,5,10,30,60].flatMap(t=>[{id:`forward-${t}s`,name:`Forward ${t}s`,icon:"forward",repeatable:!0,callback(e){e.remoter.seekForward(t)}},{id:`rewind-${t}s`,name:`Rewind ${t}s`,icon:"rewind",repeatable:!0,callback(e){e.remoter.seekBackward(t)}},{id:"toggle-mute",name:"Mute/unmute",icon:"volume-x",callback(e){e.remoter.toggleMuted()}},{id:"toggle-fullscreen",name:"Enter/exit fullscreen",icon:"expand",checkCallback(e,r){if(e)return!!r.player?.state.canFullscreen;r.remoter.toggleFullscreen()}}])];function kV(){return LWe.map(t=>({id:t.id,name:t.name,icon:t.icon,repeatable:t.repeatable,checkCallback:(e,{mediaView:r})=>{if(!r)return!1;if(t.checkCallback)return t.checkCallback(e,r);if(t.callback){if(e)return!0;t.callback(r)}}}))}var Po=require("obsidian");var MWe=new Set(["https://www.youtube-nocookie.com","https://www.youtube.com"]);function Khe(t,e){return(t.source===null||!e||t.source===e.contentWindow)&&MWe.has(t.origin)}var _We=Ee(ke(),u0(),An({event:Pt(["initialDelivery"]),info:An({availablePlaybackRates:Wl(hr()),videoData:An({title:ke(),author:ke(),video_id:Ee(ke(),gi())})})})),$d=fn(re(),(t,e)=>{let r=t(Kt),n=t(mt);if(!ua(r)){e($d,null);return}let i=s=>{if(!(Bu(n?.provider)&&Khe(s)))return;let a=Pn(_We,s.data);if(!a.success)return;let{videoData:{title:o,author:l,video_id:c},availablePlaybackRates:u}=a.output.info;e($d,{title:o,author:l,video_id:c,availablePlaybackRates:u})};return window.addEventListener("message",i),()=>{window.removeEventListener("message",i)}});var qt=fn(re(null),(t,e)=>{var l=[];try{let r=t(Kt);let{mediaLib:n,app:{vault:i}}=t(Tt);if(!r)return;let s=f=>{e(qt,f??null)};s(n.getMediaMeta(r)?.meta);let a=J(l,new DisposableStack);a.defer(n.on("media-meta-changed",f=>{da(f.src,r)&&s(n.getMediaMeta(r)?.meta)}));a.defer(n.on("media-meta-removed",f=>{da(f.src,r)&&s(null)}));r.type==="file"&&xr(a,i.on("rename",f=>{f===r.file&&s(n.getMediaMeta(r)?.meta)}));let o=a.move();return()=>o.dispose()}catch(c){var u=c,d=!0}finally{ee(l,u,d)}});var WR=[.25,.5,.75,1,1.25,1.5,1.75,2,3,5],Yhe=re(t=>{let e=t(Kt);return ua(e)?t($d)?.availablePlaybackRates??[.25,.5,.75,1,1.25,1.5,1.75,2]:WR}),Xhe=re(t=>{let e=t(jt)?.playbackRate,r=t(qt)?.playbackRate;return e??r??1});var Zhe=require("obsidian");function SV(t){return new Promise(e=>setTimeout(e,t))}var Qhe=Symbol("loading"),CV=class{#e=null;setMessage(e){this.#e?this.#e.setMessage(e):this.#e=new Zhe.Notice(e,0)}[Symbol.dispose](){this.#e?.hide()}};async function OWe(t,e){var l=[];try{let{loading:r,loadingDelay:n=200,successDuration:i=2e3,errorDuration:s=4e3,throwAborted:a=!1}=e;let o=J(l,new CV);if(r)try{let f=n>0?SV(n):Promise.resolve();await Promise.race([t,f.then(()=>Qhe)])===Qhe&&o.setMessage(r)}catch{}try{let f=await t,p=typeof e.success=="function"?e.success(f):e.success;if(!p)return;o.setMessage(p),await SV(i)}catch(f){if(!a&&kt.test(f)||e.error===void 0)return;let p=typeof e.error=="function"?e.error(f instanceof Error?f.message:typeof f=="string"?f:"Unknown error",f):e.error;if(console.error(p instanceof DocumentFragment?p.textContent:p,f),!p)return;o.setMessage(p),await SV(s)}}catch(c){var u=c,d=!0}finally{ee(l,u,d)}}async function gt(t,{swallowError:e=!0,...r}){try{OWe(t,r).catch(()=>{});let n=await t;if(!e)return n}catch(n){if(e)return;throw n}}var TV=require("obsidian");var Jhe=require("obsidian"),eme=Z(zR(),1);var tme=Z(Ge(),1),Gc=class extends Jhe.Modal{#e;constructor(e){super(e),this.modalEl.addClass("mx","mx-dialog"),this.#e=Promise.withResolvers(),this.#e.promise.catch(()=>{}).finally(()=>{this.close()})}resolveWith(e){this.#e.resolve(e)}rejectWith(e){this.#e.reject(e)}onClose(){this.#e.reject(new kt),super.onClose()}async requestInput(){return this.open(),await this.#e.promise}},si=class extends Gc{#e=null;async onOpen(){var i=[];try{await super.onOpen();let e=J(i,new DisposableStack);let r=eme.default.createRoot(this.contentEl);e.defer(()=>{r.unmount()});let n=this.getShadowRootClassName?.();r.render((0,tme.jsx)(Rf,{className:n,children:await this.renderContent()}));this.#e=e.move()}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}onClose(){this.#e?.[Symbol.dispose](),super.onClose()}};var nv=class extends Gc{#e;constructor(e,r){super(e),this.#e=r,this.containerEl.addClass("mx-playback-prompt"),this.titleEl.setText("Playback Speed")}onOpen(){let{contentEl:e}=this,r=e.createEl("form",{},n=>{n.createEl("input",{type:"number",placeholder:"Enter a number between 0 and 10",attr:{min:.1,max:10,step:.1,width:100,required:!0,name:"playback-speed"}}),n.createEl("button",{attr:{type:"submit"},text:"Submit"})});r.oninvalid=n=>{n.preventDefault(),new TV.Notice("Invalid playback rate")},r.onsubmit=n=>{n.preventDefault();let i=new FormData(r),s=Number(i.get("playback-speed").toString());if(!this.#e(s)){new TV.Notice("Invalid playback rate");return}this.resolveWith(s)}}};var EV=class{#e=null;notify(e,{autoHide:r=!0}={}){!this.#e||this.#e.messageEl.isConnected===!1?this.#e=new Po.Notice(e,0):this.#e.setMessage(e),r&&this.autoHide()}autoHide=(0,Po.debounce)(()=>this.#e?.hide(),2e3,!0);dismiss(){this.#e?.hide()}};function IV(){let t=new EV,e=WR.map(n=>({id:`set-speed-${n}x`,name:n===1?"Reset playback speed":`Set playback speed to ${n}x`,icon:"gauge",checkCallback:(i,s)=>{if(!s.mediaView?.isValidSpeed(n))return!1;if(i)return!0;s.mediaView.remoter.setPlaybackRate(n),t.notify(`Speed set to ${n}x`)}}));return[...WR.filter(n=>n>1).map(r),...e,{id:"increase-speed",name:"Increase playback speed",icon:"arrow-up",checkCallback:(n,{mediaView:i})=>{if(!i?.player?.state)return!1;if(n)return!0;let s=i.player.state.playbackRate;if(!i.isValidSpeed(s)){new Po.Notice("Cannot increase speed further");return}let a=i.speedOptions.find(o=>o>s);i.remoter.setPlaybackRate(a),t.notify(`Speed increased to ${a}x`)}},{id:"decrease-speed",name:"Decrease playback speed",icon:"arrow-down",checkCallback:(n,{mediaView:i})=>{if(!i?.player?.state)return!1;if(n)return!0;let s=i.player.state.playbackRate;if(!i.isValidSpeed(s)){new Po.Notice("Cannot decrease speed further");return}let a=i.speedOptions.toReversed().find(o=>o<s);i.remoter.setPlaybackRate(a),t.notify(`Speed decreased to ${a}x`)}},{id:"set-speed",name:"Set playback speed to custom value",icon:"gauge",checkCallback:(n,{mediaView:i})=>{if(!i)return!1;if(n)return!0;let s=i.remoter;gt(new nv(i.app,a=>i.isValidSpeed(a)).requestInput().then(a=>(s.setPlaybackRate(a),a)),{success:a=>`Speed set to ${a}x`,error:a=>`Cannot set speed: ${a}`})}},{id:"increase-speed-granular",name:"Fine-tune increase playback speed",icon:"arrow-up",checkCallback:(n,{mediaView:i})=>{if(!i?.player?.state)return!1;if(n)return!0;let s=i.player.state.playbackRate;if(!i.isValidSpeed(s)){new Po.Notice("Cannot increase speed further");return}i.settings.loaded.then(a=>{let o=a["playback.speed-step"],l=Math.round((s+o)*100)/100;if(!i.isValidSpeed(l)){new Po.Notice("Cannot increase speed further");return}i.remoter.setPlaybackRate(l),t.notify(`Speed increased to ${l}x`)})}},{id:"decrease-speed-granular",name:"Fine-tune decrease playback speed",icon:"arrow-down",checkCallback:(n,{mediaView:i})=>{if(!i?.player?.state)return!1;if(n)return!0;let s=i.player.state.playbackRate;if(!i.isValidSpeed(s)){new Po.Notice("Cannot decrease speed further");return}i.settings.loaded.then(a=>{let o=a["playback.speed-step"],l=Math.round((s-o)*100)/100;if(!i.isValidSpeed(l)){new Po.Notice("Cannot decrease speed further");return}i.remoter.setPlaybackRate(l),t.notify(`Speed decreased to ${l}x`)})}}];function r(n){let i=!1,s=o=>{i&&(o.remoter.setPlaybackRate(1),t.dismiss(),i=!1)},a=(0,Po.debounce)(s,1e3,!0);return{id:`fast-forward-${n}x`,name:`Fast forward at ${n}x by holding hotkey`,icon:"forward",repeatCallbacks:{check:o=>!!o.mediaView?.isValidSpeed(n),onKeyDown:(o,{mediaView:l})=>{o.repeat&&(i||(i=!0,l.remoter.setPlaybackRate(n),t.notify(`Fast forwarding at ${n}x`,{autoHide:!1})),a(l))},onKeyUp:(o,{mediaView:l})=>{s(l)}}}}}var rme=require("obsidian");function nme({onKeyDown:t,onTrigger:e,onKeyUp:r}){var o=[];try{let n=J(o,new DisposableStack);let i=null;let s=new Set;n.defer(()=>{for(let d of s)window.removeEventListener("keyup",d,{capture:!0})});cm(n,window,"keydown",d=>{if(!i)return;let f=d.target;if(f.instanceOf(HTMLElement)&&f.matches("input.prompt-input"))return;let p=d;if(t(d,...i),r){let h=i,m=v=>{let b=DWe(p);(v.code===p.code&&b.every(y=>rme.Keymap.isModifier(v,y))||b.some(y=>v.key===y))&&(r(v,...h),window.removeEventListener("keyup",m,{capture:!0}),s.delete(m))};s.add(m),window.addEventListener("keyup",m,{passive:!0,capture:!0})}i=null},!0);let a=n.move();return{callback:(...d)=>{i=d,setTimeout(()=>{i===null||(e?.(...d),i=null)},0)},[Symbol.dispose]:()=>a.dispose()}}catch(l){var c=l,u=!0}finally{ee(o,c,u)}}function DWe(t){let e=[];return t.ctrlKey&&e.push("Ctrl"),t.altKey&&e.push("Alt"),t.shiftKey&&e.push("Shift"),t.metaKey&&e.push("Meta"),e}var KR=class{plugin;app;mediaLib;templateInsertion;workspaceFind;constructor(e){this.plugin=e.plugin,this.app=e.app,this.mediaLib=e.mediaLib,this.templateInsertion=e.templateInsertion,this.workspaceFind=e.workspaceFind,this.addMediaCommands(kV()),this.addMediaCommands(IV()),this.addMediaCommands(Whe),this.addMediaCommands(wV()),this.addMediaCommand({id:"update-metadata",name:"Update media metadata",icon:"tag",checkCallback:(r,{media:n})=>{if(!e.metadataUpdater.supportUpdate(n))return!1;if(r)return!0;e.metadataUpdater.updateMetadata(n)}}),this.addMediaCommand({id:"edit-metadata",name:"Edit media metadata",icon:"hash",callback:r=>{e.metadataUpdater.editMetadata(r.media)}}),this.plugin.register(Ghe(this.app)),this.addGlobalCommand({id:"mx:migrate-media-uid",name:"Migrate media notes from old format",callback:async()=>{await e.mediaUidMigrator.migrate()}}),this.addGlobalCommand({id:"mx:show-password-manager",name:"Show password manager",checkCallback:r=>{if(!YR.Platform.isDesktopApp)return!1;if(r)return!0;e.passwordManagerModal.open()}})}addGlobalCommand(e){this.plugin.addCommand(e)}addMediaCommands(e){for(let r of e)this.addMediaCommand(r)}addMediaCommand(e){let r=this.#e(e);r&&(this.plugin.register(()=>r[Symbol.dispose]()),this.plugin.addCommand({...Yf(e,["id","name","hotkeys","icon","mobileOnly"]),repeatable:!!e.repeatCallbacks||e.repeatable,checkCallback:r.checkCallback}))}#e({repeatCallbacks:e,checkCallback:r,callback:n}){if(e){let{onKeyDown:i,onKeyUp:s,onTrigger:a,check:o}=e,l=nme({onKeyDown:i,onKeyUp:s,onTrigger:a});return{checkCallback:c=>{let u=this.#r();if(!u)return!1;if(c)return o?.(u)??!0;l.callback(u)},[Symbol.dispose]:()=>l[Symbol.dispose]()}}return r?{checkCallback:i=>{let s=this.#r();return s?r(i,s):!1},[Symbol.dispose]:()=>{}}:n?{checkCallback:i=>{let s=this.#r();if(!s)return!1;if(i)return!0;n(s)},[Symbol.dispose]:()=>{}}:null}#t(){let e=this.workspaceFind.getMostRecentEditorLeaf()?.view;return e?{file:e.file,editor:e.editor}:null}#r(){let e=this.app.workspace,r=this.workspaceFind.getActiveMediaView(),n=this.#t();if(r?.service.media)return{media:r.service.media,mediaView:r.service,note:null,insertTarget:n};let i=e.getActiveViewOfType(YR.MarkdownView);if(i?.file){let u=this.mediaLib.findMediaByNote(i.file);if(u){let d=this.workspaceFind.findMediaLeavesWithSameMedia(u.src).filter(o0).sort(zl(Xo)).at(0);return d?.view?{media:u.src,mediaView:d.view.service,note:i.file,insertTarget:{file:i.file,editor:i.editor}}:null}}let s=this.workspaceFind.getAllMediaLeaves(),a=s.filter(u=>u.pinned).filter(o0).sort(zl(Xo)).at(0);if(a?.view.service.media){let u=a.view.service.media;return{media:u,mediaView:a.view.service,note:this.mediaLib.findNoteByMedia(u),insertTarget:n}}let{activeTabGroup:o}=e,l=o?s.filter(u=>!o.children.includes(u.leaf)):s;l.sort(zl(l0,Xo));let c=l.at(0)?.view?.service;return c?.media?{media:c.media,mediaView:c,note:this.mediaLib.findNoteByMedia(c.media),insertTarget:n}:null}};function ot(t,{lifetime:e=qn.SINGLETON,...r}={}){return ji(t,{...r,lifetime:e}).disposer(NWe)}function NWe(t){typeof t!="object"||t===null||(Symbol.dispose in t&&typeof t[Symbol.dispose]=="function"?t[Symbol.dispose]():Symbol.asyncDispose in t&&typeof t[Symbol.asyncDispose]=="function"&&t[Symbol.asyncDispose]())}var nS=require("obsidian");var ime={host:"baidu-pan",variant:"video",chromeTabQuery:["*://pan.baidu.com/pfile/video?*"],pattern:{hostname:"pan.baidu.com",pathname:"/pfile/video",searchParams:{path:!0}},parse(t){let e=t.searchParams.get("path");return e?{host:this.host,type:"video",path:e}:null}};var sme=[ime];function ame(t){let e=new URLSearchParams({path:t.path});return new URL(`https://pan.baidu.com/pfile/video?${e.toString()}`)}function Sh(t,e=0){if(!t)return null;let r=Number.parseInt(t.slice(e),10);return Number.isNaN(r)?null:r}function XR(t){if(!t)return null;let e=Number.parseFloat(t);return Number.isNaN(e)?null:e}function QR(t){let e=t.get("t");return{t:XR(e)}}var ome={pattern:{hostname:"{*.}?bilibili.com",pathname:"/bangumi/play/:id{/}?"},host:"bilibili",variant:"bangumi",chromeTabQuery:["*://www.bilibili.com/bangumi/play/*"],parse(t,e){let r=e("pathname","id"),n=QR(t.searchParams);return r.startsWith("ss")?{host:this.host,type:"ssid",ssid:r,...n}:r.startsWith("ep")?{host:this.host,type:"epid",epid:r,...n}:null}};var lme={pattern:{hostname:"b23.tv",pathname:"/:uid{/}?"},host:"bilibili",variant:"short-uri",chromeTabQuery:["*://b23.tv/*"],parse(t,e){return{host:this.host,type:"short-uri",uid:e("pathname","uid")}}};var cme={host:"bilibili",variant:"vid",pattern:{hostname:"{*.}?bilibili.com",pathname:"/video/:id{/}?"},chromeTabQuery:["*://www.bilibili.com/video/*"],parse(t,e){let r=e("pathname","id"),n=Sh(t.searchParams.get("p")),i=QR(t.searchParams);if(r.startsWith("BV"))return{host:this.host,type:"bvid",bvid:r,page:n??1,...i};if(r.startsWith("av")){let s=Sh(r,2);return s===null?null:{host:this.host,type:"aid",aid:s,page:n??1,...i}}return null}};var ume=[cme,ome,lme];function dme(t,e){let r;return t.type==="aid"?r=new URL(`https://www.bilibili.com/video/av${t.aid}`):t.type==="bvid"?r=new URL(`https://www.bilibili.com/video/${t.bvid}`):t.type==="epid"?r=new URL(`https://www.bilibili.com/bangumi/play/${t.epid}`):t.type==="ssid"?r=new URL(`https://www.bilibili.com/bangumi/play/${t.ssid}`):Be(t),e&&Qi(e)&&r.searchParams.set("t",String(e.start)),r}var fme=[{hostname:"www.coursera.org",pathname:"/learn/:course_id/lecture/:lecture_id/"},{hostname:"www.coursera.org",pathname:"/learn/:course_id/lecture/:lecture_id/:lecture_label?"}].map(t=>({host:"coursera",variant:"lecture",pattern:t,chromeTabQuery:["*://www.coursera.org/learn/*/lecture/*"],parse(e,r){return{host:this.host,type:"lecture",courseId:r("pathname","course_id"),lectureId:r("pathname","lecture_id"),lectureLabel:r("pathname","lecture_label")}}}));var pme=[...fme];function hme(t){return new URL(`https://www.coursera.org/learn/${t.courseId}/lecture/${t.lectureId}`)}function an(t){if(!t)return null;if(t instanceof URL)return t;try{return new URL(t)}catch{return null}}var ZR=class{#e;#t;constructor(e){this.#e=new Map,this.#t=new Map;for(let r of e){let{searchParams:n,...i}=r.pattern,s=new URLPattern(i);if(this.#e.set(s,r),i.hostname){let a=new URLPattern({hostname:i.hostname});this.#t.set(a,r)}}}matchHost(e){let r=an(e);if(!r)return!1;for(let[n]of this.#t)if(n.test(r))return!0;return!1}parse(e){let r=an(e);if(!r)return null;for(let[n,i]of this.#e){if(!n.test(r)||i.pattern.searchParams&&Object.entries(i.pattern.searchParams).some(([o,l])=>typeof l=="boolean"?r.searchParams.has(o)!==l:r.searchParams.get(o)!==l))continue;let s=n.exec(r),a=i.parse(r,(o,l)=>s[o].groups[l]);if(a)return{host:i.host,variant:i.variant,vid:a}}return null}};function iv(t){if(!t)return null;let e=XR(t);if(e===null)return e;let r=/^(?:(?<h>\d+)h)?(?:(?<m>\d+)m)?(?:(?<s>\d+)s)?$/,n=t.match(r);if(!n)return null;let{h:i,m:s,s:a}=n.groups,o=Sh(i)??0,l=Sh(s)??0,c=Sh(a)??0;return o*3600+l*60+c}function JR(t){let r=new URLSearchParams(t.hash.replace(/^#/,"")).get("t");return{t:iv(r)}}var mme={host:"vimeo",variant:"embed",pattern:{hostname:"player.vimeo.com",pathname:"/video/:id{/}?"},chromeTabQuery:["*://player.vimeo.com/video/*"],parse(t,e){let r=e("pathname","id");return r?{host:this.host,type:"video",vid:r,...JR(t)}:null}};var gme={host:"vimeo",variant:"video",pattern:{hostname:"{*.}?vimeo.com",pathname:"/:id{/}?"},chromeTabQuery:["*://vimeo.com/*"],parse(t,e){let r=e("pathname","id");return!r||t.pathname.startsWith("/channels/")||r==="video"?null:{host:this.host,type:"video",vid:r,...JR(t)}}};var yme=[gme,mme];function vme(t){return new URL(`https://vimeo.com/${t.vid}`)}function sv(t){let e=t.get("t"),r=t.get("start"),n=t.get("end");return{t:iv(e),start:iv(r),end:iv(n)}}function eL(t){return t.toFixed(0)}var bme={pattern:{hostname:"{*.}?youtube.com",pathname:"/(embed|shorts|v)/:id{/}?"},host:"youtube",chromeTabQuery:["*://youtube.com/embed/*","*://youtube.com/shorts/*","*://www.youtube.com/embed/*","*://www.youtube.com/shorts/*"],variant:"pathname",parse(t,e){return{host:this.host,vid:e("pathname","id"),...sv(t.searchParams)}}};var xme={pattern:{hostname:"youtu.be",pathname:"/:id{/}?"},chromeTabQuery:["*://youtu.be/*"],host:"youtube",variant:"short-uri",parse(t,e){return{host:this.host,vid:e("pathname","id"),...sv(t.searchParams)}}};var wme={host:"youtube",variant:"watch",pattern:{hostname:"{*.}?youtube.com",pathname:"/watch",searchParams:{v:!0}},chromeTabQuery:["*://www.youtube.com/watch?*","*://youtube.com/watch?*"],parse(t){return t.searchParams.has("v")?{host:this.host,vid:t.searchParams.get("v"),...sv(t.searchParams)}:null}};var kme=[wme,bme,xme];function Sme(t,e){let r=new URL(`https://www.youtube.com/watch?v=${t.vid}`);return e?Qi(e)||e.start>0&&e.start===e.end?(r.searchParams.set("t",eL(e.start)),r):(e.start>0&&r.searchParams.set("start",eL(e.start)),e.end>0&&r.searchParams.set("end",eL(e.end)),r):r}function Cme(t){if(!Bt(t))return t;let e=t.pathname.match(/^\/(?<drive>[A-Z]+):(?<path>.+)/i);if(!e)return t;let{drive:r,path:n}=e.groups;if(!n.includes("%5C"))return t;let s=decodeURIComponent(n).replace(/\\+/g,"/");return new URL(`file:///${r}:${s}`)}var Tme=new ZR([...kme,...yme,...sme,...ume,...pme]);function rS(t,e={}){let r=new URL(t);return Bt(r)&&(r=Cme(r)),r.searchParams.sort(),r.hash=Zu(e).toString(),r}function Bt(t){return t.protocol==="file:"}function Ud(t,e={}){let r,n=e.tempFragment;return t.host==="youtube"?r=Sme(t,n):t.host==="bilibili"?r=dme(t,n):t.host==="coursera"?r=hme(t):t.host==="baidu-pan"?r=ame(t):t.host==="vimeo"?r=vme(t):Be(t),r.hash=Zu(e).toString(),r}var Eme=require("obsidian");function Ime(t,e,r){if(!e)return zd(t)??!1;let n=zd(t);return r.click===null?n??!1:n===void 0||n===!1?r.click:r.alt!==null&&n===r.click?r.alt:n}function qd(t){let e=Eme.Keymap.isModEvent(t);return zd(e)}function zd(t){return t===!0?"tab":t}var tL=require("obsidian");function rL(t){if(tL.Platform.isDesktopApp&&!(0,tL.requireApiVersion)("1.9.0")){require("electron").shell.openExternal(t);return}window.open(t,"external")}var FWe=re(1),Ame=$i(t=>{let e=t(FWe);t(K1)?.changeAudioGain(e,new Event("audio-gain-change"))}),Pme=$i(t=>{let e=t(K1);if(!e)return;let r=t(jt),n=r?.audioGain,i=t.peek(qt),s=i?.audioGain;e.changeAudioGain(n??s??1,new rE({hash:r,noteMeta:i}))}),Rme=[{value:1,label:"Normal"},{value:1.1,label:"+10%"},{value:1.25,label:"+25%"},{value:1.5,label:"+50%"},{value:1.75,label:"+75%"},{value:2,label:"+100%"},{value:2.5,label:"+150%"},{value:3,label:"+200%"}];var AV=require("obsidian");var nL=class extends Gc{constructor(e){super(e),this.containerEl.addClass("mx-gain-prompt"),this.titleEl.setText("Audio Gain")}onOpen(){let{contentEl:e}=this,r=e.createEl("div",{cls:"mx-gain-description"});r.createEl("p",{text:"Adjust the audio gain (volume amplification) for this media. The gain value is a multiplier applied to the audio output."});let n=r.createEl("div",{cls:"mx-gain-examples"});n.createEl("p",{text:"Examples:",cls:"mx-gain-examples-title"});let i=n.createEl("ul");i.createEl("li",{text:"1.0 = Normal volume (100%)"}),i.createEl("li",{text:"1.5 = 50% louder (+50%)"}),i.createEl("li",{text:"2.0 = Double volume (+100%)"}),i.createEl("li",{text:"0.5 = Half volume (50%)"}),r.createEl("p",{text:"Note: Values above 1.0 may cause audio distortion at high levels.",cls:"mx-gain-note"});let s=e.createEl("form",{},a=>{a.createEl("label",{text:"Audio Gain Value:",attr:{for:"audio-gain"}}),a.createEl("input",{type:"number",placeholder:"e.g., 1.5 for +50% volume",attr:{min:.1,max:10,step:.1,width:100,required:!0,name:"audio-gain",id:"audio-gain"}}),a.createEl("button",{attr:{type:"submit"},text:"Apply Audio Gain"})});s.oninvalid=a=>{a.preventDefault(),new AV.Notice("Invalid audio gain value. Please enter a number between 0.1 and 10.")},s.onsubmit=a=>{a.preventDefault();let o=new FormData(s),l=Pn(wc,Number(o.get("audio-gain").toString()));if(!l.success){new AV.Notice("Invalid audio gain value. Please enter a number between 0.1 and 10.");return}this.resolveWith(l.output)}}};function Lme(t,e){let r=e.player?.state,n=e.remoter;t.addItem(i=>{let s=i.setSection("action").setIcon("volume-2").setTitle(r?.audioGain?`Audio ${r.audioGain}x`:"Audio Gain").setDisabled(!r?.canSetAudioGain).setSubmenu();for(let{label:a,value:o}of Rme)s.addItem(l=>{l.setTitle(a).setChecked((r?.audioGain??1)===o).setDisabled(!r).onClick(c=>{n.setAudioGain(o,c)})});s.addItem(a=>{a.setTitle("Custom").setIcon("settings").onClick(()=>{gt(new nL(e.app).requestInput().then(o=>(n.setAudioGain(o),o)),{success:o=>`Audio gain set to ${o}`,error:o=>`Cannot set audio gain: ${o}`})})})})}function Mme(t,e){!e.player||po(e.player.provider)||t.addItem(r=>r.setTitle("Flip video").setSection("action").setIcon("flip-horizontal-2").setSubmenu().addItem(n=>n.setTitle("Disable").setIcon("rotate-ccw-square").setChecked(e.flip==="none").onClick(()=>{e.flip="none"})).addItem(n=>n.setTitle("Horizontal (Mirror)").setIcon("flip-horizontal").setChecked(e.flip==="horizontal"||e.flip==="both").onClick(()=>{e.flip==="horizontal"?e.flip="none":e.flip==="vertical"?e.flip="both":e.flip==="both"?e.flip="vertical":e.flip="horizontal"})).addItem(n=>n.setTitle("Vertical (Upside down)").setIcon("flip-vertical").setChecked(e.flip==="vertical"||e.flip==="both").onClick(()=>{e.flip==="vertical"?e.flip="none":e.flip==="horizontal"?e.flip="both":e.flip==="both"?e.flip="horizontal":e.flip="vertical"})))}function _me(t,e){if(!(!e.supportsScreenshot||!Io())){t.addItem(r=>{r.setTitle("Extract text from screenshot").setSection("info").setIcon("scan-text").onClick(()=>{e.screenshotAction.extractTextToClipboard()})});for(let{clip:r}of[{clip:!0},{clip:!1}])t.addItem(n=>{n.setTitle(r?"Copy clipped screenshot":"Copy screenshot").setSection("info").setIcon("copy").onClick(()=>{e.screenshotAction.copyScreenshot({clip:r})})}).addItem(n=>{n.setTitle(r?"Save clipped screenshot":"Save screenshot").setSection("action").setIcon("image").onClick(()=>{e.screenshotAction.saveScreenshot({clip:r})})}).addItem(n=>{n.setTitle(r?"Set clipped screenshot as media cover":"Set current screenshot as media cover").setSection("action").setIcon("image").onClick(()=>{e.screenshotAction.setAsCover({clip:r})})})}}function Ome(t,e){let r=e.player?.state,n=e.remoter,i=e.player;t.addItem(s=>{let a=s.setSection("action").setIcon("gauge").setTitle(r?`Speed ${r.playbackRate}x`:"Speed").setDisabled(!r).setSubmenu();i&&BWe(a,e)&&a.addSeparator();for(let o of e.speedOptions)a.addItem(l=>{l.setTitle(`${o}x`).setChecked(r?.playbackRate===o).setDisabled(!r).onClick(c=>{n.setPlaybackRate(o,c)})});a.addItem(o=>{o.setTitle("Custom").setIcon("settings").onClick(()=>{gt(new nv(e.app,l=>e.isValidSpeed(l)).requestInput().then(l=>(n.setPlaybackRate(l),l)),{success:l=>`Speed set to ${l}x`,error:l=>`Cannot set speed: ${l}`})})})})}function BWe(t,e){return e.preservePitch===null?!1:(t.addItem(r=>r.setTitle("Preserve pitch").setChecked(e.preservePitch).onClick(()=>{e.preservePitch=!e.preservePitch})),!0)}var Dme=require("obsidian");var iL=class extends Gc{#e;#t;#r;#n;constructor(e,r){super(r.app),this.#e=e,this.#t=r.actionIcon??"check",this.#r=r.actionTooltip??"Select transcript",this.#n=r.actionText,this.modalEl.addClass("mx-transcript-select"),this.titleEl.setText("Select Transcript")}onOpen(){let e=this.contentEl;e.empty();let r=this.#i(this.#e);r.vault.length>0&&this.#s(e,"In Vault",r.vault),r.local.length>0&&this.#s(e,"Local Files",r.local),r.remote.length>0&&this.#s(e,"Remote",r.remote)}#i(e){let r={vault:[],local:[],remote:[]};for(let n of e)switch(n.type){case"internal.resolved":r.vault.push(n);break;case"file":r.local.push(n);break;case"url":r.remote.push(n);break}return r}#s(e,r,n){let i=e.createDiv("mx-transcript-group");i.createEl("h3",{text:r,cls:"mx-transcript-group-title"});let s=i.createDiv("mx-transcript-list");for(let a of n)this.#a(s,a)}#a(e,r){let n=e.createDiv("mx-transcript-item"),i=n.createDiv("mx-transcript-info");i.createEl("div",{text:this.#o(r),cls:"mx-transcript-title"});let s=i.createDiv("mx-transcript-meta");r.meta.language&&s.createSpan({text:r.meta.language,cls:"mx-transcript-language"}),s.createSpan({text:r.meta.kind,cls:"mx-transcript-kind"}),r.meta.format&&s.createSpan({text:r.meta.format.toUpperCase(),cls:"mx-transcript-format"}),r.meta.isDefault&&s.createSpan({text:"Default",cls:"mx-transcript-default"}),r.meta.label&&r.meta.label!==this.#o(r)&&s.createSpan({text:r.meta.label,cls:"mx-transcript-label"}),i.createDiv("mx-transcript-path").setText(this.#l(r));let o=new Dme.ButtonComponent(n);this.#n?o.setButtonText(this.#n):o.setIcon(this.#t),o.setTooltip(this.#r).setClass("mx-transcript-select-btn").onClick(()=>{this.resolveWith(r)})}#o(e){if(e.meta.label)return e.meta.label;switch(e.type){case"internal.resolved":return e.src.basename;case"file":return e.src.basename||e.src.path.split("/").pop()||"Local File";case"url":return e.src.hostname||"Remote"}}#l(e){switch(e.type){case"internal.resolved":return e.src.path;case"file":return e.src.path;case"url":return e.src.toString()}}};function Nme(t,e){let r=e.player;t.addItem(n=>{if(n.setIcon("captions").setTitle("Subtitles").setSection("view"),!r?.textTracks||r.textTracks.length===0){n.setDisabled(!0);return}let i=n.setSubmenu();r.textTracks.selectedIndex!==-1&&i.addItem(a=>a.setTitle("Disable").setIcon("captions-off").onClick(()=>{r.textTracks.selected?.setMode("disabled")})).addSeparator();for(let a of r.textTracks.toArray())i.addItem(o=>{o.setTitle(a.label).setChecked(a.mode==="showing").onClick(()=>{a.setMode("showing")})})})}function Fme(t,e,r){t.addItem(n=>{n.setSection("view").setTitle("Open transcript").setIcon("book-text").onClick(async()=>{let i=await gt(r.transcriptLoader.getTracks(e),{swallowError:!1,loading:"Loading track list..."});await gt(new iL(i,{app:r.app,actionIcon:"square-arrow-out-up-right",actionTooltip:"Open transcript"}).requestInput().then(s=>r.workspaceOpen.openTranscript(s,{newLeaf:"split"})),{error:"Failed to open transcript, see console for details"})})})}var sL=class{plugin;app;fileService;mediaLib;mediaNote;workspaceOpen;metadataUpdate;transcriptLoader;mediaParser;link;hashEditor;settings;#e;constructor(e){var n=[];try{this.plugin=e.plugin;this.app=e.app;this.fileService=e.fileService;this.mediaLib=e.mediaLib;this.mediaNote=e.mediaNote;this.workspaceOpen=e.workspaceOpen;this.metadataUpdate=e.metadataUpdater;this.transcriptLoader=e.transcriptLoader;this.mediaParser=e.mediaParser;this.link=e.linkHandler;this.settings=e.settings;this.hashEditor=e.hashEditor;let r=J(n,new DisposableStack);xr(r,this.app.workspace.on("file-menu",this.#i,this));xr(r,this.app.workspace.on("url-menu",this.#n,this));xr(r,this.app.workspace.on("mx:media-menu",this.#r,this));xr(r,this.app.workspace.on("mx:editor-link-menu",this.#t,this));this.#e=r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}[Symbol.dispose](){this.#e.dispose()}#t(e,r,{token:n,editor:i}){e.addItem(s=>s.setTitle("Edit hash properties").setIcon("hash").setSection("selection").onClick(()=>{let a;if(n.type==="internal-link"){let o=i.getRange(n.start,n.end),l=o.indexOf("|");l>=0&&o[l-1]==="\\"&&(l-=1),a={start:n.start,end:{line:n.start.line,ch:l<0?n.end.ch:n.start.ch+l},text:n.text}}else a={start:n.start,end:n.end,text:n.text};this.hashEditor.editHash(a,i).catch(o=>{if(!kt.test(o))throw o})}))}#r(e,r,n){this.mediaViewActions(e,r,n),Xf(r.media)&&n!=="player-menu-embed"&&n!=="player-menu-view"&&(VWe(e,r.media),this.mediaUrlActions(e,r.media,n))}#n(e,r){let n=this.mediaParser.parseUrl(r);if(n){if(Bt(n.info.url)){let i=this.fileService.getMediaFullPath(n.info);i&&yP(e,i),this.mediaFileActions(e,n.info,"link-context-menu")}else this.mediaUrlActions(e,n.info,"link-context-menu");this.openInMediaExtended(e,n.info)}}#i(e,r,n){if(!(r instanceof nS.TFile))return;let i=this.mediaParser.parseFile(r),s=this.mediaLib.findMediaByNote(r);i?this.mediaFileActions(e,i,n):s&&this.mediaNoteActions(e,{file:r,media:s.src},n)}mediaUrlActions(e,r,n){this.mediaLibActions(e,r),this.openTranscriptMenu(e,r),n!=="link-context-menu"&&this.updateMetadataActions(e,r),n==="link-context-menu"?this.editMetadataActions(e,r,{icon:"table-properties",section:"selection"}):this.editMetadataActions(e,r)}mediaFileActions(e,r,n){this.mediaLibActions(e,r),this.openTranscriptMenu(e,r),n!=="link-context-menu"&&this.updateMetadataActions(e,r),n==="link-context-menu"?this.editMetadataActions(e,r,{icon:"table-properties",section:"selection"}):this.editMetadataActions(e,r)}mediaNoteActions(e,r,n){e.addItem(i=>{i.setTitle("Open related media").setIcon("square-play").setSection("view").onClick(s=>{this.workspaceOpen.openMedia({info:r.media},{fromUser:!0,newLeaf:qd(s)})})}),this.openTranscriptMenu(e,r.media),n==="more-options"&&(this.updateMetadataActions(e,r.media),this.editMetadataActions(e,r.media))}mediaViewActions(e,r,n){Xf(r.media)&&n!=="player-menu-embed"&&n!=="player-menu-view"&&e.addItem(i=>i.setTitle("Copy URL with timestamp").setIcon("copy-check").setSection("info").onClick(()=>{r.timestampAction.copyTimestampedUrl()})),n==="player-menu-embed"&&this.mediaEmbedActions(e,r),(n==="player-menu-view"||n==="player-menu-embed")&&(Ome(e,r),Lme(e,r),Mme(e,r),Nme(e,r)),n==="tab-header"&&e.addItem(i=>{let s=r.player?.state,a=r.remoter;i.setTitle("Mute").setSection("action").setIcon("volume-high").setDisabled(!s).setChecked(!!s?.muted).onClick(o=>{a.toggleMuted(o)})}),(n==="player-menu-embed"||n==="more-options")&&_me(e,r)}updateMetadataActions(e,r){e.addItem(n=>{n.setTitle("Update metadata").setIcon("refresh-cw").setSection("action").setDisabled(!this.metadataUpdate.supportUpdate(r)).onClick(()=>{this.metadataUpdate.updateMetadata(r)})})}editMetadataActions(e,r,{icon:n="hash",section:i="action"}={}){e.addItem(s=>s.setTitle("Edit media metadata").setIcon(n).setSection(i).onClick(()=>{this.metadataUpdate.editMetadata(r)}))}mediaEmbedActions(e,r){for(let{newLeaf:n,icon:i,title:s}of[{newLeaf:"split",icon:"separator-vertical",title:"Open to the right"},{newLeaf:"tab",icon:"file-plus",title:"Open in new tab"},{newLeaf:"window",icon:"maximize",title:"Open in new window"}])e.addItem(a=>a.setTitle(s).setIcon(i).setSection("open").setDisabled(!r.media).onClick(()=>{r.media&&this.workspaceOpen.openMedia({info:r.media},{newLeaf:n})}))}mediaLibActions(e,r){let n=this.mediaLib.findNoteByMedia(r);n?(e.addItem(i=>i.setTitle("Open media properties").setIcon("table-properties").setSection("view").onClick(()=>{this.app.workspace.openLinkText(n.path,"","tab")})),e.addItem(i=>{i.setTitle("Remove from media library").setIcon("trash").setSection("danger").onClick(async()=>{await this.app.fileManager.promptForDeletion(n)})})):e.addItem(i=>{i.setTitle("Add to media library").setIcon("badge-plus").setSection("action").onClick(async()=>{let s=await this.mediaNote.ensureMediaNote(r);new nS.Notice(`Added to media library: ${s.note.path}`)})})}openInMediaExtended(e,r){e.addItem(n=>{n.setTitle("Open in Media Extended").setIcon("square-play").setSection("open").onClick(i=>{this.workspaceOpen.openMedia({info:r},{fromUser:!0,newLeaf:qd(i)})})})}openTranscriptMenu(e,r){Fme(e,r,{transcriptLoader:this.transcriptLoader,app:this.app,workspaceOpen:this.workspaceOpen})}};function VWe(t,e){t.addItem(r=>r.setTitle("Open in default browser").setIcon("globe").setSection("open").onClick(()=>{rL(e.url.toString())})).addItem(r=>r.setTitle("Copy URL").setIcon("link").setSection("info").onClick(async()=>{await navigator.clipboard.writeText(e.url.toString()),new nS.Notice("URL copied to clipboard")}))}var Pi=class t extends Error{#e;constructor(e,r){super(e,{cause:r?.cause}),this.name="BaseApiError",this.#e=r?.status??500}get status(){return this.#e}static fromResponse(e,r){let n=e.status,i=r??e.statusText;switch(n){case 400:case 422:throw new Ch(`Validation failed: ${i}`,{status:n});case 401:case 403:throw new av(`Authentication failed: ${i}`,{status:n});case 404:throw new PV(`Resource not found: ${i}`,{status:n});case 429:throw new RV("Rate limit exceeded",{status:n});case 500:case 502:case 503:case 504:throw new LV(`Server error: ${i}`,{status:n});default:throw new t(`API error: ${i}`,{status:n})}}},av=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??401}),this.name="AuthError"}},Ro=class extends av{constructor(e,r){super(e,{...r,status:r?.status??401}),this.name="UnauthorizedError"}},iS=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??202}),this.name="ProcessingError"}},PV=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??404}),this.name="NotFoundError"}},RV=class extends Pi{constructor(e="Rate limit exceeded. Please try again later.",r){super(e,{...r,status:r?.status??429}),this.name="RateLimitError"}},LV=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??500}),this.name="ServerError"}},Ch=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??400}),this.name="ValidationError"}},ov=class extends Error{constructor(e="No text found in the provided image"){super(e),this.name="NoTextFoundError"}};var jWe=(t,e,r={})=>{let n=`${t}=${e}`;if(t.startsWith("__Secure-")&&!r.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(t.startsWith("__Host-")){if(!r.secure)throw new Error("__Host- Cookie must have Secure attributes");if(r.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(r.domain)throw new Error("__Host- Cookie must not have Domain attributes")}if(r&&typeof r.maxAge=="number"&&r.maxAge>=0){if(r.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");n+=`; Max-Age=${r.maxAge|0}`}if(r.domain&&r.prefix!=="host"&&(n+=`; Domain=${r.domain}`),r.path&&(n+=`; Path=${r.path}`),r.expires){if(r.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");n+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(n+="; HttpOnly"),r.secure&&(n+="; Secure"),r.sameSite&&(n+=`; SameSite=${r.sameSite.charAt(0).toUpperCase()+r.sameSite.slice(1)}`),r.priority&&(n+=`; Priority=${r.priority}`),r.partitioned){if(!r.secure)throw new Error("Partitioned Cookie must have Secure attributes");n+="; Partitioned"}return n},Bme=(t,e,r)=>(e=encodeURIComponent(e),jWe(t,e,r));var Vme=(t,e)=>(t=t.replace(/\/+$/,""),t=t+"/",e=e.replace(/^\/+/,""),t+e),oL=(t,e)=>{for(let[r,n]of Object.entries(e)){let i=new RegExp("/:"+r+"(?:{[^/]+})?\\??");t=t.replace(i,n?`/${n}`:"")}return t},MV=t=>{let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(n!==void 0)if(Array.isArray(n))for(let i of n)e.append(r,i);else e.set(r,n);return e},jme=(t,e)=>{switch(e){case"ws":return t.replace(/^http/,"ws");case"http":return t.replace(/^ws/,"http")}},$me=t=>/^https?:\/\/[^\/]+?\/index$/.test(t)?t.replace(/\/index$/,"/"):t.replace(/\/index$/,"");function aL(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function _V(t,e){if(!aL(t)&&!aL(e))return e;let r={...t};for(let n in e){let i=e[n];aL(r[n])&&aL(i)?r[n]=_V(r[n],i):r[n]=i}return r}var Ume=(t,e)=>new Proxy(()=>{},{get(n,i){if(!(typeof i!="string"||i==="then"))return Ume(t,[...e,i])},apply(n,i,s){return t({path:e,args:s})}}),$We=class{url;method;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(t,e){this.url=t,this.method=e}fetch=async(t,e)=>{if(t){if(t.query&&(this.queryParams=MV(t.query)),t.form){let o=new FormData;for(let[l,c]of Object.entries(t.form))if(Array.isArray(c))for(let u of c)o.append(l,u);else o.append(l,c);this.rBody=o}t.json&&(this.rBody=JSON.stringify(t.json),this.cType="application/json"),t.param&&(this.pathParams=t.param)}let r=this.method.toUpperCase(),n={...t?.header,...typeof e?.headers=="function"?await e.headers():e?.headers};if(t?.cookie){let o=[];for(let[l,c]of Object.entries(t.cookie))o.push(Bme(l,c,{path:"/"}));n.Cookie=o.join(",")}this.cType&&(n["Content-Type"]=this.cType);let i=new Headers(n??void 0),s=this.url;s=$me(s),s=oL(s,this.pathParams),this.queryParams&&(s=s+"?"+this.queryParams.toString()),r=this.method.toUpperCase();let a=!(r==="GET"||r==="HEAD");return(e?.fetch||fetch)(s,{body:a?this.rBody:void 0,method:r,headers:i,...e?.init})}},OV=(t,e)=>Ume(function r(n){let i=[...n.path],s=i.slice(-3).reverse();if(s[0]==="toString")return s[1]==="name"?s[2]||"":r.toString();if(s[0]==="valueOf")return s[1]==="name"?s[2]||"":r;let a="";if(/^\$/.test(s[0])){let u=i.pop();u&&(a=u.replace(/^\$/,""))}let o=i.join("/"),l=Vme(t,o);if(a==="url"){let u=l;return n.args[0]&&(n.args[0].param&&(u=oL(l,n.args[0].param)),n.args[0].query&&(u=u+"?"+MV(n.args[0].query).toString())),new URL(u)}if(a==="ws"){let u=jme(n.args[0]&&n.args[0].param?oL(l,n.args[0].param):l,"ws"),d=new URL(u),f=n.args[0]?.query;return f&&Object.entries(f).forEach(([h,m])=>{Array.isArray(m)?m.forEach(v=>d.searchParams.append(h,v)):d.searchParams.set(h,m)}),((...h)=>e?.webSocket!==void 0&&typeof e.webSocket=="function"?e.webSocket(...h):new WebSocket(...h))(d.toString())}let c=new $We(l,a);if(a){e??={};let u=_V(e,{...n.args[1]});return c.fetch(n.args[0],u)}return c},[]);var zme=(...t)=>OV(...t);async function qme(t,e){let{multiplier:r=2,maxTimeout:n=6e4,maxAttempts:i=5,minTimeout:s=1e3,jitter:a=1,isRetriable:o=()=>!0}=e??{};if(n<=0)throw new TypeError(`Cannot retry as 'maxTimeout' must be positive: current value is ${n}`);if(s>n)throw new TypeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${s}', 'maxTimeout=${n}'`);if(a>1)throw new TypeError(`Cannot retry as 'jitter' must be <= 1: current value is ${a}`);let l=0;for(;;){try{return await t()}catch(c){if(!o(c))throw c;if(l+1>=i)throw new bT(c,i);let u=C6(n,s,l,r,a);await new Promise(d=>setTimeout(d,u))}l++}}async function UWe(t,{retry:e,...r}){return await qme(async()=>{let i=await fetch(t,r);if(i.status===202)throw new iS("Request is still being processed");return i},e)}async function Hme(t,e){return await UWe(t,{retry:{maxAttempts:5,minTimeout:5e3,maxTimeout:3e4,multiplier:2,jitter:.1,isRetriable:i=>i instanceof iS},...e})}async function Gme(){let{data:t,error:e}=await un.auth.getSession();if(e)throw new av("Failed to get access token",{cause:e,status:e.status});let r=t.session?.access_token;if(!r)throw new Ro("No access token available. Please log in.");return r}var lv=zme("https://api-production.aiden-lx.workers.dev",{headers:async()=>({Authorization:`Bearer ${await Gme()}`}),fetch:Hme});var DV=4*1024*1024,Wme=Pt(["image/png","image/jpeg","image/webp","image/heic","image/heif"]);var zWe=lv["text-extract"].$post,sS=class{#e(e){if(!ws(Wme,e.type))throw new Ch(`Unsupported image type: ${e.type}`);if(e.size>DV)throw new Ch(`Image file size exceeds the limit of ${DV} bytes`);if(e.size===0)throw new Ch("Image file is empty")}async extractText(e){this.#e(e);let r=await zWe({form:{image:e}});if(r.status===500)throw Pi.fromResponse(r,(await r.json()).message);if(!r.ok)throw Pi.fromResponse(r);let n=await r.json();if(n.status==="no_text_found")throw new ov;return n.content}};var qWe=lv.youtube.video[":video_id"].metadata.$get,HWe=lv.youtube.video[":video_id"].subtitles.$get,GWe=lv.youtube.video[":video_id"].subtitles[":subtitle_id"].$get,aS=class{async getVideoMetadata(e){let r=await qWe({param:{video_id:e}});if(!r.ok)throw Pi.fromResponse(r,await r.text());return await r.json()}async getSubtitlesList(e){let r=await HWe({param:{video_id:e}});if(!r.ok)throw Pi.fromResponse(r,await r.text());return await r.json()}async getSubtitleContent(e,r){let n=await GWe({param:{video_id:e,subtitle_id:r}});if(!n.ok)throw Pi.fromResponse(n,await n.text());return await n.text()}};var BV=require("obsidian");var NV=require("obsidian");async function FV(t,e){let r=t.getAbstractFileByPath(e);if(r){if(r instanceof NV.TFolder)return r;throw new Error(`Path ${e} occupied by file`)}let n=e.split("/").filter(Boolean);if(n.length===0)return t.getRoot();let i=n[0],s=t.getAbstractFileByPath(i),a;if(!s)a=await t.createFolder(i);else if(s instanceof NV.TFolder)a=s;else throw new Error(`Path ${i} exists but is not a folder`);let o=n.slice(1).join("/");return o?FV(t,`${i}/${o}`):a}var lL=class{app;constructor(e){this.app=e.app}async getAttachmentFolder(e){let{vault:r}=this.app;if(!e.folderPath){let s=await this.#e(e.sourcePath),a=r.getFolderByPath(s);if(!a)throw new Error(`Attachment folder not found: ${s}`);return a}let n=(0,BV.normalizePath)(e.folderPath);return await FV(this.app.vault,n)}async#e(e){let r=Math.random().toString(36).substring(2),i=(await this.app.fileManager.getAvailablePathForAttachment(r,e)).replace(r,"");return(0,BV.normalizePath)(i)||"/"}};var Pl=require("obsidian");var cL=require("@codemirror/language"),Kme=require("@lezer/common");function uL(t,e){let r=e.getCursor("to");e.replaceRange(t,r,r),e.setCursor(e.offsetToPos(e.posToOffset(r)+t.length))}function dL(t,e){let r=e.getCursor("from");e.replaceRange(t,r,r)}function Yme(t,e){if(e){let r=t.posAtCoords({x:e.clientX,y:e.clientY});if(r)return r}return t.state.selection.main.head}function VV(t){return new Set(t.prop(cL.tokenClassNodeProp)?.split(" "))}function jV(t,e){let r=t.activeCM,n=r.state.doc.lineAt(e),i=(0,cL.syntaxTree)(r.state).cursorAt(e,-1,Kme.IterMode.ExcludeBuffers);do{let s=VV(i.type);if(s.has("formatting-link-start"))return{pos:i.from,isEmbed:r.state.sliceDoc(i.from,i.to).startsWith("!")};if(s.has("formatting-link")&&r.state.sliceDoc(i.from,i.to)==="[")return{pos:i.from,isEmbed:!1};if(s.has("image-marker"))return{pos:i.from,isEmbed:!0}}while(i.prev()&&i.from>=n.from);return null}function Xme(t,e){let r=t.posToOffset(e);return jV(t,r)?.isEmbed}function Qme(t,e){let n=t.getLine(e.line).substring(0,e.ch),i=n.lastIndexOf("[["),s=n.lastIndexOf("](");return i===-1&&s===-1?null:i>s?"wiki":"markdown"}function Zme(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n--)r++;return(r&1)===1}function Jme(t,e,r){for(let n=r;n<t.length;n++)if(t[n]===e&&!Zme(t,n))return n;return-1}function WWe(t,e){for(let r=e;r<t.length-1;r++)if(t[r]==="]"&&!Zme(t,r)&&t[r+1]==="]")return r+2;return-1}function ege(t,e){let r=Jme(t,"|",e+1);return r===-1?null:r}function tge(t,e,r){let n=t.getLine(e.line);if(r==="wiki"){let i=WWe(n,e.ch);return{line:e.line,ch:i===-1?e.ch:i}}if(r==="markdown"){let i=Jme(n,")",e.ch);return{line:e.line,ch:i===-1?e.ch:i+1}}return{line:e.line,ch:e.ch}}var rge=require("obsidian");function nge(t,{onOpenFile:e}){var n=[];try{let r=J(n,new DisposableStack);r.defer(pr(rge.WorkspaceLeaf.prototype,{openFile:o=>async function(l,c,...u){let d=()=>o.call(this,l,c,...u),f=this;if(f[$V]===!0)return delete f[$V],d();try{await e.call(t,l,c,d)}catch(p){console.error("onOpenFile error in openFile, fallback to default",p),d()}}}));return r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}var $V=Symbol("MX_INTERNAL_OPENFILE");async function fL(t,e){return this[$V]=!0,await this.openFile(t,e)}var pL=class{plugin;app;settings;template;mediaParser;#e=null;#t;#r=new DisposableStack;constructor(e){var n=[];try{this.plugin=e.plugin;this.settings=e.settings;this.app=e.app;this.template=e.template;this.mediaParser=e.mediaParser;let r=J(n,new DisposableStack);r.defer(this.patchRecordPlugin());this.#t=new Map;r.defer(()=>this.#t.clear());this.addCommand();this.#r=r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}[Symbol.dispose](){this.#r.dispose()}async onRecordingSaved(e){if(!this.#e)return;let{start:r}=this.#e;this.#e=null;let n=await this.settings.loaded,i=this.mediaParser.parseFile(e);if(!i){new Pl.Notice(`Failed to get media info from the saved file: ${e.path}`);return}for(let s of this.#t){let a=s[0],o=()=>{},l=s[1];if(!a.containerEl.isConnected){if(!l){new Pl.Notice("One of the note with timestamp is closed, the timestamp will not be updated");continue}if(a=XWe(l,this.app),!a){let c=this.app.workspace.getLeaf("tab");if(await fL.call(c,l,{state:{mode:"source"}}),!(c.view instanceof Pl.MarkdownView)){new Pl.Notice(`Failed to open note for timestamp update: ${l.path}`);continue}a=c.view.editor,o=()=>c.detach()}}try{let c=a.getValue().replaceAll(KWe(r),(u,d)=>{let f=Number.parseInt(d,10);return this.template.renderTimestampInsertion({currentTime:f/1e3,src:i},{sourcePath:l?.path??"",settings:n})});a.setValue(c)}catch(c){console.error("failed to insert timestamp",c)}finally{o()}}this.#t.clear()}patchRecordPlugin(){let e=this.app.internalPlugins.plugins["audio-recorder"];if(!e)return console.info("recorder not found, skip patching for recorder note"),()=>{};let r=e.instance,n=this,{vault:i,workspace:s}=this.app;return pr(r,{saveRecording(a){return function(...o){s.getLeaf("split").setViewState({type:"empty",active:!0});let l=a.apply(this,o);return(async()=>{var f=[];try{let c=J(f,new DisposableStack);let u=new Promise(v=>{xr(c,i.on("create",b=>{b instanceof Pl.TFile?v(b):console.error("unexpected folder")}))});let d=await Vr(u,AbortSignal.timeout(3e5));await n.onRecordingSaved(d)}catch(p){var h=p,m=!0}finally{ee(f,h,m)}})(),l}},startRecording(a){return function(...o){let l=a.apply(this,o),c=this.recorder;if(n.#e={start:Date.now()},console.debug("recording start called",n.#e.start),c&&c instanceof MediaRecorder){c.addEventListener("start",()=>{n.#e={start:Date.now()},console.debug("recording started in MediaRecorder",n.#e.start)},{once:!0});let u=()=>{n.#e&&(n.#e.end=Date.now(),console.debug("recording stopped in MediaRecorder",n.#e.end)),c.removeEventListener("stop",u),c.removeEventListener("error",u)};c.addEventListener("stop",u,{once:!0}),c.addEventListener("error",u,{once:!0})}return l}}})}addCommand(){this.plugin.addCommand({id:"take-rec-timestamp",name:"Take timestamp on current recording",editorCheckCallback:(e,r,n)=>{if(!this.#e)return!1;if(e)return!0;let{start:i,notified:s}=this.#e;!s&&!n.file&&(new Pl.Notice("You've taken a timestamp for the recording, probably in canvas node, keep editor in foreground and in live preview mode. Otherwise, the dummy timestamp cannot be updated when recording is saved."),this.#e.notified=!0);let a=Date.now()-i,o=YWe(i,a);this.settings.loaded.then(l=>{l["note.template.insert-at"]==="before-cursor"?dL(o,r):uL(o,r)}),this.#t.set(r,n.file)}})}};function KWe(t){return new RegExp(`%%REC_${t}_(?<offset>\\d+)%%`,"g")}function YWe(t,e){return`%%REC_${t}_${e}%%`}function XWe(t,e){let r=null;return e.workspace.iterateAllLeaves(n=>{n.view instanceof Pl.MarkdownView&&t.path===n.view.file?.path&&n.view.getMode()==="source"&&(r=n.view)}),r?.editor}var hL=require("obsidian");var Wc=require("obsidian");var Hd=class t extends Wc.Modal{constructor(e,r){super(e),this.onClose=r.bind(this)}static async open(e){var n=[];try{let r=J(n,new DisposableStack);try{let o=await new Promise((c,u)=>{let d=new t(e.app,()=>c(null));d.open(),r.defer(()=>{d.close()}),r.defer(e.on("oauth-login:success",f=>c(f))),r.defer(e.on("oauth-login:error",f=>u(f)))});if(!o)return;let l=o.user_metadata?.full_name||o.email?.split("@")[0];new Wc.Notice(l?`Welcome ${l}!`:"Welcome to Media Extended!")}catch(o){new Wc.Notice("Error logging in, see console for details")}}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}onOpen(){this.#e()}onClose(){this.contentEl.empty()}#e(){let{contentEl:e}=this;e.empty(),e.addClass("login-modal-content");let r=e.createDiv("login-header");r.createEl("h3",{text:"Connect to Media Extended"}),r.createEl("p",{text:"Sign in or create an account to access online features",cls:"login-subtitle"});let n=e.createDiv("login-options"),i=n.createDiv("login-button-container"),s=new Wc.ButtonComponent(i).setButtonText("Continue with Google").setIcon("google").setDisabled(!0).onClick(()=>{this.#t()});s.buttonEl.appendText("Continue with Google"),s.buttonEl.addClass("login-button","google-login");let a=n.createDiv("login-button-container"),o=new Wc.ButtonComponent(a).setIcon("github").onClick(()=>{this.#r()});o.buttonEl.appendText("Continue with GitHub"),o.buttonEl.addClass("login-button","github-login");let c=e.createDiv("login-footer").createEl("p",{cls:"login-terms"});c.appendText("By continuing, you agree to our "),c.createEl("a",{text:"Terms of Service",href:"#",cls:"login-link"}),c.appendText(" and "),c.createEl("a",{text:"Privacy Policy",href:"#",cls:"login-link"})}#t(){console.log("Google login clicked")}async#r(){let{data:e,error:r}=await un.auth.signInWithOAuth({provider:"github",options:{skipBrowserRedirect:!0,redirectTo:`obsidian://${UV}`}});r?(console.error("Error signing in with GitHub:",r),new Wc.Notice("Error signing in with GitHub")):rL(e.url)}};var UV="mx-auth-callback",mL=class{plugin;app;#e;#t;showPasswordManager(){this.#e.passwordManagerModal.open()}constructor(e){var n=[];try{this.plugin=e.plugin;this.app=e.app;this.#e=e;let r=J(n,new DisposableStack);this.#s(r);this.#n();this.#i();this.#t=r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}[Symbol.dispose](){this.#t.dispose()}#r=th();on(e,r){return this.#r.on(e,r)}#n(){this.plugin.registerObsidianProtocolHandler(UV,async({code:e})=>{if(!e){console.error("No code provided from PKCE callback");return}console.debug("Auth callback received",e);let{data:r,error:n}=await un.auth.exchangeCodeForSession(e);n?(console.error("Error exchanging code for session",n),this.#r.emit("oauth-login:error",n)):(console.info("Media Extended: User logged in via OAuth"),this.#r.emit("oauth-login:success",r.user))})}#i(){this.plugin.addCommand({id:"mx-auth-logout",name:"Logout",callback:async()=>{let{error:e}=await un.auth.signOut();e?(console.error("Error signing out",e),new hL.Notice(`Error signing out: ${e.message}`)):new hL.Notice("You have been signed out")}}),this.plugin.addCommand({id:"mx-auth-login",name:"Login",icon:"log-in",callback:async()=>{let e=(await un.auth.getSession()).data.session;if(e){new hL.Notice(`You are already logged in as ${e.user.email}`);return}await Hd.open(this)}})}#s(e){un.auth.startAutoRefresh(),e.defer(()=>un.auth.stopAutoRefresh()),cm(e,document,"visibilitychange",()=>{document.visibilityState==="visible"?un.auth.startAutoRefresh():un.auth.stopAutoRefresh()})}};var Lo=require("obsidian");var gL=class{app;constructor(e){this.app=e.app}getFullPath(e){if(!(Lo.Platform.isDesktopApp&&this.app.vault.adapter instanceof Lo.FileSystemAdapter))return null;try{if(e instanceof Lo.TFile)return this.app.vault.adapter.getFullPath(e.path);if(Bt(e)){let{fileURLToPath:r}=Vi();return r(e.toString())}return null}catch(r){return console.error("Failed to get media file path",r),null}}getMediaFullPath(e){return e.type==="file"?this.getFullPath(e.file):e.type==="url:direct"?this.getFullPath(e.url):null}resolveFileUri(e){if(!Bt(e))throw new Gd("not-supported",e);if(!Lo.Platform.isDesktopApp||!(this.app.vault.adapter instanceof Lo.FileSystemAdapter))throw new Gd("not-supported",e);let r=this.app.vault.adapter.getFullPath("/"),n=Sm(r);if(n&&QWe(e,n))throw new Gd("in-vault",e);if(e.hostname)throw new Gd("network-path",e);try{return Vi().fileURLToPath(e.toString())}catch(i){throw console.warn(`Invalid file URL: ${e.toString()}`,i),new Gd("invalid-file-uri",e)}}safeResolveFileUri(e){try{return{success:!0,path:Vi().fileURLToPath(e.toString())}}catch(r){return r instanceof Gd?{success:!1,code:r.code,message:r.message}:(console.warn(`Invalid file URL: ${e.toString()}`,r),{success:!1,code:"invalid-file-uri",message:r instanceof Error?r.message:"Unknown error"})}}};function QWe(t,e){let r=(0,Lo.normalizePath)(t.pathname),n=(0,Lo.normalizePath)(e.pathname);return r.startsWith(n)}var Gd=class extends Error{code;constructor(e,r){if(e==="not-supported")super(`File URI not supported: ${r.toString()}`);else if(e==="in-vault")super(`File URI is in vault: ${r.toString()}`);else if(e==="network-path")super(`File URI is a network path: ${r.toString()}`);else if(e==="invalid-file-uri")super(`File URI is invalid: ${r.toString()}`);else throw Be(e),new Error("Unreachable");this.code=e}};var PL=require("obsidian");var wL=Z(Te(),1),Ba=Z(Te(),1),dS=t=>t.type==="checkbox",Th=t=>t instanceof Date,Ri=t=>t==null,gge=t=>typeof t=="object",Nr=t=>!Ri(t)&&!Array.isArray(t)&&gge(t)&&!Th(t),ZWe=t=>Nr(t)&&t.target?dS(t.target)?t.target.checked:t.target.value:t,JWe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,eKe=(t,e)=>t.has(JWe(e)),tKe=t=>{let e=t.constructor&&t.constructor.prototype;return Nr(e)&&e.hasOwnProperty("isPrototypeOf")},HV=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Un(t){let e,r=Array.isArray(t),n=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(HV&&(t instanceof Blob||n))&&(r||Nr(t)))if(e=r?[]:{},!r&&!tKe(t))e=t;else for(let i in t)t.hasOwnProperty(i)&&(e[i]=Un(t[i]));else return t;return e}var kL=t=>/^\w*$/.test(t),Dr=t=>t===void 0,GV=t=>Array.isArray(t)?t.filter(Boolean):[],WV=t=>GV(t.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(t,e,r)=>{if(!e||!Nr(t))return r;let n=(kL(e)?[e]:WV(e)).reduce((i,s)=>Ri(i)?i:i[s],t);return Dr(n)||n===t?Dr(t[e])?r:t[e]:n},Rl=t=>typeof t=="boolean",Mt=(t,e,r)=>{let n=-1,i=kL(e)?[e]:WV(e),s=i.length,a=s-1;for(;++n<s;){let o=i[n],l=r;if(n!==a){let c=t[o];l=Nr(c)||Array.isArray(c)?c:isNaN(+i[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;t[o]=l,t=t[o]}},ige={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Mo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Kc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},rKe=Ba.default.createContext(null);rKe.displayName="HookFormContext";var nKe=(t,e,r,n=!0)=>{let i={defaultValues:e._defaultValues};for(let s in t)Object.defineProperty(i,s,{get:()=>{let a=s;return e._proxyFormState[a]!==Mo.all&&(e._proxyFormState[a]=!n||Mo.all),r&&(r[a]=!0),t[a]}});return i},iKe=typeof window<"u"?wL.useLayoutEffect:wL.useEffect;var Ll=t=>typeof t=="string",sKe=(t,e,r,n,i)=>Ll(t)?(n&&e.watch.add(t),fe(r,t,i)):Array.isArray(t)?t.map(s=>(n&&e.watch.add(s),fe(r,s))):(n&&(e.watchAll=!0),r);var KV=(t,e,r,n,i)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:i||!0}}:{},cS=t=>Array.isArray(t)?t:[t],sge=()=>{let t=[];return{get observers(){return t},next:i=>{for(let s of t)s.next&&s.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(s=>s!==i)}}),unsubscribe:()=>{t=[]}}},qV=t=>Ri(t)||!gge(t);function Wd(t,e,r=new WeakSet){if(qV(t)||qV(e))return t===e;if(Th(t)&&Th(e))return t.getTime()===e.getTime();let n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(let s of n){let a=t[s];if(!i.includes(s))return!1;if(s!=="ref"){let o=e[s];if(Th(a)&&Th(o)||Nr(a)&&Nr(o)||Array.isArray(a)&&Array.isArray(o)?!Wd(a,o,r):a!==o)return!1}}return!0}var as=t=>Nr(t)&&!Object.keys(t).length,YV=t=>t.type==="file",_o=t=>typeof t=="function",vL=t=>{if(!HV)return!1;let e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},yge=t=>t.type==="select-multiple",XV=t=>t.type==="radio",aKe=t=>XV(t)||dS(t),zV=t=>vL(t)&&t.isConnected;function oKe(t,e){let r=e.slice(0,-1).length,n=0;for(;n<r;)t=Dr(t)?n++:t[e[n++]];return t}function lKe(t){for(let e in t)if(t.hasOwnProperty(e)&&!Dr(t[e]))return!1;return!0}function Wr(t,e){let r=Array.isArray(e)?e:kL(e)?[e]:WV(e),n=r.length===1?t:oKe(t,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(Nr(n)&&as(n)||Array.isArray(n)&&lKe(n))&&Wr(t,r.slice(0,-1)),t}var vge=t=>{for(let e in t)if(_o(t[e]))return!0;return!1};function bL(t,e={}){let r=Array.isArray(t);if(Nr(t)||r)for(let n in t)Array.isArray(t[n])||Nr(t[n])&&!vge(t[n])?(e[n]=Array.isArray(t[n])?[]:{},bL(t[n],e[n])):Ri(t[n])||(e[n]=!0);return e}function bge(t,e,r){let n=Array.isArray(t);if(Nr(t)||n)for(let i in t)Array.isArray(t[i])||Nr(t[i])&&!vge(t[i])?Dr(e)||qV(r[i])?r[i]=Array.isArray(t[i])?bL(t[i],[]):{...bL(t[i])}:bge(t[i],Ri(e)?{}:e[i],r[i]):r[i]=!Wd(t[i],e[i]);return r}var oS=(t,e)=>bge(t,e,bL(e)),age={value:!1,isValid:!1},oge={value:!0,isValid:!0},xge=t=>{if(Array.isArray(t)){if(t.length>1){let e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Dr(t[0].attributes.value)?Dr(t[0].value)||t[0].value===""?oge:{value:t[0].value,isValid:!0}:oge:age}return age},wge=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:n})=>Dr(t)?t:e?t===""?NaN:t&&+t:r&&Ll(t)?new Date(t):n?n(t):t,lge={isValid:!1,value:null},kge=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,lge):lge;function cge(t){let e=t.ref;return YV(e)?e.files:XV(e)?kge(t.refs).value:yge(e)?[...e.selectedOptions].map(({value:r})=>r):dS(e)?xge(t.refs).value:wge(Dr(e.value)?t.ref.value:e.value,t)}var cKe=(t,e,r,n)=>{let i={};for(let s of t){let a=fe(e,s);a&&Mt(i,s,a._f)}return{criteriaMode:r,names:[...t],fields:i,shouldUseNativeValidation:n}},xL=t=>t instanceof RegExp,lS=t=>Dr(t)?t:xL(t)?t.source:Nr(t)?xL(t.value)?t.value.source:t.value:t,uge=t=>({isOnSubmit:!t||t===Mo.onSubmit,isOnBlur:t===Mo.onBlur,isOnChange:t===Mo.onChange,isOnAll:t===Mo.all,isOnTouch:t===Mo.onTouched}),dge="AsyncFunction",uKe=t=>!!t&&!!t.validate&&!!(_o(t.validate)&&t.validate.constructor.name===dge||Nr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===dge)),dKe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),fge=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(n=>t.startsWith(n)&&/^\.\w+/.test(t.slice(n.length)))),uS=(t,e,r,n)=>{for(let i of r||Object.keys(t)){let s=fe(t,i);if(s){let{_f:a,...o}=s;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],i)&&!n)return!0;if(a.ref&&e(a.ref,a.name)&&!n)return!0;if(uS(o,e))break}else if(Nr(o)&&uS(o,e))break}}};function pge(t,e,r){let n=fe(t,r);if(n||kL(r))return{error:n,name:r};let i=r.split(".");for(;i.length;){let s=i.join("."),a=fe(e,s),o=fe(t,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(o&&o.type)return{name:s,error:o};if(o&&o.root&&o.root.type)return{name:`${s}.root`,error:o.root};i.pop()}return{name:r}}var fKe=(t,e,r,n)=>{r(t);let{name:i,...s}=t;return as(s)||Object.keys(s).length>=Object.keys(e).length||Object.keys(s).find(a=>e[a]===(!n||Mo.all))},pKe=(t,e,r)=>!t||!e||t===e||cS(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),hKe=(t,e,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(e||t):(r?n.isOnBlur:i.isOnBlur)?!t:(r?n.isOnChange:i.isOnChange)?t:!0,mKe=(t,e)=>!GV(fe(t,e)).length&&Wr(t,e),gKe=(t,e,r)=>{let n=cS(fe(t,r));return Mt(n,"root",e[r]),Mt(t,r,n),t},yL=t=>Ll(t);function hge(t,e,r="validate"){if(yL(t)||Array.isArray(t)&&t.every(yL)||Rl(t)&&!t)return{type:r,message:yL(t)?t:"",ref:e}}var cv=t=>Nr(t)&&!xL(t)?t:{value:t,message:""},mge=async(t,e,r,n,i,s)=>{let{ref:a,refs:o,required:l,maxLength:c,minLength:u,min:d,max:f,pattern:p,validate:h,name:m,valueAsNumber:v,mount:b}=t._f,y=fe(r,m);if(!b||e.has(m))return{};let x=o?o[0]:a,w=I=>{i&&x.reportValidity&&(x.setCustomValidity(Rl(I)?"":I||""),x.reportValidity())},C={},O=XV(a),S=dS(a),T=O||S,E=(v||YV(a))&&Dr(a.value)&&Dr(y)||vL(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,P=KV.bind(null,m,n,C),R=(I,B,M,z=Kc.maxLength,G=Kc.minLength)=>{let V=I?B:M;C[m]={type:I?z:G,message:V,ref:a,...P(I?z:G,V)}};if(s?!Array.isArray(y)||!y.length:l&&(!T&&(E||Ri(y))||Rl(y)&&!y||S&&!xge(o).isValid||O&&!kge(o).isValid)){let{value:I,message:B}=yL(l)?{value:!!l,message:l}:cv(l);if(I&&(C[m]={type:Kc.required,message:B,ref:x,...P(Kc.required,B)},!n))return w(B),C}if(!E&&(!Ri(d)||!Ri(f))){let I,B,M=cv(f),z=cv(d);if(!Ri(y)&&!isNaN(y)){let G=a.valueAsNumber||y&&+y;Ri(M.value)||(I=G>M.value),Ri(z.value)||(B=G<z.value)}else{let G=a.valueAsDate||new Date(y),V=Me=>new Date(new Date().toDateString()+" "+Me),K=a.type=="time",de=a.type=="week";Ll(M.value)&&y&&(I=K?V(y)>V(M.value):de?y>M.value:G>new Date(M.value)),Ll(z.value)&&y&&(B=K?V(y)<V(z.value):de?y<z.value:G<new Date(z.value))}if((I||B)&&(R(!!I,M.message,z.message,Kc.max,Kc.min),!n))return w(C[m].message),C}if((c||u)&&!E&&(Ll(y)||s&&Array.isArray(y))){let I=cv(c),B=cv(u),M=!Ri(I.value)&&y.length>+I.value,z=!Ri(B.value)&&y.length<+B.value;if((M||z)&&(R(M,I.message,B.message),!n))return w(C[m].message),C}if(p&&!E&&Ll(y)){let{value:I,message:B}=cv(p);if(xL(I)&&!y.match(I)&&(C[m]={type:Kc.pattern,message:B,ref:a,...P(Kc.pattern,B)},!n))return w(B),C}if(h){if(_o(h)){let I=await h(y,r),B=hge(I,x);if(B&&(C[m]={...B,...P(Kc.validate,B.message)},!n))return w(B.message),C}else if(Nr(h)){let I={};for(let B in h){if(!as(I)&&!n)break;let M=hge(await h[B](y,r),x,B);M&&(I={...M,...P(B,M.message)},w(M.message),n&&(C[m]=I))}if(!as(I)&&(C[m]={ref:x,...I},!n))return C}}return w(!0),C},yKe={mode:Mo.onSubmit,reValidateMode:Mo.onChange,shouldFocusError:!0};function vKe(t={}){let e={...yKe,...t},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:_o(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},n={},i=Nr(e.defaultValues)||Nr(e.values)?Un(e.defaultValues||e.values)||{}:{},s=e.shouldUnregister?{}:Un(i),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0,u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u},f={array:sge(),state:sge()},p=e.criteriaMode===Mo.all,h=k=>A=>{clearTimeout(c),c=setTimeout(k,A)},m=async k=>{if(!e.disabled&&(u.isValid||d.isValid||k)){let A=e.resolver?as((await S()).errors):await E(n,!0);A!==r.isValid&&f.state.next({isValid:A})}},v=(k,A)=>{!e.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((k||Array.from(o.mount)).forEach(D=>{D&&(A?Mt(r.validatingFields,D,A):Wr(r.validatingFields,D))}),f.state.next({validatingFields:r.validatingFields,isValidating:!as(r.validatingFields)}))},b=(k,A=[],D,q,j=!0,H=!0)=>{if(q&&D&&!e.disabled){if(a.action=!0,H&&Array.isArray(fe(n,k))){let ne=D(fe(n,k),q.argA,q.argB);j&&Mt(n,k,ne)}if(H&&Array.isArray(fe(r.errors,k))){let ne=D(fe(r.errors,k),q.argA,q.argB);j&&Mt(r.errors,k,ne),mKe(r.errors,k)}if((u.touchedFields||d.touchedFields)&&H&&Array.isArray(fe(r.touchedFields,k))){let ne=D(fe(r.touchedFields,k),q.argA,q.argB);j&&Mt(r.touchedFields,k,ne)}(u.dirtyFields||d.dirtyFields)&&(r.dirtyFields=oS(i,s)),f.state.next({name:k,isDirty:R(k,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Mt(s,k,A)},y=(k,A)=>{Mt(r.errors,k,A),f.state.next({errors:r.errors})},x=k=>{r.errors=k,f.state.next({errors:r.errors,isValid:!1})},w=(k,A,D,q)=>{let j=fe(n,k);if(j){let H=fe(s,k,Dr(D)?fe(i,k):D);Dr(H)||q&&q.defaultChecked||A?Mt(s,k,A?H:cge(j._f)):M(k,H),a.mount&&m()}},C=(k,A,D,q,j)=>{let H=!1,ne=!1,ve={name:k};if(!e.disabled){if(!D||q){(u.isDirty||d.isDirty)&&(ne=r.isDirty,r.isDirty=ve.isDirty=R(),H=ne!==ve.isDirty);let Qe=Wd(fe(i,k),A);ne=!!fe(r.dirtyFields,k),Qe?Wr(r.dirtyFields,k):Mt(r.dirtyFields,k,!0),ve.dirtyFields=r.dirtyFields,H=H||(u.dirtyFields||d.dirtyFields)&&ne!==!Qe}if(D){let Qe=fe(r.touchedFields,k);Qe||(Mt(r.touchedFields,k,D),ve.touchedFields=r.touchedFields,H=H||(u.touchedFields||d.touchedFields)&&Qe!==D)}H&&j&&f.state.next(ve)}return H?ve:{}},O=(k,A,D,q)=>{let j=fe(r.errors,k),H=(u.isValid||d.isValid)&&Rl(A)&&r.isValid!==A;if(e.delayError&&D?(l=h(()=>y(k,D)),l(e.delayError)):(clearTimeout(c),l=null,D?Mt(r.errors,k,D):Wr(r.errors,k)),(D?!Wd(j,D):j)||!as(q)||H){let ne={...q,...H&&Rl(A)?{isValid:A}:{},errors:r.errors,name:k};r={...r,...ne},f.state.next(ne)}},S=async k=>{v(k,!0);let A=await e.resolver(s,e.context,cKe(k||o.mount,n,e.criteriaMode,e.shouldUseNativeValidation));return v(k),A},T=async k=>{let{errors:A}=await S(k);if(k)for(let D of k){let q=fe(A,D);q?Mt(r.errors,D,q):Wr(r.errors,D)}else r.errors=A;return A},E=async(k,A,D={valid:!0})=>{for(let q in k){let j=k[q];if(j){let{_f:H,...ne}=j;if(H){let ve=o.array.has(H.name),Qe=j._f&&uKe(j._f);Qe&&u.validatingFields&&v([q],!0);let En=await mge(j,o.disabled,s,p,e.shouldUseNativeValidation&&!A,ve);if(Qe&&u.validatingFields&&v([q]),En[H.name]&&(D.valid=!1,A))break;!A&&(fe(En,H.name)?ve?gKe(r.errors,En,H.name):Mt(r.errors,H.name,En[H.name]):Wr(r.errors,H.name))}!as(ne)&&await E(ne,A,D)}}return D.valid},P=()=>{for(let k of o.unMount){let A=fe(n,k);A&&(A._f.refs?A._f.refs.every(D=>!zV(D)):!zV(A._f.ref))&&lt(k)}o.unMount=new Set},R=(k,A)=>!e.disabled&&(k&&A&&Mt(s,k,A),!Wd(Me(),i)),I=(k,A,D)=>sKe(k,o,{...a.mount?s:Dr(A)?i:Ll(k)?{[k]:A}:A},D,A),B=k=>GV(fe(a.mount?s:i,k,e.shouldUnregister?fe(i,k,[]):[])),M=(k,A,D={})=>{let q=fe(n,k),j=A;if(q){let H=q._f;H&&(!H.disabled&&Mt(s,k,wge(A,H)),j=vL(H.ref)&&Ri(A)?"":A,yge(H.ref)?[...H.ref.options].forEach(ne=>ne.selected=j.includes(ne.value)):H.refs?dS(H.ref)?H.refs.forEach(ne=>{(!ne.defaultChecked||!ne.disabled)&&(Array.isArray(j)?ne.checked=!!j.find(ve=>ve===ne.value):ne.checked=j===ne.value||!!j)}):H.refs.forEach(ne=>ne.checked=ne.value===j):YV(H.ref)?H.ref.value="":(H.ref.value=j,H.ref.type||f.state.next({name:k,values:Un(s)})))}(D.shouldDirty||D.shouldTouch)&&C(k,j,D.shouldTouch,D.shouldDirty,!0),D.shouldValidate&&de(k)},z=(k,A,D)=>{for(let q in A){if(!A.hasOwnProperty(q))return;let j=A[q],H=k+"."+q,ne=fe(n,H);(o.array.has(k)||Nr(j)||ne&&!ne._f)&&!Th(j)?z(H,j,D):M(H,j,D)}},G=(k,A,D={})=>{let q=fe(n,k),j=o.array.has(k),H=Un(A);Mt(s,k,H),j?(f.array.next({name:k,values:Un(s)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&D.shouldDirty&&f.state.next({name:k,dirtyFields:oS(i,s),isDirty:R(k,H)})):q&&!q._f&&!Ri(H)?z(k,H,D):M(k,H,D),fge(k,o)&&f.state.next({...r}),f.state.next({name:a.mount?k:void 0,values:Un(s)})},V=async k=>{a.mount=!0;let A=k.target,D=A.name,q=!0,j=fe(n,D),H=Qe=>{q=Number.isNaN(Qe)||Th(Qe)&&isNaN(Qe.getTime())||Wd(Qe,fe(s,D,Qe))},ne=uge(e.mode),ve=uge(e.reValidateMode);if(j){let Qe,En,hs=A.type?cge(j._f):ZWe(k),$o=k.type===ige.BLUR||k.type===ige.FOCUS_OUT,eb=!dKe(j._f)&&!e.resolver&&!fe(r.errors,D)&&!j._f.deps||hKe($o,fe(r.touchedFields,D),r.isSubmitted,ve,ne),wf=fge(D,o,$o);Mt(s,D,hs),$o?(j._f.onBlur&&j._f.onBlur(k),l&&l(0)):j._f.onChange&&j._f.onChange(k);let tb=C(D,hs,$o),fC=!as(tb)||wf;if(!$o&&f.state.next({name:D,type:k.type,values:Un(s)}),eb)return(u.isValid||d.isValid)&&(e.mode==="onBlur"?$o&&m():$o||m()),fC&&f.state.next({name:D,...wf?{}:tb});if(!$o&&wf&&f.state.next({...r}),e.resolver){let{errors:pC}=await S([D]);if(H(hs),q){let hC=pge(r.errors,n,D),AU=pge(pC,n,hC.name||D);Qe=AU.error,D=AU.name,En=as(pC)}}else v([D],!0),Qe=(await mge(j,o.disabled,s,p,e.shouldUseNativeValidation))[D],v([D]),H(hs),q&&(Qe?En=!1:(u.isValid||d.isValid)&&(En=await E(n,!0)));q&&(j._f.deps&&de(j._f.deps),O(D,En,Qe,tb))}},K=(k,A)=>{if(fe(r.errors,A)&&k.focus)return k.focus(),1},de=async(k,A={})=>{let D,q,j=cS(k);if(e.resolver){let H=await T(Dr(k)?k:j);D=as(H),q=k?!j.some(ne=>fe(H,ne)):D}else k?(q=(await Promise.all(j.map(async H=>{let ne=fe(n,H);return await E(ne&&ne._f?{[H]:ne}:ne)}))).every(Boolean),!(!q&&!r.isValid)&&m()):q=D=await E(n);return f.state.next({...!Ll(k)||(u.isValid||d.isValid)&&D!==r.isValid?{}:{name:k},...e.resolver||!k?{isValid:D}:{},errors:r.errors}),A.shouldFocus&&!q&&uS(n,K,k?j:o.mount),q},Me=k=>{let A={...a.mount?s:i};return Dr(k)?A:Ll(k)?fe(A,k):k.map(D=>fe(A,D))},pt=(k,A)=>({invalid:!!fe((A||r).errors,k),isDirty:!!fe((A||r).dirtyFields,k),error:fe((A||r).errors,k),isValidating:!!fe(r.validatingFields,k),isTouched:!!fe((A||r).touchedFields,k)}),At=k=>{k&&cS(k).forEach(A=>Wr(r.errors,A)),f.state.next({errors:k?r.errors:{}})},Ue=(k,A,D)=>{let q=(fe(n,k,{_f:{}})._f||{}).ref,j=fe(r.errors,k)||{},{ref:H,message:ne,type:ve,...Qe}=j;Mt(r.errors,k,{...Qe,...A,ref:q}),f.state.next({name:k,errors:r.errors,isValid:!1}),D&&D.shouldFocus&&q&&q.focus&&q.focus()},Gt=(k,A)=>_o(k)?f.state.subscribe({next:D=>k(I(void 0,A),D)}):I(k,A,!0),Kr=k=>f.state.subscribe({next:A=>{pKe(k.name,A.name,k.exact)&&fKe(A,k.formState||u,h_,k.reRenderRoot)&&k.callback({values:{...s},...r,...A})}}).unsubscribe,Di=k=>(a.mount=!0,d={...d,...k.formState},Kr({...k,formState:d})),lt=(k,A={})=>{for(let D of k?cS(k):o.mount)o.mount.delete(D),o.array.delete(D),A.keepValue||(Wr(n,D),Wr(s,D)),!A.keepError&&Wr(r.errors,D),!A.keepDirty&&Wr(r.dirtyFields,D),!A.keepTouched&&Wr(r.touchedFields,D),!A.keepIsValidating&&Wr(r.validatingFields,D),!e.shouldUnregister&&!A.keepDefaultValue&&Wr(i,D);f.state.next({values:Un(s)}),f.state.next({...r,...A.keepDirty?{isDirty:R()}:{}}),!A.keepIsValid&&m()},ps=({disabled:k,name:A})=>{(Rl(k)&&a.mount||k||o.disabled.has(A))&&(k?o.disabled.add(A):o.disabled.delete(A))},Ir=(k,A={})=>{let D=fe(n,k),q=Rl(A.disabled)||Rl(e.disabled);return Mt(n,k,{...D||{},_f:{...D&&D._f?D._f:{ref:{name:k}},name:k,mount:!0,...A}}),o.mount.add(k),D?ps({disabled:Rl(A.disabled)?A.disabled:e.disabled,name:k}):w(k,!0,A.value),{...q?{disabled:A.disabled||e.disabled}:{},...e.progressive?{required:!!A.required,min:lS(A.min),max:lS(A.max),minLength:lS(A.minLength),maxLength:lS(A.maxLength),pattern:lS(A.pattern)}:{},name:k,onChange:V,onBlur:V,ref:j=>{if(j){Ir(k,A),D=fe(n,k);let H=Dr(j.value)&&j.querySelectorAll&&j.querySelectorAll("input,select,textarea")[0]||j,ne=aKe(H),ve=D._f.refs||[];if(ne?ve.find(Qe=>Qe===H):H===D._f.ref)return;Mt(n,k,{_f:{...D._f,...ne?{refs:[...ve.filter(zV),H,...Array.isArray(fe(i,k))?[{}]:[]],ref:{type:H.type,name:k}}:{ref:H}}}),w(k,!1,void 0,H)}else D=fe(n,k,{}),D._f&&(D._f.mount=!1),(e.shouldUnregister||A.shouldUnregister)&&!(eKe(o.array,k)&&a.action)&&o.unMount.add(k)}}},Ar=()=>e.shouldFocusError&&uS(n,K,o.mount),Zs=k=>{Rl(k)&&(f.state.next({disabled:k}),uS(n,(A,D)=>{let q=fe(n,D);q&&(A.disabled=q._f.disabled||k,Array.isArray(q._f.refs)&&q._f.refs.forEach(j=>{j.disabled=q._f.disabled||k}))},0,!1))},ui=(k,A)=>async D=>{let q;D&&(D.preventDefault&&D.preventDefault(),D.persist&&D.persist());let j=Un(s);if(f.state.next({isSubmitting:!0}),e.resolver){let{errors:H,values:ne}=await S();r.errors=H,j=Un(ne)}else await E(n);if(o.disabled.size)for(let H of o.disabled)Wr(j,H);if(Wr(r.errors,"root"),as(r.errors)){f.state.next({errors:{}});try{await k(j,D)}catch(H){q=H}}else A&&await A({...r.errors},D),Ar(),setTimeout(Ar);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:as(r.errors)&&!q,submitCount:r.submitCount+1,errors:r.errors}),q)throw q},xf=(k,A={})=>{fe(n,k)&&(Dr(A.defaultValue)?G(k,Un(fe(i,k))):(G(k,A.defaultValue),Mt(i,k,Un(A.defaultValue))),A.keepTouched||Wr(r.touchedFields,k),A.keepDirty||(Wr(r.dirtyFields,k),r.isDirty=A.defaultValue?R(k,Un(fe(i,k))):R()),A.keepError||(Wr(r.errors,k),u.isValid&&m()),f.state.next({...r}))},Fl=(k,A={})=>{let D=k?Un(k):i,q=Un(D),j=as(k),H=j?i:q;if(A.keepDefaultValues||(i=D),!A.keepValues){if(A.keepDirtyValues){let ne=new Set([...o.mount,...Object.keys(oS(i,s))]);for(let ve of Array.from(ne))fe(r.dirtyFields,ve)?Mt(H,ve,fe(s,ve)):G(ve,fe(H,ve))}else{if(HV&&Dr(k))for(let ne of o.mount){let ve=fe(n,ne);if(ve&&ve._f){let Qe=Array.isArray(ve._f.refs)?ve._f.refs[0]:ve._f.ref;if(vL(Qe)){let En=Qe.closest("form");if(En){En.reset();break}}}}for(let ne of o.mount){let ve=fe(H,ne,fe(i,ne));Dr(ve)||(Mt(H,ne,ve),G(ne,fe(H,ne)))}}s=Un(H),f.array.next({values:{...H}}),f.state.next({values:{...H}})}o={mount:A.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!u.isValid||!!A.keepIsValid||!!A.keepDirtyValues,a.watch=!!e.shouldUnregister,f.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:j?!1:A.keepDirty?r.isDirty:!!(A.keepDefaultValues&&!Wd(k,i)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:j?{}:A.keepDirtyValues?A.keepDefaultValues&&s?oS(i,s):r.dirtyFields:A.keepDefaultValues&&k?oS(i,k):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},cu=(k,A)=>Fl(_o(k)?k(s):k,A),Uh=(k,A={})=>{let D=fe(n,k),q=D&&D._f;if(q){let j=q.refs?q.refs[0]:q.ref;j.focus&&(j.focus(),A.shouldSelect&&_o(j.select)&&j.select())}},h_=k=>{r={...r,...k}},_={control:{register:Ir,unregister:lt,getFieldState:pt,handleSubmit:ui,setError:Ue,_subscribe:Kr,_runSchema:S,_focusError:Ar,_getWatch:I,_getDirty:R,_setValid:m,_setFieldArray:b,_setDisabledField:ps,_setErrors:x,_getFieldArray:B,_reset:Fl,_resetDefaultValues:()=>_o(e.defaultValues)&&e.defaultValues().then(k=>{cu(k,e.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:Zs,_subjects:f,_proxyFormState:u,get _fields(){return n},get _formValues(){return s},get _state(){return a},set _state(k){a=k},get _defaultValues(){return i},get _names(){return o},set _names(k){o=k},get _formState(){return r},get _options(){return e},set _options(k){e={...e,...k}}},subscribe:Di,trigger:de,register:Ir,handleSubmit:ui,watch:Gt,setValue:G,getValues:Me,reset:cu,resetField:xf,clearErrors:At,unregister:lt,setError:Ue,setFocus:Uh,getFieldState:pt};return{..._,formControl:_}}function SL(t={}){let e=Ba.default.useRef(void 0),r=Ba.default.useRef(void 0),[n,i]=Ba.default.useState({isDirty:!1,isValidating:!1,isLoading:_o(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:_o(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!_o(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{let{formControl:a,...o}=vKe(t);e.current={...o,formState:n}}let s=e.current.control;return s._options=t,iKe(()=>{let a=s._subscribe({formState:s._proxyFormState,callback:()=>i({...s._formState}),reRenderRoot:!0});return i(o=>({...o,isReady:!0})),s._formState.isReady=!0,a},[s]),Ba.default.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),Ba.default.useEffect(()=>{t.mode&&(s._options.mode=t.mode),t.reValidateMode&&(s._options.reValidateMode=t.reValidateMode)},[s,t.mode,t.reValidateMode]),Ba.default.useEffect(()=>{t.errors&&(s._setErrors(t.errors),s._focusError())},[s,t.errors]),Ba.default.useEffect(()=>{t.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,t.shouldUnregister]),Ba.default.useEffect(()=>{if(s._proxyFormState.isDirty){let a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),Ba.default.useEffect(()=>{t.values&&!Wd(t.values,r.current)?(s._reset(t.values,s._options.resetOptions),r.current=t.values,i(a=>({...a}))):s._resetDefaultValues()},[s,t.values]),Ba.default.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),e.current.formState=nKe(n,s),e.current}var Sge=(t,e,r)=>{if(t&&"reportValidity"in t){let n=fe(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},bKe=(t,e)=>{for(let r in e.fields){let n=e.fields[r];n&&n.ref&&"reportValidity"in n.ref?Sge(n.ref,r,t):n&&n.refs&&n.refs.forEach(i=>Sge(i,r,t))}},Tge=(t,e)=>{e.shouldUseNativeValidation&&bKe(t,e);let r={};for(let n in t){let i=fe(e.fields,n),s=Object.assign(t[n]||{},{ref:i&&i.ref});if(xKe(e.names||Object.keys(t),n)){let a=Object.assign({},fe(r,n));Mt(a,"root",s),Mt(r,n,a)}else Mt(r,n,s)}return r},xKe=(t,e)=>{let r=Cge(e);return t.some(n=>Cge(n).match(`^${r}\\.\\d+`))};function Cge(t){return t.replace(/\]|\[/g,"")}function uv(t,e,r){return r===void 0&&(r={}),function(n,i,s){try{var a=!s.shouldUseNativeValidation&&s.criteriaMode==="all";return Promise.resolve(BQ(t,n,Object.assign({},e,{abortPipeEarly:!a}))).then(function(o){if(o.issues){for(var l={};o.issues.length;){var c=o.issues[0],u=DQ(c);if(u&&(l[u]||(l[u]={message:c.message,type:c.type}),a)){var d=l[u].types,f=d&&d[c.type];l[u]=KV(u,a,l,c.type,f?[].concat(f,c.message):c.message)}o.issues.shift()}return{values:{},errors:Tge(l,s)}}return{values:r.raw?Object.assign({},n):o.output,errors:{}}})}catch(o){return Promise.reject(o)}}}var Ige=require("obsidian");function CL(t){return{loop:!1,muted:!1,volume:t["playback.default-volume"],autoPlay:!0,showControls:!0,audioGain:1,playbackRate:1,preservePitch:t["playback.preserve-pitch"],flip:"none",title:"",crossOrigin:"disabled",type:"media",play:"eager"}}function TL(t){return{timestamp:Qi(t)?HA(t.start*1e3):void 0,clip:fl(t)?{start:HA(t.start*1e3),end:HA(t.end*1e3),playToEnd:t.end===Number.POSITIVE_INFINITY}:void 0}}function Ege(t){return{start:Yp(t)/1e3,end:-1}}function EL(t){return{start:t.start?Yp(t.start)/1e3:-1,end:t.playToEnd?Number.POSITIVE_INFINITY:t.end?Yp(t.end)/1e3:-1}}var QV=Z(Ge(),1),fS=class extends si{#e;#t;#r;constructor(e,r,n=!1){super(e.app),this.modalEl.addClass("meta-editor"),this.titleEl.setText(`Edit ${n?"Embed":"Link"} Hash Properties`),this.#e=r,this.#r=e.settings,this.#t=n}get#n(){let{crossOrigin:e,embedLoadStrategy:r,tempFragment:n,type:i,...s}=this.#e;return{...s,play:r,type:i,crossOrigin:e===!1?"disabled":e,...TL(n)}}#i(e){let{crossOrigin:r,play:n,aspectRatio:i,type:s,...a}=e,o=(e.clip&&EL(e.clip))??(e.timestamp&&Ege(e.timestamp));return{...a,embedLoadStrategy:n,type:s!=="media"?s:void 0,crossOrigin:r==="disabled"?!1:r,aspectRatio:i?pl(i.width,i.height):void 0,tempFragment:o}}async renderContent(){let e=await this.#r.loaded,r=this.#n,n=CL(e),i=wKe.filter(a=>this.#t?a!=="timestamp":a!=="play");return(0,QV.jsx)(()=>{let a=SL({resolver:uv(GA),defaultValues:r});return(0,QV.jsx)(KA,{form:a,defaultValues:r,fallbackValues:n,settingItems:i,onSubmit:o=>{this.resolveWith(this.#i(o))},onError:()=>{new Ige.Notice("Failed to save changes, fix errors before confirm")},description:"Options with dot indicator are included in link's hash properties. To exclude them, click reset button in each option or the pills in the header. ",fields:{title:{description:"Override title specified in note or media"},autoPlay:{description:"Start playback when link is opened or seeked to. Disable this will make sure media keep play/paused."},muted:{description:"Mute the media by default."},audioGain:{description:"Amplify audio above maximum volume level by default."},volume:{description:"Default volume level when link is opened."},playbackRate:{description:"Default playback rate when link is opened."}}})},{})}},wKe=["clip","timestamp","autoPlay","loop","muted","volume","showControls","audioGain","playbackRate","preservePitch","aspectRatio","flip","crossOrigin","type","title","play"];var pS=new RegExp(`\\.(?:${jQ().join("|")})$`,"i");async function Age(t){await dm(t);let e=t.app.workspace.editorSuggest.suggests.find(n=>"suggestManager"in n);if(!e)return()=>{};let r=Object.getPrototypeOf(e);return pr(r,{onTrigger:n=>function(i,s,a){let o=i.line,l=s.getLine(o).substring(0,i.ch),c=l.lastIndexOf("[["),u=l.lastIndexOf("]");if(c!==-1&&u<c){let d=l.substring(c+2),f=d.indexOf("#");if(f>0){let p=d.substring(0,f);if(pS.test(p))return null}}return n.call(this,i,s,a)}})}var Eh=require("obsidian");var IL=class extends Eh.EditorSuggest{hashEditor;#e=null;#t=null;constructor(e){super(e.app),this.hashEditor=e}getSuggestions(e){let r=e.query.trim(),n={type:"open-editor"},s=this.#n(e)?"embed":"link",a=c=>!c.supports||c.supports.includes(s);if(this.#t){let c=ZV.find(p=>p.key===this.#t&&p.hasValue),u=c&&a(c)?c.options??[]:[],d=(0,Eh.prepareSimpleSearch)(r),f=u.map(p=>{let h=d(p)?.score??(r?-1:0),m=d(p)?.matches??[];return{e:{key:p,label:p,hasValue:!1,keyMatches:m},score:h}}).filter(p=>p.score>-1).sort((p,h)=>h.score-p.score||p.e.key.localeCompare(h.e.key)).slice(0,20).map(({e:p})=>p);return f.length>0?f:[n]}if(!r)return[n,...ZV.filter(a).slice(0,20)];let l=(0,Eh.prepareSimpleSearch)(r);return ZV.filter(a).map(c=>{let u=l(c.key)?.score??-1,d=l(c.label)?.score??-1,f=Math.max(...(c.aliases??[]).map(m=>l(m)?.score??-1)),p=Math.max(u,d,f),h=l(c.key)?.matches??[];return{e:{...c,keyMatches:h},score:p}}).filter(c=>c.score>-1).sort((c,u)=>u.score-c.score||c.e.key.localeCompare(u.e.key)).slice(0,20).map(({e:c})=>c)}renderSuggestion(e,r){if("key"in e){r.addClass("mx-hash-prop");let a=r.createDiv({cls:"mx-hash-prop-title"});this.#s(a,e.key,e.keyMatches??[]),e.description&&r.createDiv({cls:"mx-hash-prop-desc"}).setText(e.description);return}r.addClasses(["mx-hash-prop","icon"]);let n=r.createDiv({cls:"mx-hash-edit-icon"});(0,Eh.setIcon)(n,"square-pen"),r.createDiv({cls:"mx-hash-prop-title"}).appendText("Edit hash properties"),r.createDiv({cls:"mx-hash-prop-desc"}).setText("Open dialog to edit all hash parameters")}selectSuggestion(e){if(!this.context)return;let{editor:r}=this.context;if(!("key"in e)){let p=r.getCursor(),h=Pge(this.#e,r,p);if(!h)return;let m=r.getRange(h.start,h.end);this.hashEditor.editHash({start:h.start,end:h.end,text:m},r).then(()=>{let v=Pge(this.#e,r,r.getCursor());if(!v)return;let b=r.getLine(v.end.line),y=v.end.ch;if(this.#e==="wiki"){let x=b.indexOf("]]",v.end.ch);y=x===-1?v.end.ch:x+2}else if(this.#e==="markdown"){let x=b.indexOf(")",v.end.ch);y=x===-1?v.end.ch:x+1}r.setCursor({line:v.end.line,ch:y})}).catch(v=>{if(!kt.test(v))throw v});return}let n=r.getCursor(),i=r.getLine(n.line),s=i.lastIndexOf("#",n.ch-1),a=i.lastIndexOf("&",n.ch-1),o=a!==-1&&a>s?a+1:s+1;if(this.#t){let p=i.lastIndexOf("=",n.ch-1),h={line:n.line,ch:Math.max(p+1,o)},m={line:n.line,ch:n.ch};r.replaceRange(e.key,h,m);let v=h.ch+e.key.length,y=r.getLine(n.line).charAt(v);y!=="&"&&r.replaceRange("&",{line:n.line,ch:v});let x=v+(y==="&"?0:1),w=r.getLine(n.line);this.#e==="wiki"?w.indexOf("]]",x)===-1&&r.replaceRange("]]",{line:n.line,ch:x}):this.#e==="markdown"&&w.indexOf(")",x)===-1&&r.replaceRange(")",{line:n.line,ch:x}),r.setCursor({line:n.line,ch:x});return}let l=e.hasValue?`${e.key}=`:`${e.key}&`,c={line:n.line,ch:Math.max(o,0)},u={line:n.line,ch:n.ch};r.replaceRange(l,c,u);let d=c.ch+l.length,f=r.getLine(n.line);this.#e==="wiki"?f.indexOf("]]",d)===-1&&r.replaceRange("]]",{line:n.line,ch:d}):this.#e==="markdown"&&f.indexOf(")",d)===-1&&r.replaceRange(")",{line:n.line,ch:d}),e.hasValue?r.setCursor({line:n.line,ch:d}):r.setCursor({line:n.line,ch:d})}onTrigger(e,r){return this.#i(e,r)??this.#r(e,r)}#r(e,r){let n=e.line,i=r.getLine(n),a=i.substring(0,e.ch).lastIndexOf("](");if(a===-1)return null;let o=a+1,l=i.indexOf("#",o+1);if(l===-1||l>=e.ch)return null;let c=i.substring(o+1,e.ch);if(!(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("file://")))return null;let u=i.substring(o+1,l);if(c.startsWith("file://")&&!pS.test(u))return null;let d=i.lastIndexOf("&",e.ch-1),f=d!==-1&&d>l?d+1:l+1,p=i.lastIndexOf("=",e.ch-1);if(this.#e="markdown",p>=f){let h=i.substring(f,p).trim();return this.#t=h,{start:{line:n,ch:p+1},end:{line:n,ch:e.ch},query:i.substring(p+1,e.ch)}}return this.#t=null,{start:{line:n,ch:f},end:{line:n,ch:e.ch},query:i.substring(f,e.ch)}}#n(e){let{editor:r,end:n}=e,s=r.getLine(n.line).substring(0,n.ch);if(this.#e==="wiki"){let a=s.lastIndexOf("[[");return a===-1?!1:a>0&&s.charAt(a-1)==="!"}if(this.#e==="markdown"){let a=s.lastIndexOf("](");if(a===-1)return!1;let o=s.lastIndexOf("[",a);return o===-1?!1:o>0&&s.charAt(o-1)==="!"}return!1}#i(e,r){let n=e.line,i=r.getLine(n),a=i.substring(0,e.ch).lastIndexOf("[[");if(a===-1)return null;let o=i.indexOf("#",a+2);if(o===-1||o>=e.ch)return null;let l=i.indexOf("|",o+1);if(l!==-1&&e.ch>l)return null;let c=i.substring(a+2,o);if(!pS.test(c))return null;let u=i.lastIndexOf("&",e.ch-1),d=u!==-1&&u>o?u+1:o+1,f=i.lastIndexOf("=",e.ch-1);if(this.#e="wiki",f>=d){let p=i.substring(d,f).trim();return this.#t=p,{start:{line:n,ch:f+1},end:{line:n,ch:e.ch},query:i.substring(f+1,e.ch)}}return this.#t=null,{start:{line:n,ch:d},end:{line:n,ch:e.ch},query:i.substring(d,e.ch)}}#s(e,r,n){if(!n.length){e.setText(r);return}let i=0;for(let[s,a]of n)i<s&&e.appendText(r.slice(i,s)),e.createSpan({cls:"mx-hash-prop-mark"}).setText(r.slice(s,a)),i=a;i<r.length&&e.appendText(r.slice(i))}},ZV=[{key:"t",label:"Temporal",description:"Timestamp or clip time range",hasValue:!0,aliases:["time","timestamp","clip"]},{key:"vol",label:"Volume",description:"Volume level (0-100)",hasValue:!0,aliases:["volume"]},{key:"speed",label:"Playback Rate",description:"Playback speed multiplier",hasValue:!0,aliases:["rate","playbackRate"]},{key:"autoplay",label:"Auto Play",description:"Start playing automatically",hasValue:!1,aliases:["play"]},{key:"no_autoplay",label:"No Auto Play",description:"Do not autoplay when opened",hasValue:!1,aliases:["no play"]},{key:"mute",label:"Muted",description:"Mute the media when opened",hasValue:!1,aliases:["muted"]},{key:"no_mute",label:"No Mute",description:"Do not mute when opened",hasValue:!1},{key:"loop",label:"Loop",description:"Restart playback when it ends",hasValue:!1},{key:"no_loop",label:"No Loop",description:"Disable looping",hasValue:!1},{key:"controls",label:"Controls",description:"Display player controls",hasValue:!1},{key:"no_controls",label:"No Controls",description:"Hide player controls",hasValue:!1,aliases:["noctrl"]},{key:"keep_pitch",label:"Preserve Pitch",description:"Maintain audio pitch when changing speed",hasValue:!1,aliases:["preservePitch","pitch"]},{key:"no_pitch",label:"No Preserve Pitch",description:"Do not preserve audio pitch",hasValue:!1},{key:"ratio",label:"Aspect Ratio",description:"Video aspect ratio (e.g., 16:9)",hasValue:!0,aliases:["aspect","aspectRatio"]},{key:"flip",label:"Flip",description:"Mirror video horizontally or vertically",hasValue:!0,options:["none","horizontal","vertical","both"],aliases:["mirror"]},{key:"crossorigin",label:"Cross Origin",description:"CORS policy for media loading",hasValue:!0,options:["anonymous","use-credentials"],aliases:["cors","crossOrigin"]},{key:"gain",label:"Audio Gain",description:"Audio amplification multiplier",hasValue:!0,aliases:["audioGain"]},{key:"load",label:"Load Strategy",description:"When to start loading the media",hasValue:!0,supports:["embed"],options:["eager","play"],aliases:["play","embed","strategy"]},{key:"as",label:"Media Type",description:"Force media type interpretation",hasValue:!0,options:["video","audio"],aliases:["type","media"]},{key:"title",label:"Title",description:"Custom title for the media",hasValue:!0}];function kKe(t,e,r){for(let n=r;n<t.length;n++)if(t[n]===e&&!Rge(t,n))return n;return-1}function Rge(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n--)r++;return(r&1)===1}function SKe(t,e){for(let r=e;r<t.length-1;r++)if(t[r]==="]"&&!Rge(t,r)&&t[r+1]==="]")return r+2;return-1}function Pge(t,e,r){let n=r.line,i=e.getLine(n);if(t==="markdown"){let a=i.substring(0,r.ch).lastIndexOf("](");if(a===-1)return null;let o=a+1;if(i.indexOf("#",o+1)===-1)return null;let c=kKe(i,")",o+1);return c===-1?(e.replaceRange(")",{line:n,ch:r.ch}),{start:{line:n,ch:o+1},end:{line:n,ch:r.ch}}):{start:{line:n,ch:o+1},end:{line:n,ch:c}}}if(t==="wiki"){let a=i.substring(0,r.ch).lastIndexOf("[[");if(a===-1)return null;let o=i.indexOf("#",a+2);if(o===-1)return null;let l=SKe(i,a+2),c=i.indexOf("|",o+1);if(l===-1)return e.replaceRange("]]",{line:n,ch:r.ch}),{start:{line:n,ch:a+2},end:{line:n,ch:r.ch}};let u=c!==-1&&c<l?c:l-2;return{start:{line:n,ch:a+2},end:{line:n,ch:u}}}return null}var AL=class{plugin;app;mediaParser;settings;#e;#t=null;#r;constructor(e){var n=[];try{this.plugin=e.plugin;this.app=e.app;this.mediaParser=e.mediaParser;this.settings=e.settings;this.#r=(o,l)=>new fS(e,o,l).requestInput();let r=J(n,new DisposableStack);cm(r,window,"contextmenu",o=>{this.#t=o,sleep(100).then(()=>{this.#t=null})},{capture:!0,passive:!0});Age(this.plugin).then(o=>this.#e.defer(o));xr(r,this.app.workspace.on("editor-menu",this.#n,this));this.plugin.registerEditorSuggest(new IL(this));this.#e=r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}[Symbol.dispose](){this.#e.dispose()}async editHash(e,r){let n=e.text.indexOf("#"),i=n===-1?"":e.text.substring(n+1),s=this.mediaParser.parseHash(i),a=!!Xme(r,e.start),o=await this.#r(s,a),l=Zu(o).toString();if(r.getRange(e.start,e.end)!==e.text){new PL.Notice("Link has been modified externally, edit cancelled");return}let u=e.end,d=Qme(r,e.start);if(n!==-1&&d==="wiki"){let p=ege(e.text,n);p!=null&&(u={line:e.end.line,ch:e.start.ch+p})}r.replaceRange(l,{line:e.start.line,ch:e.start.ch+n+1},u);let f=tge(r,e.start,d);r.setCursor(f)}#n(e,r,n){let i=r.activeCM,s=r.offsetToPos(Yme(i,this.#t)),a=r.getClickableTokenAt(s);if(!a||!this.settings.value)return;let l={isEmbed:jV(r,r.posToOffset(a.start))?.isEmbed,editor:r,info:n,token:a,event:this.#t};if(a.type==="external-link"){let c=this.mediaParser.parseUrl(a.text);if(!c)return;this.plugin.app.workspace.trigger("mx:editor-link-menu",e,c,l)}if(a.type==="internal-link"){let{path:c,subpath:u}=(0,PL.parseLinktext)(a.text),d=this.plugin.app.metadataCache.getFirstLinkpathDest(c,n.file?.path??"");if(!d)return;let f=this.mediaParser.parseFile(d);if(!f)return;let p=this.mediaParser.parseHash(u),h={info:f,hash:p};this.plugin.app.workspace.trigger("mx:editor-link-menu",e,h,l)}}};var tj=(t,e)=>e.some(r=>t instanceof r),Lge,Mge;function CKe(){return Lge||(Lge=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function TKe(){return Mge||(Mge=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var rj=new WeakMap,JV=new WeakMap,RL=new WeakMap;function EKe(t){let e=new Promise((r,n)=>{let i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",a)},s=()=>{r(Kd(t.result)),i()},a=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",a)});return RL.set(e,t),e}function IKe(t){if(rj.has(t))return;let e=new Promise((r,n)=>{let i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",a),t.removeEventListener("abort",a)},s=()=>{r(),i()},a=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",a),t.addEventListener("abort",a)});rj.set(t,e)}var nj={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return rj.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Kd(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Nge(t){nj=t(nj)}function AKe(t){return TKe().includes(t)?function(...e){return t.apply(ij(this),e),Kd(this.request)}:function(...e){return Kd(t.apply(ij(this),e))}}function PKe(t){return typeof t=="function"?AKe(t):(t instanceof IDBTransaction&&IKe(t),tj(t,CKe())?new Proxy(t,nj):t)}function Kd(t){if(t instanceof IDBRequest)return EKe(t);if(JV.has(t))return JV.get(t);let e=PKe(t);return e!==t&&(JV.set(t,e),RL.set(e,t)),e}var ij=t=>RL.get(t);function aj(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){let a=indexedDB.open(t,e),o=Kd(a);return n&&a.addEventListener("upgradeneeded",l=>{n(Kd(a.result),l.oldVersion,l.newVersion,Kd(a.transaction),l)}),r&&a.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),o.then(l=>{s&&l.addEventListener("close",()=>s()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),o}function Fge(t,{blocked:e}={}){let r=indexedDB.deleteDatabase(t);return e&&r.addEventListener("blocked",n=>e(n.oldVersion,n)),Kd(r).then(()=>{})}var RKe=["get","getKey","getAll","getAllKeys","count"],LKe=["put","add","delete","clear"],ej=new Map;function _ge(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(ej.get(e))return ej.get(e);let r=e.replace(/FromIndex$/,""),n=e!==r,i=LKe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||RKe.includes(r)))return;let s=async function(a,...o){let l=this.transaction(a,i?"readwrite":"readonly"),c=l.store;return n&&(c=c.index(o.shift())),(await Promise.all([c[r](...o),i&&l.done]))[0]};return ej.set(e,s),s}Nge(t=>({...t,get:(e,r,n)=>_ge(e,r)||t.get(e,r,n),has:(e,r)=>!!_ge(e,r)||t.has(e,r)}));var MKe=["continue","continuePrimaryKey","advance"],Oge={},sj=new WeakMap,Bge=new WeakMap,_Ke={get(t,e){if(!MKe.includes(e))return t[e];let r=Oge[e];return r||(r=Oge[e]=function(...n){sj.set(this,Bge.get(this)[e](...n))}),r}};async function*OKe(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;let r=new Proxy(e,_Ke);for(Bge.set(r,e),RL.set(r,ij(e));e;)yield r,e=await(sj.get(r)||e.continue()),sj.delete(r)}function Dge(t,e){return e===Symbol.asyncIterator&&tj(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&tj(t,[IDBIndex,IDBObjectStore])}Nge(t=>({...t,get(e,r,n){return Dge(e,r)?OKe:t.get(e,r,n)},has(e,r){return Dge(e,r)||t.has(e,r)}}));var LL=class{settings;app;#e=null;#t=null;constructor(e){this.settings=e.settings,this.app=e.app}get vaultId(){return this.app.appId}get storeName(){return`vault-${this.vaultId}`}get maxSizeMB(){return this.settings.value?.["cache.cover-image.max-size-mb"]??100}get maxSizeBytes(){return this.maxSizeMB*1024*1024}async#r(){return this.#e?this.#e:(this.#t||(this.#t=aj("mx-cover-image-cache",1,{upgrade(e){}})),this.#e=await this.#t,this.#e)}async#n(){let e=await this.#r();if(!e.objectStoreNames.contains(this.storeName)){this.#e=null,this.#t=null;let r=e.version;e.close();let n=this;this.#t=aj("mx-cover-image-cache",r+1,{upgrade(i){i.objectStoreNames.contains(n.storeName)||i.createObjectStore(n.storeName,{keyPath:"uid"})}}),this.#e=await this.#t}}async getMany(e){let r=new Map;try{await this.#n();let i=(await this.#r()).transaction(this.storeName,"readwrite"),s=i.objectStore(this.storeName),a=MQ(e),o=Date.now();for(let l of a){let c=await s.get(l);c&&(c.lastAccessed=o,await s.put(c),r.set(l,c.blob))}return await i.done,r}catch(n){return console.error("Failed to get image from cache:",n),r}}async get(e){try{await this.#n();let n=(await this.#r()).transaction(this.storeName,"readwrite"),i=n.objectStore(this.storeName),s=await i.get(e);return s?(s.lastAccessed=Date.now(),await i.put(s),await n.done,s.blob):null}catch(r){return console.error("Failed to get image from cache:",r),null}}async set(e,r){try{await this.#n();let n=await this.#r(),i={uid:e,blob:r,lastAccessed:Date.now(),size:r.size};await n.put(this.storeName,i),await this.#i()}catch(n){console.error("Failed to set image in cache:",n)}}async delete(e){try{await this.#n(),await(await this.#r()).delete(this.storeName,e)}catch(r){console.error("Failed to delete image from cache:",r)}}async clear(){try{await this.#n(),await(await this.#r()).clear(this.storeName)}catch(e){console.error("Failed to clear cache:",e)}}async getTotalSize(){try{await this.#n();let n=(await this.#r()).transaction(this.storeName,"readonly").objectStore(this.storeName),i=0;for await(let s of n)i+=s.value.size;return i}catch(e){return console.error("Failed to get total cache size:",e),-1}}async resetDatabase(){try{this.#e&&(this.#e.close(),this.#e=null,this.#t=null),await Fge("mx-cover-image-cache")}catch(e){console.error("Failed to reset cache database:",e)}}async#i(){try{let r=(await this.#r()).transaction(this.storeName,"readwrite"),n=r.objectStore(this.storeName),i=[],s=0;for await(let o of n)i.push(o.value),s+=o.value.size;if(s<=this.maxSizeBytes)return;i.sort((o,l)=>o.lastAccessed-l.lastAccessed);let a=s;for(let o of i){if(a<=this.maxSizeBytes)break;await n.delete(o.uid),a-=o.size}await r.done}catch(e){console.error("Failed to evict cache entries:",e)}}};var Vge=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),jge=t=>{throw TypeError(t)},$ge=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&jge("Object expected");var n,i;r&&(n=e[Vge("asyncDispose")]),n===void 0&&(n=e[Vge("dispose")],r&&(i=n)),typeof n!="function"&&jge("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},Uge=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,l,c){return c=Error(l),c.name="SuppressedError",c.error=a,c.suppressed=o,c},i=a=>e=r?new n(a,e,"An error was suppressed during disposal"):(r=!0,a),s=a=>{for(;a=t.pop();)try{var o=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(o).then(s,l=>(i(l),s()))}catch(l){i(l)}if(r)throw e};return s()},DKe=1e4;function hS(t,{timeout:e=DKe,signal:r}={}){return{createRemoteFn(n){return Object.assign(async(...a)=>{var o=[];try{let u=Xr(),d={type:"TASK",taskId:u,fnName:n,args:a},f=AbortSignal.any([AbortSignal.timeout(e),r].filter(v=>v!==void 0)),p=$ge(o,new DisposableStack),h=async()=>{console.log("handleAbort",u),await t.sendMessage({type:"ABORT",taskId:u})};f.addEventListener("abort",h,{once:!0}),p.defer(()=>{f.removeEventListener("abort",h)});let m=await t.invoke(d,{signal:f});if(m.type==="ERROR")throw m.error;return m.value}catch(u){var l=u,c=!0}finally{Uge(o,l,c)}},{with:async(a,o)=>{var l=[];try{let d=Xr(),f={type:"TASK",taskId:d,fnName:n,args:a},p=$ge(l,new DisposableStack),h=async()=>{console.log("handleAbort",d),await t.sendMessage({type:"ABORT",taskId:d})},m=AbortSignal.any([AbortSignal.timeout(o.timeout??e),r,o.signal].filter(y=>y!==void 0));m.addEventListener("abort",h,{once:!0}),p.defer(()=>{m.removeEventListener("abort",h)});let v=a0(o,["timeout","signal"]),b=await t.invoke(f,{signal:m,...v});if(b.type==="ERROR")throw b.error;return b.value}catch(d){var c=d,u=!0}finally{Uge(l,c,u)}}})}}}var ls=class t extends Error{static name="CodeError";code;constructor(e,r){super(r),this.name=t.name,this.code=e}};function zge(t){return t?.type==="TASK"}function qge(t){return t?.type==="RESULT"}function Hge(t){return t?.type==="ERROR"}function Gge(t){return t?.type==="ABORT"}function oj(t){return t?.type==="EVENT"}function Wge(t){if(typeof t!="object"||t===null)return!1;let e=t;return qge(e)||Hge(e)||zge(e)||Gge(e)||oj(e)}function ML(t,e){let r=e;return!r||oj(r)?!1:r.taskId===t.taskId&&(qge(r)||Hge(r))}var Ih=require("obsidian");async function lj(t,{onExternalLinkClick:e,onInternalLinkClick:r}){let n=await QY();return pr(n,{triggerClickableToken:i=>async function(s,a,...o){let l=()=>i.call(this,s,a,...o);if(r&&s.type==="internal-link")try{await r.call(t,s.text,this.file.path,zd(a),l)}catch(c){console.error("onInternalLinkClick error in editor, fallback to default",c),l()}else if(e&&s.type==="external-link")try{await e.call(t,s.text,zd(a),l)}catch(c){console.error("onExternalLinkClick error in editor, fallback to default",c),l()}else l()}})}var Kge=require("obsidian");function cj(t,{onExternalLinkClick:e}){let r=o=>{let l=o.target;if(!l.instanceOf(HTMLElement)||!l.matches(".metadata-property .metadata-property-value .external-link"))return;let c=l.closest(".metadata-property");if(!c)return;let u=c.dataset.propertyKey;if(!(u!=="video"&&u!=="audio"&&u!=="media")&&l.textContent&&an(l.textContent)){e.call(t,o,l.textContent,qd(o));return}},n=new WeakSet,i=o=>{n.has(o)||(n.add(o),o.registerDomEvent(o.containerEl,"click",r,{capture:!0}))},s=o=>{n.has(o)&&(n.delete(o),o.containerEl.removeEventListener("click",r))};for(let o of t.app.workspace.getLeavesOfType("markdown"))o.isDeferred||i(o.view);let a=pr(Kge.MarkdownView.prototype,{onload:o=>function(){return i(this),o.call(this)}});t.register(()=>{a();for(let o of t.app.workspace.getLeavesOfType("markdown"))s(o.view)})}var Yge=require("obsidian");function uj(t,{onInternalLinkClick:e}){var n=[];try{let r=J(n,new DisposableStack);r.defer(pr(Yge.Workspace.prototype,{openLinkText:o=>async function(l,c,u,d,...f){let p=()=>o.call(this,l,c,u,d,...f);try{await e.call(t,l,c,zd(u),p)}catch(h){console.error("onInternalLinkClick error in openLinktext, fallback to default",h),p()}}}));return r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}function dj(t){t.registerMarkdownPostProcessor(e=>{for(let r of e.querySelectorAll("a")){let n=r.getAttr("aria-label");if(n)try{let i=decodeURI(n);n!==i&&r.setAttr("aria-label",i)}catch{}}})}var Xge=require("obsidian");function fj(t,e){let r=new DisposableStack,n=r.use(new hu);return NKe({signal:n.signal}).then(i=>{r.use(FKe(i,e,t)),console.debug("preview click patched")}).catch(i=>{kt.test(i)||console.error("Failed to patch preview click",i)}),r}async function NKe({signal:t}){var n=[];try{let e=J(n,new DisposableStack);let r=new Promise(o=>{e.defer(pr(Xge.MarkdownPreviewRenderer,{registerDomEvents:l=>function(c,u,...d){return o(u),l.call(this,c,u,...d)}}))});return await Vr(r,t)}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}function FKe(t,{onExternalLinkClick:e,onInternalLinkClick:r},n){var s=[];try{let i=J(s,new DisposableStack);i.defer(pr(KY(t),{...e?{onExternalLinkClick:c=>async function(u,d,f,...p){let h=()=>c.call(this,u,d,f,...p);u.preventDefault();try{await e.call(n,f,qd(u),h)}catch(m){console.error("onExternalLinkClick error in preview, fallback to default",m),h()}}}:{},...r?{onInternalLinkClick:c=>async function(u,d,f,...p){let h=()=>c.call(this,u,d,f,...p);u.preventDefault();try{await r.call(n,f,this.info?.file?.path??"",qd(u),h)}catch(m){console.error("onInternalLinkClick error in preview, fallback to default",m),h()}}}:{}}));return i.move()}catch(a){var o=a,l=!0}finally{ee(s,o,l)}}var _L=class{plugin;app;workspace;settings;mediaLib;fileHelper;mediaParser;#e;constructor(e){var n=[];try{this.plugin=e.plugin;this.app=e.plugin.app;this.workspace=e.workspaceOpen;this.settings=e.settings;this.mediaLib=e.mediaLib;this.fileHelper=e.fileService;this.mediaParser=e.mediaParser;let r=J(n,new DisposableStack);lj(this,{onExternalLinkClick:this.#i,onInternalLinkClick:this.#r}).then(o=>this.#e.defer(o));r.use(fj(this,{onExternalLinkClick:this.#i,onInternalLinkClick:this.#r}));r.use(uj(this,{onInternalLinkClick:this.#n}));r.use(nge(this,{onOpenFile:this.#t}));dj(this.plugin);cj(this.plugin,{onExternalLinkClick:(o,l,c)=>{o.stopImmediatePropagation(),this.#i(l,c,()=>{})}});this.#e=r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}[Symbol.dispose](){this.#e.dispose()}shouldHandleLinkLogic(e,r){let{info:n,hash:i}=e;if(n.type==="url:hosted")return r["link.handle-hosted"];if(n.type==="url:direct"){if(!r["link.handle-direct-url"])return!1;let s=!!this.mediaLib.findNoteByMedia(n),a=!!i?.tempFragment,o=xD(n.url);return s||a||o}Be(n)}async shouldHandleLink(e){let r=await this.settings.loaded;return this.shouldHandleLinkLogic(e,r)}shouldHandleEmbedLogic(e,r){let{info:n,hash:i}=e;if(n.type==="url:hosted")return r["note.embed.handle-hosted"];if(n.type==="url:direct"){if(!r["note.embed.handle-direct-url"])return!1;let s=!!this.mediaLib.findNoteByMedia(n),a=!!i?.tempFragment,o=xD(n.url);return s||a||o}Be(n)}#t=async(e,r,n)=>{let i=this.mediaParser.parseFile(e),s=this.mediaParser.parseHashFromEphemeralState(r?.eState)??void 0;if(!i)return n();await this.workspace.openMedia({info:i,hash:s})};#r=async(e,r,n,i)=>{let{path:s,subpath:a}=(0,Ih.parseLinktext)(e),o=this.mediaParser.parseFile(this.app.metadataCache.getFirstLinkpathDest(s,r));if(!o){i();return}await this.workspace.openMedia({info:o,hash:this.mediaParser.parseHash(a)},{newLeaf:n,fromUser:!0})};#n=async(e,r,n,i)=>{let{path:s,subpath:a}=(0,Ih.parseLinktext)(e),o=this.mediaParser.parseFile(this.app.metadataCache.getFirstLinkpathDest(s,r));if(!o){i();return}await this.workspace.openMedia({info:o,hash:this.mediaParser.parseHash(a)},{newLeaf:n,fromUser:!1})};#i=async(e,r,n)=>{let i=this.mediaParser.parseUrl(e);try{if(!i||!await this.shouldHandleLink(i))throw new ls("fallback");i.info.type==="url:direct"&&Bt(i.info.url)&&this.fileHelper.resolveFileUri(i.info.url),await this.workspace.openMedia(i,{newLeaf:r,fromUser:!0})}catch(s){if(s instanceof Error){if(s instanceof ls){if(s.code==="no-browser-session"){new Ih.Notice("No browser session connected to obsidian, go to browser companion to connect");return}if(s.code==="fallback"){s.message&&(console.error("open external link fallback error",s),new Ih.Notice(`Failed to open media link: ${s.message}`)),n();return}if(s.code==="browser-na"){n();return}}console.error("open external link error",s,ls),new Ih.Notice(`Failed to open media link: ${s.message}`)}throw s}}};var uye=require("obsidian");var Qge="4.1.0";var C3t=Symbol.for("mx:main-ps"),Zge="mx:main-ps:ready",Jge="mx:main-ps:connect",eye="mx:main-ps:disconnect",tye=Qge;var OL="mx:ipc-emit:v1",rye="mx:ipc-invoke:v1";function DL(t){return Wge(t)?t:(console.warn("Received non-IPC message, ignoring",t),null)}Oe.registerCustom({isApplicable:t=>t instanceof Error&&t.name===ls.name&&typeof t.code=="string",serialize:t=>JSON.stringify(Yf(t,["name","message","code"])),deserialize:t=>{let{message:e,...r}=JSON.parse(t);return Object.assign(new ls(e),r)}},"nodejs-error");Oe.registerCustom({isApplicable:t=>t instanceof Error&&t.name===ls.name,serialize:t=>JSON.stringify(Yf(t,["message","code","stack"])),deserialize:t=>{let{message:e,code:r,...n}=JSON.parse(t);return Object.assign(new ls(r,e),n)}},"fallback-error");function nye(t){try{let e=Oe.deserialize(t);return DL(e)}catch(e){return console.warn("Error deserializing SuperJSON payload",e,t),null}}function iye(t){return Oe.serialize(t)}function NL(t,{taskId:e,stack:r}){return new Promise(n=>{let i=()=>{n({type:"ERROR",taskId:e,error:new Error("Aborted")})};t?.addEventListener("abort",i,{once:!0}),r.defer(()=>{t?.removeEventListener("abort",i)})})}var sye=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),aye=t=>{throw TypeError(t)},oye=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&aye("Object expected");var n,i;r&&(n=e[sye("asyncDispose")]),n===void 0&&(n=e[sye("dispose")],r&&(i=n)),typeof n!="function"&&aye("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},lye=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,l,c){return c=Error(l),c.name="SuppressedError",c.error=a,c.suppressed=o,c},i=a=>e=r?new n(a,e,"An error was suppressed during disposal"):(r=!0,a),s=a=>{for(;a=t.pop();)try{var o=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(o).then(s,l=>(i(l),s()))}catch(l){i(l)}if(r)throw e};return s()},FL={parse:nye,stringify:iye},BL=class{#e;constructor(e){this.#e=e}async sendMessage(e){this.#e.send(OL,FL.stringify(e))}addMessageHandler(e){var r=[];try{let s=oye(r,new DisposableStack),a=(o,l)=>{let c=FL.parse(l);c&&e(c)};return this.#e.on(OL,a),s.defer(()=>{this.#e.off(OL,a)}),s.move()}catch(s){var n=s,i=!0}finally{lye(r,n,i)}}async invoke(e,{signal:r}={}){var n=[];try{let a=oye(n,new DisposableStack);return await Promise.race([this.#e.invoke(rye,FL.stringify(e)).then(o=>{let l=FL.parse(o);return ML(e,l)?l:{type:"ERROR",taskId:e.taskId,error:new Error("Invalid invoke response")}}),NL(r,{taskId:e.taskId,stack:a})])}catch(a){var i=a,s=!0}finally{lye(n,i,s)}}};var dv={getAll:"get-credentials",set:"set-credential",delete:"delete-credential",clear:"clear-credentials",import:"import-credentials"};function pj(t){let e=new BL(t),r=hS(e);return{getCredentials:r.createRemoteFn(dv.getAll),setCredential:r.createRemoteFn(dv.set),deleteCredential:r.createRemoteFn(dv.delete),clearCredentials:r.createRemoteFn(dv.clear),importCredentials:r.createRemoteFn(dv.import),[Symbol.dispose]:()=>{}}}var hj='"use strict";var qg=Object.create;var gr=Object.defineProperty;var Ng=Object.getOwnPropertyDescriptor;var Lg=Object.getOwnPropertyNames;var Dg=Object.getPrototypeOf,Mg=Object.prototype.hasOwnProperty;var Ta=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ca=e=>{throw TypeError(e)};var p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jg=(e,t)=>{for(var r in t)gr(e,r,{get:t[r],enumerable:!0})},Ia=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Lg(t))!Mg.call(e,i)&&i!==r&&gr(e,i,{get:()=>t[i],enumerable:!(n=Ng(t,i))||n.enumerable});return e};var at=(e,t,r)=>(r=e!=null?qg(Dg(e)):{},Ia(t||!e||!e.__esModule?gr(r,"default",{value:e,enumerable:!0}):r,e)),$g=e=>Ia(gr({},"__esModule",{value:!0}),e);var Ye=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Ca("Object expected");var n,i;r&&(n=t[Ta("asyncDispose")]),n===void 0&&(n=t[Ta("dispose")],r&&(i=n)),typeof n!="function"&&Ca("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else r&&e.push([r]);return t},Xe=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()};var W=p((oi,ka)=>{"use strict";var qt=function(e){return e&&e.Math===Math&&e};ka.exports=qt(typeof globalThis=="object"&&globalThis)||qt(typeof window=="object"&&window)||qt(typeof self=="object"&&self)||qt(typeof global=="object"&&global)||qt(typeof oi=="object"&&oi)||function(){return this}()||Function("return this")()});var re=p((nO,qa)=>{"use strict";qa.exports=function(e){try{return!!e()}catch{return!0}}});var fe=p((iO,Na)=>{"use strict";var Fg=re();Na.exports=!Fg(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var mr=p((sO,La)=>{"use strict";var Hg=re();La.exports=!Hg(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var Qe=p((oO,Da)=>{"use strict";var Bg=mr(),vr=Function.prototype.call;Da.exports=Bg?vr.bind(vr):function(){return vr.apply(vr,arguments)}});var Fa=p($a=>{"use strict";var Ma={}.propertyIsEnumerable,ja=Object.getOwnPropertyDescriptor,Ug=ja&&!Ma.call({1:2},1);$a.f=Ug?function(t){var r=ja(this,t);return!!r&&r.enumerable}:Ma});var Nt=p((uO,Ha)=>{"use strict";Ha.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}});var J=p((cO,Ga)=>{"use strict";var Ba=mr(),Ua=Function.prototype,ai=Ua.call,Gg=Ba&&Ua.bind.bind(ai,ai);Ga.exports=Ba?Gg:function(e){return function(){return ai.apply(e,arguments)}}});var _r=p((lO,Ka)=>{"use strict";var Va=J(),Vg=Va({}.toString),Kg=Va("".slice);Ka.exports=function(e){return Kg(Vg(e),8,-1)}});var za=p((fO,Wa)=>{"use strict";var Wg=J(),zg=re(),Yg=_r(),ui=Object,Xg=Wg("".split);Wa.exports=zg(function(){return!ui("z").propertyIsEnumerable(0)})?function(e){return Yg(e)==="String"?Xg(e,""):ui(e)}:ui});var br=p((pO,Ya)=>{"use strict";Ya.exports=function(e){return e==null}});var Sr=p((hO,Xa)=>{"use strict";var Qg=br(),Zg=TypeError;Xa.exports=function(e){if(Qg(e))throw new Zg("Can\'t call method on "+e);return e}});var Lt=p((dO,Qa)=>{"use strict";var Jg=za(),em=Sr();Qa.exports=function(e){return Jg(em(e))}});var Z=p((yO,Za)=>{"use strict";var ci=typeof document=="object"&&document.all;Za.exports=typeof ci>"u"&&ci!==void 0?function(e){return typeof e=="function"||e===ci}:function(e){return typeof e=="function"}});var xe=p((gO,Ja)=>{"use strict";var tm=Z();Ja.exports=function(e){return typeof e=="object"?e!==null:tm(e)}});var qe=p((mO,eu)=>{"use strict";var li=W(),rm=Z(),nm=function(e){return rm(e)?e:void 0};eu.exports=function(e,t){return arguments.length<2?nm(li[e]):li[e]&&li[e][t]}});var Er=p((vO,tu)=>{"use strict";var im=J();tu.exports=im({}.isPrototypeOf)});var su=p((_O,iu)=>{"use strict";var sm=W(),ru=sm.navigator,nu=ru&&ru.userAgent;iu.exports=nu?String(nu):""});var pi=p((bO,fu)=>{"use strict";var lu=W(),fi=su(),ou=lu.process,au=lu.Deno,uu=ou&&ou.versions||au&&au.version,cu=uu&&uu.v8,pe,wr;cu&&(pe=cu.split("."),wr=pe[0]>0&&pe[0]<4?1:+(pe[0]+pe[1]));!wr&&fi&&(pe=fi.match(/Edge\\/(\\d+)/),(!pe||pe[1]>=74)&&(pe=fi.match(/Chrome\\/(\\d+)/),pe&&(wr=+pe[1])));fu.exports=wr});var hi=p((SO,hu)=>{"use strict";var pu=pi(),om=re(),am=W(),um=am.String;hu.exports=!!Object.getOwnPropertySymbols&&!om(function(){var e=Symbol("symbol detection");return!um(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&pu&&pu<41})});var di=p((EO,du)=>{"use strict";var cm=hi();du.exports=cm&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var yi=p((wO,yu)=>{"use strict";var lm=qe(),fm=Z(),pm=Er(),hm=di(),dm=Object;yu.exports=hm?function(e){return typeof e=="symbol"}:function(e){var t=lm("Symbol");return fm(t)&&pm(t.prototype,dm(e))}});var mu=p((RO,gu)=>{"use strict";var ym=String;gu.exports=function(e){try{return ym(e)}catch{return"Object"}}});var Ze=p((xO,vu)=>{"use strict";var gm=Z(),mm=mu(),vm=TypeError;vu.exports=function(e){if(gm(e))return e;throw new vm(mm(e)+" is not a function")}});var Dt=p((PO,_u)=>{"use strict";var _m=Ze(),bm=br();_u.exports=function(e,t){var r=e[t];return bm(r)?void 0:_m(r)}});var Su=p((AO,bu)=>{"use strict";var gi=Qe(),mi=Z(),vi=xe(),Sm=TypeError;bu.exports=function(e,t){var r,n;if(t==="string"&&mi(r=e.toString)&&!vi(n=gi(r,e))||mi(r=e.valueOf)&&!vi(n=gi(r,e))||t!=="string"&&mi(r=e.toString)&&!vi(n=gi(r,e)))return n;throw new Sm("Can\'t convert object to primitive value")}});var Mt=p((OO,Eu)=>{"use strict";Eu.exports=!1});var Rr=p((TO,Ru)=>{"use strict";var wu=W(),Em=Object.defineProperty;Ru.exports=function(e,t){try{Em(wu,e,{value:t,configurable:!0,writable:!0})}catch{wu[e]=t}return t}});var jt=p((CO,Au)=>{"use strict";var wm=Mt(),Rm=W(),xm=Rr(),xu="__core-js_shared__",Pu=Au.exports=Rm[xu]||xm(xu,{});(Pu.versions||(Pu.versions=[])).push({version:"3.41.0",mode:wm?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var _i=p((IO,Tu)=>{"use strict";var Ou=jt();Tu.exports=function(e,t){return Ou[e]||(Ou[e]=t||{})}});var bi=p((kO,Cu)=>{"use strict";var Pm=Sr(),Am=Object;Cu.exports=function(e){return Am(Pm(e))}});var oe=p((qO,Iu)=>{"use strict";var Om=J(),Tm=bi(),Cm=Om({}.hasOwnProperty);Iu.exports=Object.hasOwn||function(t,r){return Cm(Tm(t),r)}});var Si=p((NO,ku)=>{"use strict";var Im=J(),km=0,qm=Math.random(),Nm=Im(1 .toString);ku.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Nm(++km+qm,36)}});var ne=p((LO,Nu)=>{"use strict";var Lm=W(),Dm=_i(),qu=oe(),Mm=Si(),jm=hi(),$m=di(),ut=Lm.Symbol,Ei=Dm("wks"),Fm=$m?ut.for||ut:ut&&ut.withoutSetter||Mm;Nu.exports=function(e){return qu(Ei,e)||(Ei[e]=jm&&qu(ut,e)?ut[e]:Fm("Symbol."+e)),Ei[e]}});var ju=p((DO,Mu)=>{"use strict";var Hm=Qe(),Lu=xe(),Du=yi(),Bm=Dt(),Um=Su(),Gm=ne(),Vm=TypeError,Km=Gm("toPrimitive");Mu.exports=function(e,t){if(!Lu(e)||Du(e))return e;var r=Bm(e,Km),n;if(r){if(t===void 0&&(t="default"),n=Hm(r,e,t),!Lu(n)||Du(n))return n;throw new Vm("Can\'t convert object to primitive value")}return t===void 0&&(t="number"),Um(e,t)}});var wi=p((MO,$u)=>{"use strict";var Wm=ju(),zm=yi();$u.exports=function(e){var t=Wm(e,"string");return zm(t)?t:t+""}});var xi=p((jO,Hu)=>{"use strict";var Ym=W(),Fu=xe(),Ri=Ym.document,Xm=Fu(Ri)&&Fu(Ri.createElement);Hu.exports=function(e){return Xm?Ri.createElement(e):{}}});var Pi=p(($O,Bu)=>{"use strict";var Qm=fe(),Zm=re(),Jm=xi();Bu.exports=!Qm&&!Zm(function(){return Object.defineProperty(Jm("div"),"a",{get:function(){return 7}}).a!==7})});var $t=p(Gu=>{"use strict";var ev=fe(),tv=Qe(),rv=Fa(),nv=Nt(),iv=Lt(),sv=wi(),ov=oe(),av=Pi(),Uu=Object.getOwnPropertyDescriptor;Gu.f=ev?Uu:function(t,r){if(t=iv(t),r=sv(r),av)try{return Uu(t,r)}catch{}if(ov(t,r))return nv(!tv(rv.f,t,r),t[r])}});var Ai=p((HO,Vu)=>{"use strict";var uv=fe(),cv=re();Vu.exports=uv&&cv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var ct=p((BO,Ku)=>{"use strict";var lv=xe(),fv=String,pv=TypeError;Ku.exports=function(e){if(lv(e))return e;throw new pv(fv(e)+" is not an object")}});var Pe=p(zu=>{"use strict";var hv=fe(),dv=Pi(),yv=Ai(),xr=ct(),Wu=wi(),gv=TypeError,Oi=Object.defineProperty,mv=Object.getOwnPropertyDescriptor,Ti="enumerable",Ci="configurable",Ii="writable";zu.f=hv?yv?function(t,r,n){if(xr(t),r=Wu(r),xr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Ii in n&&!n[Ii]){var i=mv(t,r);i&&i[Ii]&&(t[r]=n.value,n={configurable:Ci in n?n[Ci]:i[Ci],enumerable:Ti in n?n[Ti]:i[Ti],writable:!1})}return Oi(t,r,n)}:Oi:function(t,r,n){if(xr(t),r=Wu(r),xr(n),dv)try{return Oi(t,r,n)}catch{}if("get"in n||"set"in n)throw new gv("Accessors not supported");return"value"in n&&(t[r]=n.value),t}});var Ft=p((GO,Yu)=>{"use strict";var vv=fe(),_v=Pe(),bv=Nt();Yu.exports=vv?function(e,t,r){return _v.f(e,t,bv(1,r))}:function(e,t,r){return e[t]=r,e}});var Zu=p((VO,Qu)=>{"use strict";var ki=fe(),Sv=oe(),Xu=Function.prototype,Ev=ki&&Object.getOwnPropertyDescriptor,qi=Sv(Xu,"name"),wv=qi&&function(){}.name==="something",Rv=qi&&(!ki||ki&&Ev(Xu,"name").configurable);Qu.exports={EXISTS:qi,PROPER:wv,CONFIGURABLE:Rv}});var ec=p((KO,Ju)=>{"use strict";var xv=J(),Pv=Z(),Ni=jt(),Av=xv(Function.toString);Pv(Ni.inspectSource)||(Ni.inspectSource=function(e){return Av(e)});Ju.exports=Ni.inspectSource});var nc=p((WO,rc)=>{"use strict";var Ov=W(),Tv=Z(),tc=Ov.WeakMap;rc.exports=Tv(tc)&&/native code/.test(String(tc))});var Pr=p((zO,sc)=>{"use strict";var Cv=_i(),Iv=Si(),ic=Cv("keys");sc.exports=function(e){return ic[e]||(ic[e]=Iv(e))}});var Ar=p((YO,oc)=>{"use strict";oc.exports={}});var Cr=p((XO,cc)=>{"use strict";var kv=nc(),uc=W(),qv=xe(),Nv=Ft(),Li=oe(),Di=jt(),Lv=Pr(),Dv=Ar(),ac="Object already initialized",Mi=uc.TypeError,Mv=uc.WeakMap,Or,Ht,Tr,jv=function(e){return Tr(e)?Ht(e):Or(e,{})},$v=function(e){return function(t){var r;if(!qv(t)||(r=Ht(t)).type!==e)throw new Mi("Incompatible receiver, "+e+" required");return r}};kv||Di.state?(he=Di.state||(Di.state=new Mv),he.get=he.get,he.has=he.has,he.set=he.set,Or=function(e,t){if(he.has(e))throw new Mi(ac);return t.facade=e,he.set(e,t),t},Ht=function(e){return he.get(e)||{}},Tr=function(e){return he.has(e)}):(Je=Lv("state"),Dv[Je]=!0,Or=function(e,t){if(Li(e,Je))throw new Mi(ac);return t.facade=e,Nv(e,Je,t),t},Ht=function(e){return Li(e,Je)?e[Je]:{}},Tr=function(e){return Li(e,Je)});var he,Je;cc.exports={set:Or,get:Ht,has:Tr,enforce:jv,getterFor:$v}});var Fi=p((QO,pc)=>{"use strict";var $i=J(),Fv=re(),Hv=Z(),Ir=oe(),ji=fe(),Bv=Zu().CONFIGURABLE,Uv=ec(),fc=Cr(),Gv=fc.enforce,Vv=fc.get,lc=String,kr=Object.defineProperty,Kv=$i("".slice),Wv=$i("".replace),zv=$i([].join),Yv=ji&&!Fv(function(){return kr(function(){},"length",{value:8}).length!==8}),Xv=String(String).split("String"),Qv=pc.exports=function(e,t,r){Kv(lc(t),0,7)==="Symbol("&&(t="["+Wv(lc(t),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Ir(e,"name")||Bv&&e.name!==t)&&(ji?kr(e,"name",{value:t,configurable:!0}):e.name=t),Yv&&r&&Ir(r,"arity")&&e.length!==r.arity&&kr(e,"length",{value:r.arity});try{r&&Ir(r,"constructor")&&r.constructor?ji&&kr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=Gv(e);return Ir(n,"source")||(n.source=zv(Xv,typeof t=="string"?t:"")),e};Function.prototype.toString=Qv(function(){return Hv(this)&&Vv(this).source||Uv(this)},"toString")});var Ae=p((ZO,hc)=>{"use strict";var Zv=Z(),Jv=Pe(),e_=Fi(),t_=Rr();hc.exports=function(e,t,r,n){n||(n={});var i=n.enumerable,s=n.name!==void 0?n.name:t;if(Zv(r)&&e_(r,s,n),n.global)i?e[t]=r:t_(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch{}i?e[t]=r:Jv.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}});var yc=p((JO,dc)=>{"use strict";var r_=Math.ceil,n_=Math.floor;dc.exports=Math.trunc||function(t){var r=+t;return(r>0?n_:r_)(r)}});var Hi=p((eT,gc)=>{"use strict";var i_=yc();gc.exports=function(e){var t=+e;return t!==t||t===0?0:i_(t)}});var vc=p((tT,mc)=>{"use strict";var s_=Hi(),o_=Math.max,a_=Math.min;mc.exports=function(e,t){var r=s_(e);return r<0?o_(r+t,0):a_(r,t)}});var bc=p((rT,_c)=>{"use strict";var u_=Hi(),c_=Math.min;_c.exports=function(e){var t=u_(e);return t>0?c_(t,9007199254740991):0}});var Ec=p((nT,Sc)=>{"use strict";var l_=bc();Sc.exports=function(e){return l_(e.length)}});var xc=p((iT,Rc)=>{"use strict";var f_=Lt(),p_=vc(),h_=Ec(),wc=function(e){return function(t,r,n){var i=f_(t),s=h_(i);if(s===0)return!e&&-1;var o=p_(n,s),a;if(e&&r!==r){for(;s>o;)if(a=i[o++],a!==a)return!0}else for(;s>o;o++)if((e||o in i)&&i[o]===r)return e||o||0;return!e&&-1}};Rc.exports={includes:wc(!0),indexOf:wc(!1)}});var Ui=p((sT,Ac)=>{"use strict";var d_=J(),Bi=oe(),y_=Lt(),g_=xc().indexOf,m_=Ar(),Pc=d_([].push);Ac.exports=function(e,t){var r=y_(e),n=0,i=[],s;for(s in r)!Bi(m_,s)&&Bi(r,s)&&Pc(i,s);for(;t.length>n;)Bi(r,s=t[n++])&&(~g_(i,s)||Pc(i,s));return i}});var qr=p((oT,Oc)=>{"use strict";Oc.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Cc=p(Tc=>{"use strict";var v_=Ui(),__=qr(),b_=__.concat("length","prototype");Tc.f=Object.getOwnPropertyNames||function(t){return v_(t,b_)}});var kc=p(Ic=>{"use strict";Ic.f=Object.getOwnPropertySymbols});var Nc=p((cT,qc)=>{"use strict";var S_=qe(),E_=J(),w_=Cc(),R_=kc(),x_=ct(),P_=E_([].concat);qc.exports=S_("Reflect","ownKeys")||function(t){var r=w_.f(x_(t)),n=R_.f;return n?P_(r,n(t)):r}});var Gi=p((lT,Dc)=>{"use strict";var Lc=oe(),A_=Nc(),O_=$t(),T_=Pe();Dc.exports=function(e,t,r){for(var n=A_(t),i=T_.f,s=O_.f,o=0;o<n.length;o++){var a=n[o];!Lc(e,a)&&!(r&&Lc(r,a))&&i(e,a,s(t,a))}}});var jc=p((fT,Mc)=>{"use strict";var C_=re(),I_=Z(),k_=/#|\\.prototype\\./,Bt=function(e,t){var r=N_[q_(e)];return r===D_?!0:r===L_?!1:I_(t)?C_(t):!!t},q_=Bt.normalize=function(e){return String(e).replace(k_,".").toLowerCase()},N_=Bt.data={},L_=Bt.NATIVE="N",D_=Bt.POLYFILL="P";Mc.exports=Bt});var Lr=p((pT,$c)=>{"use strict";var Nr=W(),M_=$t().f,j_=Ft(),$_=Ae(),F_=Rr(),H_=Gi(),B_=jc();$c.exports=function(e,t){var r=e.target,n=e.global,i=e.stat,s,o,a,u,c,l;if(n?o=Nr:i?o=Nr[r]||F_(r,{}):o=Nr[r]&&Nr[r].prototype,o)for(a in t){if(c=t[a],e.dontCallGetSet?(l=M_(o,a),u=l&&l.value):u=o[a],s=B_(n?a:r+(i?".":"#")+a,e.forced),!s&&u!==void 0){if(typeof c==typeof u)continue;H_(c,u)}(e.sham||u&&u.sham)&&j_(c,"sham",!0),$_(o,a,c,e)}}});var Hc=p((hT,Fc)=>{"use strict";var U_=re();Fc.exports=!U_(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})});var Dr=p((dT,Uc)=>{"use strict";var G_=oe(),V_=Z(),K_=bi(),W_=Pr(),z_=Hc(),Bc=W_("IE_PROTO"),Vi=Object,Y_=Vi.prototype;Uc.exports=z_?Vi.getPrototypeOf:function(e){var t=K_(e);if(G_(t,Bc))return t[Bc];var r=t.constructor;return V_(r)&&t instanceof r?r.prototype:t instanceof Vi?Y_:null}});var Vc=p((yT,Gc)=>{"use strict";var X_=J(),Q_=Ze();Gc.exports=function(e,t,r){try{return X_(Q_(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}}});var Wc=p((gT,Kc)=>{"use strict";var Z_=xe();Kc.exports=function(e){return Z_(e)||e===null}});var Yc=p((mT,zc)=>{"use strict";var J_=Wc(),eb=String,tb=TypeError;zc.exports=function(e){if(J_(e))return e;throw new tb("Can\'t set "+eb(e)+" as a prototype")}});var Qc=p((vT,Xc)=>{"use strict";var rb=Vc(),nb=xe(),ib=Sr(),sb=Yc();Xc.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=rb(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(i,s){return ib(i),sb(s),nb(i)&&(e?r(i,s):i.__proto__=s),i}}():void 0)});var Jc=p((_T,Zc)=>{"use strict";var ob=Ui(),ab=qr();Zc.exports=Object.keys||function(t){return ob(t,ab)}});var tl=p(el=>{"use strict";var ub=fe(),cb=Ai(),lb=Pe(),fb=ct(),pb=Lt(),hb=Jc();el.f=ub&&!cb?Object.defineProperties:function(t,r){fb(t);for(var n=pb(r),i=hb(r),s=i.length,o=0,a;s>o;)lb.f(t,a=i[o++],n[a]);return t}});var nl=p((ST,rl)=>{"use strict";var db=qe();rl.exports=db("document","documentElement")});var $r=p((ET,ll)=>{"use strict";var yb=ct(),gb=tl(),il=qr(),mb=Ar(),vb=nl(),_b=xi(),bb=Pr(),sl=">",ol="<",Wi="prototype",zi="script",ul=bb("IE_PROTO"),Ki=function(){},cl=function(e){return ol+zi+sl+e+ol+"/"+zi+sl},al=function(e){e.write(cl("")),e.close();var t=e.parentWindow.Object;return e=null,t},Sb=function(){var e=_b("iframe"),t="java"+zi+":",r;return e.style.display="none",vb.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(cl("document.F=Object")),r.close(),r.F},Mr,jr=function(){try{Mr=new ActiveXObject("htmlfile")}catch{}jr=typeof document<"u"?document.domain&&Mr?al(Mr):Sb():al(Mr);for(var e=il.length;e--;)delete jr[Wi][il[e]];return jr()};mb[ul]=!0;ll.exports=Object.create||function(t,r){var n;return t!==null?(Ki[Wi]=yb(t),n=new Ki,Ki[Wi]=null,n[ul]=t):n=jr(),r===void 0?n:gb.f(n,r)}});var dl=p((wT,hl)=>{"use strict";var Eb=J(),fl=Error,wb=Eb("".replace),Rb=function(e){return String(new fl(e).stack)}("zxcasd"),pl=/\\n\\s*at [^:]*:[^\\n]*/,xb=pl.test(Rb);hl.exports=function(e,t){if(xb&&typeof e=="string"&&!fl.prepareStackTrace)for(;t--;)e=wb(e,pl,"");return e}});var gl=p((RT,yl)=>{"use strict";var Pb=re(),Ab=Nt();yl.exports=!Pb(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",Ab(1,7)),e.stack!==7):!0})});var _l=p((xT,vl)=>{"use strict";var Ob=Ft(),Tb=dl(),Cb=gl(),ml=Error.captureStackTrace;vl.exports=function(e,t,r,n){Cb&&(ml?ml(e,t):Ob(e,"stack",Tb(r,n)))}});var El=p((PT,Sl)=>{"use strict";var Ib=ne(),kb=Ib("toStringTag"),bl={};bl[kb]="z";Sl.exports=String(bl)==="[object z]"});var Rl=p((AT,wl)=>{"use strict";var qb=El(),Nb=Z(),Fr=_r(),Lb=ne(),Db=Lb("toStringTag"),Mb=Object,jb=Fr(function(){return arguments}())==="Arguments",$b=function(e,t){try{return e[t]}catch{}};wl.exports=qb?Fr:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=$b(t=Mb(e),Db))=="string"?r:jb?Fr(t):(n=Fr(t))==="Object"&&Nb(t.callee)?"Arguments":n}});var Pl=p((OT,xl)=>{"use strict";var Fb=Rl(),Hb=String;xl.exports=function(e){if(Fb(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Hb(e)}});var Ol=p((TT,Al)=>{"use strict";var Bb=Pl();Al.exports=function(e,t){return e===void 0?arguments.length<2?"":t:Bb(e)}});var Il=p(()=>{"use strict";var Ub=Lr(),Gb=W(),Vb=Er(),Tl=Dr(),Br=Qc(),Kb=Gi(),Cl=$r(),Hr=Ft(),Yi=Nt(),Wb=_l(),zb=Ol(),Yb=ne(),Xb=re(),Qb=Mt(),lt=Gb.SuppressedError,Zb=Yb("toStringTag"),Ur=Error,Jb=!!lt&&lt.length!==3,eS=!!lt&&Xb(function(){return new lt(1,2,3,{cause:4}).cause===4}),Gr=Jb||eS,et=function(t,r,n){var i=Vb(Ut,this),s;return Br?s=Gr&&(!i||Tl(this)===Ut)?new lt:Br(new Ur,i?Tl(this):Ut):(s=i?this:Cl(Ut),Hr(s,Zb,"Error")),n!==void 0&&Hr(s,"message",zb(n)),Wb(s,et,s.stack,1),Hr(s,"error",t),Hr(s,"suppressed",r),s};Br?Br(et,Ur):Kb(et,Ur,{name:!0});var Ut=et.prototype=Gr?lt.prototype:Cl(Ur.prototype,{constructor:Yi(1,et),message:Yi(1,""),name:Yi(1,"SuppressedError")});Gr&&!Qb&&(Ut.constructor=et);Ub({global:!0,constructor:!0,arity:3,forced:Gr},{SuppressedError:et})});var Xi=p((kT,kl)=>{"use strict";var tS=Er(),rS=TypeError;kl.exports=function(e,t){if(tS(t,e))return e;throw new rS("Incorrect invocation")}});var Qi=p((qT,ql)=>{"use strict";var nS=Ae();ql.exports=function(e,t,r){for(var n in t)nS(e,n,t[n],r);return e}});var Zi=p((NT,Ll)=>{"use strict";var Nl=Fi(),iS=Pe();Ll.exports=function(e,t,r){return r.get&&Nl(r.get,t,{getter:!0}),r.set&&Nl(r.set,t,{setter:!0}),iS.f(e,t,r)}});var Ml=p((LT,Dl)=>{"use strict";var sS=_r(),oS=J();Dl.exports=function(e){if(sS(e)==="Function")return oS(e)}});var Fl=p((DT,$l)=>{"use strict";var jl=Ml(),aS=Ze(),uS=mr(),cS=jl(jl.bind);$l.exports=function(e,t){return aS(e),t===void 0?e:uS?cS(e,t):function(){return e.apply(t,arguments)}}});var es=p((MT,Vl)=>{"use strict";var lS=qe(),fS=Qe(),pS=J(),hS=Fl(),dS=ct(),yS=Ze(),Ul=br(),Ji=Dt(),Gl=ne(),gS=Gl("asyncDispose"),Hl=Gl("dispose"),mS=pS([].push),vS=function(e,t){if(t==="async-dispose"){var r=Ji(e,gS);return r!==void 0||(r=Ji(e,Hl),r===void 0)?r:function(){var n=this,i=lS("Promise");return new i(function(s){fS(r,n),s(void 0)})}}return Ji(e,Hl)},Bl=function(e,t,r){return arguments.length<3&&!Ul(e)&&(r=yS(vS(dS(e),t))),r===void 0?function(){}:hS(r,e)};Vl.exports=function(e,t,r,n){var i;if(arguments.length<4){if(Ul(t)&&r==="sync-dispose")return;i=Bl(t,r)}else i=Bl(void 0,r,n);mS(e.stack,i)}});var Jl=p(()=>{"use strict";var _S=Lr(),Kr=fe(),Yl=qe(),Kl=Ze(),bS=Xi(),Xl=Ae(),SS=Qi(),ES=Zi(),Ql=ne(),Zl=Cr(),ts=es(),Wl=pi(),zl=Yl("Promise"),wS=Yl("SuppressedError"),RS=ReferenceError,xS=Ql("asyncDispose"),PS=Ql("toStringTag"),zr="AsyncDisposableStack",AS=Zl.set,Wr=Zl.getterFor(zr),rs="async-dispose",Gt="disposed",OS="pending",Vr=function(e){var t=Wr(e);if(t.state===Gt)throw new RS(zr+" already disposed");return t},ns=function(){AS(bS(this,ft),{type:zr,state:OS,stack:[]}),Kr||(this.disposed=!1)},ft=ns.prototype;SS(ft,{disposeAsync:function(){var t=this;return new zl(function(r,n){var i=Wr(t);if(i.state===Gt)return r(void 0);i.state=Gt,Kr||(t.disposed=!0);var s=i.stack,o=s.length,a=!1,u,c=function(f){a?u=new wS(f,u):(a=!0,u=f),l()},l=function(){if(o){var f=s[--o];s[o]=null;try{zl.resolve(f()).then(l,c)}catch(h){c(h)}}else i.stack=null,a?n(u):r(void 0)};l()})},use:function(t){return ts(Vr(this),t,rs),t},adopt:function(t,r){var n=Vr(this);return Kl(r),ts(n,void 0,rs,function(){return r(t)}),t},defer:function(t){var r=Vr(this);Kl(t),ts(r,void 0,rs,t)},move:function(){var t=Vr(this),r=new ns;return Wr(r).stack=t.stack,t.stack=[],t.state=Gt,Kr||(this.disposed=!0),r}});Kr&&ES(ft,"disposed",{configurable:!0,get:function(){return Wr(this).state===Gt}});Xl(ft,xS,ft.disposeAsync,{name:"disposeAsync"});Xl(ft,PS,zr,{nonWritable:!0});var TS=Wl&&Wl<136;_S({global:!0,constructor:!0,forced:TS},{AsyncDisposableStack:ns})});var cf=p((FT,uf)=>{"use strict";var sf=W(),of=jt(),af=Z(),CS=$r(),Yr=Dr(),IS=Ae(),kS=ne(),qS=Mt(),ef="USE_FUNCTION_CONSTRUCTOR",tf=kS("asyncIterator"),rf=sf.AsyncIterator,nf=of.AsyncIteratorPrototype,_e,is;if(nf)_e=nf;else if(af(rf))_e=rf.prototype;else if(of[ef]||sf[ef])try{is=Yr(Yr(Yr(Function("return async function*(){}()")()))),Yr(is)===Object.prototype&&(_e=is)}catch{}_e?qS&&(_e=CS(_e)):_e={};af(_e[tf])||IS(_e,tf,function(){return this});uf.exports=_e});var hf=p(()=>{"use strict";var NS=Qe(),LS=Ae(),DS=qe(),MS=Dt(),jS=oe(),$S=ne(),lf=cf(),ff=$S("asyncDispose"),pf=DS("Promise");jS(lf,ff)||LS(lf,ff,function(){var e=this;return new pf(function(t,r){var n=MS(e,"return");n?pf.resolve(NS(n,e)).then(function(){t(void 0)},r):t(void 0)})})});var vf=p(()=>{"use strict";var FS=Lr(),Qr=fe(),HS=qe(),df=Ze(),BS=Xi(),yf=Ae(),US=Qi(),GS=Zi(),gf=ne(),mf=Cr(),ss=es(),VS=HS("SuppressedError"),KS=ReferenceError,WS=gf("dispose"),zS=gf("toStringTag"),Jr="DisposableStack",YS=mf.set,Zr=mf.getterFor(Jr),os="sync-dispose",Vt="disposed",XS="pending",Xr=function(e){var t=Zr(e);if(t.state===Vt)throw new KS(Jr+" already disposed");return t},as=function(){YS(BS(this,pt),{type:Jr,state:XS,stack:[]}),Qr||(this.disposed=!1)},pt=as.prototype;US(pt,{dispose:function(){var t=Zr(this);if(t.state!==Vt){t.state=Vt,Qr||(this.disposed=!0);for(var r=t.stack,n=r.length,i=!1,s;n;){var o=r[--n];r[n]=null;try{o()}catch(a){i?s=new VS(a,s):(i=!0,s=a)}}if(t.stack=null,i)throw s}},use:function(t){return ss(Xr(this),t,os),t},adopt:function(t,r){var n=Xr(this);return df(r),ss(n,void 0,os,function(){r(t)}),t},defer:function(t){var r=Xr(this);df(t),ss(r,void 0,os,t)},move:function(){var t=Xr(this),r=new as;return Zr(r).stack=t.stack,t.stack=[],t.state=Vt,Qr||(this.disposed=!0),r}});Qr&&GS(pt,"disposed",{configurable:!0,get:function(){return Zr(this).state===Vt}});yf(pt,WS,pt.dispose,{name:"dispose"});yf(pt,zS,Jr,{nonWritable:!0});FS({global:!0,constructor:!0},{DisposableStack:as})});var Ef=p((VT,Sf)=>{"use strict";var QS=re(),ZS=Z(),JS=xe(),eE=$r(),_f=Dr(),tE=Ae(),rE=ne(),nE=Mt(),ls=rE("iterator"),bf=!1,Oe,us,cs;[].keys&&(cs=[].keys(),"next"in cs?(us=_f(_f(cs)),us!==Object.prototype&&(Oe=us)):bf=!0);var iE=!JS(Oe)||QS(function(){var e={};return Oe[ls].call(e)!==e});iE?Oe={}:nE&&(Oe=eE(Oe));ZS(Oe[ls])||tE(Oe,ls,function(){return this});Sf.exports={IteratorPrototype:Oe,BUGGY_SAFARI_ITERATORS:bf}});var xf=p(()=>{"use strict";var sE=Qe(),oE=Ae(),aE=Dt(),uE=oe(),cE=ne(),wf=Ef().IteratorPrototype,Rf=cE("dispose");uE(wf,Rf)||oE(wf,Rf,function(){var e=aE(this,"return");e&&sE(e,this)})});var Af=p((zT,Pf)=>{"use strict";var lE=W();Pf.exports=lE});var Tf=p(Of=>{"use strict";var fE=ne();Of.f=fE});var fs=p((XT,If)=>{"use strict";var Cf=Af(),pE=oe(),hE=Tf(),dE=Pe().f;If.exports=function(e){var t=Cf.Symbol||(Cf.Symbol={});pE(t,e)||dE(t,e,{value:hE.f(e)})}});var kf=p(()=>{"use strict";var yE=W(),gE=fs(),mE=Pe().f,vE=$t().f,ps=yE.Symbol;gE("asyncDispose");ps&&(Kt=vE(ps,"asyncDispose"),Kt.enumerable&&Kt.configurable&&Kt.writable&&mE(ps,"asyncDispose",{value:Kt.value,enumerable:!1,configurable:!1,writable:!1}));var Kt});var qf=p(()=>{"use strict";var _E=W(),bE=fs(),SE=Pe().f,EE=$t().f,hs=_E.Symbol;bE("dispose");hs&&(Wt=EE(hs,"dispose"),Wt.enumerable&&Wt.configurable&&Wt.writable&&SE(hs,"dispose",{value:Wt.value,enumerable:!1,configurable:!1,writable:!1}));var Wt});var Nf=p(()=>{"use strict";Il();Jl();hf();vf();xf();kf();qf()});var Pp=p(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.splitWhen=bt.flatten=void 0;function hw(e){return e.reduce((t,r)=>[].concat(t,r),[])}bt.flatten=hw;function dw(e,t){let r=[[]],n=0;for(let i of e)t(i)?(n++,r[n]=[]):r[n].push(i);return r}bt.splitWhen=dw});var Ap=p(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.isEnoentCodeError=void 0;function yw(e){return e.code==="ENOENT"}hn.isEnoentCodeError=yw});var Op=p(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.createDirentFromStats=void 0;var qs=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function gw(e,t){return new qs(e,t)}dn.createDirentFromStats=gw});var kp=p(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.convertPosixPathToPattern=G.convertWindowsPathToPattern=G.convertPathToPattern=G.escapePosixPath=G.escapeWindowsPath=G.escape=G.removeLeadingDotSegment=G.makeAbsolute=G.unixify=void 0;var mw=require("os"),vw=require("path"),Tp=mw.platform()==="win32",_w=2,bw=/(\\\\?)([()*?[\\]{|}]|^!|[!+@](?=\\()|\\\\(?![!()*+?@[\\]{|}]))/g,Sw=/(\\\\?)([()[\\]{}]|^!|[!+@](?=\\())/g,Ew=/^\\\\\\\\([.?])/,ww=/\\\\(?![!()+@[\\]{}])/g;function Rw(e){return e.replace(/\\\\/g,"/")}G.unixify=Rw;function xw(e,t){return vw.resolve(e,t)}G.makeAbsolute=xw;function Pw(e){if(e.charAt(0)==="."){let t=e.charAt(1);if(t==="/"||t==="\\\\")return e.slice(_w)}return e}G.removeLeadingDotSegment=Pw;G.escape=Tp?Ns:Ls;function Ns(e){return e.replace(Sw,"\\\\$2")}G.escapeWindowsPath=Ns;function Ls(e){return e.replace(bw,"\\\\$2")}G.escapePosixPath=Ls;G.convertPathToPattern=Tp?Cp:Ip;function Cp(e){return Ns(e).replace(Ew,"//$1").replace(ww,"/")}G.convertWindowsPathToPattern=Cp;function Ip(e){return Ls(e)}G.convertPosixPathToPattern=Ip});var Np=p((hk,qp)=>{qp.exports=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\\\).|([@?!+*]\\(.*\\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}});var Mp=p((dk,Dp)=>{var Aw=Np(),Lp={"{":"}","(":")","[":"]"},Ow=function(e){if(e[0]==="!")return!0;for(var t=0,r=-2,n=-2,i=-2,s=-2,o=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(o===-1||o>n||(o=e.indexOf("\\\\",t),o===-1||o>n)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(o=e.indexOf("\\\\",t),o===-1||o>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(o=e.indexOf("\\\\",t),o===-1||o>s))||r!==-1&&e[t]==="("&&e[t+1]!=="|"&&(r<t&&(r=e.indexOf("|",t)),r!==-1&&e[r+1]!==")"&&(s=e.indexOf(")",r),s>r&&(o=e.indexOf("\\\\",r),o===-1||o>s))))return!0;if(e[t]==="\\\\"){var a=e[t+1];t+=2;var u=Lp[a];if(u){var c=e.indexOf(u,t);c!==-1&&(t=c+1)}if(e[t]==="!")return!0}else t++}return!1},Tw=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\\]]/.test(e[t]))return!0;if(e[t]==="\\\\"){var r=e[t+1];t+=2;var n=Lp[r];if(n){var i=e.indexOf(n,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1};Dp.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(Aw(t))return!0;var n=Ow;return r&&r.strict===!1&&(n=Tw),n(t)}});var $p=p((yk,jp)=>{"use strict";var Cw=Mp(),Iw=require("path").posix.dirname,kw=require("os").platform()==="win32",Ds="/",qw=/\\\\/g,Nw=/[\\{\\[].*[\\}\\]]$/,Lw=/(^|[^\\\\])([\\{\\[]|\\([^\\)]+$)/,Dw=/\\\\([\\!\\*\\?\\|\\[\\]\\(\\)\\{\\}])/g;jp.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&kw&&t.indexOf(Ds)<0&&(t=t.replace(qw,Ds)),Nw.test(t)&&(t+=Ds),t+="a";do t=Iw(t);while(Cw(t)||Lw.test(t));return t.replace(Dw,"$1")}});var yn=p(ue=>{"use strict";ue.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;ue.find=(e,t)=>e.nodes.find(r=>r.type===t);ue.exceedsLimit=(e,t,r=1,n)=>n===!1||!ue.isInteger(e)||!ue.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;ue.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\\\"+n.value,n.escaped=!0)};ue.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1;ue.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;ue.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;ue.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);ue.flatten=(...e)=>{let t=[],r=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){r(s);continue}s!==void 0&&t.push(s)}return t};return r(e),t}});var gn=p((mk,Hp)=>{"use strict";var Fp=yn();Hp.exports=(e,t={})=>{let r=(n,i={})=>{let s=t.escapeInvalid&&Fp.isInvalidBrace(i),o=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(s||o)&&Fp.isOpenOrClose(n)?"\\\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(e)}});var Up=p((vk,Bp)=>{"use strict";Bp.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Zp=p((_k,Qp)=>{"use strict";var Gp=Up(),nt=(e,t,r)=>{if(Gp(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Gp(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=e+":"+t+"="+i+s+o+a;if(nt.cache.hasOwnProperty(u))return nt.cache[u].result;let c=Math.min(e,t),l=Math.max(e,t);if(Math.abs(c-l)===1){let v=e+"|"+t;return n.capture?`(${v})`:n.wrap===!1?v:`(?:${v})`}let f=Xp(e)||Xp(t),h={min:e,max:t,a:c,b:l},w=[],d=[];if(f&&(h.isPadded=f,h.maxLen=String(h.max).length),c<0){let v=l<0?Math.abs(l):1;d=Vp(v,Math.abs(c),h,n),c=h.a=0}return l>=0&&(w=Vp(c,l,h,n)),h.negatives=d,h.positives=w,h.result=Mw(d,w,n),n.capture===!0?h.result=`(${h.result})`:n.wrap!==!1&&w.length+d.length>1&&(h.result=`(?:${h.result})`),nt.cache[u]=h,h.result};function Mw(e,t,r){let n=Ms(e,t,"-",!1,r)||[],i=Ms(t,e,"",!1,r)||[],s=Ms(e,t,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}function jw(e,t){let r=1,n=1,i=Wp(e,r),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),r+=1,i=Wp(e,r);for(i=zp(t+1,n)-1;e<i&&i<=t;)s.add(i),n+=1,i=zp(t+1,n)-1;return s=[...s],s.sort(Hw),s}function $w(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Fw(e,t),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[u,c]=n[a];u===c?s+=u:u!=="0"||c!=="9"?s+=Bw(u,c,r):o++}return o&&(s+=r.shorthand===!0?"\\\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function Vp(e,t,r,n){let i=jw(e,t),s=[],o=e,a;for(let u=0;u<i.length;u++){let c=i[u],l=$w(String(o),String(c),n),f="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+Yp(a.count),o=c+1;continue}r.isPadded&&(f=Uw(c,r,n)),l.string=f+l.pattern+Yp(l.count),s.push(l),o=c+1,a=l}return s}function Ms(e,t,r,n,i){let s=[];for(let o of e){let{string:a}=o;!n&&!Kp(t,"string",a)&&s.push(r+a),n&&Kp(t,"string",a)&&s.push(r+a)}return s}function Fw(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Hw(e,t){return e>t?1:t>e?-1:0}function Kp(e,t,r){return e.some(n=>n[t]===r)}function Wp(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function zp(e,t){return e-e%Math.pow(10,t)}function Yp(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Bw(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Xp(e){return/^-?(0+)\\d/.test(e)}function Uw(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}nt.cache={};nt.clearCache=()=>nt.cache={};Qp.exports=nt});var Fs=p((bk,sh)=>{"use strict";var Gw=require("util"),eh=Zp(),Jp=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Vw=e=>t=>e===!0?Number(t):String(t),js=e=>typeof e=="number"||typeof e=="string"&&e!=="",er=e=>Number.isInteger(+e),$s=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Kw=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Ww=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},vn=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},zw=(e,t,r)=>{e.negatives.sort((a,u)=>a<u?-1:a>u?1:0),e.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=t.capture?"":"?:",i="",s="",o;return e.positives.length&&(i=e.positives.map(a=>vn(String(a),r)).join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.map(a=>vn(String(a),r)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,t.wrap?`(${n}${o})`:o},th=(e,t,r,n)=>{if(r)return eh(e,t,{wrap:!1,...n});let i=String.fromCharCode(e);if(e===t)return i;let s=String.fromCharCode(t);return`[${i}-${s}]`},rh=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${e.join("|")})`:e.join("|")}return eh(e,t,r)},nh=(...e)=>new RangeError("Invalid range arguments: "+Gw.inspect(...e)),ih=(e,t,r)=>{if(r.strictRanges===!0)throw nh([e,t]);return[]},Yw=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Xw=(e,t,r=1,n={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw nh([e,t]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(e),u=String(t),c=String(r);r=Math.max(Math.abs(r),1);let l=$s(a)||$s(u)||$s(c),f=l?Math.max(a.length,u.length,c.length):0,h=l===!1&&Kw(e,t,n)===!1,w=n.transform||Vw(h);if(n.toRegex&&r===1)return th(vn(e,f),vn(t,f),!0,n);let d={negatives:[],positives:[]},v=C=>d[C<0?"negatives":"positives"].push(Math.abs(C)),b=[],T=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&r>1?v(i):b.push(Ww(w(i,T),f,h)),i=o?i-r:i+r,T++;return n.toRegex===!0?r>1?zw(d,n,f):rh(b,null,{wrap:!1,...n}):b},Qw=(e,t,r=1,n={})=>{if(!er(e)&&e.length>1||!er(t)&&t.length>1)return ih(e,t,n);let i=n.transform||(h=>String.fromCharCode(h)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),a=s>o,u=Math.min(s,o),c=Math.max(s,o);if(n.toRegex&&r===1)return th(u,c,!1,n);let l=[],f=0;for(;a?s>=o:s<=o;)l.push(i(s,f)),s=a?s-r:s+r,f++;return n.toRegex===!0?rh(l,null,{wrap:!1,options:n}):l},mn=(e,t,r,n={})=>{if(t==null&&js(e))return[e];if(!js(e)||!js(t))return ih(e,t,n);if(typeof r=="function")return mn(e,t,1,{transform:r});if(Jp(r))return mn(e,t,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,er(r)?er(e)&&er(t)?Xw(e,t,r,i):Qw(e,t,Math.max(Math.abs(r),1),i):r!=null&&!Jp(r)?Yw(r,i):mn(e,t,1,r)};sh.exports=mn});var uh=p((Sk,ah)=>{"use strict";var Zw=Fs(),oh=yn(),Jw=(e,t={})=>{let r=(n,i={})=>{let s=oh.isInvalidBrace(i),o=n.invalid===!0&&t.escapeInvalid===!0,a=s===!0||o===!0,u=t.escapeInvalid===!0?"\\\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=oh.reduce(n.nodes),f=Zw(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return l.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(e)};ah.exports=Jw});var fh=p((Ek,lh)=>{"use strict";var eR=Fs(),ch=gn(),St=yn(),it=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?St.flatten(t).map(i=>`{${i}}`):t;for(let i of e)if(Array.isArray(i))for(let s of i)n.push(it(s,t,r));else for(let s of t)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?it(i,s,r):i+s);return St.flatten(n)},tR=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(it(a.pop(),ch(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(it(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=St.reduce(i.nodes);if(St.exceedsLimit(...f,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let h=eR(...f,t);h.length===0&&(h=ch(i,t)),a.push(it(a.pop(),h)),i.nodes=[];return}let u=St.encloseBrace(i),c=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let f=0;f<i.nodes.length;f++){let h=i.nodes[f];if(h.type==="comma"&&i.type==="brace"){f===1&&c.push(""),c.push("");continue}if(h.type==="close"){a.push(it(a.pop(),c,u));continue}if(h.value&&h.type!=="open"){c.push(it(c.pop(),h.value));continue}h.nodes&&n(h,i)}return c};return St.flatten(n(e))};lh.exports=tR});var hh=p((wk,ph)=>{"use strict";ph.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:\'"\',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`\n`,CHAR_NO_BREAK_SPACE:"\\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"\'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\\uFEFF"}});var vh=p((Rk,mh)=>{"use strict";var rR=gn(),{MAX_LENGTH:dh,CHAR_BACKSLASH:Hs,CHAR_BACKTICK:nR,CHAR_COMMA:iR,CHAR_DOT:sR,CHAR_LEFT_PARENTHESES:oR,CHAR_RIGHT_PARENTHESES:aR,CHAR_LEFT_CURLY_BRACE:uR,CHAR_RIGHT_CURLY_BRACE:cR,CHAR_LEFT_SQUARE_BRACKET:yh,CHAR_RIGHT_SQUARE_BRACKET:gh,CHAR_DOUBLE_QUOTE:lR,CHAR_SINGLE_QUOTE:fR,CHAR_NO_BREAK_SPACE:pR,CHAR_ZERO_WIDTH_NOBREAK_SPACE:hR}=hh(),dR=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(dh,r.maxLength):dh;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let i={type:"root",input:e,nodes:[]},s=[i],o=i,a=i,u=0,c=e.length,l=0,f=0,h,w=()=>e[l++],d=v=>{if(v.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&v.type==="text"){a.value+=v.value;return}return o.nodes.push(v),v.parent=o,v.prev=a,a=v,v};for(d({type:"bos"});l<c;)if(o=s[s.length-1],h=w(),!(h===hR||h===pR)){if(h===Hs){d({type:"text",value:(t.keepEscaping?h:"")+w()});continue}if(h===gh){d({type:"text",value:"\\\\"+h});continue}if(h===yh){u++;let v;for(;l<c&&(v=w());){if(h+=v,v===yh){u++;continue}if(v===Hs){h+=w();continue}if(v===gh&&(u--,u===0))break}d({type:"text",value:h});continue}if(h===oR){o=d({type:"paren",nodes:[]}),s.push(o),d({type:"text",value:h});continue}if(h===aR){if(o.type!=="paren"){d({type:"text",value:h});continue}o=s.pop(),d({type:"text",value:h}),o=s[s.length-1];continue}if(h===lR||h===fR||h===nR){let v=h,b;for(t.keepQuotes!==!0&&(h="");l<c&&(b=w());){if(b===Hs){h+=b+w();continue}if(b===v){t.keepQuotes===!0&&(h+=b);break}h+=b}d({type:"text",value:h});continue}if(h===uR){f++;let b={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=d(b),s.push(o),d({type:"open",value:h});continue}if(h===cR){if(o.type!=="brace"){d({type:"text",value:h});continue}let v="close";o=s.pop(),o.close=!0,d({type:v,value:h}),f--,o=s[s.length-1];continue}if(h===iR&&f>0){if(o.ranges>0){o.ranges=0;let v=o.nodes.shift();o.nodes=[v,{type:"text",value:rR(o)}]}d({type:"comma",value:h}),o.commas++;continue}if(h===sR&&f>0&&o.commas===0){let v=o.nodes;if(f===0||v.length===0){d({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){v.pop();let b=v[v.length-1];b.value+=a.value+h,a=b,o.ranges--;continue}d({type:"dot",value:h});continue}d({type:"text",value:h})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(T=>{T.nodes||(T.type==="open"&&(T.isOpen=!0),T.type==="close"&&(T.isClose=!0),T.nodes||(T.type="text"),T.invalid=!0)});let v=s[s.length-1],b=v.nodes.indexOf(o);v.nodes.splice(b,1,...o.nodes)}while(s.length>0);return d({type:"eos"}),i};mh.exports=dR});var Sh=p((xk,bh)=>{"use strict";var _h=gn(),yR=uh(),gR=fh(),mR=vh(),ie=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let i=ie.create(n,t);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(ie.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};ie.parse=(e,t={})=>mR(e,t);ie.stringify=(e,t={})=>_h(typeof e=="string"?ie.parse(e,t):e,t);ie.compile=(e,t={})=>(typeof e=="string"&&(e=ie.parse(e,t)),yR(e,t));ie.expand=(e,t={})=>{typeof e=="string"&&(e=ie.parse(e,t));let r=gR(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};ie.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?ie.compile(e,t):ie.expand(e,t);bh.exports=ie});var tr=p((Pk,Ph)=>{"use strict";var vR=require("path"),Se="\\\\\\\\/",Eh=`[^${Se}]`,Ce="\\\\.",_R="\\\\+",bR="\\\\?",_n="\\\\/",SR="(?=.)",wh="[^/]",Bs=`(?:${_n}|$)`,Rh=`(?:^|${_n})`,Us=`${Ce}{1,2}${Bs}`,ER=`(?!${Ce})`,wR=`(?!${Rh}${Us})`,RR=`(?!${Ce}{0,1}${Bs})`,xR=`(?!${Us})`,PR=`[^.${_n}]`,AR=`${wh}*?`,xh={DOT_LITERAL:Ce,PLUS_LITERAL:_R,QMARK_LITERAL:bR,SLASH_LITERAL:_n,ONE_CHAR:SR,QMARK:wh,END_ANCHOR:Bs,DOTS_SLASH:Us,NO_DOT:ER,NO_DOTS:wR,NO_DOT_SLASH:RR,NO_DOTS_SLASH:xR,QMARK_NO_DOT:PR,STAR:AR,START_ANCHOR:Rh},OR={...xh,SLASH_LITERAL:`[${Se}]`,QMARK:Eh,STAR:`${Eh}*?`,DOTS_SLASH:`${Ce}{1,2}(?:[${Se}]|$)`,NO_DOT:`(?!${Ce})`,NO_DOTS:`(?!(?:^|[${Se}])${Ce}{1,2}(?:[${Se}]|$))`,NO_DOT_SLASH:`(?!${Ce}{0,1}(?:[${Se}]|$))`,NO_DOTS_SLASH:`(?!${Ce}{1,2}(?:[${Se}]|$))`,QMARK_NO_DOT:`[^.${Se}]`,START_ANCHOR:`(?:^|[${Se}])`,END_ANCHOR:`(?:[${Se}]|$)`},TR={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\\\x00-\\\\x7F",blank:" \\\\t",cntrl:"\\\\x00-\\\\x1F\\\\x7F",digit:"0-9",graph:"\\\\x21-\\\\x7E",lower:"a-z",print:"\\\\x20-\\\\x7E ",punct:"\\\\-!\\"#$%&\'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~",space:" \\\\t\\\\r\\\\n\\\\v\\\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ph.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:TR,REGEX_BACKSLASH:/\\\\(?![*+?^${}(|)[\\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\\].,$*+?^{}()|\\\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\\\?)((\\W)(\\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:vR.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?OR:xh}}});var rr=p(ee=>{"use strict";var CR=require("path"),IR=process.platform==="win32",{REGEX_BACKSLASH:kR,REGEX_REMOVE_BACKSLASH:qR,REGEX_SPECIAL_CHARS:NR,REGEX_SPECIAL_CHARS_GLOBAL:LR}=tr();ee.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);ee.hasRegexChars=e=>NR.test(e);ee.isRegexChar=e=>e.length===1&&ee.hasRegexChars(e);ee.escapeRegex=e=>e.replace(LR,"\\\\$1");ee.toPosixSlashes=e=>e.replace(kR,"/");ee.removeBackslashes=e=>e.replace(qR,t=>t==="\\\\"?"":t);ee.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};ee.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:IR===!0||CR.sep==="\\\\";ee.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\\\"?ee.escapeLast(e,t,n-1):`${e.slice(0,n)}\\\\${e.slice(n)}`};ee.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};ee.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${e})${i}`;return t.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var Nh=p((Ok,qh)=>{"use strict";var Ah=rr(),{CHAR_ASTERISK:Gs,CHAR_AT:DR,CHAR_BACKWARD_SLASH:nr,CHAR_COMMA:MR,CHAR_DOT:Vs,CHAR_EXCLAMATION_MARK:Ks,CHAR_FORWARD_SLASH:kh,CHAR_LEFT_CURLY_BRACE:Ws,CHAR_LEFT_PARENTHESES:zs,CHAR_LEFT_SQUARE_BRACKET:jR,CHAR_PLUS:$R,CHAR_QUESTION_MARK:Oh,CHAR_RIGHT_CURLY_BRACE:FR,CHAR_RIGHT_PARENTHESES:Th,CHAR_RIGHT_SQUARE_BRACKET:HR}=tr(),Ch=e=>e===kh||e===nr,Ih=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},BR=(e,t)=>{let r=t||{},n=e.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],u=e,c=-1,l=0,f=0,h=!1,w=!1,d=!1,v=!1,b=!1,T=!1,C=!1,A=!1,k=!1,_=!1,P=0,E,R,O={value:"",depth:0,isGlob:!1},D=()=>c>=n,y=()=>u.charCodeAt(c+1),j=()=>(E=R,u.charCodeAt(++c));for(;c<n;){R=j();let X;if(R===nr){C=O.backslashes=!0,R=j(),R===Ws&&(T=!0);continue}if(T===!0||R===Ws){for(P++;D()!==!0&&(R=j());){if(R===nr){C=O.backslashes=!0,j();continue}if(R===Ws){P++;continue}if(T!==!0&&R===Vs&&(R=j())===Vs){if(h=O.isBrace=!0,d=O.isGlob=!0,_=!0,i===!0)continue;break}if(T!==!0&&R===MR){if(h=O.isBrace=!0,d=O.isGlob=!0,_=!0,i===!0)continue;break}if(R===FR&&(P--,P===0)){T=!1,h=O.isBrace=!0,_=!0;break}}if(i===!0)continue;break}if(R===kh){if(s.push(c),o.push(O),O={value:"",depth:0,isGlob:!1},_===!0)continue;if(E===Vs&&c===l+1){l+=2;continue}f=c+1;continue}if(r.noext!==!0&&(R===$R||R===DR||R===Gs||R===Oh||R===Ks)===!0&&y()===zs){if(d=O.isGlob=!0,v=O.isExtglob=!0,_=!0,R===Ks&&c===l&&(k=!0),i===!0){for(;D()!==!0&&(R=j());){if(R===nr){C=O.backslashes=!0,R=j();continue}if(R===Th){d=O.isGlob=!0,_=!0;break}}continue}break}if(R===Gs){if(E===Gs&&(b=O.isGlobstar=!0),d=O.isGlob=!0,_=!0,i===!0)continue;break}if(R===Oh){if(d=O.isGlob=!0,_=!0,i===!0)continue;break}if(R===jR){for(;D()!==!0&&(X=j());){if(X===nr){C=O.backslashes=!0,j();continue}if(X===HR){w=O.isBracket=!0,d=O.isGlob=!0,_=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&R===Ks&&c===l){A=O.negated=!0,l++;continue}if(r.noparen!==!0&&R===zs){if(d=O.isGlob=!0,i===!0){for(;D()!==!0&&(R=j());){if(R===zs){C=O.backslashes=!0,R=j();continue}if(R===Th){_=!0;break}}continue}break}if(d===!0){if(_=!0,i===!0)continue;break}}r.noext===!0&&(v=!1,d=!1);let $=u,ke="",g="";l>0&&(ke=u.slice(0,l),u=u.slice(l),f-=l),$&&d===!0&&f>0?($=u.slice(0,f),g=u.slice(f)):d===!0?($="",g=u):$=u,$&&$!==""&&$!=="/"&&$!==u&&Ch($.charCodeAt($.length-1))&&($=$.slice(0,-1)),r.unescape===!0&&(g&&(g=Ah.removeBackslashes(g)),$&&C===!0&&($=Ah.removeBackslashes($)));let m={prefix:ke,input:e,start:l,base:$,glob:g,isBrace:h,isBracket:w,isGlob:d,isExtglob:v,isGlobstar:b,negated:A,negatedExtglob:k};if(r.tokens===!0&&(m.maxDepth=0,Ch(R)||o.push(O),m.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let M=0;M<s.length;M++){let me=X?X+1:l,ve=s[M],te=e.slice(me,ve);r.tokens&&(M===0&&l!==0?(o[M].isPrefix=!0,o[M].value=ke):o[M].value=te,Ih(o[M]),m.maxDepth+=o[M].depth),(M!==0||te!=="")&&a.push(te),X=ve}if(X&&X+1<e.length){let M=e.slice(X+1);a.push(M),r.tokens&&(o[o.length-1].value=M,Ih(o[o.length-1]),m.maxDepth+=o[o.length-1].depth)}m.slashes=s,m.parts=a}return m};qh.exports=BR});var Mh=p((Tk,Dh)=>{"use strict";var bn=tr(),se=rr(),{MAX_LENGTH:Sn,POSIX_REGEX_SOURCE:UR,REGEX_NON_SPECIAL_CHARS:GR,REGEX_SPECIAL_CHARS_BACKREF:VR,REPLACEMENTS:Lh}=bn,KR=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(i=>se.escapeRegex(i)).join("..")}return r},Et=(e,t)=>`Missing ${e}: "${t}" - use "\\\\\\\\${t}" to match literal characters`,Ys=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Lh[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(Sn,r.maxLength):Sn,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",u=se.isWindows(t),c=bn.globChars(u),l=bn.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:w,ONE_CHAR:d,DOTS_SLASH:v,NO_DOT:b,NO_DOT_SLASH:T,NO_DOTS_SLASH:C,QMARK:A,QMARK_NO_DOT:k,STAR:_,START_ANCHOR:P}=c,E=x=>`(${a}(?:(?!${P}${x.dot?v:f}).)*?)`,R=r.dot?"":b,O=r.dot?A:k,D=r.bash===!0?E(r):_;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let y={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=se.removePrefix(e,y),i=e.length;let j=[],$=[],ke=[],g=s,m,X=()=>y.index===i-1,M=y.peek=(x=1)=>e[y.index+x],me=y.advance=()=>e[++y.index]||"",ve=()=>e.slice(y.index+1),te=(x="",F=0)=>{y.consumed+=x,y.index+=F},pr=x=>{y.output+=x.output!=null?x.output:x.value,te(x.value)},Ig=()=>{let x=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)me(),y.start++,x++;return x%2===0?!1:(y.negated=!0,y.start++,!0)},hr=x=>{y[x]++,ke.push(x)},ze=x=>{y[x]--,ke.pop()},L=x=>{if(g.type==="globstar"){let F=y.braces>0&&(x.type==="comma"||x.type==="brace"),S=x.extglob===!0||j.length&&(x.type==="pipe"||x.type==="paren");x.type!=="slash"&&x.type!=="paren"&&!F&&!S&&(y.output=y.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=D,y.output+=g.output)}if(j.length&&x.type!=="paren"&&(j[j.length-1].inner+=x.value),(x.value||x.output)&&pr(x),g&&g.type==="text"&&x.type==="text"){g.value+=x.value,g.output=(g.output||"")+x.value;return}x.prev=g,o.push(x),g=x},dr=(x,F)=>{let S={...l[F],conditions:1,inner:""};S.prev=g,S.parens=y.parens,S.output=y.output;let N=(r.capture?"(":"")+S.open;hr("parens"),L({type:x,value:F,output:y.output?"":d}),L({type:"paren",extglob:!0,value:me(),output:N}),j.push(S)},kg=x=>{let F=x.close+(r.capture?")":""),S;if(x.type==="negate"){let N=D;if(x.inner&&x.inner.length>1&&x.inner.includes("/")&&(N=E(r)),(N!==D||X()||/^\\)+$/.test(ve()))&&(F=x.close=`)$))${N}`),x.inner.includes("*")&&(S=ve())&&/^\\.[^\\\\/.]+$/.test(S)){let B=Ys(S,{...t,fastpaths:!1}).output;F=x.close=`)${B})${N})`}x.prev.type==="bos"&&(y.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:m,output:F}),ze("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\\]{}"])/.test(e)){let x=!1,F=e.replace(VR,(S,N,B,Q,V,si)=>Q==="\\\\"?(x=!0,S):Q==="?"?N?N+Q+(V?A.repeat(V.length):""):si===0?O+(V?A.repeat(V.length):""):A.repeat(B.length):Q==="."?f.repeat(B.length):Q==="*"?N?N+Q+(V?D:""):D:N?S:`\\\\${S}`);return x===!0&&(r.unescape===!0?F=F.replace(/\\\\/g,""):F=F.replace(/\\\\+/g,S=>S.length%2===0?"\\\\\\\\":S?"\\\\":"")),F===e&&r.contains===!0?(y.output=e,y):(y.output=se.wrapOutput(F,y,t),y)}for(;!X();){if(m=me(),m==="\\0")continue;if(m==="\\\\"){let S=M();if(S==="/"&&r.bash!==!0||S==="."||S===";")continue;if(!S){m+="\\\\",L({type:"text",value:m});continue}let N=/^\\\\+/.exec(ve()),B=0;if(N&&N[0].length>2&&(B=N[0].length,y.index+=B,B%2!==0&&(m+="\\\\")),r.unescape===!0?m=me():m+=me(),y.brackets===0){L({type:"text",value:m});continue}}if(y.brackets>0&&(m!=="]"||g.value==="["||g.value==="[^")){if(r.posix!==!1&&m===":"){let S=g.value.slice(1);if(S.includes("[")&&(g.posix=!0,S.includes(":"))){let N=g.value.lastIndexOf("["),B=g.value.slice(0,N),Q=g.value.slice(N+2),V=UR[Q];if(V){g.value=B+V,y.backtrack=!0,me(),!s.output&&o.indexOf(g)===1&&(s.output=d);continue}}}(m==="["&&M()!==":"||m==="-"&&M()==="]")&&(m=`\\\\${m}`),m==="]"&&(g.value==="["||g.value==="[^")&&(m=`\\\\${m}`),r.posix===!0&&m==="!"&&g.value==="["&&(m="^"),g.value+=m,pr({value:m});continue}if(y.quotes===1&&m!==\'"\'){m=se.escapeRegex(m),g.value+=m,pr({value:m});continue}if(m===\'"\'){y.quotes=y.quotes===1?0:1,r.keepQuotes===!0&&L({type:"text",value:m});continue}if(m==="("){hr("parens"),L({type:"paren",value:m});continue}if(m===")"){if(y.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Et("opening","("));let S=j[j.length-1];if(S&&y.parens===S.parens+1){kg(j.pop());continue}L({type:"paren",value:m,output:y.parens?")":"\\\\)"}),ze("parens");continue}if(m==="["){if(r.nobracket===!0||!ve().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Et("closing","]"));m=`\\\\${m}`}else hr("brackets");L({type:"bracket",value:m});continue}if(m==="]"){if(r.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){L({type:"text",value:m,output:`\\\\${m}`});continue}if(y.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Et("opening","["));L({type:"text",value:m,output:`\\\\${m}`});continue}ze("brackets");let S=g.value.slice(1);if(g.posix!==!0&&S[0]==="^"&&!S.includes("/")&&(m=`/${m}`),g.value+=m,pr({value:m}),r.literalBrackets===!1||se.hasRegexChars(S))continue;let N=se.escapeRegex(g.value);if(y.output=y.output.slice(0,-g.value.length),r.literalBrackets===!0){y.output+=N,g.value=N;continue}g.value=`(${a}${N}|${g.value})`,y.output+=g.value;continue}if(m==="{"&&r.nobrace!==!0){hr("braces");let S={type:"brace",value:m,output:"(",outputIndex:y.output.length,tokensIndex:y.tokens.length};$.push(S),L(S);continue}if(m==="}"){let S=$[$.length-1];if(r.nobrace===!0||!S){L({type:"text",value:m,output:m});continue}let N=")";if(S.dots===!0){let B=o.slice(),Q=[];for(let V=B.length-1;V>=0&&(o.pop(),B[V].type!=="brace");V--)B[V].type!=="dots"&&Q.unshift(B[V].value);N=KR(Q,r),y.backtrack=!0}if(S.comma!==!0&&S.dots!==!0){let B=y.output.slice(0,S.outputIndex),Q=y.tokens.slice(S.tokensIndex);S.value=S.output="\\\\{",m=N="\\\\}",y.output=B;for(let V of Q)y.output+=V.output||V.value}L({type:"brace",value:m,output:N}),ze("braces"),$.pop();continue}if(m==="|"){j.length>0&&j[j.length-1].conditions++,L({type:"text",value:m});continue}if(m===","){let S=m,N=$[$.length-1];N&&ke[ke.length-1]==="braces"&&(N.comma=!0,S="|"),L({type:"comma",value:m,output:S});continue}if(m==="/"){if(g.type==="dot"&&y.index===y.start+1){y.start=y.index+1,y.consumed="",y.output="",o.pop(),g=s;continue}L({type:"slash",value:m,output:w});continue}if(m==="."){if(y.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let S=$[$.length-1];g.type="dots",g.output+=m,g.value+=m,S.dots=!0;continue}if(y.braces+y.parens===0&&g.type!=="bos"&&g.type!=="slash"){L({type:"text",value:m,output:f});continue}L({type:"dot",value:m,output:f});continue}if(m==="?"){if(!(g&&g.value==="(")&&r.noextglob!==!0&&M()==="("&&M(2)!=="?"){dr("qmark",m);continue}if(g&&g.type==="paren"){let N=M(),B=m;if(N==="<"&&!se.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(N)||N==="<"&&!/<([!=]|\\w+>)/.test(ve()))&&(B=`\\\\${m}`),L({type:"text",value:m,output:B});continue}if(r.dot!==!0&&(g.type==="slash"||g.type==="bos")){L({type:"qmark",value:m,output:k});continue}L({type:"qmark",value:m,output:A});continue}if(m==="!"){if(r.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){dr("negate",m);continue}if(r.nonegate!==!0&&y.index===0){Ig();continue}}if(m==="+"){if(r.noextglob!==!0&&M()==="("&&M(2)!=="?"){dr("plus",m);continue}if(g&&g.value==="("||r.regex===!1){L({type:"plus",value:m,output:h});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||y.parens>0){L({type:"plus",value:m});continue}L({type:"plus",value:h});continue}if(m==="@"){if(r.noextglob!==!0&&M()==="("&&M(2)!=="?"){L({type:"at",extglob:!0,value:m,output:""});continue}L({type:"text",value:m});continue}if(m!=="*"){(m==="$"||m==="^")&&(m=`\\\\${m}`);let S=GR.exec(ve());S&&(m+=S[0],y.index+=S[0].length),L({type:"text",value:m});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=m,g.output=D,y.backtrack=!0,y.globstar=!0,te(m);continue}let x=ve();if(r.noextglob!==!0&&/^\\([^?]/.test(x)){dr("star",m);continue}if(g.type==="star"){if(r.noglobstar===!0){te(m);continue}let S=g.prev,N=S.prev,B=S.type==="slash"||S.type==="bos",Q=N&&(N.type==="star"||N.type==="globstar");if(r.bash===!0&&(!B||x[0]&&x[0]!=="/")){L({type:"star",value:m,output:""});continue}let V=y.braces>0&&(S.type==="comma"||S.type==="brace"),si=j.length&&(S.type==="pipe"||S.type==="paren");if(!B&&S.type!=="paren"&&!V&&!si){L({type:"star",value:m,output:""});continue}for(;x.slice(0,3)==="/**";){let yr=e[y.index+4];if(yr&&yr!=="/")break;x=x.slice(3),te("/**",3)}if(S.type==="bos"&&X()){g.type="globstar",g.value+=m,g.output=E(r),y.output=g.output,y.globstar=!0,te(m);continue}if(S.type==="slash"&&S.prev.type!=="bos"&&!Q&&X()){y.output=y.output.slice(0,-(S.output+g.output).length),S.output=`(?:${S.output}`,g.type="globstar",g.output=E(r)+(r.strictSlashes?")":"|$)"),g.value+=m,y.globstar=!0,y.output+=S.output+g.output,te(m);continue}if(S.type==="slash"&&S.prev.type!=="bos"&&x[0]==="/"){let yr=x[1]!==void 0?"|$":"";y.output=y.output.slice(0,-(S.output+g.output).length),S.output=`(?:${S.output}`,g.type="globstar",g.output=`${E(r)}${w}|${w}${yr})`,g.value+=m,y.output+=S.output+g.output,y.globstar=!0,te(m+me()),L({type:"slash",value:"/",output:""});continue}if(S.type==="bos"&&x[0]==="/"){g.type="globstar",g.value+=m,g.output=`(?:^|${w}|${E(r)}${w})`,y.output=g.output,y.globstar=!0,te(m+me()),L({type:"slash",value:"/",output:""});continue}y.output=y.output.slice(0,-g.output.length),g.type="globstar",g.output=E(r),g.value+=m,y.output+=g.output,y.globstar=!0,te(m);continue}let F={type:"star",value:m,output:D};if(r.bash===!0){F.output=".*?",(g.type==="bos"||g.type==="slash")&&(F.output=R+F.output),L(F);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&r.regex===!0){F.output=m,L(F);continue}(y.index===y.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(y.output+=T,g.output+=T):r.dot===!0?(y.output+=C,g.output+=C):(y.output+=R,g.output+=R),M()!=="*"&&(y.output+=d,g.output+=d)),L(F)}for(;y.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Et("closing","]"));y.output=se.escapeLast(y.output,"["),ze("brackets")}for(;y.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Et("closing",")"));y.output=se.escapeLast(y.output,"("),ze("parens")}for(;y.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Et("closing","}"));y.output=se.escapeLast(y.output,"{"),ze("braces")}if(r.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${w}?`}),y.backtrack===!0){y.output="";for(let x of y.tokens)y.output+=x.output!=null?x.output:x.value,x.suffix&&(y.output+=x.suffix)}return y};Ys.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(Sn,r.maxLength):Sn,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);e=Lh[e]||e;let s=se.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:w,START_ANCHOR:d}=bn.globChars(s),v=r.dot?f:l,b=r.dot?h:l,T=r.capture?"":"?:",C={negated:!1,prefix:""},A=r.bash===!0?".*?":w;r.capture&&(A=`(${A})`);let k=R=>R.noglobstar===!0?A:`(${T}(?:(?!${d}${R.dot?c:o}).)*?)`,_=R=>{switch(R){case"*":return`${v}${u}${A}`;case".*":return`${o}${u}${A}`;case"*.*":return`${v}${A}${o}${u}${A}`;case"*/*":return`${v}${A}${a}${u}${b}${A}`;case"**":return v+k(r);case"**/*":return`(?:${v}${k(r)}${a})?${b}${u}${A}`;case"**/*.*":return`(?:${v}${k(r)}${a})?${b}${A}${o}${u}${A}`;case"**/.*":return`(?:${v}${k(r)}${a})?${o}${u}${A}`;default:{let O=/^(.*?)\\.(\\w+)$/.exec(R);if(!O)return;let D=_(O[1]);return D?D+o+O[2]:void 0}}},P=se.removePrefix(e,C),E=_(P);return E&&r.strictSlashes!==!0&&(E+=`${a}?`),E};Dh.exports=Ys});var $h=p((Ck,jh)=>{"use strict";var WR=require("path"),zR=Nh(),Xs=Mh(),Qs=rr(),YR=tr(),XR=e=>e&&typeof e=="object"&&!Array.isArray(e),U=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(h=>U(h,t,r));return h=>{for(let w of l){let d=w(h);if(d)return d}return!1}}let n=XR(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=t||{},s=Qs.isWindows(t),o=n?U.compileRe(e,t):U.makeRe(e,t,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};u=U(i.ignore,l,r)}let c=(l,f=!1)=>{let{isMatch:h,match:w,output:d}=U.test(l,o,t,{glob:e,posix:s}),v={glob:e,state:a,regex:o,posix:s,input:l,output:d,match:w,isMatch:h};return typeof i.onResult=="function"&&i.onResult(v),h===!1?(v.isMatch=!1,f?v:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(v),v.isMatch=!1,f?v:!1):(typeof i.onMatch=="function"&&i.onMatch(v),f?v:!0)};return r&&(c.state=a),c};U.test=(e,t,r,{glob:n,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?Qs.toPosixSlashes:null),a=e===n,u=a&&o?o(e):e;return a===!1&&(u=o?o(e):e,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=U.matchBase(e,t,r,i):a=t.exec(u)),{isMatch:!!a,match:a,output:u}};U.matchBase=(e,t,r,n=Qs.isWindows(r))=>(t instanceof RegExp?t:U.makeRe(t,r)).test(WR.basename(e));U.isMatch=(e,t,r)=>U(t,r)(e);U.parse=(e,t)=>Array.isArray(e)?e.map(r=>U.parse(r,t)):Xs(e,{...t,fastpaths:!1});U.scan=(e,t)=>zR(e,t);U.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let i=t||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${e.output})${o}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let u=U.toRegex(a,t);return n===!0&&(u.state=e),u};U.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=Xs.fastpaths(e,t)),i.output||(i=Xs(e,t)),U.compileRe(i,t,r,n)};U.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};U.constants=YR;jh.exports=U});var Hh=p((Ik,Fh)=>{"use strict";Fh.exports=$h()});var Wh=p((kk,Kh)=>{"use strict";var Uh=require("util"),Gh=Sh(),Ee=Hh(),Zs=rr(),Bh=e=>e===""||e==="./",Vh=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},H=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,i=new Set,s=new Set,o=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let f=Ee(String(t[l]),{...r,onResult:a},!0),h=f.state.negated||f.state.negatedExtglob;h&&o++;for(let w of e){let d=f(w,!0);(h?!d.isMatch:d.isMatch)&&(h?n.add(d.output):(n.delete(d.output),i.add(d.output)))}}let c=(o===t.length?[...s]:[...i]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(l=>l.replace(/\\\\/g,"")):t}return c};H.match=H;H.matcher=(e,t)=>Ee(e,t);H.isMatch=(e,t,r)=>Ee(t,r)(e);H.any=H.isMatch;H.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(H(e,t,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};H.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Uh.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>H.contains(e,n,r));if(typeof t=="string"){if(Bh(e)||Bh(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return H.isMatch(e,t,{...r,contains:!0})};H.matchKeys=(e,t,r)=>{if(!Zs.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=H(Object.keys(e),t,r),i={};for(let s of n)i[s]=e[s];return i};H.some=(e,t,r)=>{let n=[].concat(e);for(let i of[].concat(t)){let s=Ee(String(i),r);if(n.some(o=>s(o)))return!0}return!1};H.every=(e,t,r)=>{let n=[].concat(e);for(let i of[].concat(t)){let s=Ee(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};H.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Uh.inspect(e)}"`);return[].concat(t).every(n=>Ee(n,r)(e))};H.capture=(e,t,r)=>{let n=Zs.isWindows(r),s=Ee.makeRe(String(e),{...r,capture:!0}).exec(n?Zs.toPosixSlashes(t):t);if(s)return s.slice(1).map(o=>o===void 0?"":o)};H.makeRe=(...e)=>Ee.makeRe(...e);H.scan=(...e)=>Ee.scan(...e);H.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let i of Gh(String(n),t))r.push(Ee.parse(i,t));return r};H.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Vh(e)?[e]:Gh(e,t)};H.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return H.braces(e,{...t,expand:!0})};H.hasBraces=Vh;Kh.exports=H});var nd=p(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.isAbsolute=I.partitionAbsoluteAndRelative=I.removeDuplicateSlashes=I.matchAny=I.convertPatternsToRe=I.makeRe=I.getPatternParts=I.expandBraceExpansion=I.expandPatternsWithBraceExpansion=I.isAffectDepthOfReadingPattern=I.endsWithSlashGlobStar=I.hasGlobStar=I.getBaseDirectory=I.isPatternRelatedToParentDirectory=I.getPatternsOutsideCurrentDirectory=I.getPatternsInsideCurrentDirectory=I.getPositivePatterns=I.getNegativePatterns=I.isPositivePattern=I.isNegativePattern=I.convertToNegativePattern=I.convertToPositivePattern=I.isDynamicPattern=I.isStaticPattern=void 0;var zh=require("path"),QR=$p(),Js=Wh(),Yh="**",ZR="\\\\",JR=/[*?]|^!/,ex=/\\[[^[]*]/,tx=/(?:^|[^!*+?@])\\([^(]*\\|[^|]*\\)/,rx=/[!*+?@]\\([^(]*\\)/,nx=/,|\\.\\./,ix=/(?!^)\\/{2,}/g;function Xh(e,t={}){return!Qh(e,t)}I.isStaticPattern=Xh;function Qh(e,t={}){return e===""?!1:!!(t.caseSensitiveMatch===!1||e.includes(ZR)||JR.test(e)||ex.test(e)||tx.test(e)||t.extglob!==!1&&rx.test(e)||t.braceExpansion!==!1&&sx(e))}I.isDynamicPattern=Qh;function sx(e){let t=e.indexOf("{");if(t===-1)return!1;let r=e.indexOf("}",t+1);if(r===-1)return!1;let n=e.slice(t,r);return nx.test(n)}function ox(e){return En(e)?e.slice(1):e}I.convertToPositivePattern=ox;function ax(e){return"!"+e}I.convertToNegativePattern=ax;function En(e){return e.startsWith("!")&&e[1]!=="("}I.isNegativePattern=En;function Zh(e){return!En(e)}I.isPositivePattern=Zh;function ux(e){return e.filter(En)}I.getNegativePatterns=ux;function cx(e){return e.filter(Zh)}I.getPositivePatterns=cx;function lx(e){return e.filter(t=>!eo(t))}I.getPatternsInsideCurrentDirectory=lx;function fx(e){return e.filter(eo)}I.getPatternsOutsideCurrentDirectory=fx;function eo(e){return e.startsWith("..")||e.startsWith("./..")}I.isPatternRelatedToParentDirectory=eo;function px(e){return QR(e,{flipBackslashes:!1})}I.getBaseDirectory=px;function hx(e){return e.includes(Yh)}I.hasGlobStar=hx;function Jh(e){return e.endsWith("/"+Yh)}I.endsWithSlashGlobStar=Jh;function dx(e){let t=zh.basename(e);return Jh(e)||Xh(t)}I.isAffectDepthOfReadingPattern=dx;function yx(e){return e.reduce((t,r)=>t.concat(ed(r)),[])}I.expandPatternsWithBraceExpansion=yx;function ed(e){let t=Js.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((r,n)=>r.length-n.length),t.filter(r=>r!=="")}I.expandBraceExpansion=ed;function gx(e,t){let{parts:r}=Js.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return r.length===0&&(r=[e]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}I.getPatternParts=gx;function td(e,t){return Js.makeRe(e,t)}I.makeRe=td;function mx(e,t){return e.map(r=>td(r,t))}I.convertPatternsToRe=mx;function vx(e,t){return t.some(r=>r.test(e))}I.matchAny=vx;function _x(e){return e.replace(ix,"/")}I.removeDuplicateSlashes=_x;function bx(e){let t=[],r=[];for(let n of e)rd(n)?t.push(n):r.push(n);return[t,r]}I.partitionAbsoluteAndRelative=bx;function rd(e){return zh.isAbsolute(e)}I.isAbsolute=rd});var ad=p((Nk,od)=>{"use strict";var Sx=require("stream"),id=Sx.PassThrough,Ex=Array.prototype.slice;od.exports=wx;function wx(){let e=[],t=Ex.call(arguments),r=!1,n=t[t.length-1];n&&!Array.isArray(n)&&n.pipe==null?t.pop():n={};let i=n.end!==!1,s=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=id(n);function a(){for(let l=0,f=arguments.length;l<f;l++)e.push(sd(arguments[l],n));return u(),this}function u(){if(r)return;r=!0;let l=e.shift();if(!l){process.nextTick(c);return}Array.isArray(l)||(l=[l]);let f=l.length+1;function h(){--f>0||(r=!1,u())}function w(d){function v(){d.removeListener("merge2UnpipeEnd",v),d.removeListener("end",v),s&&d.removeListener("error",b),h()}function b(T){o.emit("error",T)}if(d._readableState.endEmitted)return h();d.on("merge2UnpipeEnd",v),d.on("end",v),s&&d.on("error",b),d.pipe(o,{end:!1}),d.resume()}for(let d=0;d<l.length;d++)w(l[d]);h()}function c(){r=!1,o.emit("queueDrain"),i&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),t.length&&a.apply(null,t),o}function sd(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=sd(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(id(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}});var cd=p(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.merge=void 0;var Rx=ad();function xx(e){let t=Rx(e);return e.forEach(r=>{r.once("error",n=>t.emit("error",n))}),t.once("close",()=>ud(e)),t.once("end",()=>ud(e)),t}wn.merge=xx;function ud(e){e.forEach(t=>t.emit("close"))}});var ld=p(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.isEmpty=wt.isString=void 0;function Px(e){return typeof e=="string"}wt.isString=Px;function Ax(e){return e===""}wt.isEmpty=Ax});var Ie=p(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.string=z.stream=z.pattern=z.path=z.fs=z.errno=z.array=void 0;var Ox=Pp();z.array=Ox;var Tx=Ap();z.errno=Tx;var Cx=Op();z.fs=Cx;var Ix=kp();z.path=Ix;var kx=nd();z.pattern=kx;var qx=cd();z.stream=qx;var Nx=ld();z.string=Nx});var dd=p(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.convertPatternGroupToTask=Y.convertPatternGroupsToTasks=Y.groupPatternsByBaseDirectory=Y.getNegativePatternsAsPositive=Y.getPositivePatterns=Y.convertPatternsToTasks=Y.generate=void 0;var ye=Ie();function Lx(e,t){let r=fd(e,t),n=fd(t.ignore,t),i=pd(r),s=hd(r,n),o=i.filter(l=>ye.pattern.isStaticPattern(l,t)),a=i.filter(l=>ye.pattern.isDynamicPattern(l,t)),u=to(o,s,!1),c=to(a,s,!0);return u.concat(c)}Y.generate=Lx;function fd(e,t){let r=e;return t.braceExpansion&&(r=ye.pattern.expandPatternsWithBraceExpansion(r)),t.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>ye.pattern.removeDuplicateSlashes(n))}function to(e,t,r){let n=[],i=ye.pattern.getPatternsOutsideCurrentDirectory(e),s=ye.pattern.getPatternsInsideCurrentDirectory(e),o=ro(i),a=ro(s);return n.push(...no(o,t,r)),"."in a?n.push(io(".",s,t,r)):n.push(...no(a,t,r)),n}Y.convertPatternsToTasks=to;function pd(e){return ye.pattern.getPositivePatterns(e)}Y.getPositivePatterns=pd;function hd(e,t){return ye.pattern.getNegativePatterns(e).concat(t).map(ye.pattern.convertToPositivePattern)}Y.getNegativePatternsAsPositive=hd;function ro(e){let t={};return e.reduce((r,n)=>{let i=ye.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},t)}Y.groupPatternsByBaseDirectory=ro;function no(e,t,r){return Object.keys(e).map(n=>io(n,e[n],t,r))}Y.convertPatternGroupsToTasks=no;function io(e,t,r,n){return{dynamic:n,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(ye.pattern.convertToNegativePattern))}}Y.convertPatternGroupToTask=io});var gd=p(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.read=void 0;function Dx(e,t,r){t.fs.lstat(e,(n,i)=>{if(n!==null){yd(r,n);return}if(!i.isSymbolicLink()||!t.followSymbolicLink){so(r,i);return}t.fs.stat(e,(s,o)=>{if(s!==null){if(t.throwErrorOnBrokenSymbolicLink){yd(r,s);return}so(r,i);return}t.markSymbolicLink&&(o.isSymbolicLink=()=>!0),so(r,o)})})}Rn.read=Dx;function yd(e,t){e(t)}function so(e,t){e(null,t)}});var md=p(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.read=void 0;function Mx(e,t){let r=t.fs.lstatSync(e);if(!r.isSymbolicLink()||!t.followSymbolicLink)return r;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!t.throwErrorOnBrokenSymbolicLink)return r;throw n}}xn.read=Mx});var vd=p($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.createFileSystemAdapter=$e.FILE_SYSTEM_ADAPTER=void 0;var Pn=require("fs");$e.FILE_SYSTEM_ADAPTER={lstat:Pn.lstat,stat:Pn.stat,lstatSync:Pn.lstatSync,statSync:Pn.statSync};function jx(e){return e===void 0?$e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},$e.FILE_SYSTEM_ADAPTER),e)}$e.createFileSystemAdapter=jx});var _d=p(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});var $x=vd(),oo=class{constructor(t={}){this._options=t,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=$x.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(t,r){return t??r}};ao.default=oo});var st=p(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.statSync=Fe.stat=Fe.Settings=void 0;var bd=gd(),Fx=md(),uo=_d();Fe.Settings=uo.default;function Hx(e,t,r){if(typeof t=="function"){bd.read(e,co(),t);return}bd.read(e,co(t),r)}Fe.stat=Hx;function Bx(e,t){let r=co(t);return Fx.read(e,r)}Fe.statSync=Bx;function co(e={}){return e instanceof uo.default?e:new uo.default(e)}});var wd=p((Gk,Ed)=>{var Sd;Ed.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):e=>(Sd||(Sd=Promise.resolve())).then(e).catch(t=>setTimeout(()=>{throw t},0))});var xd=p((Vk,Rd)=>{Rd.exports=Gx;var Ux=wd();function Gx(e,t){let r,n,i,s=!0;Array.isArray(e)?(r=[],n=e.length):(i=Object.keys(e),r={},n=i.length);function o(u){function c(){t&&t(u,r),t=null}s?Ux(c):c()}function a(u,c,l){r[u]=l,(--n===0||c)&&o(c)}n?i?i.forEach(function(u){e[u](function(c,l){a(u,c,l)})}):e.forEach(function(u,c){u(function(l,f){a(c,l,f)})}):o(null),s=!1}});var lo=p(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var An=process.versions.node.split(".");if(An[0]===void 0||An[1]===void 0)throw new Error(`Unexpected behavior. The \'process.versions.node\' variable has invalid value: ${process.versions.node}`);var Pd=Number.parseInt(An[0],10),Vx=Number.parseInt(An[1],10),Ad=10,Kx=10,Wx=Pd>Ad,zx=Pd===Ad&&Vx>=Kx;On.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Wx||zx});var Od=p(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.createDirentFromStats=void 0;var fo=class{constructor(t,r){this.name=t,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Yx(e,t){return new fo(e,t)}Tn.createDirentFromStats=Yx});var po=p(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.fs=void 0;var Xx=Od();Cn.fs=Xx});var ho=p(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.joinPathSegments=void 0;function Qx(e,t,r){return e.endsWith(r)?e+t:e+r+t}In.joinPathSegments=Qx});var Nd=p(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.readdir=He.readdirWithFileTypes=He.read=void 0;var Zx=st(),Td=xd(),Jx=lo(),Cd=po(),Id=ho();function eP(e,t,r){if(!t.stats&&Jx.IS_SUPPORT_READDIR_WITH_FILE_TYPES){kd(e,t,r);return}qd(e,t,r)}He.read=eP;function kd(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,i)=>{if(n!==null){kn(r,n);return}let s=i.map(a=>({dirent:a,name:a.name,path:Id.joinPathSegments(e,a.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){yo(r,s);return}let o=s.map(a=>tP(a,t));Td(o,(a,u)=>{if(a!==null){kn(r,a);return}yo(r,u)})})}He.readdirWithFileTypes=kd;function tP(e,t){return r=>{if(!e.dirent.isSymbolicLink()){r(null,e);return}t.fs.stat(e.path,(n,i)=>{if(n!==null){if(t.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,e);return}e.dirent=Cd.fs.createDirentFromStats(e.name,i),r(null,e)})}}function qd(e,t,r){t.fs.readdir(e,(n,i)=>{if(n!==null){kn(r,n);return}let s=i.map(o=>{let a=Id.joinPathSegments(e,o,t.pathSegmentSeparator);return u=>{Zx.stat(a,t.fsStatSettings,(c,l)=>{if(c!==null){u(c);return}let f={name:o,path:a,dirent:Cd.fs.createDirentFromStats(o,l)};t.stats&&(f.stats=l),u(null,f)})}});Td(s,(o,a)=>{if(o!==null){kn(r,o);return}yo(r,a)})})}He.readdir=qd;function kn(e,t){e(t)}function yo(e,t){e(null,t)}});var $d=p(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.readdir=Be.readdirWithFileTypes=Be.read=void 0;var rP=st(),nP=lo(),Ld=po(),Dd=ho();function iP(e,t){return!t.stats&&nP.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Md(e,t):jd(e,t)}Be.read=iP;function Md(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:Dd.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let s=t.fs.statSync(i.path);i.dirent=Ld.fs.createDirentFromStats(i.name,s)}catch(s){if(t.throwErrorOnBrokenSymbolicLink)throw s}return i})}Be.readdirWithFileTypes=Md;function jd(e,t){return t.fs.readdirSync(e).map(n=>{let i=Dd.joinPathSegments(e,n,t.pathSegmentSeparator),s=rP.statSync(i,t.fsStatSettings),o={name:n,path:i,dirent:Ld.fs.createDirentFromStats(n,s)};return t.stats&&(o.stats=s),o})}Be.readdir=jd});var Fd=p(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.createFileSystemAdapter=Ue.FILE_SYSTEM_ADAPTER=void 0;var Rt=require("fs");Ue.FILE_SYSTEM_ADAPTER={lstat:Rt.lstat,stat:Rt.stat,lstatSync:Rt.lstatSync,statSync:Rt.statSync,readdir:Rt.readdir,readdirSync:Rt.readdirSync};function sP(e){return e===void 0?Ue.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ue.FILE_SYSTEM_ADAPTER),e)}Ue.createFileSystemAdapter=sP});var Hd=p(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});var oP=require("path"),aP=st(),uP=Fd(),go=class{constructor(t={}){this._options=t,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=uP.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,oP.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new aP.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};mo.default=go});var qn=p(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.Settings=Ge.scandirSync=Ge.scandir=void 0;var Bd=Nd(),cP=$d(),vo=Hd();Ge.Settings=vo.default;function lP(e,t,r){if(typeof t=="function"){Bd.read(e,_o(),t);return}Bd.read(e,_o(t),r)}Ge.scandir=lP;function fP(e,t){let r=_o(t);return cP.read(e,r)}Ge.scandirSync=fP;function _o(e={}){return e instanceof vo.default?e:new vo.default(e)}});var Gd=p((tq,Ud)=>{"use strict";function pP(e){var t=new e,r=t;function n(){var s=t;return s.next?t=s.next:(t=new e,r=t),s.next=null,s}function i(s){r.next=s,r=s}return{get:n,release:i}}Ud.exports=pP});var Kd=p((rq,bo)=>{"use strict";var hP=Gd();function Vd(e,t,r){if(typeof e=="function"&&(r=t,t=e,e=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=hP(dP),i=null,s=null,o=0,a=null,u={push:v,drain:ce,saturated:ce,pause:l,paused:!1,get concurrency(){return r},set concurrency(_){if(!(_>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=_,!u.paused)for(;i&&o<r;)o++,T()},running:c,resume:w,idle:d,length:f,getQueue:h,unshift:b,empty:ce,kill:C,killAndDrain:A,error:k};return u;function c(){return o}function l(){u.paused=!0}function f(){for(var _=i,P=0;_;)_=_.next,P++;return P}function h(){for(var _=i,P=[];_;)P.push(_.value),_=_.next;return P}function w(){if(u.paused){if(u.paused=!1,i===null){o++,T();return}for(;i&&o<r;)o++,T()}}function d(){return o===0&&u.length()===0}function v(_,P){var E=n.get();E.context=e,E.release=T,E.value=_,E.callback=P||ce,E.errorHandler=a,o>=r||u.paused?s?(s.next=E,s=E):(i=E,s=E,u.saturated()):(o++,t.call(e,E.value,E.worked))}function b(_,P){var E=n.get();E.context=e,E.release=T,E.value=_,E.callback=P||ce,E.errorHandler=a,o>=r||u.paused?i?(E.next=i,i=E):(i=E,s=E,u.saturated()):(o++,t.call(e,E.value,E.worked))}function T(_){_&&n.release(_);var P=i;P&&o<=r?u.paused?o--:(s===i&&(s=null),i=P.next,P.next=null,t.call(e,P.value,P.worked),s===null&&u.empty()):--o===0&&u.drain()}function C(){i=null,s=null,u.drain=ce}function A(){i=null,s=null,u.drain(),u.drain=ce}function k(_){a=_}}function ce(){}function dP(){this.value=null,this.callback=ce,this.next=null,this.release=ce,this.context=null,this.errorHandler=null;var e=this;this.worked=function(r,n){var i=e.callback,s=e.errorHandler,o=e.value;e.value=null,e.callback=ce,e.errorHandler&&s(r,o),i.call(e.context,r,n),e.release(e)}}function yP(e,t,r){typeof e=="function"&&(r=t,t=e,e=null);function n(l,f){t.call(this,l).then(function(h){f(null,h)},f)}var i=Vd(e,n,r),s=i.push,o=i.unshift;return i.push=a,i.unshift=u,i.drained=c,i;function a(l){var f=new Promise(function(h,w){s(l,function(d,v){if(d){w(d);return}h(v)})});return f.catch(ce),f}function u(l){var f=new Promise(function(h,w){o(l,function(d,v){if(d){w(d);return}h(v)})});return f.catch(ce),f}function c(){var l=new Promise(function(f){process.nextTick(function(){if(i.idle())f();else{var h=i.drain;i.drain=function(){typeof h=="function"&&h(),f(),i.drain=h}}})});return l}}bo.exports=Vd;bo.exports.promise=yP});var Nn=p(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.joinPathSegments=we.replacePathSegmentSeparator=we.isAppliedFilter=we.isFatalError=void 0;function gP(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}we.isFatalError=gP;function mP(e,t){return e===null||e(t)}we.isAppliedFilter=mP;function vP(e,t){return e.split(/[/\\\\]/).join(t)}we.replacePathSegmentSeparator=vP;function _P(e,t,r){return e===""?t:e.endsWith(r)?e+t:e+r+t}we.joinPathSegments=_P});var wo=p(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});var bP=Nn(),So=class{constructor(t,r){this._root=t,this._settings=r,this._root=bP.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}};Eo.default=So});var Po=p(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});var SP=require("events"),EP=qn(),wP=Kd(),Ln=Nn(),RP=wo(),Ro=class extends RP.default{constructor(t,r){super(t,r),this._settings=r,this._scandir=EP.scandir,this._emitter=new SP.EventEmitter,this._queue=wP(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){let n={directory:t,base:r};this._queue.push(n,i=>{i!==null&&this._handleError(i)})}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,(n,i)=>{if(n!==null){r(n,void 0);return}for(let s of i)this._handleEntry(s,t.base);r(null,void 0)})}_handleError(t){this._isDestroyed||!Ln.isFatalError(this._settings,t)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",t))}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError)return;let n=t.path;r!==void 0&&(t.path=Ln.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Ln.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&Ln.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_emitEntry(t){this._emitter.emit("entry",t)}};xo.default=Ro});var Wd=p(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});var xP=Po(),Ao=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new xP.default(this._root,this._settings),this._storage=[]}read(t){this._reader.onError(r=>{PP(t,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{AP(t,this._storage)}),this._reader.read()}};Oo.default=Ao;function PP(e,t){e(t)}function AP(e,t){e(null,t)}});var zd=p(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});var OP=require("stream"),TP=Po(),To=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new TP.default(this._root,this._settings),this._stream=new OP.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(t=>{this._stream.emit("error",t)}),this._reader.onEntry(t=>{this._stream.push(t)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};Co.default=To});var Yd=p(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});var CP=qn(),Dn=Nn(),IP=wo(),Io=class extends IP.default{constructor(){super(...arguments),this._scandir=CP.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(let t of this._queue.values())this._handleDirectory(t.directory,t.base)}_handleDirectory(t,r){try{let n=this._scandir(t,this._settings.fsScandirSettings);for(let i of n)this._handleEntry(i,r)}catch(n){this._handleError(n)}}_handleError(t){if(Dn.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=Dn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Dn.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&Dn.isAppliedFilter(this._settings.deepFilter,t)&&this._pushToQueue(n,r===void 0?void 0:t.path)}_pushToStorage(t){this._storage.push(t)}};ko.default=Io});var Xd=p(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});var kP=Yd(),qo=class{constructor(t,r){this._root=t,this._settings=r,this._reader=new kP.default(this._root,this._settings)}read(){return this._reader.read()}};No.default=qo});var Qd=p(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});var qP=require("path"),NP=qn(),Lo=class{constructor(t={}){this._options=t,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,qP.sep),this.fsScandirSettings=new NP.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t??r}};Do.default=Lo});var jn=p(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.Settings=Re.walkStream=Re.walkSync=Re.walk=void 0;var Zd=Wd(),LP=zd(),DP=Xd(),Mo=Qd();Re.Settings=Mo.default;function MP(e,t,r){if(typeof t=="function"){new Zd.default(e,Mn()).read(t);return}new Zd.default(e,Mn(t)).read(r)}Re.walk=MP;function jP(e,t){let r=Mn(t);return new DP.default(e,r).read()}Re.walkSync=jP;function $P(e,t){let r=Mn(t);return new LP.default(e,r).read()}Re.walkStream=$P;function Mn(e={}){return e instanceof Mo.default?e:new Mo.default(e)}});var $n=p($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});var FP=require("path"),HP=st(),Jd=Ie(),jo=class{constructor(t){this._settings=t,this._fsStatSettings=new HP.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(t){return FP.resolve(this._settings.cwd,t)}_makeEntry(t,r){let n={name:r,path:r,dirent:Jd.fs.createDirentFromStats(r,t)};return this._settings.stats&&(n.stats=t),n}_isFatalError(t){return!Jd.errno.isEnoentCodeError(t)&&!this._settings.suppressErrors}};$o.default=jo});var Bo=p(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var BP=require("stream"),UP=st(),GP=jn(),VP=$n(),Fo=class extends VP.default{constructor(){super(...arguments),this._walkStream=GP.walkStream,this._stat=UP.stat}dynamic(t,r){return this._walkStream(t,r)}static(t,r){let n=t.map(this._getFullEntryPath,this),i=new BP.PassThrough({objectMode:!0});i._write=(s,o,a)=>this._getEntry(n[s],t[s],r).then(u=>{u!==null&&r.entryFilter(u)&&i.push(u),s===n.length-1&&i.end(),a()}).catch(a);for(let s=0;s<n.length;s++)i.write(s);return i}_getEntry(t,r,n){return this._getStat(t).then(i=>this._makeEntry(i,r)).catch(i=>{if(n.errorFilter(i))return null;throw i})}_getStat(t){return new Promise((r,n)=>{this._stat(t,this._fsStatSettings,(i,s)=>i===null?r(s):n(i))})}};Ho.default=Fo});var ey=p(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});var KP=jn(),WP=$n(),zP=Bo(),Uo=class extends WP.default{constructor(){super(...arguments),this._walkAsync=KP.walk,this._readerStream=new zP.default(this._settings)}dynamic(t,r){return new Promise((n,i)=>{this._walkAsync(t,r,(s,o)=>{s===null?n(o):i(s)})})}async static(t,r){let n=[],i=this._readerStream.static(t,r);return new Promise((s,o)=>{i.once("error",o),i.on("data",a=>n.push(a)),i.once("end",()=>s(n))})}};Go.default=Uo});var ty=p(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});var ir=Ie(),Vo=class{constructor(t,r,n){this._patterns=t,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let t of this._patterns){let r=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:t,segments:r,sections:n})}}_getPatternSegments(t){return ir.pattern.getPatternParts(t,this._micromatchOptions).map(n=>ir.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:ir.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(t){return ir.array.splitWhen(t,r=>r.dynamic&&ir.pattern.hasGlobStar(r.pattern))}};Ko.default=Vo});var ry=p(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});var YP=ty(),Wo=class extends YP.default{match(t){let r=t.split("/"),n=r.length,i=this._storage.filter(s=>!s.complete||s.segments.length>n);for(let s of i){let o=s.sections[0];if(!s.complete&&n>o.length||r.every((u,c)=>{let l=s.segments[c];return!!(l.dynamic&&l.patternRe.test(u)||!l.dynamic&&l.pattern===u)}))return!0}return!1}};zo.default=Wo});var ny=p(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});var Fn=Ie(),XP=ry(),Yo=class{constructor(t,r){this._settings=t,this._micromatchOptions=r}getFilter(t,r,n){let i=this._getMatcher(r),s=this._getNegativePatternsRe(n);return o=>this._filter(t,o,i,s)}_getMatcher(t){return new XP.default(t,this._settings,this._micromatchOptions)}_getNegativePatternsRe(t){let r=t.filter(Fn.pattern.isAffectDepthOfReadingPattern);return Fn.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(t,r,n,i){if(this._isSkippedByDeep(t,r.path)||this._isSkippedSymbolicLink(r))return!1;let s=Fn.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(s,n)?!1:this._isSkippedByNegativePatterns(s,i)}_isSkippedByDeep(t,r){return this._settings.deep===1/0?!1:this._getEntryLevel(t,r)>=this._settings.deep}_getEntryLevel(t,r){let n=r.split("/").length;if(t==="")return n;let i=t.split("/").length;return n-i}_isSkippedSymbolicLink(t){return!this._settings.followSymbolicLinks&&t.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(t,r){return!this._settings.baseNameMatch&&!r.match(t)}_isSkippedByNegativePatterns(t,r){return!Fn.pattern.matchAny(t,r)}};Xo.default=Yo});var iy=p(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});var Ve=Ie(),Qo=class{constructor(t,r){this._settings=t,this._micromatchOptions=r,this.index=new Map}getFilter(t,r){let[n,i]=Ve.pattern.partitionAbsoluteAndRelative(r),s={positive:{all:Ve.pattern.convertPatternsToRe(t,this._micromatchOptions)},negative:{absolute:Ve.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:Ve.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,s)}_filter(t,r){let n=Ve.path.removeLeadingDotSegment(t.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(t)||this._onlyDirectoryFilter(t))return!1;let i=this._isMatchToPatternsSet(n,r,t.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(n),i}_isDuplicateEntry(t){return this.index.has(t)}_createIndexRecord(t){this.index.set(t,void 0)}_onlyFileFilter(t){return this._settings.onlyFiles&&!t.dirent.isFile()}_onlyDirectoryFilter(t){return this._settings.onlyDirectories&&!t.dirent.isDirectory()}_isMatchToPatternsSet(t,r,n){return!(!this._isMatchToPatterns(t,r.positive.all,n)||this._isMatchToPatterns(t,r.negative.relative,n)||this._isMatchToAbsoluteNegative(t,r.negative.absolute,n))}_isMatchToAbsoluteNegative(t,r,n){if(r.length===0)return!1;let i=Ve.path.makeAbsolute(this._settings.cwd,t);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(t,r,n){if(r.length===0)return!1;let i=Ve.pattern.matchAny(t,r);return!i&&n?Ve.pattern.matchAny(t+"/",r):i}};Zo.default=Qo});var sy=p(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var QP=Ie(),Jo=class{constructor(t){this._settings=t}getFilter(){return t=>this._isNonFatalError(t)}_isNonFatalError(t){return QP.errno.isEnoentCodeError(t)||this._settings.suppressErrors}};ea.default=Jo});var ay=p(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var oy=Ie(),ta=class{constructor(t){this._settings=t}getTransformer(){return t=>this._transform(t)}_transform(t){let r=t.path;return this._settings.absolute&&(r=oy.path.makeAbsolute(this._settings.cwd,r),r=oy.path.unixify(r)),this._settings.markDirectories&&t.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},t),{path:r}):r}};ra.default=ta});var Hn=p(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});var ZP=require("path"),JP=ny(),eA=iy(),tA=sy(),rA=ay(),na=class{constructor(t){this._settings=t,this.errorFilter=new tA.default(this._settings),this.entryFilter=new eA.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new JP.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new rA.default(this._settings)}_getRootDirectory(t){return ZP.resolve(this._settings.cwd,t.base)}_getReaderOptions(t){let r=t.base==="."?"":t.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,t.positive,t.negative),entryFilter:this.entryFilter.getFilter(t.positive,t.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};ia.default=na});var uy=p(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});var nA=ey(),iA=Hn(),sa=class extends iA.default{constructor(){super(...arguments),this._reader=new nA.default(this._settings)}async read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return(await this.api(r,t,n)).map(s=>n.transform(s))}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};oa.default=sa});var cy=p(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var sA=require("stream"),oA=Bo(),aA=Hn(),aa=class extends aA.default{constructor(){super(...arguments),this._reader=new oA.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),i=this.api(r,t,n),s=new sA.Readable({objectMode:!0,read:()=>{}});return i.once("error",o=>s.emit("error",o)).on("data",o=>s.emit("data",n.transform(o))).once("end",()=>s.emit("end")),s.once("close",()=>i.destroy()),s}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};ua.default=aa});var ly=p(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});var uA=st(),cA=jn(),lA=$n(),ca=class extends lA.default{constructor(){super(...arguments),this._walkSync=cA.walkSync,this._statSync=uA.statSync}dynamic(t,r){return this._walkSync(t,r)}static(t,r){let n=[];for(let i of t){let s=this._getFullEntryPath(i),o=this._getEntry(s,i,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(t,r,n){try{let i=this._getStat(t);return this._makeEntry(i,r)}catch(i){if(n.errorFilter(i))return null;throw i}}_getStat(t){return this._statSync(t,this._fsStatSettings)}};la.default=ca});var fy=p(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var fA=ly(),pA=Hn(),fa=class extends pA.default{constructor(){super(...arguments),this._reader=new fA.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t);return this.api(r,t,n).map(n.transform)}api(t,r,n){return r.dynamic?this._reader.dynamic(t,n):this._reader.static(r.patterns,n)}};pa.default=fa});var py=p(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var xt=require("fs"),hA=require("os"),dA=Math.max(hA.cpus().length,1);Pt.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:xt.lstat,lstatSync:xt.lstatSync,stat:xt.stat,statSync:xt.statSync,readdir:xt.readdir,readdirSync:xt.readdirSync};var ha=class{constructor(t={}){this._options=t,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,dA),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(t,r){return t===void 0?r:t}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},Pt.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};Pt.default=ha});var yy=p((Aq,dy)=>{"use strict";var hy=dd(),yA=uy(),gA=cy(),mA=fy(),da=py(),le=Ie();async function ya(e,t){ge(e);let r=ga(e,yA.default,t),n=await Promise.all(r);return le.array.flatten(n)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(c,l){ge(c);let f=ga(c,mA.default,l);return le.array.flatten(f)}e.sync=t;function r(c,l){ge(c);let f=ga(c,gA.default,l);return le.stream.merge(f)}e.stream=r;function n(c,l){ge(c);let f=[].concat(c),h=new da.default(l);return hy.generate(f,h)}e.generateTasks=n;function i(c,l){ge(c);let f=new da.default(l);return le.pattern.isDynamicPattern(c,f)}e.isDynamicPattern=i;function s(c){return ge(c),le.path.escape(c)}e.escapePath=s;function o(c){return ge(c),le.path.convertPathToPattern(c)}e.convertPathToPattern=o;let a;(function(c){function l(h){return ge(h),le.path.escapePosixPath(h)}c.escapePath=l;function f(h){return ge(h),le.path.convertPosixPathToPattern(h)}c.convertPathToPattern=f})(a=e.posix||(e.posix={}));let u;(function(c){function l(h){return ge(h),le.path.escapeWindowsPath(h)}c.escapePath=l;function f(h){return ge(h),le.path.convertWindowsPathToPattern(h)}c.convertPathToPattern=f})(u=e.win32||(e.win32={}))})(ya||(ya={}));function ga(e,t,r){let n=[].concat(e),i=new da.default(r),s=hy.generate(n,i),o=new t(i);return s.map(o.read,o)}function ge(e){if(![].concat(e).every(n=>le.string.isString(n)&&!le.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}dy.exports=ya});var my=p((Oq,gy)=>{function vA(e){return import(e)}gy.exports={importModule:vA}});var va=p((Tq,Gn)=>{var vy,_y,by,Sy,Ey,wy,Ry,xy,Py,Ay,Oy,Ty,Cy,Bn,ma,Iy,ky,qy,At,Ny,Ly,Dy,My,jy,$y,Fy,Hy,By,Un,Uy,Gy,Vy;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Gn=="object"&&typeof Gn.exports=="object"?e(r(t,r(Gn.exports))):e(r(t));function r(n,i){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(s,o){return n[s]=i?i(s,o):o}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,o){s.__proto__=o}||function(s,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(s[a]=o[a])};vy=function(s,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(s,o);function a(){this.constructor=s}s.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)},_y=Object.assign||function(s){for(var o,a=1,u=arguments.length;a<u;a++){o=arguments[a];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(s[c]=o[c])}return s},by=function(s,o){var a={};for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&o.indexOf(u)<0&&(a[u]=s[u]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,u=Object.getOwnPropertySymbols(s);c<u.length;c++)o.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(s,u[c])&&(a[u[c]]=s[u[c]]);return a},Sy=function(s,o,a,u){var c=arguments.length,l=c<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,a):u,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(s,o,a,u);else for(var h=s.length-1;h>=0;h--)(f=s[h])&&(l=(c<3?f(l):c>3?f(o,a,l):f(o,a))||l);return c>3&&l&&Object.defineProperty(o,a,l),l},Ey=function(s,o){return function(a,u){o(a,u,s)}},wy=function(s,o,a,u,c,l){function f(P){if(P!==void 0&&typeof P!="function")throw new TypeError("Function expected");return P}for(var h=u.kind,w=h==="getter"?"get":h==="setter"?"set":"value",d=!o&&s?u.static?s:s.prototype:null,v=o||(d?Object.getOwnPropertyDescriptor(d,u.name):{}),b,T=!1,C=a.length-1;C>=0;C--){var A={};for(var k in u)A[k]=k==="access"?{}:u[k];for(var k in u.access)A.access[k]=u.access[k];A.addInitializer=function(P){if(T)throw new TypeError("Cannot add initializers after decoration has completed");l.push(f(P||null))};var _=(0,a[C])(h==="accessor"?{get:v.get,set:v.set}:v[w],A);if(h==="accessor"){if(_===void 0)continue;if(_===null||typeof _!="object")throw new TypeError("Object expected");(b=f(_.get))&&(v.get=b),(b=f(_.set))&&(v.set=b),(b=f(_.init))&&c.unshift(b)}else(b=f(_))&&(h==="field"?c.unshift(b):v[w]=b)}d&&Object.defineProperty(d,u.name,v),T=!0},Ry=function(s,o,a){for(var u=arguments.length>2,c=0;c<o.length;c++)a=u?o[c].call(s,a):o[c].call(s);return u?a:void 0},xy=function(s){return typeof s=="symbol"?s:"".concat(s)},Py=function(s,o,a){return typeof o=="symbol"&&(o=o.description?"[".concat(o.description,"]"):""),Object.defineProperty(s,"name",{configurable:!0,value:a?"".concat(a," ",o):o})},Ay=function(s,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,o)},Oy=function(s,o,a,u){function c(l){return l instanceof a?l:new a(function(f){f(l)})}return new(a||(a=Promise))(function(l,f){function h(v){try{d(u.next(v))}catch(b){f(b)}}function w(v){try{d(u.throw(v))}catch(b){f(b)}}function d(v){v.done?l(v.value):c(v.value).then(h,w)}d((u=u.apply(s,o||[])).next())})},Ty=function(s,o){var a={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},u,c,l,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=h(0),f.throw=h(1),f.return=h(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(d){return function(v){return w([d,v])}}function w(d){if(u)throw new TypeError("Generator is already executing.");for(;f&&(f=0,d[0]&&(a=0)),a;)try{if(u=1,c&&(l=d[0]&2?c.return:d[0]?c.throw||((l=c.return)&&l.call(c),0):c.next)&&!(l=l.call(c,d[1])).done)return l;switch(c=0,l&&(d=[d[0]&2,l.value]),d[0]){case 0:case 1:l=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,c=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(l=a.trys,!(l=l.length>0&&l[l.length-1])&&(d[0]===6||d[0]===2)){a=0;continue}if(d[0]===3&&(!l||d[1]>l[0]&&d[1]<l[3])){a.label=d[1];break}if(d[0]===6&&a.label<l[1]){a.label=l[1],l=d;break}if(l&&a.label<l[2]){a.label=l[2],a.ops.push(d);break}l[2]&&a.ops.pop(),a.trys.pop();continue}d=o.call(s,a)}catch(v){d=[6,v],c=0}finally{u=l=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},Cy=function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&Un(o,s,a)},Un=Object.create?function(s,o,a,u){u===void 0&&(u=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,c)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]},Bn=function(s){var o=typeof Symbol=="function"&&Symbol.iterator,a=o&&s[o],u=0;if(a)return a.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&u>=s.length&&(s=void 0),{value:s&&s[u++],done:!s}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},ma=function(s,o){var a=typeof Symbol=="function"&&s[Symbol.iterator];if(!a)return s;var u=a.call(s),c,l=[],f;try{for(;(o===void 0||o-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(h){f={error:h}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(f)throw f.error}}return l},Iy=function(){for(var s=[],o=0;o<arguments.length;o++)s=s.concat(ma(arguments[o]));return s},ky=function(){for(var s=0,o=0,a=arguments.length;o<a;o++)s+=arguments[o].length;for(var u=Array(s),c=0,o=0;o<a;o++)for(var l=arguments[o],f=0,h=l.length;f<h;f++,c++)u[c]=l[f];return u},qy=function(s,o,a){if(a||arguments.length===2)for(var u=0,c=o.length,l;u<c;u++)(l||!(u in o))&&(l||(l=Array.prototype.slice.call(o,0,u)),l[u]=o[u]);return s.concat(l||Array.prototype.slice.call(o))},At=function(s){return this instanceof At?(this.v=s,this):new At(s)},Ny=function(s,o,a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=a.apply(s,o||[]),c,l=[];return c=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),h("next"),h("throw"),h("return",f),c[Symbol.asyncIterator]=function(){return this},c;function f(C){return function(A){return Promise.resolve(A).then(C,b)}}function h(C,A){u[C]&&(c[C]=function(k){return new Promise(function(_,P){l.push([C,k,_,P])>1||w(C,k)})},A&&(c[C]=A(c[C])))}function w(C,A){try{d(u[C](A))}catch(k){T(l[0][3],k)}}function d(C){C.value instanceof At?Promise.resolve(C.value.v).then(v,b):T(l[0][2],C)}function v(C){w("next",C)}function b(C){w("throw",C)}function T(C,A){C(A),l.shift(),l.length&&w(l[0][0],l[0][1])}},Ly=function(s){var o,a;return o={},u("next"),u("throw",function(c){throw c}),u("return"),o[Symbol.iterator]=function(){return this},o;function u(c,l){o[c]=s[c]?function(f){return(a=!a)?{value:At(s[c](f)),done:!1}:l?l(f):f}:l}},Dy=function(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=s[Symbol.asyncIterator],a;return o?o.call(s):(s=typeof Bn=="function"?Bn(s):s[Symbol.iterator](),a={},u("next"),u("throw"),u("return"),a[Symbol.asyncIterator]=function(){return this},a);function u(l){a[l]=s[l]&&function(f){return new Promise(function(h,w){f=s[l](f),c(h,w,f.done,f.value)})}}function c(l,f,h,w){Promise.resolve(w).then(function(d){l({value:d,done:h})},f)}},My=function(s,o){return Object.defineProperty?Object.defineProperty(s,"raw",{value:o}):s.raw=o,s};var r=Object.create?function(s,o){Object.defineProperty(s,"default",{enumerable:!0,value:o})}:function(s,o){s.default=o},n=function(s){return n=Object.getOwnPropertyNames||function(o){var a=[];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(a[a.length]=u);return a},n(s)};jy=function(s){if(s&&s.__esModule)return s;var o={};if(s!=null)for(var a=n(s),u=0;u<a.length;u++)a[u]!=="default"&&Un(o,s,a[u]);return r(o,s),o},$y=function(s){return s&&s.__esModule?s:{default:s}},Fy=function(s,o,a,u){if(a==="a"&&!u)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?s!==o||!u:!o.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?u:a==="a"?u.call(s):u?u.value:o.get(s)},Hy=function(s,o,a,u,c){if(u==="m")throw new TypeError("Private method is not writable");if(u==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?s!==o||!c:!o.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u==="a"?c.call(s,a):c?c.value=a:o.set(s,a),a},By=function(s,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use \'in\' operator on non-object");return typeof s=="function"?o===s:s.has(o)},Uy=function(s,o,a){if(o!=null){if(typeof o!="object"&&typeof o!="function")throw new TypeError("Object expected.");var u,c;if(a){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");u=o[Symbol.asyncDispose]}if(u===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");u=o[Symbol.dispose],a&&(c=u)}if(typeof u!="function")throw new TypeError("Object not disposable.");c&&(u=function(){try{c.call(this)}catch(l){return Promise.reject(l)}}),s.stack.push({value:o,dispose:u,async:a})}else a&&s.stack.push({async:!0});return o};var i=typeof SuppressedError=="function"?SuppressedError:function(s,o,a){var u=new Error(a);return u.name="SuppressedError",u.error=s,u.suppressed=o,u};Gy=function(s){function o(l){s.error=s.hasError?new i(l,s.error,"An error was suppressed during disposal."):l,s.hasError=!0}var a,u=0;function c(){for(;a=s.stack.pop();)try{if(!a.async&&u===1)return u=0,s.stack.push(a),Promise.resolve().then(c);if(a.dispose){var l=a.dispose.call(a.value);if(a.async)return u|=2,Promise.resolve(l).then(c,function(f){return o(f),c()})}else u|=1}catch(f){o(f)}if(u===1)return s.hasError?Promise.reject(s.error):Promise.resolve();if(s.hasError)throw s.error}return c()},Vy=function(s,o){return typeof s=="string"&&/^\\.\\.?\\//.test(s)?s.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i,function(a,u,c,l,f){return u?o?".jsx":".js":c&&(!l||!f)?a:c+l+"."+f.toLowerCase()+"js"}):s},e("__extends",vy),e("__assign",_y),e("__rest",by),e("__decorate",Sy),e("__param",Ey),e("__esDecorate",wy),e("__runInitializers",Ry),e("__propKey",xy),e("__setFunctionName",Py),e("__metadata",Ay),e("__awaiter",Oy),e("__generator",Ty),e("__exportStar",Cy),e("__createBinding",Un),e("__values",Bn),e("__read",ma),e("__spread",Iy),e("__spreadArrays",ky),e("__spreadArray",qy),e("__await",At),e("__asyncGenerator",Ny),e("__asyncDelegator",Ly),e("__asyncValues",Dy),e("__makeTemplateObject",My),e("__importStar",jy),e("__importDefault",$y),e("__classPrivateFieldGet",Fy),e("__classPrivateFieldSet",Hy),e("__classPrivateFieldIn",By),e("__addDisposableResource",Uy),e("__disposeResources",Gy),e("__rewriteRelativeImportExtension",Vy)})});var Ky=p(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.lowerCase=Ot.localeLowerCase=void 0;var _A={tr:{regexp:/\\u0130|\\u0049|\\u0049\\u0307/g,map:{\\u0130:"i",I:"\\u0131",I\\u0307:"i"}},az:{regexp:/\\u0130/g,map:{\\u0130:"i",I:"\\u0131",I\\u0307:"i"}},lt:{regexp:/\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,map:{I:"i\\u0307",J:"j\\u0307",\\u012E:"\\u012F\\u0307",\\u00CC:"i\\u0307\\u0300",\\u00CD:"i\\u0307\\u0301",\\u0128:"i\\u0307\\u0303"}}};function bA(e,t){var r=_A[t.toLowerCase()];return _a(r?e.replace(r.regexp,function(n){return r.map[n]}):e)}Ot.localeLowerCase=bA;function _a(e){return e.toLowerCase()}Ot.lowerCase=_a});var zy=p(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.noCase=void 0;var SA=Ky(),EA=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],wA=/[^A-Z0-9]+/gi;function RA(e,t){t===void 0&&(t={});for(var r=t.splitRegexp,n=r===void 0?EA:r,i=t.stripRegexp,s=i===void 0?wA:i,o=t.transform,a=o===void 0?SA.lowerCase:o,u=t.delimiter,c=u===void 0?" ":u,l=Wy(Wy(e,n,"$1\\0$2"),s,"\\0"),f=0,h=l.length;l.charAt(f)==="\\0";)f++;for(;l.charAt(h-1)==="\\0";)h--;return l.slice(f,h).split("\\0").map(a).join(c)}Vn.noCase=RA;function Wy(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce(function(n,i){return n.replace(i,r)},e)}});var Xy=p(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.pascalCase=Ke.pascalCaseTransformMerge=Ke.pascalCaseTransform=void 0;var xA=va(),PA=zy();function Yy(e,t){var r=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}Ke.pascalCaseTransform=Yy;function AA(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}Ke.pascalCaseTransformMerge=AA;function OA(e,t){return t===void 0&&(t={}),PA.noCase(e,xA.__assign({delimiter:"",transform:Yy},t))}Ke.pascalCase=OA});var Zy=p(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.camelCase=We.camelCaseTransformMerge=We.camelCaseTransform=void 0;var TA=va(),ba=Xy();function Qy(e,t){return t===0?e.toLowerCase():ba.pascalCaseTransform(e,t)}We.camelCaseTransform=Qy;function CA(e,t){return t===0?e.toLowerCase():ba.pascalCaseTransformMerge(e)}We.camelCaseTransformMerge=CA;function IA(e,t){return t===void 0&&(t={}),ba.pascalCase(e,TA.__assign({transform:Qy},t))}We.camelCase=IA});var tO={};jg(tO,{init:()=>JA});module.exports=$g(tO);var nC=at(Nf(),1);var Xt=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(e,t,r,n,i,s){this.type=e,this.name=t,this.prefix=r,this.value=n,this.suffix=i,this.modifier=s}hasCustomName(){return this.name!==""&&typeof this.name!="number"}},wE=/[$_\\p{ID_Start}]/u,RE=/[$_\\u200C\\u200D\\p{ID_Continue}]/u,ys=".*";function xE(e,t){return(t?/^[\\x00-\\xFF]*$/:/^[\\x00-\\x7F]*$/).test(e)}function Mf(e,t=!1){let r=[],n=0;for(;n<e.length;){let i=e[n],s=function(o){if(!t)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:e[n++]})};if(i==="*"){r.push({type:"ASTERISK",index:n,value:e[n++]});continue}if(i==="+"||i==="?"){r.push({type:"OTHER_MODIFIER",index:n,value:e[n++]});continue}if(i==="\\\\"){r.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});continue}if(i==="{"){r.push({type:"OPEN",index:n,value:e[n++]});continue}if(i==="}"){r.push({type:"CLOSE",index:n,value:e[n++]});continue}if(i===":"){let o="",a=n+1;for(;a<e.length;){let u=e.substr(a,1);if(a===n+1&&wE.test(u)||a!==n+1&&RE.test(u)){o+=e[a++];continue}break}if(!o){s(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:o}),n=a;continue}if(i==="("){let o=1,a="",u=n+1,c=!1;if(e[u]==="?"){s(`Pattern cannot start with "?" at ${u}`);continue}for(;u<e.length;){if(!xE(e[u],!1)){s(`Invalid character \'${e[u]}\' at ${u}.`),c=!0;break}if(e[u]==="\\\\"){a+=e[u++]+e[u++];continue}if(e[u]===")"){if(o--,o===0){u++;break}}else if(e[u]==="("&&(o++,e[u+1]!=="?")){s(`Capturing groups are not allowed at ${u}`),c=!0;break}a+=e[u++]}if(c)continue;if(o){s(`Unbalanced pattern at ${n}`);continue}if(!a){s(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:a}),n=u;continue}r.push({type:"CHAR",index:n,value:e[n++]})}return r.push({type:"END",index:n,value:""}),r}function jf(e,t={}){let r=Mf(e);t.delimiter??="/#?",t.prefixes??="./";let n=`[^${ae(t.delimiter)}]+?`,i=[],s=0,o=0,a="",u=new Set,c=A=>{if(o<r.length&&r[o].type===A)return r[o++].value},l=()=>c("OTHER_MODIFIER")??c("ASTERISK"),f=A=>{let k=c(A);if(k!==void 0)return k;let{type:_,index:P}=r[o];throw new TypeError(`Unexpected ${_} at ${P}, expected ${A}`)},h=()=>{let A="",k;for(;k=c("CHAR")??c("ESCAPED_CHAR");)A+=k;return A},w=A=>A,d=t.encodePart||w,v="",b=A=>{v+=A},T=()=>{v.length&&(i.push(new Xt(3,"","",d(v),"",3)),v="")},C=(A,k,_,P,E)=>{let R=3;switch(E){case"?":R=1;break;case"*":R=0;break;case"+":R=2;break}if(!k&&!_&&R===3){b(A);return}if(T(),!k&&!_){if(!A)return;i.push(new Xt(3,"","",d(A),"",R));return}let O;_?_==="*"?O=ys:O=_:O=n;let D=2;O===n?(D=1,O=""):O===ys&&(D=0,O="");let y;if(k?y=k:_&&(y=s++),u.has(y))throw new TypeError(`Duplicate name \'${y}\'.`);u.add(y),i.push(new Xt(D,y,d(A),O,d(P),R))};for(;o<r.length;){let A=c("CHAR"),k=c("NAME"),_=c("REGEX");if(!k&&!_&&(_=c("ASTERISK")),k||_){let E=A??"";t.prefixes.indexOf(E)===-1&&(b(E),E=""),T();let R=l();C(E,k,_,"",R);continue}let P=A??c("ESCAPED_CHAR");if(P){b(P);continue}if(c("OPEN")){let E=h(),R=c("NAME"),O=c("REGEX");!R&&!O&&(O=c("ASTERISK"));let D=h();f("CLOSE");let y=l();C(E,R,O,D,y);continue}T(),f("END")}return i}function ae(e){return e.replace(/([.+*?^${}()[\\]|/\\\\])/g,"\\\\$1")}function Lf(e){return e&&e.ignoreCase?"ui":"u"}function PE(e,t,r){return $f(jf(e,r),t,r)}function ht(e){switch(e){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function $f(e,t,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let a of e){if(a.type===3){a.modifier===3?n+=ae(a.value):n+=`(?:${ae(a.value)})${ht(a.modifier)}`;continue}t&&t.push(a.name);let u=`[^${ae(r.delimiter)}]+?`,c=a.value;if(a.type===1?c=u:a.type===0&&(c=ys),!a.prefix.length&&!a.suffix.length){a.modifier===3||a.modifier===1?n+=`(${c})${ht(a.modifier)}`:n+=`((?:${c})${ht(a.modifier)})`;continue}if(a.modifier===3||a.modifier===1){n+=`(?:${ae(a.prefix)}(${c})${ae(a.suffix)})`,n+=ht(a.modifier);continue}n+=`(?:${ae(a.prefix)}`,n+=`((?:${c})(?:`,n+=ae(a.suffix),n+=ae(a.prefix),n+=`(?:${c}))*)${ae(a.suffix)})`,a.modifier===0&&(n+="?")}let i=`[${ae(r.endsWith)}]|$`,s=`[${ae(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${s}?`),r.endsWith.length?n+=`(?=${i})`:n+="$",new RegExp(n,Lf(r));r.strict||(n+=`(?:${s}(?=${i}))?`);let o=!1;if(e.length){let a=e[e.length-1];a.type===3&&a.modifier===3&&(o=r.delimiter.indexOf(a)>-1)}return o||(n+=`(?=${s}|${i})`),new RegExp(n,Lf(r))}var Le={delimiter:"",prefixes:"",sensitive:!0,strict:!0},AE={delimiter:".",prefixes:"",sensitive:!0,strict:!0},OE={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function TE(e,t){return e.length?e[0]==="/"?!0:!t||e.length<2?!1:(e[0]=="\\\\"||e[0]=="{")&&e[1]=="/":!1}function Ff(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function CE(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function Hf(e){return!e||e.length<2?!1:e[0]==="["||(e[0]==="\\\\"||e[0]==="{")&&e[1]==="["}var Bf=["ftp","file","http","https","ws","wss"];function Uf(e){if(!e)return!0;for(let t of Bf)if(e.test(t))return!0;return!1}function IE(e,t){if(e=Ff(e,"#"),t||e==="")return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}function kE(e,t){if(e=Ff(e,"?"),t||e==="")return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}function qE(e,t){return t||e===""?e:Hf(e)?Kf(e):Vf(e)}function NE(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.password=e,r.password}function LE(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.username=e,r.username}function DE(e,t,r){if(r||e==="")return e;if(t&&!Bf.includes(t))return new URL(`${t}:${e}`).pathname;let n=e[0]=="/";return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}function ME(e,t,r){return Gf(t)===e&&(e=""),r||e===""?e:Wf(e)}function jE(e,t){return e=CE(e,":"),t||e===""?e:gs(e)}function Gf(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function gs(e){if(e==="")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol \'${e}\'.`)}function $E(e){if(e==="")return e;let t=new URL("https://example.com");return t.username=e,t.username}function FE(e){if(e==="")return e;let t=new URL("https://example.com");return t.password=e,t.password}function Vf(e){if(e==="")return e;if(/[\\t\\n\\r #%/:<>?@[\\]^\\\\|]/g.test(e))throw new TypeError(`Invalid hostname \'${e}\'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function Kf(e){if(e==="")return e;if(/[^0-9a-fA-F[\\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname \'${e}\'`);return e.toLowerCase()}function Wf(e){if(e===""||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port \'${e}\'.`)}function HE(e){if(e==="")return e;let t=new URL("https://example.com");return t.pathname=e[0]!=="/"?"/-"+e:e,e[0]!=="/"?t.pathname.substring(2,t.pathname.length):t.pathname}function BE(e){return e===""?e:new URL(`data:${e}`).pathname}function UE(e){if(e==="")return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function GE(e){if(e==="")return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}var VE=class{#t;#r=[];#n={};#e=0;#i=1;#a=0;#o=0;#c=0;#d=0;#y=!1;constructor(e){this.#t=e}get result(){return this.#n}parse(){for(this.#r=Mf(this.#t,!0);this.#e<this.#r.length;this.#e+=this.#i){if(this.#i=1,this.#r[this.#e].type==="END"){if(this.#o===0){this.#_(),this.#f()?this.#s(9,1):this.#p()?this.#s(8,1):this.#s(7,0);continue}else if(this.#o===2){this.#h(5);continue}this.#s(10,0);break}if(this.#c>0)if(this.#P())this.#c-=1;else continue;if(this.#x()){this.#c+=1;continue}switch(this.#o){case 0:this.#b()&&this.#h(1);break;case 1:if(this.#b()){this.#T();let e=7,t=1;this.#E()?(e=2,t=3):this.#y&&(e=2),this.#s(e,t)}break;case 2:this.#m()?this.#h(3):(this.#v()||this.#p()||this.#f())&&this.#h(5);break;case 3:this.#w()?this.#s(4,1):this.#m()&&this.#s(5,1);break;case 4:this.#m()&&this.#s(5,1);break;case 5:this.#A()?this.#d+=1:this.#O()&&(this.#d-=1),this.#R()&&!this.#d?this.#s(6,1):this.#v()?this.#s(7,0):this.#p()?this.#s(8,1):this.#f()&&this.#s(9,1);break;case 6:this.#v()?this.#s(7,0):this.#p()?this.#s(8,1):this.#f()&&this.#s(9,1);break;case 7:this.#p()?this.#s(8,1):this.#f()&&this.#s(9,1);break;case 8:this.#f()&&this.#s(9,1);break;case 9:break;case 10:break}}this.#n.hostname!==void 0&&this.#n.port===void 0&&(this.#n.port="")}#s(e,t){switch(this.#o){case 0:break;case 1:this.#n.protocol=this.#l();break;case 2:break;case 3:this.#n.username=this.#l();break;case 4:this.#n.password=this.#l();break;case 5:this.#n.hostname=this.#l();break;case 6:this.#n.port=this.#l();break;case 7:this.#n.pathname=this.#l();break;case 8:this.#n.search=this.#l();break;case 9:this.#n.hash=this.#l();break;case 10:break}this.#o!==0&&e!==10&&([1,2,3,4].includes(this.#o)&&[6,7,8,9].includes(e)&&(this.#n.hostname??=""),[1,2,3,4,5,6].includes(this.#o)&&[8,9].includes(e)&&(this.#n.pathname??=this.#y?"/":""),[1,2,3,4,5,6,7].includes(this.#o)&&e===9&&(this.#n.search??="")),this.#S(e,t)}#S(e,t){this.#o=e,this.#a=this.#e+t,this.#e+=t,this.#i=0}#_(){this.#e=this.#a,this.#i=0}#h(e){this.#_(),this.#o=e}#g(e){return e<0&&(e=this.#r.length-e),e<this.#r.length?this.#r[e]:this.#r[this.#r.length-1]}#u(e,t){let r=this.#g(e);return r.value===t&&(r.type==="CHAR"||r.type==="ESCAPED_CHAR"||r.type==="INVALID_CHAR")}#b(){return this.#u(this.#e,":")}#E(){return this.#u(this.#e+1,"/")&&this.#u(this.#e+2,"/")}#m(){return this.#u(this.#e,"@")}#w(){return this.#u(this.#e,":")}#R(){return this.#u(this.#e,":")}#v(){return this.#u(this.#e,"/")}#p(){if(this.#u(this.#e,"?"))return!0;if(this.#r[this.#e].value!=="?")return!1;let e=this.#g(this.#e-1);return e.type!=="NAME"&&e.type!=="REGEX"&&e.type!=="CLOSE"&&e.type!=="ASTERISK"}#f(){return this.#u(this.#e,"#")}#x(){return this.#r[this.#e].type=="OPEN"}#P(){return this.#r[this.#e].type=="CLOSE"}#A(){return this.#u(this.#e,"[")}#O(){return this.#u(this.#e,"]")}#l(){let e=this.#r[this.#e],t=this.#g(this.#a).index;return this.#t.substring(t,e.index)}#T(){let e={};Object.assign(e,Le),e.encodePart=gs;let t=PE(this.#l(),void 0,e);this.#y=Uf(t)}},ds=["protocol","username","password","hostname","port","pathname","search","hash"],Ne="*";function Df(e,t){if(typeof e!="string")throw new TypeError("parameter 1 is not of type \'string\'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==""?r.search.substring(1,r.search.length):void 0,hash:r.hash!==""?r.hash.substring(1,r.hash.length):void 0}}function Te(e,t){return t?Yt(e):e}function zt(e,t,r){let n;if(typeof t.baseURL=="string")try{n=new URL(t.baseURL),t.protocol===void 0&&(e.protocol=Te(n.protocol.substring(0,n.protocol.length-1),r)),!r&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&(e.username=Te(n.username,r)),!r&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&t.password===void 0&&(e.password=Te(n.password,r)),t.protocol===void 0&&t.hostname===void 0&&(e.hostname=Te(n.hostname,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&(e.port=Te(n.port,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&(e.pathname=Te(n.pathname,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&(e.search=Te(n.search.substring(1,n.search.length),r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&t.hash===void 0&&(e.hash=Te(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL \'${t.baseURL}\'.`)}if(typeof t.protocol=="string"&&(e.protocol=jE(t.protocol,r)),typeof t.username=="string"&&(e.username=LE(t.username,r)),typeof t.password=="string"&&(e.password=NE(t.password,r)),typeof t.hostname=="string"&&(e.hostname=qE(t.hostname,r)),typeof t.port=="string"&&(e.port=ME(t.port,e.protocol,r)),typeof t.pathname=="string"){if(e.pathname=t.pathname,n&&!TE(e.pathname,r)){let i=n.pathname.lastIndexOf("/");i>=0&&(e.pathname=Te(n.pathname.substring(0,i+1),r)+e.pathname)}e.pathname=DE(e.pathname,e.protocol,r)}return typeof t.search=="string"&&(e.search=kE(t.search,r)),typeof t.hash=="string"&&(e.hash=IE(t.hash,r)),e}function Yt(e){return e.replace(/([+*?:{}()\\\\])/g,"\\\\$1")}function KE(e){return e.replace(/([.+*?^${}()[\\]|/\\\\])/g,"\\\\$1")}function WE(e,t){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let r=".*",n=`[^${KE(t.delimiter)}]+?`,i=/[$_\\u200C\\u200D\\p{ID_Continue}]/u,s="";for(let o=0;o<e.length;++o){let a=e[o];if(a.type===3){if(a.modifier===3){s+=Yt(a.value);continue}s+=`{${Yt(a.value)}}${ht(a.modifier)}`;continue}let u=a.hasCustomName(),c=!!a.suffix.length||!!a.prefix.length&&(a.prefix.length!==1||!t.prefixes.includes(a.prefix)),l=o>0?e[o-1]:null,f=o<e.length-1?e[o+1]:null;if(!c&&u&&a.type===1&&a.modifier===3&&f&&!f.prefix.length&&!f.suffix.length)if(f.type===3){let h=f.value.length>0?f.value[0]:"";c=i.test(h)}else c=!f.hasCustomName();if(!c&&!a.prefix.length&&l&&l.type===3){let h=l.value[l.value.length-1];c=t.prefixes.includes(h)}c&&(s+="{"),s+=Yt(a.prefix),u&&(s+=`:${a.name}`),a.type===2?s+=`(${a.value})`:a.type===1?u||(s+=`(${n})`):a.type===0&&(!u&&(!l||l.type===3||l.modifier!==3||c||a.prefix!=="")?s+="*":s+=`(${r})`),a.type===1&&u&&a.suffix.length&&i.test(a.suffix[0])&&(s+="\\\\"),s+=Yt(a.suffix),c&&(s+="}"),a.modifier!==3&&(s+=ht(a.modifier))}return s}var zf=class{#t;#r={};#n={};#e={};#i={};#a=!1;constructor(e={},t,r){try{let n;if(typeof t=="string"?n=t:r=t,typeof e=="string"){let a=new VE(e);if(a.parse(),e=a.result,n===void 0&&typeof e.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");e.baseURL=n}else{if(!e||typeof e!="object")throw new TypeError("parameter 1 is not of type \'string\' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type \'string\'.")}typeof r>"u"&&(r={ignoreCase:!1});let i={ignoreCase:r.ignoreCase===!0},s={pathname:Ne,protocol:Ne,username:Ne,password:Ne,hostname:Ne,port:Ne,search:Ne,hash:Ne};this.#t=zt(s,e,!0),Gf(this.#t.protocol)===this.#t.port&&(this.#t.port="");let o;for(o of ds){if(!(o in this.#t))continue;let a={},u=this.#t[o];switch(this.#n[o]=[],o){case"protocol":Object.assign(a,Le),a.encodePart=gs;break;case"username":Object.assign(a,Le),a.encodePart=$E;break;case"password":Object.assign(a,Le),a.encodePart=FE;break;case"hostname":Object.assign(a,AE),Hf(u)?a.encodePart=Kf:a.encodePart=Vf;break;case"port":Object.assign(a,Le),a.encodePart=Wf;break;case"pathname":Uf(this.#r.protocol)?(Object.assign(a,OE,i),a.encodePart=HE):(Object.assign(a,Le,i),a.encodePart=BE);break;case"search":Object.assign(a,Le,i),a.encodePart=UE;break;case"hash":Object.assign(a,Le,i),a.encodePart=GE;break}try{this.#i[o]=jf(u,a),this.#r[o]=$f(this.#i[o],this.#n[o],a),this.#e[o]=WE(this.#i[o],a),this.#a=this.#a||this.#i[o].some(c=>c.type===2)}catch{throw new TypeError(`invalid ${o} pattern \'${this.#t[o]}\'.`)}}}catch(n){throw new TypeError(`Failed to construct \'URLPattern\': ${n.message}`)}}test(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type \'string\'.");if(typeof e>"u")return!1;try{typeof e=="object"?r=zt(r,e,!1):r=zt(r,Df(e,t),!1)}catch{return!1}let n;for(n of ds)if(!this.#r[n].exec(r[n]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof e!="string"&&t)throw new TypeError("parameter 1 is not of type \'string\'.");if(typeof e>"u")return;try{typeof e=="object"?r=zt(r,e,!1):r=zt(r,Df(e,t),!1)}catch{return null}let n={};t?n.inputs=[e,t]:n.inputs=[e];let i;for(i of ds){let s=this.#r[i].exec(r[i]);if(!s)return null;let o={};for(let[a,u]of this.#n[i].entries())if(typeof u=="string"||typeof u=="number"){let c=s[a+1];o[u]=c}n[i]={input:r[i]??"",groups:o}}return n}static compareComponent(e,t,r){let n=(a,u)=>{for(let c of["type","modifier","prefix","value","suffix"]){if(a[c]<u[c])return-1;if(a[c]!==u[c])return 1}return 0},i=new Xt(3,"","","","",3),s=new Xt(0,"","","","",3),o=(a,u)=>{let c=0;for(;c<Math.min(a.length,u.length);++c){let l=n(a[c],u[c]);if(l)return l}return a.length===u.length?0:n(a[c]??i,u[c]??i)};return!t.#e[e]&&!r.#e[e]?0:t.#e[e]&&!r.#e[e]?o(t.#i[e],[s]):!t.#e[e]&&r.#e[e]?o([s],r.#i[e]):o(t.#i[e],r.#i[e])}get protocol(){return this.#e.protocol}get username(){return this.#e.username}get password(){return this.#e.password}get hostname(){return this.#e.hostname}get port(){return this.#e.port}get pathname(){return this.#e.pathname}get search(){return this.#e.search}get hash(){return this.#e.hash}get hasRegExpGroups(){return this.#a}};globalThis.URLPattern||(globalThis.URLPattern=zf);var Cg=require("electron");var Yf="4.1.0";var ms=Symbol.for("mx:main-ps"),Xf="mx:main-ps:ready",vs="mx:main-ps:connect",_s="mx:main-ps:disconnect",bs=Yf;var Qt="mx:ipc-emit:v1",Ss="mx:ipc-invoke:v1";function dt(e){return e?.type==="TASK"}function Qf(e){return e?.type==="RESULT"}function Zf(e){return e?.type==="ERROR"}function Es(e){return e?.type==="ABORT"}function Zt(e){return e?.type==="EVENT"}function Jf(e){if(typeof e!="object"||e===null)return!1;let t=e;return Qf(t)||Zf(t)||dt(t)||Es(t)||Zt(t)}function ep(e,t){let r=t;return!r||Zt(r)?!1:r.taskId===e.taskId&&(Qf(r)||Zf(r))}function Jt(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}var en=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,r){this.keyToValue.set(t,r),this.valueToKey.set(r,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}};var yt=class{constructor(t){this.generateIdentifier=t,this.kv=new en}register(t,r){this.kv.getByValue(t)||(r||(r=this.generateIdentifier(t)),this.kv.set(r,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}};var tn=class extends yt{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(t,r.allowProps),super.register(t,r.identifier)):super.register(t,r)}getAllowedProps(t){return this.classToAllowedProps.get(t)}};function YE(e){if("values"in Object)return Object.values(e);let t=[];for(let r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}function tp(e,t){let r=YE(e);if("find"in r)return r.find(t);let n=r;for(let i=0;i<n.length;i++){let s=n[i];if(t(s))return s}}function tt(e,t){Object.entries(e).forEach(([r,n])=>t(n,r))}function gt(e,t){return e.indexOf(t)!==-1}function ws(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(t(n))return n}}var rn=class{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return tp(this.transfomers,r=>r.isApplicable(t))}findByName(t){return this.transfomers[t]}};var XE=e=>Object.prototype.toString.call(e).slice(8,-1),Rs=e=>typeof e>"u",QE=e=>e===null,rt=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,nn=e=>rt(e)&&Object.keys(e).length===0,de=e=>Array.isArray(e),ZE=e=>typeof e=="string",JE=e=>typeof e=="number"&&!isNaN(e),ew=e=>typeof e=="boolean",rp=e=>e instanceof RegExp,De=e=>e instanceof Map,Me=e=>e instanceof Set,xs=e=>XE(e)==="Symbol",np=e=>e instanceof Date&&!isNaN(e.valueOf()),ip=e=>e instanceof Error,Ps=e=>typeof e=="number"&&isNaN(e),sp=e=>ew(e)||QE(e)||Rs(e)||JE(e)||ZE(e)||xs(e),op=e=>typeof e=="bigint",ap=e=>e===1/0||e===-1/0,up=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),cp=e=>e instanceof URL;var As=e=>e.replace(/\\./g,"\\\\."),sn=e=>e.map(String).map(As).join("."),mt=e=>{let t=[],r="";for(let i=0;i<e.length;i++){let s=e.charAt(i);if(s==="\\\\"&&e.charAt(i+1)==="."){r+=".",i++;continue}if(s==="."){t.push(r),r="";continue}r+=s}let n=r;return t.push(n),t};function be(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}var lp=[be(Rs,"undefined",()=>null,()=>{}),be(op,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),be(np,"Date",e=>e.toISOString(),e=>new Date(e)),be(ip,"Error",(e,t)=>{let r={name:e.name,message:e.message};return t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r},(e,t)=>{let r=new Error(e.message);return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(n=>{r[n]=e[n]}),r}),be(rp,"regexp",e=>""+e,e=>{let t=e.slice(1,e.lastIndexOf("/")),r=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,r)}),be(Me,"set",e=>[...e.values()],e=>new Set(e)),be(De,"map",e=>[...e.entries()],e=>new Map(e)),be(e=>Ps(e)||ap(e),"number",e=>Ps(e)?"NaN":e>0?"Infinity":"-Infinity",Number),be(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),be(cp,"URL",e=>e.toString(),e=>new URL(e))];function on(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}var fp=on((e,t)=>xs(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,r)=>{let n=r.symbolRegistry.getValue(t[1]);if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),tw=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),pp=on(up,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{let r=tw[t[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(e)});function Os(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var hp=on(Os,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return{...e};let n={};return r.forEach(i=>{n[i]=e[i]}),n},(e,t,r)=>{let n=r.classRegistry.getValue(t[1]);if(!n)throw new Error(`Trying to deserialize unknown class \'${t[1]}\' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),e)}),dp=on((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,r)=>{let n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),rw=[hp,fp,dp,pp],Ts=(e,t)=>{let r=ws(rw,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};let n=ws(lp,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation}},yp={};lp.forEach(e=>{yp[e.annotation]=e});var gp=(e,t,r)=>{if(de(t))switch(t[0]){case"symbol":return fp.untransform(e,t,r);case"class":return hp.untransform(e,t,r);case"custom":return dp.untransform(e,t,r);case"typed-array":return pp.untransform(e,t,r);default:throw new Error("Unknown transformation: "+t)}else{let n=yp[t];if(!n)throw new Error("Unknown transformation: "+t);return n.untransform(e,r)}};var vt=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");let r=e.keys();for(;t>0;)r.next(),t--;return r.next().value};function mp(e){if(gt(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(gt(e,"prototype"))throw new Error("prototype is not allowed as a property");if(gt(e,"constructor"))throw new Error("constructor is not allowed as a property")}var vp=(e,t)=>{mp(t);for(let r=0;r<t.length;r++){let n=t[r];if(Me(e))e=vt(e,+n);else if(De(e)){let i=+n,s=+t[++r]==0?"key":"value",o=vt(e,i);switch(s){case"key":e=o;break;case"value":e=e.get(o);break}}else e=e[n]}return e},an=(e,t,r)=>{if(mp(t),t.length===0)return r(e);let n=e;for(let s=0;s<t.length-1;s++){let o=t[s];if(de(n)){let a=+o;n=n[a]}else if(rt(n))n=n[o];else if(Me(n)){let a=+o;n=vt(n,a)}else if(De(n)){if(s===t.length-2)break;let u=+o,c=+t[++s]==0?"key":"value",l=vt(n,u);switch(c){case"key":n=l;break;case"value":n=n.get(l);break}}}let i=t[t.length-1];if(de(n)?n[+i]=r(n[+i]):rt(n)&&(n[i]=r(n[i])),Me(n)){let s=vt(n,+i),o=r(s);s!==o&&(n.delete(s),n.add(o))}if(De(n)){let s=+t[t.length-2],o=vt(n,s);switch(+i==0?"key":"value"){case"key":{let u=r(o);n.set(u,n.get(o)),u!==o&&n.delete(o);break}case"value":{n.set(o,r(n.get(o)));break}}}return e};function Cs(e,t,r=[]){if(!e)return;if(!de(e)){tt(e,(s,o)=>Cs(s,t,[...r,...mt(o)]));return}let[n,i]=e;i&&tt(i,(s,o)=>{Cs(s,t,[...r,...mt(o)])}),t(n,r)}function _p(e,t,r){return Cs(t,(n,i)=>{e=an(e,i,s=>gp(s,n,r))}),e}function bp(e,t){function r(n,i){let s=vp(e,mt(i));n.map(mt).forEach(o=>{e=an(e,o,()=>s)})}if(de(t)){let[n,i]=t;n.forEach(s=>{e=an(e,mt(s),()=>e)}),i&&tt(i,r)}else tt(t,r);return e}var nw=(e,t)=>rt(e)||de(e)||De(e)||Me(e)||Os(e,t);function iw(e,t,r){let n=r.get(e);n?n.push(t):r.set(e,[t])}function Sp(e,t){let r={},n;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,u)=>a.length-u.length));let[s,...o]=i;s.length===0?n=o.map(sn):r[sn(s)]=o.map(sn)}),n?nn(r)?[n]:[n,r]:nn(r)?void 0:r}var Is=(e,t,r,n,i=[],s=[],o=new Map)=>{let a=sp(e);if(!a){iw(e,i,t);let w=o.get(e);if(w)return n?{transformedValue:null}:w}if(!nw(e,r)){let w=Ts(e,r),d=w?{transformedValue:w.value,annotations:[w.type]}:{transformedValue:e};return a||o.set(e,d),d}if(gt(s,e))return{transformedValue:null};let u=Ts(e,r),c=u?.value??e,l=de(c)?[]:{},f={};tt(c,(w,d)=>{if(d==="__proto__"||d==="constructor"||d==="prototype")throw new Error(`Detected property ${d}. This is a prototype pollution risk, please remove it from your object.`);let v=Is(w,t,r,n,[...i,d],[...s,e],o);l[d]=v.transformedValue,de(v.annotations)?f[d]=v.annotations:rt(v.annotations)&&tt(v.annotations,(b,T)=>{f[As(d)+"."+T]=b})});let h=nn(f)?{transformedValue:l,annotations:u?[u.type]:void 0}:{transformedValue:l,annotations:u?[u.type,f]:f};return a||o.set(e,h),h};function un(e){return Object.prototype.toString.call(e).slice(8,-1)}function ks(e){return un(e)==="Array"}function Ep(e){if(un(e)!=="Object")return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function sw(e){return un(e)==="Null"}function ow(e,t,r,n,i){return s=>e(s)||t(s)||!!r&&r(s)||!!n&&n(s)||!!i&&i(s)}function aw(e){return un(e)==="Undefined"}var qI=ow(sw,aw);function uw(e,t,r,n,i){let s={}.propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";s==="enumerable"&&(e[t]=r),i&&s==="nonenumerable"&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}function cn(e,t={}){if(ks(e))return e.map(i=>cn(i,t));if(!Ep(e))return e;let r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols(e);return[...r,...n].reduce((i,s)=>{if(ks(t.props)&&!t.props.includes(s))return i;let o=e[s],a=cn(o,t);return uw(i,s,a,e,t.nonenumerable),i},{})}var q=class{constructor({dedupe:t=!1}={}){this.classRegistry=new tn,this.symbolRegistry=new yt(r=>r.description??""),this.customTransformerRegistry=new rn,this.allowedErrorProps=[],this.dedupe=t}serialize(t){let r=new Map,n=Is(t,r,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta={...i.meta,values:n.annotations});let s=Sp(r,this.dedupe);return s&&(i.meta={...i.meta,referentialEqualities:s}),i}deserialize(t){let{json:r,meta:n}=t,i=cn(r);return n?.values&&(i=_p(i,n.values,this)),n?.referentialEqualities&&(i=bp(i,n.referentialEqualities)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t))}registerClass(t,r){this.classRegistry.register(t,r)}registerSymbol(t,r){this.symbolRegistry.register(t,r)}registerCustom(t,r){this.customTransformerRegistry.register({name:r,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}};q.defaultInstance=new q;q.serialize=q.defaultInstance.serialize.bind(q.defaultInstance);q.deserialize=q.defaultInstance.deserialize.bind(q.defaultInstance);q.stringify=q.defaultInstance.stringify.bind(q.defaultInstance);q.parse=q.defaultInstance.parse.bind(q.defaultInstance);q.registerClass=q.defaultInstance.registerClass.bind(q.defaultInstance);q.registerSymbol=q.defaultInstance.registerSymbol.bind(q.defaultInstance);q.registerCustom=q.defaultInstance.registerCustom.bind(q.defaultInstance);q.allowErrorProps=q.defaultInstance.allowErrorProps.bind(q.defaultInstance);var BI=q.serialize,UI=q.deserialize,GI=q.stringify,VI=q.parse,KI=q.registerClass,WI=q.registerCustom,zI=q.registerSymbol,YI=q.allowErrorProps;var je=class e extends Error{static name="CodeError";code;constructor(t,r){super(r),this.name=e.name,this.code=t}};function wp(e){return Jf(e)?e:(console.warn("Received non-IPC message, ignoring",e),null)}q.registerCustom({isApplicable:e=>e instanceof Error&&e.name===je.name&&typeof e.code=="string",serialize:e=>JSON.stringify(Jt(e,["name","message","code"])),deserialize:e=>{let{message:t,...r}=JSON.parse(e);return Object.assign(new je(t),r)}},"nodejs-error");q.registerCustom({isApplicable:e=>e instanceof Error&&e.name===je.name,serialize:e=>JSON.stringify(Jt(e,["message","code","stack"])),deserialize:e=>{let{message:t,code:r,...n}=JSON.parse(e);return Object.assign(new je(r,t),n)}},"fallback-error");function ln(e){try{let t=q.deserialize(e);return wp(t)}catch(t){return console.warn("Error deserializing SuperJSON payload",t,e),null}}function fn(e){return q.serialize(e)}var Rp=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),xp=e=>{throw TypeError(e)},cw=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&xp("Object expected");var n,i;r&&(n=t[Rp("asyncDispose")]),n===void 0&&(n=t[Rp("dispose")],r&&(i=n)),typeof n!="function"&&xp("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else r&&e.push([r]);return t},lw=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()};function fw(e){return e.startsWith("emit:")}function pw(e){return e.startsWith("invoke:")}var _t={parse:ln,stringify:fn},pn=class{#t=new Map;#r=new Map;#n;#e;constructor(t){var r=[];try{this.#n=t;let s=cw(r,new DisposableStack);this.#n.on(Qt,this.#i),s.defer(()=>{this.#n.removeListener(Qt,this.#i),this.#t.clear()}),this.#n.handle(Ss,this.#a),s.defer(()=>{this.#n.removeHandler(Ss),this.#r.clear()}),this.#e=s.move()}catch(s){var n=s,i=!0}finally{lw(r,n,i)}}[Symbol.dispose](){return this.#e.dispose()}on(t,r){if(fw(t)){let n=r;return this.#t.set(t,n),()=>{this.#t.delete(t)}}if(pw(t)){let n=r;return this.#r.set(t,n),()=>{this.#r.delete(t)}}throw new Error(`Unknown event type: ${t}`)}#i=(t,r)=>{let n=_t.parse(r);!n||!dt(n)||this.#t.get(`emit:${t.sender.id}`)?.(n)};#a=async(t,r)=>{let n=_t.parse(r);if(!n)return _t.stringify({type:"ERROR",taskId:"",error:new Error("Invalid request")});if(!dt(n))return _t.stringify({type:"ERROR",taskId:Zt(n)?"-":n.taskId,error:new Error("Invalid request")});let i=this.#r.get(`invoke:${t.sender.id}`);if(!i)return _t.stringify({type:"ERROR",taskId:n.taskId,error:new Error("No Invoke handler returned a result")});let s=await i(n);return _t.stringify(s)}};var Kn=at(require("util"),1),sg=at(yy(),1),Wn=at(require("path"),1),og=at(my(),1),ag=at(Zy(),1),ug=require("url"),Jy=`\n`,Sa=class extends Error{constructor(t){super(t),Object.defineProperty(this,"message",{enumerable:!1,value:t}),Object.defineProperty(this,"name",{enumerable:!1,value:this.constructor.name}),"captureStackTrace"in Error?Error.captureStackTrace(this,this.constructor):Object.defineProperty(this,"stack",{enumerable:!1,value:Error(t).stack,writable:!0,configurable:!0})}},ur=class extends Sa{},Ct=class e extends ur{constructor(t,r,n,i){super(`${t}: expected ${r} to be ${n}, but got ${i}.`)}static assert(t,r,n,i,s){if(!t)throw new e(r,n,i,s);return t}},Tt=class extends ur{constructor(t,r,n){let i=t.toString(),s=r.map(({name:u})=>u.toString());s.push(i);let o=s.join(" -> "),a=`Could not resolve \'${i}\'.`;n&&(a+=` ${n}`),a+=Jy+Jy,a+=`Resolution path: ${o}`,super(a)}},Ea=class extends ur{constructor(t,r){let i=`Could not register \'${t.toString()}\'.`;r&&(i+=` ${r}`),super(i)}},cr={PROXY:"PROXY",CLASSIC:"CLASSIC"},K={SINGLETON:"SINGLETON",TRANSIENT:"TRANSIENT",SCOPED:"SCOPED"};function kA(e,t){return e===K.SINGLETON&&t!==K.SINGLETON||e===K.SCOPED&&t===K.TRANSIENT}function cg(e){let t=e.length,r=0,n="EOF",i="",s=0,o=0,a=0;return{next:u,done:v};function u(b=0){return s=b,c(),d()}function c(){for(i="",n="EOF";;){if(r>=t)return n="EOF";let b=e.charAt(r);if(eg(b)){r++;continue}switch(b){case"(":return r++,o++,n=b;case")":return r++,a++,n=b;case"*":return r++,n=b;case",":return r++,n=b;case"=":return r++,(s&1)===0&&f(),n=b;case"/":{r++;let T=e.charAt(r);T==="/"&&(h(C=>C===`\n`,!0),r++),T==="*"&&(h(C=>{let A=e.charAt(r+1);return C==="*"&&A==="/"},!0),r++);break}default:if(DA(b))return l(),n;r++}}}function l(){let b=e.charAt(r),T=++r;for(;MA(e.charAt(r));)r++;return i=""+b+e.substring(T,r),n=i==="function"||i==="class"?i:"ident",n!=="ident"&&(i=""),i}function f(){h(b=>{let T=o===a+1;return b===","&&T?!0:b==="("?(o++,!1):!!(b===")"&&(a++,T))})}function h(b,T=!1){for(;r<e.length;){let C=e.charAt(r);if(b(C))return;if(!T){if(eg(C)){r++;continue}if(qA(C)){w();continue}}r++}}function w(){let b=e.charAt(r);for(r++;r<e.length;){let T=e.charAt(r),C=e.charAt(r-1);if(T===b&&C!=="\\\\"){r++;return}b==="`"&&e.charAt(r+1)==="$"&&e.charAt(r+2)==="{"&&(r=r+2,h(_=>_==="}")),r++}}function d(){return i?{value:i,type:n}:{type:n}}function v(){return n==="EOF"}}function eg(e){switch(e){case"\\r":case`\n`:case" ":return!0}return!1}function qA(e){switch(e){case"\'":case\'"\':case"`":return!0}return!1}var NA=/^[_$a-zA-Z\\xA0-\\uFFFF]$/,LA=/^[?._$a-zA-Z0-9\\xA0-\\uFFFF]$/;function DA(e){return NA.test(e)}function MA(e){return LA.test(e)}function jA(e){let t=[];return e.forEach(r=>{r.forEach(n=>{t.push(n)})}),t}function $A(e,t){let r=e;return typeof r=="string"||typeof r=="symbol"?{[e]:t}:r}function FA(e){return e[e.length-1]}function lg(e){if(typeof e!="function")return!1;let t=cg(e.toString()),r=t.next();if(r.type==="class")return!0;let n=t.next();return!!(r.type==="function"&&n.value&&n.value[0]===n.value[0].toUpperCase())}function or(e){return typeof e=="function"}function HA(e){return Array.from(new Set(e))}var BA=/(.*)\\..*/i;function tg(e,t){t={cwd:process.cwd(),glob:sg.default.sync,...t};let r=null;return Array.isArray(e)&&(r=e[1],e=e[0]),e=e.replace(/\\\\/g,"/"),t.glob(e,{cwd:t.cwd}).map(s=>({name:BA.exec(Wn.basename(s))[1],path:Wn.resolve(t.cwd,s),opts:r}))}function UA(e,t){return Array.isArray(e)?jA(e.map(r=>tg(r,t))):tg(e,t)}function GA(e){let{next:t,done:r}=cg(e),n=[],i=null;for(u();!r();)switch(i.type){case"class":{if(!o())return null;break}case"function":{let l=u();(l.type==="ident"||l.type==="*")&&u();break}case"(":s();break;case")":return n;case"ident":{let l={name:i.value,optional:!1};if(i.value==="async"){let f=u();if(f&&f.type!=="=")break}return n.push(l),n}default:throw c()}return n;function s(){let l={name:"",optional:!1};for(;!r();)switch(u(),i.type){case"ident":l.name=i.value;break;case"=":l.optional=!0;break;case",":n.push(l),l={name:"",optional:!1};break;case")":l.name&&n.push(l);return;default:throw c()}}function o(){for(;!r();){if(a()){if(u(1),i.type!=="(")continue;return!0}u(1)}return!1}function a(){return i.type==="ident"&&i.value==="constructor"}function u(l=0){return i=t(l),i}function c(){return new SyntaxError(`Parsing parameter list, did not expect ${i.type} token${i.value?` (${i.value})`:""}`)}}var zn=Symbol("Awilix Resolver Config");function Yn(e,t){if(!or(e))throw new Ct("asFunction","fn","function",e);let r={lifetime:K.TRANSIENT};t=fg(r,t,e[zn]);let i={resolve:hg(e),...t};return wa(ar(i))}function Xn(e,t){if(!or(e))throw new Ct("asClass","Type","class",e);let r={lifetime:K.TRANSIENT};t=fg(r,t,e[zn]);let i=hg(function(...o){return Reflect.construct(e,o)},e);return wa(ar({...t,resolve:i}))}function ar(e){function t(i){return ar({...this,lifetime:i})}function r(i){return ar({...this,injectionMode:i})}function n(i){return ar({...this,injector:i})}return pg(e,{setLifetime:t,inject:n,transient:sr(t,K.TRANSIENT),scoped:sr(t,K.SCOPED),singleton:sr(t,K.SINGLETON),setInjectionMode:r,proxy:sr(r,cr.PROXY),classic:sr(r,cr.CLASSIC)})}function wa(e){function t(r){return wa({...this,dispose:r})}return pg(e,{disposer:t})}function sr(e,t){return function(){return e.call(this,t)}}function fg(e,...t){return Object.assign({},e,...t)}function pg(e,t){return{...e,...t}}function VA(e,t){return function(n,i){return n in t?t[n]:e.resolve(n,i)}}function KA(e,t){let r=t(e),n=HA([...Reflect.ownKeys(e.cradle),...Reflect.ownKeys(r)]);return new Proxy({},{get(s,o){return o===Symbol.iterator?function*(){for(let u in e.cradle)yield u;for(let u in r)yield u}:o in r?r[o]:e.resolve(o)},ownKeys(){return n},getOwnPropertyDescriptor(s,o){if(n.indexOf(o)>-1)return{enumerable:!0,configurable:!0}}})}function hg(e,t){t||(t=e);let r=dg(t);return function(i){if((this.injectionMode||i.options.injectionMode||cr.PROXY)!==cr.CLASSIC){let o=this.injector?KA(i,this.injector):i.cradle;return e(o)}if(r.length>0){let o=this.injector?VA(i,this.injector(i)):i.resolve,a=r.map(u=>o(u.name,{allowUnregistered:u.optional}));return e(...a)}return e()}}function dg(e){let t=GA(e.toString());if(!t){let r=Object.getPrototypeOf(e);return typeof r=="function"&&r!==Function.prototype?dg(r):[]}return t}var WA={camelCase:e=>(0,ag.camelCase)(e)};function rg(e,t,r){r??={};let n=e.container;r=YA(r);let i=e.listModules(t,r);if(r.esModules)return zA(e,n,i,r);{let s=i.map(o=>{let a=e.require(o.path);return yg(a,o)});return gg(s,n,i,r)}}async function zA(e,t,r,n){let i=[];for(let a of r){let u=(0,ug.pathToFileURL)(a.path).toString();i.push(e.require(u))}let s=await Promise.all(i),o=[];for(let a=0;a<r.length;a++)o.push(yg(s[a],r[a]));return gg(o,t,r,n)}function yg(e,t){let r=[];if(!e)return r;if(or(e))return r.push({name:t.name,path:t.path,value:e,opts:t.opts}),r;e.default&&or(e.default)&&r.push({name:t.name,path:t.path,value:e.default,opts:t.opts});for(let n of Object.keys(e))n!=="default"&&or(e[n])&&zn in e[n]&&r.push({name:n,path:t.path,value:e[n],opts:t.opts});return r}function gg(e,t,r,n){return e.reduce((i,s)=>i.concat(s),[]).filter(i=>i).forEach(XA.bind(null,t,n)),{loadedModules:r}}function YA(e){return{resolverOptions:{lifetime:K.TRANSIENT,...e&&e.resolverOptions},...e}}function XA(e,t,r){let n=r.value[zn],i=n&&n.name;if(!i){i=r.name;let u=t.formatName;u&&(typeof u=="string"&&(u=WA[u]),u&&(i=u(i,r)))}let s=r.opts;typeof s=="string"&&(s={lifetime:s});let o={...t.resolverOptions,...s,...n},a=o.register?o.register:lg(r.value)?Xn:Yn;e.register(i,a(r.value,o))}var ng=Symbol("familyTree"),ig=Symbol("rollUpRegistrations"),QA="AwilixContainerCradle";function Ra(e={}){return mg(e)}function mg(e,t,r){e={injectionMode:cr.PROXY,strict:!1,...e};let n=r??[],i={},s=new Proxy({[Kn.inspect.custom]:d},{get:(_,P)=>b(P),set:(_,P)=>{throw new Error(`Attempted setting property "${P}" on container cradle - this is not allowed.`)},ownKeys(){return Array.from(s)},getOwnPropertyDescriptor(_,P){let E=l();if(Object.getOwnPropertyDescriptor(E,P))return{enumerable:!0,configurable:!0}}}),o={options:e,cradle:s,inspect:c,cache:new Map,loadModules:A,createScope:h,register:w,build:C,resolve:b,hasRegistration:T,dispose:k,getRegistration:v,[Kn.inspect.custom]:c,[ig]:l,get registrations(){return l()}},a=t?[o].concat(t[ng]):[o];o[ng]=a;let u=FA(a);return o;function c(){return`[AwilixContainer (${t?"scoped, ":""}registrations: ${Object.keys(o.registrations).length})]`}function l(){return{...t&&t[ig](),...i}}function*f(){let _=l();for(let P in _)yield P}function h(){return mg(e,o,n)}function w(_,P){let E=$A(_,P),R=[...Object.keys(E),...Object.getOwnPropertySymbols(E)];for(let O of R){let D=E[O];if(e.strict&&D.lifetime===K.SINGLETON&&t)throw new Ea(O,"Cannot register a singleton on a scoped container.");i[O]=D}return o}function d(){return Object.prototype.toString.call(s)}function v(_){let P=i[_];return P||(t?t.getRegistration(_):null)}function b(_,P){P=P||{};try{let E=v(_);if(n.some(({name:y})=>y===_))throw new Tt(_,n,"Cyclic dependencies detected.");if(_==="toJSON")return d;if(_==="constructor")return Ra;if(!E){switch(_){case Kn.inspect.custom:case"inspect":case"toString":return d;case Symbol.toStringTag:return QA;case"then":return;case Symbol.iterator:return f}if(P.allowUnregistered)return;throw new Tt(_,n)}let R=E.lifetime||K.TRANSIENT;if(e.strict&&!E.isLeakSafe){let y=n.findIndex(({lifetime:j})=>kA(j,R));if(y>-1)throw new Tt(_,n,`Dependency \'${_.toString()}\' has a shorter lifetime than its ancestor: \'${n[y].name.toString()}\'`)}n.push({name:_,lifetime:R});let O,D;switch(R){case K.TRANSIENT:D=E.resolve(o);break;case K.SINGLETON:O=u.cache.get(_),O?D=O.value:(D=E.resolve(e.strict?u:o),u.cache.set(_,{resolver:E,value:D}));break;case K.SCOPED:if(O=o.cache.get(_),O!==void 0){D=O.value;break}D=E.resolve(o),o.cache.set(_,{resolver:E,value:D});break;default:throw new Tt(_,n,`Unknown lifetime "${E.lifetime}"`)}return n.pop(),D}catch(E){throw n.length=0,E}}function T(_){return!!v(_)}function C(_,P){if(_&&_.resolve)return _.resolve(o);let E="build",R="targetOrResolver";return Ct.assert(_,E,R,"a registration, function or class",_),Ct.assert(typeof _=="function",E,R,"a function or class",_),(lg(_)?Xn(_,P):Yn(_,P)).resolve(o)}function A(_,P){let E={require:e.require||function(R){return require(R)},listModules:UA,container:o};return P?.esModules?(E.require=og.importModule,rg(E,_,P).then(()=>o)):(rg(E,_,P),o)}function k(){let _=Array.from(o.cache.entries());return o.cache.clear(),Promise.all(_.map(([,P])=>{let{resolver:E,value:R}=P,O=E;return O.dispose?Promise.resolve().then(()=>O.dispose(R)):Promise.resolve()})).then(()=>{})}}var Og=require("electron");function Qn(e,{lifetime:t=K.SINGLETON,...r}={}){return Xn(e,{...r,lifetime:t}).disposer(_g)}function vg(e,{lifetime:t=K.SINGLETON,...r}={}){return Yn(e,{...r,lifetime:t}).disposer(_g)}function _g(e){typeof e!="object"||e===null||(Symbol.dispose in e&&typeof e[Symbol.dispose]=="function"?e[Symbol.dispose]():Symbol.asyncDispose in e&&typeof e[Symbol.asyncDispose]=="function"&&e[Symbol.asyncDispose]())}var ot=require("node:fs/promises"),bg=require("node:path"),It=require("electron"),xa=class{#t;data;#r=!1;#n;#e=!1;#i=!1;constructor(t){let r=t.filename,n=It.app.getPath("userData");this.#t=(0,bg.join)(n,r),this.#n=t.defaults,this.data={...this.#n}}async load(){try{return this.data={...this.#n,...await(0,ot.readFile)(this.#t).then(this.deserilaize)},this.#r=!0,this.data}catch(t){return t.code==="ENOENT"?this.#r||(await this.save(),this.#r=!0):console.error("Error loading preferences:",t),this.data}finally{await this.onLoad(this.data)}}async onSave(t){}async onLoad(t){}async save(){if(this.#e){this.#i=!0;return}try{this.#e=!0;try{await(0,ot.writeFile)(this.#t,await this.serilaize(this.data)),await this.onSave(this.data)}catch(t){if(t.code==="ENOENT")await(0,ot.mkdir)(It.app.getPath("userData"),{recursive:!0}),await(0,ot.writeFile)(this.#t,await this.serilaize(this.data)),await this.onSave(this.data);else throw t}this.#i?(this.#i=!1,this.#e=!1,await this.save()):this.#e=!1}catch(t){throw this.#e=!1,this.#i=!1,console.error("Error saving preferences:",t),t}}async reset(){this.data={...this.#n},await this.save()}},Zn=class extends xa{async serilaize(t){return It.safeStorage.encryptString(JSON.stringify(t))}async deserilaize(t){return JSON.parse(It.safeStorage.decryptString(t))}};var Jn=class extends Zn{#t=new Map;#r=new Map;constructor(){super({filename:"login.json.bin",defaults:{credentials:[]}})}#n(){this.#t.clear(),this.#r.clear()}#e(t){try{return new URLPattern(t.pattern)}catch(r){return this.#r.set(t.id,r),null}}#i(){this.#n();for(let t of this.data.credentials){let r=this.#e(t);r&&this.#t.set(t.id,r)}}findCredential(t){let r=typeof t=="string"?new URL(t):t;for(let n of this.data.credentials)if(this.#t.get(n.id)?.test(r))return n;return null}async onLoad(){this.#i()}async onSave(){this.#i()}getCredentials(){return this.data.credentials}async setCredential(t){let r=Jt(t,["id","pattern","username","password"]),n=this.data.credentials,i=n.findIndex(o=>o.id===t.id),s=n;i===-1?s=[...n,r]:s=n.map((o,a)=>a===i?r:o),this.data.credentials=s,await this.save()}async deleteCredential(t){let r=this.data.credentials,n=r.findIndex(i=>i.id===t);return n===-1?!1:(this.data.credentials=r.filter((i,s)=>s!==n),await this.save(),!0)}async clearCredentials(){this.data.credentials=[],await this.save()}async importCredentials(t){this.data.credentials=t,await this.save()}};var Pa=require("electron");var ei=class{pref;constructor(t){var n=[];try{let r=Ye(n,new DisposableStack);this.pref=t.loginPref;Pa.app.on("login",this.#r);r.defer(()=>{Pa.app.removeListener("login",this.#r)});this.#t=r.move()}catch(i){var s=i,o=!0}finally{Xe(n,s,o)}}#t;[Symbol.dispose](){this.#t.dispose()}#r=(t,r,n,i,s)=>{let o=this.pref.findCredential(n.url);o&&(t.preventDefault(),s(o.username,o.password))}};function Sg(e,{taskId:t,stack:r}){return new Promise(n=>{let i=()=>{n({type:"ERROR",taskId:t,error:new Error("Aborted")})};e?.addEventListener("abort",i,{once:!0}),r.defer(()=>{e?.removeEventListener("abort",i)})})}var Eg=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wg=e=>{throw TypeError(e)},Rg=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&wg("Object expected");var n,i;r&&(n=t[Eg("asyncDispose")]),n===void 0&&(n=t[Eg("dispose")],r&&(i=n)),typeof n!="function"&&wg("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else r&&e.push([r]);return t},xg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()},ZA={parse:ln,stringify:fn},ti=class{#t;#r;constructor(t){this.#t=t.webContents,this.#r=t.ipc}async sendMessage(t){if(this.#t.isDestroyed()){console.warn("WebContents is destroyed, message not sent");return}this.#t.send(Qt,ZA.stringify(t))}get#n(){return this.#t.id}addMessageHandler(t){var r=[];try{let s=Rg(r,new DisposableStack);return s.defer(this.#r.on(`emit:${this.#n}`,t)),s.defer(this.#r.on(`invoke:${this.#n}`,o=>new Promise(a=>t(o,a)))),s.move()}catch(s){var n=s,i=!0}finally{xg(r,n,i)}}async invoke(t,{signal:r}={}){var n=[];try{let o=Rg(n,new DisposableStack);return await this.sendMessage(t),await Promise.race([new Promise(a=>{let u=c=>{ep(t,c)&&a(c)};o.defer(this.#r.on(`emit:${this.#n}`,u))}),Sg(r,{taskId:t.taskId,stack:o})])}catch(o){var i=o,s=!0}finally{xg(n,i,s)}}};var fr=require("electron");var ri=class{#t=new Map;add(t,r){this.#t.set(t,r)}get(t){return this.#t.get(t)}has(t){return this.#t.has(t)}pickFirst(){return this.#t.values().next().value}delete(t){let r=this.#t.get(t);return r?(this.#t.delete(t),Symbol.dispose in r?r[Symbol.dispose]():r.dispose(),!0):!1}async[Symbol.asyncDispose](){for(let t of this.#t.values())Symbol.dispose in t?t[Symbol.dispose]():t.dispose();this.#t.clear()}};var Pg=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ag=e=>{throw TypeError(e)},Aa=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Ag("Object expected");var n,i;r&&(n=t[Pg("asyncDispose")]),n===void 0&&(n=t[Pg("dispose")],r&&(i=n)),typeof n!="function"&&Ag("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else r&&e.push([r]);return t},Oa=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()},lr=class e{#t;#r=new Map;static init(t){return new e(t)}#n=new AbortController;#e;constructor(t){var r=[];try{this.#t=t;let s=Aa(r,new DisposableStack);s.use(this.#t.addMessageHandler(this.#i)),s.defer(()=>{this.#n.abort(new Error("Provider unloaded"));for(let o of this.#r.values())o.abort(new Error("Provider unloaded"));this.#r.clear()}),this.#e=s.move()}catch(s){var n=s,i=!0}finally{Oa(r,n,i)}}[Symbol.dispose](){this.#e.dispose()}#i=async(t,r)=>{var n=[];try{if(Es(t))return this.#a(t);if(!dt(t))return;Aa(n,new DisposableStack).defer(()=>{this.#r.delete(t.taskId)});let{resp:a,options:u}=await this.#o(t);r?r(a,u):await this.#t.sendMessage(a,u)}catch(o){var i=o,s=!0}finally{Oa(n,i,s)}};#a(t){let r=this.#r.get(t.taskId);r&&(r.abort(new Error("Task aborted by client")),this.#r.delete(t.taskId))}async#o(t){var r=[];try{let s=new AbortController,o=Aa(r,new DisposableStack);this.#r.set(t.taskId,s),o.defer(()=>{this.#r.delete(t.taskId)});let a={signal:AbortSignal.any([s.signal,this.#n.signal])};try{let u=this.#c.respondWithOptions.get(t.fnName);if(u){let l=await(u.type==="fn"?u.fn:u.fnCreator(a)).apply(null,t.args),{options:f,payload:h}=l;return{resp:{type:"RESULT",taskId:t.taskId,value:h},options:f}}let c=this.#c.regular.get(t.fnName);if(c){let l=await(c.type==="fn"?c.fn:c.fnCreator(a)).apply(null,t.args);return{resp:{type:"RESULT",taskId:t.taskId,value:l}}}return{resp:{type:"ERROR",taskId:t.taskId,error:new ReferenceError(`Handler not defined: ${t.fnName}`)}}}catch(u){return console.error("Error in handler",u),{resp:{type:"ERROR",taskId:t.taskId,error:u instanceof Error?u:new Error(String(u))}}}}catch(s){var n=s,i=!0}finally{Oa(r,n,i)}}addFnHandler(t){let{fn:r,fnCreator:n,name:i,respWithOpts:s=!1}=t;if(!r&&!n)throw new Error("No handler implemented");if(!i)throw new Error("Function must have a name");if(this.#c.regular.has(i)||this.#c.respondWithOptions.has(i))throw new Error(`Function ${i} already registered`);if(s){let o=r?{type:"fn",fn:r}:{type:"fnCreator",fnCreator:n};this.#c.respondWithOptions.set(i,o)}else{let o=r?{type:"fn",fn:r}:{type:"fnCreator",fnCreator:n};this.#c.regular.set(i,o)}}#c={regular:new Map,respondWithOptions:new Map}};var kt={getAll:"get-credentials",set:"set-credential",delete:"delete-credential",clear:"clear-credentials",import:"import-credentials"};var ni=class{#t;constructor(t,r){var s=[];try{let n=Ye(s,new DisposableStack);let i=n.use(lr.init(t));i.addFnHandler({fn:()=>r.loginPref.getCredentials(),name:kt.getAll});i.addFnHandler({fn:c=>r.loginPref.setCredential(c),name:kt.set});i.addFnHandler({fn:c=>r.loginPref.deleteCredential(c),name:kt.delete});i.addFnHandler({fn:()=>r.loginPref.clearCredentials(),name:kt.clear});i.addFnHandler({fn:c=>r.loginPref.importCredentials(c),name:kt.import});this.#t=n.move()}catch(o){var a=o,u=!0}finally{Xe(s,a,u)}}[Symbol.dispose](){this.#t.dispose()}};var ii=class extends ri{#t;#r;constructor(t){var n=[];try{super();this.#t=t;let r=Ye(n,new DisposableStack);fr.ipcMain.handle(vs,this.#n);r.defer(()=>{fr.ipcMain.removeHandler(vs)});fr.ipcMain.on(_s,this.#e);r.defer(()=>{fr.ipcMain.off(_s,this.#e)});this.#r=r.move()}catch(i){var s=i,o=!0}finally{Xe(n,s,o)}}[Symbol.dispose](){console.log("dispose vault connection service"),this.#r.dispose()}#n=(t,r)=>{var c=[];try{console.log("renderer connection",t.sender.id,r);let n=t.sender;let i=Ye(c,new DisposableStack);let s=new ti({webContents:n,ipc:this.#t.ipcEventRegistry});let o=()=>this.delete(n.id);n.on("destroyed",o);i.defer(()=>{n.off("destroyed",o)});let a=i.use(new ni(s,this.#t));let u=i.move();this.add(t.sender.id,{instance:a,[Symbol.dispose](){u.dispose()}});return!0}catch(l){var f=l,h=!0}finally{Xe(c,f,h)}};#e=t=>{console.log("vault disconnected",t.sender.id),this.delete(t.sender.id)}};async function Tg(){let e=Ra();e.register({vaults:Qn(ii),ipcEventRegistry:vg(()=>new pn(Og.ipcMain)),loginPref:Qn(Jn),login:Qn(ei)});let{vaults:t,login:r,loginPref:n}=e.cradle;return await n.load(),e}var JA=async e=>{await eO(e),console.log("connector server ready");for(let t of Cg.webContents.getAllWebContents())t.send(Xf,{version:bs})};async function eO(e){console.log("!!!","production",e);let t=globalThis;t[ms]??=new Map;let r=t[ms];if(!(r instanceof Map))throw new Error("Unexpected global type, please restart Obsidian");let n=`${bs}-${e}`,i=r.get(n);if(i)return await i;let s=new Map(r),o=(async()=>{if(s.size>0)throw new Error("Conflict BrowserConnector, make sure media-extended across multiple vaults are all up to date and restart Obsidian");return await Tg()})().catch(a=>{throw console.error("Error creating main process service",a),r.get(n)===o&&r.delete(n),a});return r.set(n,o),await o}0&&(module.exports={init});\n/*! Bundled license information:\n\nis-extglob/index.js:\n (*!\n * is-extglob <https://github.com/jonschlinkert/is-extglob>\n *\n * Copyright (c) 2014-2016, Jon Schlinkert.\n * Licensed under the MIT License.\n *)\n\nis-glob/index.js:\n (*!\n * is-glob <https://github.com/jonschlinkert/is-glob>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n *)\n\nis-number/index.js:\n (*!\n * is-number <https://github.com/jonschlinkert/is-number>\n *\n * Copyright (c) 2014-present, Jon Schlinkert.\n * Released under the MIT License.\n *)\n\nto-regex-range/index.js:\n (*!\n * to-regex-range <https://github.com/micromatch/to-regex-range>\n *\n * Copyright (c) 2015-present, Jon Schlinkert.\n * Released under the MIT License.\n *)\n\nfill-range/index.js:\n (*!\n * fill-range <https://github.com/jonschlinkert/fill-range>\n *\n * Copyright (c) 2014-present, Jon Schlinkert.\n * Licensed under the MIT License.\n *)\n\nqueue-microtask/index.js:\n (*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n\nrun-parallel/index.js:\n (*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n*/\n';var cye=require("obsidian");async function mj(){if(!cye.Platform.isDesktopApp)throw new Error("node env required for main process hack module");let t=Wo().app.getPath("temp"),{createHash:e}=UT(),r=e("md5").update(hj).digest("hex"),{join:n}=vs(),{writeFile:i,unlink:s}=ia(),a=n(t,`mx-hack-${r}.js`);return await i(a,hj),{require:()=>Wo().require(a),md5:r,async[Symbol.asyncDispose](){await s(a).catch(console.error)}}}var mS=class{app;#e=null;get connected(){return this.#e}instance;#t;constructor(e){var s=[];try{this.app=e.app;this.#e=!1;if(!uye.Platform.isDesktopApp)throw new Error("BrowserConnect is only available on desktop");let r=J(s,new DisposableStack);let{ipcRenderer:n}=sQ();let{createHash:i}=UT();r.defer(()=>{this.#e=null});this.instance=r.use(pj(n));console.log("waiting for connector ready");n.once(Zge,async(c,u)=>{if(console.log("connector ready",u),u.version!==tye)throw new Error(`Unsupported API version: ${u.version}`);let d=i("sha256").update(this.app.appId).digest("hex");console.log("connecting",d),await n.invoke(Jge,{name:this.app.vault.getName()})&&(this.#e=!0,console.log("connected to main process"))});r.defer(()=>{n.send(eye)});this.#t=r.move()}catch(a){var o=a,l=!0}finally{ee(s,o,l)}}[Symbol.dispose](){this.#t.dispose()}async initialize(){var n=[];try{let e=J(n,await mj(),!0);let{init:r}=e.require();await r(e.md5)}catch(i){var s=i,a=!0}finally{var o=ee(n,s,a);o&&await o}}};var gj=require("obsidian");function VL(t){if(!Bt(t))throw new Error(`not a file uri: ${t.href}`);if(!gj.Platform.isDesktopApp)throw new Error(`not a desktop app: ${t.href}`);let e=new URL(gj.Platform.resourcePathPrefix+t.href.substring(8));return e.search=Date.now().toString(),e}var jL=class{app;constructor(e){this.app=e.app}inferMediaType(e){if(e){if(e.type==="file")return bD(e.file)?"audio":p0(e.file)?"video":void 0;if(e.type==="url:direct"){let r=So(e.url.pathname,{urlEncoded:!0});return bD(r)?"audio":p0(r)?"video":void 0}e.type!=="url:hosted"&&Be(e)}}getMediaSrc(e,r){if(e.type==="file")return{src:this.app.vault.getResourcePath(e.file),type:(r??this.inferMediaType(e))==="audio"?"audio/mpeg":"video/mp4"};if(e.type==="url:direct")return{src:(Bt(e.url)?VL(e.url):e.url).toString(),type:(r??this.inferMediaType(e))==="audio"?"audio/mpeg":"video/mp4"};if(e.type==="url:hosted")return e.vid.host==="youtube"?`https://www.youtube.com/watch?v=${e.vid.vid}`:e.vid.host==="vimeo"?`https://vimeo.com/${e.vid.vid}`:null;Be(e)}getFallbackTitle(e){if(e){if(e.type==="file")return e.file.name;if(e.type==="url:direct")return pd(e.url,{urlEncoded:!0}).name;if(e.type==="url:hosted")return jKe(e.vid)}}};function jKe(t){if(t.host==="youtube")return`YouTube - ${t.vid}`;if(t.host==="vimeo")return`Vimeo - ${t.vid}`;if(t.host==="bilibili")switch(t.type){case"aid":return`Bilibili - ${t.aid}`;case"bvid":return`Bilibili - ${t.bvid}`;case"epid":return`Bilibili - ${t.epid}`;case"ssid":return`Bilibili - ${t.ssid}`;default:Be(t)}if(t.host==="coursera")return`${t.lectureId} - ${t.courseId} - Coursera`;if(t.host==="baidu-pan")return`${So(t.path,{urlEncoded:!0}).name} - Baidu Pan`;Be(t)}var dye=require("obsidian");var $L=require("obsidian");function*fv(t){for(let e of t.children)e instanceof $L.TFolder?yield*fv(e):e instanceof $L.TFile&&(yield e)}async function yj(t,{signal:e}){var i=[];try{if(t.initialized)return;let r=J(i,new DisposableStack);let n=new Promise(l=>{xr(r,t.on("finished",()=>l()))});return await Vr(n,e)}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}var UL=class{app;trackInfoParser;plugin;metadataParser;noteTo;noteFrom;#e;#t;#r;constructor(e){var i=[];try{this.app=e.plugin.app;this.plugin=e.plugin;this.trackInfoParser=e.trackInfoParser;this.metadataParser=e.metadataParser;let r=J(i,new DisposableStack);this.noteTo=r.use(new zL({trackInfoParser:e.trackInfoParser,app:e.plugin.app}));this.noteFrom=r.use(new qL);this.#e=r.move();let n=J(i,new DisposableStack);this.#r=n.use(new hu);yj(this.app.metadataCache,{signal:this.#r.signal}).then(()=>this.#a());this.#t=n.move()}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}resetIndex(){var r=[];try{let e=J(r,new DisposableStack);this.noteTo=e.use(new zL({trackInfoParser:this.trackInfoParser,app:this.plugin.app}));this.noteFrom=e.use(new qL);this.#e.dispose();this.#e=e.move()}catch(n){var i=n,s=!0}finally{ee(r,i,s)}}[Symbol.dispose](){this.#e.dispose(),this.#t.dispose()}onunload(){this[Symbol.dispose]()}findTracksByMedia(e){let r=this.findNoteByMedia(e);return r?this.noteTo.getTracks(r.path):[]}findMediaByTrack(e){return this.noteTo.getNotesFromTrack(e).map(n=>this.findMediaByNote(n)).filter(n=>n!==null)}findNoteByMedia(e){return this.noteFrom.media.get(Xl(e))??null}getMediaMeta(e){let r=this.findNoteByMedia(e);if(!r)return null;let n=this.metadataParser.getMediaMeta(r);return n?{note:r,uid:n.uid,get meta(){return n.meta}}:null}findMediaByNote(e){return this.noteTo.getMedia(e.path)??null}findNoteByUid(e){return this.noteFrom.uid.get(e)??null}findMediaByUid(e){let r=this.findNoteByUid(e);return r?this.findMediaByNote(r):null}#n(e){let r=this.noteTo.remove(e);r&&(r.media&&this.noteFrom.remove([r.media]),this.#s.emit("media-meta-removed",r.media,e))}#i(e,r){let n=Xl(r.src.info),i=this.noteFrom.media.get(n);i&&i!==e&&i.stat.ctime<=e.stat.ctime||(this.noteTo.add(e,r),this.noteFrom.addNote(e,r),this.#s.emit("media-meta-changed",{src:r.src.info,uid:r.uid},e))}#s=th();on(e,r){return this.#s.on(e,r)}#a(){this.resetIndex();for(let{file:e,meta:r}of this.iterateMediaNote())this.#i(e,r);xr(this.#t,this.app.metadataCache.on("changed",e=>{let r=this.metadataParser.getMediaMeta(e);r?this.#i(e,r):this.#n(e)})),xr(this.#t,this.app.metadataCache.on("deleted",e=>{this.#n(e)})),xr(this.#t,this.app.vault.on("rename",(e,r)=>{e instanceof dye.TFile&&this.noteTo.rename(r,e)}))}*iterateMediaNote(){for(let e of fv(this.app.vault.getRoot())){if(e.extension!=="md")continue;let r=this.metadataParser.getMediaMeta(e);r&&(yield{meta:r,file:e})}}},zL=class{trackInfoParser;app;constructor(e){this.trackInfoParser=e.trackInfoParser,this.app=e.app}#e=new Map;#t=th();#r=new DisposableStack;on(e,r){return this.#r.use({[Symbol.dispose]:this.#t.on(e,r)})}add(e,r){let n=new Map(this.#e.get(e.path)?.tracks.map(l=>[M9(l),l])??[]),i=new Map(r.textTracks.map(l=>[M9(l),l])),s=this.#e.get(e.path)?.media,a=r.src;this.#e.set(e.path,{media:{src:r.src.info,uid:r.uid},tracks:r.textTracks});let o=new Set(n.keys()).symmetricDifference(new Set(i.keys()));o.size>0&&this.#t.emit("tracks-changed",[...o].map(l=>n.get(l)||i.get(l)),e),s&&(Xl(s.src)!==Xl(a.info)||s.uid!==r.uid)&&this.#t.emit("media-changed",s,{src:a.info,uid:r.uid},e)}rename(e,r){let n=this.#e.get(e);n&&(this.#e.delete(e),this.#e.set(r.path,n))}remove(e){let r=this.#e.get(e.path);if(r)return this.#e.delete(e.path),r.tracks.length>0&&this.#t.emit("tracks-changed",r.tracks,e),this.#t.emit("media-changed",r.media,null,e),r}getMedia(e){return this.#e.get(e)?.media}#n(e,r){return e.type==="internal"?this.trackInfoParser.resolveTrackLink(e,r):e}getTracks(e){let r=this.#e.get(e)?.tracks;return r?r.map(n=>this.#n(n,{sourcePath:e})).filter(n=>n!==null):[]}getNotesFromTrack(e){let r=Ia(e);return[...this.#e.entries()].map(([i,{tracks:s}])=>s.map(o=>this.#n(o,{sourcePath:i})).filter(o=>o!==null).some(o=>Ia(o)===r)?this.app.vault.getFileByPath(i):null).filter(i=>i!==null)}[Symbol.dispose](){this.#e.clear()}},qL=class{media=new Map;uid=new Map;addNote(e,r){this.media.set(Xl(r.src.info),e),this.uid.set(r.uid,e)}remove(e){for(let{uid:r,src:n}of e)this.uid.delete(r),this.media.delete(Xl(n))}removeNote(e){for(let[r,n]of this.media)n.path===e&&this.media.delete(r);for(let[r,n]of this.uid)n.path===e&&this.uid.delete(r)}[Symbol.dispose](){this.media.clear(),this.uid.clear()}};var tve=Z(Ej(),1),Oo="mx-uid";function rve(){return(0,tve.createId)()}var EYe="cover",KL=class{app;indexer;settings;youTubeApi;auth;getFmMetaFields;updateImageCache;constructor(e){this.app=e.app,this.indexer=e.mediaLib,this.settings=e.settings,this.youTubeApi=e.youTubeApi,this.auth=e.auth,this.getFmMetaFields=r=>e.metadataUpdater.getFrontmatterFields(r),this.updateImageCache=(r,n)=>e.metadataUpdater.updateImageCache(r,n)}async setAsCover(e,r){let{note:n}=await this.ensureMediaNote(e),i=this.#e(r,{sourcePath:n.path});await this.app.fileManager.processFrontMatter(n,s=>{s[EYe]=i})}#e(e,{sourcePath:r}){return e instanceof URL?e.toString():`[[${this.app.metadataCache.fileToLinktext(e,r)}]]`}async ensureMediaNote(e){let{metadataCache:r}=this.app,n=this.indexer.getMediaMeta(e);if(n)return{note:n.note,uid:n.uid,get meta(){return n.meta}};let i=rve(),s=IYe(e,i),a=await this.getFmMetaFields(e),o=a?.typeField??"media",l;if(e.type==="file"){let c=e.file;l=await this.#t({noteName:s,fm:u=>({[Oo]:i,[o]:`[[${r.fileToLinktext(c,u)}]]`,...a?.serialized})})}else e.type==="url:direct"||e.type==="url:hosted"?l=await this.#t({noteName:s,fm:()=>({[Oo]:i,[o]:e.url.toString(),...a?.serialized})}):Be(e);return a&&await this.updateImageCache(i,a.fields),{note:l,uid:i,meta:{type:a?.type}}}async#t(e){let{noteName:r,fm:n}=e,{fileManager:i,vault:s}=this.app,a=(await this.settings.loaded)["media-lib.folder-path"],o=s.getFolderByPath(a);o||(o=await s.createFolder(a));let l=await i.createNewFile(o,r,"md",`---
---
`);return await i.processFrontMatter(l,c=>{Object.assign(c,n(l.path))}),l}};function IYe(t,e){if(t.type==="file")return`file-${e.slice(0,8)}`;if(t.type==="url:direct"||t.type==="url:hosted")return`url-${e.slice(0,8)}`;Be(t)}function Aj(t){return{[Ij]:t}}var Ij=Symbol("mx_hash"),YL=class{parseUrl(e){let r=an(e);if(!r)return null;let n=this.parseHash(r.hash);if(Bt(r))return{info:{type:"url:direct",url:rS(r)},hash:n};let i=Tme.parse(r);return i?AYe(i,n):{info:{type:"url:direct",url:rS(r)},hash:n}}parseFile(e){return!e||!Kl(e)?null:{type:"file",file:e}}parseHash(e){return m8(e).props}parseHashFromEphemeralState(e){if(typeof e!="object"||e===null)return null;let r=e;return r[Ij]?r[Ij]:"subpath"in r&&typeof r.subpath=="string"?this.parseHash(r.subpath):null}};function AYe(t,e){let r=null;if(t.host==="youtube")return t.vid.t?r={start:t.vid.t,end:-1}:(t.vid.start||t.vid.end)&&(r={start:t.vid.start??-1,end:t.vid.end??-1}),r&&!e.tempFragment&&(e.tempFragment=r),{info:{type:"url:hosted",vid:t.vid,url:Ud(t.vid)},hash:e};if(t.host==="vimeo")return t.vid.t&&(r={start:t.vid.t,end:-1}),r&&!e.tempFragment&&(e.tempFragment=r),{info:{type:"url:hosted",vid:t.vid,url:Ud(t.vid)},hash:e};if(t.host==="baidu-pan")return{info:{type:"url:hosted",vid:t.vid,url:Ud(t.vid)},hash:e};if(t.host==="bilibili")return t.vid.type==="short-uri"?null:(t.vid.t&&(r={start:t.vid.t,end:-1}),r&&!e.tempFragment&&(e.tempFragment=r),{info:{type:"url:hosted",vid:t.vid,url:Ud(t.vid)},hash:e});if(t.host==="coursera")return{info:{type:"url:hosted",vid:t.vid,url:Ud(t.vid)},hash:e};Be(t)}var jMt=new TextEncoder;var Pj={Base32:new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Base32Hex:new TextEncoder().encode("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Base32Crockford:new TextEncoder().encode("0123456789ABCDEFGHJKMNPQRSTVWXYZ")},Rj={Base32:new Uint8Array(128).fill(32),Base32Hex:new Uint8Array(128).fill(32),Base32Crockford:new Uint8Array(128).fill(32)};Pj.Base32.forEach((t,e)=>Rj.Base32[t]=e);Pj.Base32Hex.forEach((t,e)=>Rj.Base32Hex[t]=e);Pj.Base32Crockford.forEach((t,e)=>Rj.Base32Crockford[t]=e);function wS(t,e){let r=t.length;if(t.byteOffset){let n=new Uint8Array(t.buffer);n.set(t),t=n.subarray(0,r)}return t=new Uint8Array(t.buffer.transfer(e)),t.set(t.subarray(0,r),e-r),[t,e-r]}var RYe=new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),LYe=new Uint8Array(128).fill(32);RYe.forEach((t,e)=>LYe[t]=e);var JMt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split("");var nve={Base64:new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Base64Url:new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")},ive={Base64:new Uint8Array(128).fill(64),Base64Url:new Uint8Array(128).fill(64)};nve.Base64.forEach((t,e)=>ive.Base64[t]=e);nve.Base64Url.forEach((t,e)=>ive.Base64Url[t]=e);function Lj(t){return((t+2)/3|0)*4}function Mj(t,e,r,n,i){for(e+=2;e<t.length;e+=3){let s=t[e-2]<<16|t[e-1]<<8|t[e];t[r++]=n[s>>18],t[r++]=n[s>>12&63],t[r++]=n[s>>6&63],t[r++]=n[s&63]}switch(e){case t.length+1:{let s=t[e-2]<<16;t[r++]=n[s>>18],t[r++]=n[s>>12&63],t[r++]=i,t[r++]=i;break}case t.length:{let s=t[e-2]<<16|t[e-1]<<8;t[r++]=n[s>>18],t[r++]=n[s>>12&63],t[r++]=n[s>>6&63],t[r++]=i;break}}return r}var _Ye=61,sve=new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),OYe=new Uint8Array(128).fill(64);sve.forEach((t,e)=>OYe[t]=e);function ave(t){typeof t=="string"?t=new TextEncoder().encode(t):t instanceof ArrayBuffer?t=new Uint8Array(t).slice():t=t.slice();let[e,r]=wS(t,Lj(t.length));return Mj(e,r,0,sve,_Ye),new TextDecoder().decode(e)}var DYe=new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),NYe=new Uint8Array(128).fill(64);DYe.forEach((t,e)=>NYe[t]=e);var FYe=new TextEncoder().encode("0123456789abcdef"),ove=new Uint8Array(128).fill(16);FYe.forEach((t,e)=>ove[t]=e);new TextEncoder().encode("ABCDEF").forEach((t,e)=>ove[t]=e+10);var BYe=new TextEncoder().encode("0123456789abcdef"),lve=new Uint8Array(128).fill(16);BYe.forEach((t,e)=>lve[t]=e);new TextEncoder().encode("ABCDEF").forEach((t,e)=>lve[t]=e+10);var cve=new ArrayBuffer(8),m_t=new Uint32Array(cve),g_t=new BigUint64Array(cve);function F(t){if(!t)throw new Error("Assertion failed.")}var XL=t=>{let e=(t%360+360)%360;if(e===0||e===90||e===180||e===270)return e;throw new Error(`Invalid rotation ${t}.`)},Li=t=>t&&t[t.length-1];var Ht=class t{constructor(e){this.bytes=e,this.pos=0}seekToByte(e){this.pos=8*e}readBit(){let e=Math.floor(this.pos/8),r=this.bytes[e]??0,n=7-(this.pos&7),i=(r&1<<n)>>n;return this.pos++,i}readBits(e){if(e===1)return this.readBit();let r=0;for(let n=0;n<e;n++)r<<=1,r|=this.readBit();return r}writeBits(e,r){let n=this.pos+e;for(let i=this.pos;i<n;i++){let s=Math.floor(i/8),a=this.bytes[s],o=7-(i&7);a&=~(1<<o),a|=(r&1<<n-i-1)>>n-i-1<<o,this.bytes[s]=a}this.pos=n}readAlignedByte(){if(this.pos%8!==0)throw new Error("Bitstream is not byte-aligned.");let e=this.pos/8,r=this.bytes[e]??0;return this.pos+=8,r}skipBits(e){this.pos+=e}getBitsLeft(){return this.bytes.length*8-this.pos}clone(){let e=new t(this.bytes);return e.pos=this.pos,e}},ye=t=>{let e=0;for(;t.readBits(1)===0&&e<32;)e++;if(e>=32)throw new Error("Invalid exponential-Golomb code.");return(1<<e)-1+t.readBits(e)},mv=t=>{let e=ye(t);return(e&1)===0?-(e>>1):e+1>>1};var kS=t=>t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength),fr=t=>t instanceof DataView?t:t instanceof ArrayBuffer?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),kn=new TextDecoder,_j=new TextEncoder;var Oj=t=>Object.fromEntries(Object.entries(t).map(([e,r])=>[r,e])),Dj={bt709:1,bt470bg:5,smpte170m:6,bt2020:9,smpte432:12},QL=Oj(Dj),Nj={bt709:1,smpte170m:6,linear:8,"iec61966-2-1":13,pg:16,hlg:18},ZL=Oj(Nj),Fj={rgb:0,bt709:1,bt470bg:5,smpte170m:6,"bt2020-ncl":9},JL=Oj(Fj);var cs=class{constructor(){this.currentPromise=Promise.resolve()}async acquire(){let e,r=new Promise(i=>{e=i}),n=this.currentPromise;return this.currentPromise=r,await n,e}},Bj=t=>[...t].map(e=>e.toString(16).padStart(2,"0")).join(""),Vj=t=>(t=t>>1&1431655765|(t&1431655765)<<1,t=t>>2&858993459|(t&858993459)<<2,t=t>>4&252645135|(t&252645135)<<4,t=t>>8&16711935|(t&16711935)<<8,t=t>>16&65535|(t&65535)<<16,t>>>0),vr=(t,e,r)=>{let n=0,i=t.length-1,s=-1;for(;n<=i;){let a=n+i>>1,o=r(t[a]);o===e?(s=a,i=a-1):o<e?n=a+1:i=a-1}return s},dt=(t,e,r)=>{let n=0,i=t.length-1,s=-1;for(;n<=i;){let a=n+(i-n+1)/2|0;r(t[a])<=e?(s=a,n=a+1):i=a-1}return s},Qc=(t,e,r)=>{let n=dt(t,r(e),r);t.splice(n+1,0,e)},Ph=()=>{let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}};var jj=(t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r]))return t[r]},e3=(t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1};var Qd=t=>{throw new Error(`Unexpected value: ${t}`)},SS=(t,e,r)=>{let n=t.getUint8(e),i=t.getUint8(e+1),s=t.getUint8(e+2);return r?n|i<<8|s<<16:n<<16|i<<8|s};var $j=(t,e,r)=>Math.max(e,Math.min(r,t)),Sn="und",Rh=(t,e)=>{let r=10**e;return Math.round(t*r)/r},dve=(t,e)=>Math.round(t/e)*e,fve=t=>{let e=0;for(;t;)e++,t>>=1;return e},VYe=/^[a-z]{3}$/,t3=t=>VYe.test(t),Uj=1e6*(1+Number.EPSILON),zj=(t,e)=>{let r={...t,...e};if(t.headers||e.headers){let n=t.headers?uve(t.headers):{},i=e.headers?uve(e.headers):{},s={...n};Object.entries(i).forEach(([a,o])=>{let l=Object.keys(s).find(c=>c.toLowerCase()===a.toLowerCase());l&&delete s[l],s[a]=o}),r.headers=s}return r},uve=t=>{if(t instanceof Headers){let e={};return t.forEach((r,n)=>{e[n]=r}),e}if(Array.isArray(t)){let e={};return t.forEach(([r,n])=>{e[r]=n}),e}return t},qj=async(t,e,r,n)=>{let i=0;for(;;)try{return await t(e,r)}catch(s){i++;let a=n(i,s);if(a===null)throw s;if(console.error("Retrying failed fetch. Error:",s),!Number.isFinite(a)||a<0)throw new TypeError("Retry delay must be a non-negative finite number.");a>0&&await new Promise(o=>setTimeout(o,1e3*a))}};var Lh=(t,e)=>t!==-1?t:e,r3=(t,e,r,n)=>t<=n&&r<=e;var pve=t=>{let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r};var Zd=class{constructor(e,r){if(this.data=e,this.mimeType=r,!(e instanceof Uint8Array))throw new TypeError("data must be a Uint8Array.");if(typeof r!="string")throw new TypeError("mimeType must be a string.")}},n3=class{constructor(e,r,n,i){if(this.data=e,this.mimeType=r,this.name=n,this.description=i,!(e instanceof Uint8Array))throw new TypeError("data must be a Uint8Array.");if(r!==void 0&&typeof r!="string")throw new TypeError("mimeType, when provided, must be a string.");if(n!==void 0&&typeof n!="string")throw new TypeError("name, when provided, must be a string.");if(i!==void 0&&typeof i!="string")throw new TypeError("description, when provided, must be a string.")}};var TS=["pcm-s16","pcm-s16be","pcm-s24","pcm-s24be","pcm-s32","pcm-s32be","pcm-f32","pcm-f32be","pcm-f64","pcm-f64be","pcm-u8","pcm-s8","ulaw","alaw"],jYe=["aac","opus","mp3","vorbis","flac"],R_t=[...jYe,...TS];var Mh=[{maxPictureSize:36864,maxBitrate:2e5,level:10},{maxPictureSize:73728,maxBitrate:8e5,level:11},{maxPictureSize:122880,maxBitrate:18e5,level:20},{maxPictureSize:245760,maxBitrate:36e5,level:21},{maxPictureSize:552960,maxBitrate:72e5,level:30},{maxPictureSize:983040,maxBitrate:12e6,level:31},{maxPictureSize:2228224,maxBitrate:18e6,level:40},{maxPictureSize:2228224,maxBitrate:3e7,level:41},{maxPictureSize:8912896,maxBitrate:6e7,level:50},{maxPictureSize:8912896,maxBitrate:12e7,level:51},{maxPictureSize:8912896,maxBitrate:18e7,level:52},{maxPictureSize:35651584,maxBitrate:18e7,level:60},{maxPictureSize:35651584,maxBitrate:24e7,level:61},{maxPictureSize:35651584,maxBitrate:48e7,level:62}];var hve=".01.01.01.01.00",mve=".0.110.01.01.01.0";var i3=t=>{let{codec:e,codecDescription:r,colorSpace:n,avcCodecInfo:i,hevcCodecInfo:s,vp9CodecInfo:a,av1CodecInfo:o}=t;if(e==="avc"){if(i){let l=new Uint8Array([i.avcProfileIndication,i.profileCompatibility,i.avcLevelIndication]);return`avc1.${Bj(l)}`}if(!r||r.byteLength<4)throw new TypeError("AVC decoder description is not provided or is not at least 4 bytes long.");return`avc1.${Bj(r.subarray(1,4))}`}else if(e==="hevc"){let l,c,u,d,f,p;if(s)l=s.generalProfileSpace,c=s.generalProfileIdc,u=Vj(s.generalProfileCompatibilityFlags),d=s.generalTierFlag,f=s.generalLevelIdc,p=[...s.generalConstraintIndicatorFlags];else{if(!r||r.byteLength<23)throw new TypeError("HEVC decoder description is not provided or is not at least 23 bytes long.");let m=fr(r),v=m.getUint8(1);l=v>>6&3,c=v&31,u=Vj(m.getUint32(2)),d=v>>5&1,f=m.getUint8(12),p=[];for(let b=0;b<6;b++)p.push(m.getUint8(6+b))}let h="hev1.";for(h+=["","A","B","C"][l]+c,h+=".",h+=u.toString(16).toUpperCase(),h+=".",h+=d===0?"L":"H",h+=f;p.length>0&&p[p.length-1]===0;)p.pop();return p.length>0&&(h+=".",h+=p.map(m=>m.toString(16).toUpperCase()).join(".")),h}else{if(e==="vp8")return"vp8";if(e==="vp9"){if(!a){let b=t.width*t.height,y=Li(Mh).level;for(let x of Mh)if(b<=x.maxPictureSize){y=x.level;break}return`vp09.00.${y.toString().padStart(2,"0")}.08`}let l=a.profile.toString().padStart(2,"0"),c=a.level.toString().padStart(2,"0"),u=a.bitDepth.toString().padStart(2,"0"),d=a.chromaSubsampling.toString().padStart(2,"0"),f=a.colourPrimaries.toString().padStart(2,"0"),p=a.transferCharacteristics.toString().padStart(2,"0"),h=a.matrixCoefficients.toString().padStart(2,"0"),m=a.videoFullRangeFlag.toString().padStart(2,"0"),v=`vp09.${l}.${c}.${u}.${d}`;return v+=`.${f}.${p}.${h}.${m}`,v.endsWith(hve)&&(v=v.slice(0,-hve.length)),v}else if(e==="av1"){if(!o){let x=t.width*t.height,w=Li(Mh).level;for(let C of Mh)if(x<=C.maxPictureSize){w=C.level;break}return`av01.0.${w.toString().padStart(2,"0")}M.08`}let l=o.profile,c=o.level.toString().padStart(2,"0"),u=o.tier?"H":"M",d=o.bitDepth.toString().padStart(2,"0"),f=o.monochrome?"1":"0",p=100*o.chromaSubsamplingX+10*o.chromaSubsamplingY+1*(o.chromaSubsamplingX&&o.chromaSubsamplingY?o.chromaSamplePosition:0),h=n?.primaries?Dj[n.primaries]:1,m=n?.transfer?Nj[n.transfer]:1,v=n?.matrix?Fj[n.matrix]:1,b=n?.fullRange?1:0,y=`av01.${l}.${c}${u}.${d}`;return y+=`.${f}.${p.toString().padStart(3,"0")}`,y+=`.${h.toString().padStart(2,"0")}`,y+=`.${m.toString().padStart(2,"0")}`,y+=`.${v.toString().padStart(2,"0")}`,y+=`.${b}`,y.endsWith(mve)&&(y=y.slice(0,-mve.length)),y}}throw new TypeError(`Unhandled codec '${e}'.`)};var s3=t=>{let{codec:e,codecDescription:r,aacCodecInfo:n}=t;if(e==="aac"){if(!n)throw new TypeError("AAC codec info must be provided.");return n.isMpeg2?"mp4a.67":`mp4a.40.${Gj(r).objectType}`}else{if(e==="mp3")return"mp3";if(e==="opus")return"opus";if(e==="vorbis")return"vorbis";if(e==="flac")return"flac";if(e&&TS.includes(e))return e}throw new TypeError(`Unhandled codec '${e}'.`)},CS=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Hj=[-1,1,2,3,4,5,6,8],Gj=t=>{if(!t||t.byteLength<2)throw new TypeError("AAC description must be at least 2 bytes long.");let e=new Ht(t),r=e.readBits(5);r===31&&(r=32+e.readBits(6));let n=e.readBits(4),i=null;n===15?i=e.readBits(24):n<CS.length&&(i=CS[n]);let s=e.readBits(4),a=null;return s>=1&&s<=7&&(a=Hj[s]),{objectType:r,frequencyIndex:n,sampleRate:i,channelConfiguration:s,numberOfChannels:a}},_h=48e3,$Ye=/^pcm-([usf])(\d+)+(be)?$/,gve=t=>{if(F(TS.includes(t)),t==="ulaw")return{dataType:"ulaw",sampleSize:1,littleEndian:!0,silentValue:255};if(t==="alaw")return{dataType:"alaw",sampleSize:1,littleEndian:!0,silentValue:213};let e=$Ye.exec(t);F(e);let r;e[1]==="u"?r="unsigned":e[1]==="s"?r="signed":r="float";let n=Number(e[2])/8,i=e[3]!=="be",s=t==="pcm-u8"?2**7:0;return{dataType:r,sampleSize:n,littleEndian:i,silentValue:s}};var gv;(function(t){t[t.IDR=5]="IDR",t[t.SPS=7]="SPS",t[t.PPS=8]="PPS",t[t.SPS_EXT=13]="SPS_EXT"})(gv||(gv={}));var Va;(function(t){t[t.RASL_N=8]="RASL_N",t[t.RASL_R=9]="RASL_R",t[t.BLA_W_LP=16]="BLA_W_LP",t[t.RSV_IRAP_VCL23=23]="RSV_IRAP_VCL23",t[t.VPS_NUT=32]="VPS_NUT",t[t.SPS_NUT=33]="SPS_NUT",t[t.PPS_NUT=34]="PPS_NUT",t[t.PREFIX_SEI_NUT=39]="PREFIX_SEI_NUT",t[t.SUFFIX_SEI_NUT=40]="SUFFIX_SEI_NUT"})(Va||(Va={}));var o3=t=>{let e=[],r=0;for(;r<t.length;){let n=-1,i=0;for(let s=r;s<t.length-3;s++){if(t[s]===0&&t[s+1]===0&&t[s+2]===1){n=s,i=3;break}if(s<t.length-4&&t[s]===0&&t[s+1]===0&&t[s+2]===0&&t[s+3]===1){n=s,i=4;break}}if(n===-1)break;if(r>0&&n>r){let s=t.subarray(r,n);s.length>0&&e.push(s)}r=n+i}if(r<t.length){let n=t.subarray(r);n.length>0&&e.push(n)}return e},vve=(t,e)=>{let r=[],n=0,i=new DataView(t.buffer,t.byteOffset,t.byteLength);for(;n+e<=t.length;){let s;e===1?s=i.getUint8(n):e===2?s=i.getUint16(n,!1):e===3?s=SS(i,n,!1):e===4?s=i.getUint32(n,!1):(Qd(e),F(!1)),n+=e;let a=t.subarray(n,n+s);r.push(a),n+=s}return r},Wj=t=>{let e=[],r=t.length;for(let n=0;n<r;n++)n+2<r&&t[n]===0&&t[n+1]===0&&t[n+2]===3?(e.push(0,0),n+=2):e.push(t[n]);return new Uint8Array(e)};var zYe=(t,e)=>{if(e.description){let i=(kS(e.description)[4]&3)+1;return vve(t,i)}else return o3(t)},a3=t=>t[0]&31,bve=t=>{try{let e=o3(t),r=e.filter(f=>a3(f)===gv.SPS),n=e.filter(f=>a3(f)===gv.PPS),i=e.filter(f=>a3(f)===gv.SPS_EXT);if(r.length===0||n.length===0)return null;let s=r[0],a=new Ht(Wj(s));if(a.skipBits(1),a.skipBits(2),a.readBits(5)!==7)return console.error("Invalid SPS NAL unit type"),null;let l=a.readAlignedByte(),c=a.readAlignedByte(),u=a.readAlignedByte(),d={configurationVersion:1,avcProfileIndication:l,profileCompatibility:c,avcLevelIndication:u,lengthSizeMinusOne:3,sequenceParameterSets:r,pictureParameterSets:n,chromaFormat:null,bitDepthLumaMinus8:null,bitDepthChromaMinus8:null,sequenceParameterSetExt:null};if(l===100||l===110||l===122||l===144){ye(a);let f=ye(a);f===3&&a.skipBits(1);let p=ye(a),h=ye(a);d.chromaFormat=f,d.bitDepthLumaMinus8=p,d.bitDepthChromaMinus8=h,d.sequenceParameterSetExt=i}return d}catch(e){return console.error("Error building AVC Decoder Configuration Record:",e),null}};var qYe=(t,e)=>{if(e.description){let i=(kS(e.description)[21]&3)+1;return vve(t,i)}else return o3(t)},Oh=t=>t[0]>>1&63,xve=t=>{try{let e=o3(t),r=e.filter(P=>Oh(P)===Va.VPS_NUT),n=e.filter(P=>Oh(P)===Va.SPS_NUT),i=e.filter(P=>Oh(P)===Va.PPS_NUT),s=e.filter(P=>Oh(P)===Va.PREFIX_SEI_NUT||Oh(P)===Va.SUFFIX_SEI_NUT);if(n.length===0||i.length===0)return null;let a=n[0],o=new Ht(Wj(a));o.skipBits(16),o.readBits(4);let l=o.readBits(3),c=o.readBits(1),{general_profile_space:u,general_tier_flag:d,general_profile_idc:f,general_profile_compatibility_flags:p,general_constraint_indicator_flags:h,general_level_idc:m}=HYe(o,l);ye(o);let v=ye(o);v===3&&o.skipBits(1),ye(o),ye(o),o.readBits(1)&&(ye(o),ye(o),ye(o),ye(o));let b=ye(o),y=ye(o);ye(o);let w=o.readBits(1)?0:l;for(let P=w;P<=l;P++)ye(o),ye(o),ye(o);ye(o),ye(o),ye(o),ye(o),ye(o),ye(o),o.readBits(1)&&o.readBits(1)&&GYe(o),o.skipBits(1),o.skipBits(1),o.readBits(1)&&(o.skipBits(4),o.skipBits(4),ye(o),ye(o),o.skipBits(1));let C=ye(o);if(WYe(o,C),o.readBits(1)){let P=ye(o);for(let R=0;R<P;R++)ye(o),o.skipBits(1)}o.skipBits(1),o.skipBits(1);let O=0;o.readBits(1)&&(O=YYe(o,l));let S=0;if(i.length>0){let P=i[0],R=new Ht(Wj(P));R.skipBits(16),ye(R),ye(R),R.skipBits(1),R.skipBits(1),R.skipBits(3),R.skipBits(1),R.skipBits(1),ye(R),ye(R),mv(R),R.skipBits(1),R.skipBits(1),R.readBits(1)&&ye(R),mv(R),mv(R),R.skipBits(1),R.skipBits(1),R.skipBits(1),R.skipBits(1);let I=R.readBits(1),B=R.readBits(1);!I&&!B?S=0:I&&!B?S=2:!I&&B?S=3:S=0}let T=[...r.length?[{arrayCompleteness:1,nalUnitType:Va.VPS_NUT,nalUnits:r}]:[],...n.length?[{arrayCompleteness:1,nalUnitType:Va.SPS_NUT,nalUnits:n}]:[],...i.length?[{arrayCompleteness:1,nalUnitType:Va.PPS_NUT,nalUnits:i}]:[],...s.length?[{arrayCompleteness:1,nalUnitType:Oh(s[0]),nalUnits:s}]:[]];return{configurationVersion:1,generalProfileSpace:u,generalTierFlag:d,generalProfileIdc:f,generalProfileCompatibilityFlags:p,generalConstraintIndicatorFlags:h,generalLevelIdc:m,minSpatialSegmentationIdc:O,parallelismType:S,chromaFormatIdc:v,bitDepthLumaMinus8:b,bitDepthChromaMinus8:y,avgFrameRate:0,constantFrameRate:0,numTemporalLayers:l+1,temporalIdNested:c,lengthSizeMinusOne:3,arrays:T}}catch(e){return console.error("Error building HEVC Decoder Configuration Record:",e),null}},HYe=(t,e)=>{let r=t.readBits(2),n=t.readBits(1),i=t.readBits(5),s=0;for(let u=0;u<32;u++)s=s<<1|t.readBits(1);let a=new Uint8Array(6);for(let u=0;u<6;u++)a[u]=t.readBits(8);let o=t.readBits(8),l=[],c=[];for(let u=0;u<e;u++)l.push(t.readBits(1)),c.push(t.readBits(1));if(e>0)for(let u=e;u<8;u++)t.skipBits(2);for(let u=0;u<e;u++)l[u]&&t.skipBits(88),c[u]&&t.skipBits(8);return{general_profile_space:r,general_tier_flag:n,general_profile_idc:i,general_profile_compatibility_flags:s,general_constraint_indicator_flags:a,general_level_idc:o}},GYe=t=>{for(let e=0;e<4;e++)for(let r=0;r<(e===3?2:6);r++)if(!t.readBits(1))ye(t);else{let i=Math.min(64,1<<4+(e<<1));e>1&&mv(t);for(let s=0;s<i;s++)mv(t)}},WYe=(t,e)=>{let r=[];for(let n=0;n<e;n++)r[n]=KYe(t,n,e,r)},KYe=(t,e,r,n)=>{let i=0,s=0,a=0;if(e!==0&&(s=t.readBits(1)),s){if(e===r){let l=ye(t);a=e-(l+1)}else a=e-1;t.readBits(1),ye(t);let o=n[a]??0;for(let l=0;l<=o;l++)t.readBits(1)||t.readBits(1);i=n[a]}else{let o=ye(t),l=ye(t);for(let c=0;c<o;c++)ye(t),t.readBits(1);for(let c=0;c<l;c++)ye(t),t.readBits(1);i=o+l}return i},YYe=(t,e)=>{if(t.readBits(1)&&t.readBits(8)===255&&(t.readBits(16),t.readBits(16)),t.readBits(1)&&t.readBits(1),t.readBits(1)&&(t.readBits(3),t.readBits(1),t.readBits(1)&&(t.readBits(8),t.readBits(8),t.readBits(8))),t.readBits(1)&&(ye(t),ye(t)),t.readBits(1),t.readBits(1),t.readBits(1),t.readBits(1)&&(ye(t),ye(t),ye(t),ye(t)),t.readBits(1)&&(t.readBits(32),t.readBits(32),t.readBits(1)&&ye(t),t.readBits(1)&&XYe(t,!0,e)),t.readBits(1)){t.readBits(1),t.readBits(1),t.readBits(1);let r=ye(t);return ye(t),ye(t),ye(t),ye(t),r}return 0},XYe=(t,e,r)=>{let n=!1,i=!1,s=!1;e&&(n=t.readBits(1)===1,i=t.readBits(1)===1,(n||i)&&(s=t.readBits(1)===1,s&&(t.readBits(8),t.readBits(5),t.readBits(1),t.readBits(5)),t.readBits(4),t.readBits(4),s&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5)));for(let a=0;a<=r;a++){let o=t.readBits(1)===1,l=!0;o||(l=t.readBits(1)===1);let c=!1;l?ye(t):c=t.readBits(1)===1;let u=1;c||(u=ye(t)+1),n&&yve(t,u,s),i&&yve(t,u,s)}},yve=(t,e,r)=>{for(let n=0;n<e;n++)ye(t),ye(t),r&&(ye(t),ye(t)),t.readBits(1)};var l3=t=>{let e=new Ht(t);if(e.readBits(2)!==2)return null;let n=e.readBits(1),s=(e.readBits(1)<<1)+n;if(s===3&&e.skipBits(1),e.readBits(1)===1||e.readBits(1)!==0||(e.skipBits(2),e.readBits(24)!==4817730))return null;let c=8;s>=2&&(c=e.readBits(1)?12:10);let u=e.readBits(3),d=0,f=0;if(u!==7)if(f=e.readBits(1),s===1||s===3){let S=e.readBits(1),T=e.readBits(1);d=!S&&!T?3:S&&!T?2:1,e.skipBits(1)}else d=1;else d=3,f=1;let p=e.readBits(16),h=e.readBits(16),m=p+1,v=h+1,b=m*v,y=Li(Mh).level;for(let O of Mh)if(b<=O.maxPictureSize){y=O.level;break}return{profile:s,level:y,bitDepth:c,chromaSubsampling:d,videoFullRangeFlag:f,colourPrimaries:u===2?1:u===1?6:2,transferCharacteristics:u===2?1:u===1?6:2,matrixCoefficients:u===7?0:u===2?1:u===1?6:2}},wve=function*(t){let e=new Ht(t),r=()=>{let n=0;for(let i=0;i<8;i++){let s=e.readAlignedByte();if(n|=(s&127)<<i*7,!(s&128))break;if(i===7&&s&128)return null}return n>=2**32-1?null:n};for(;e.getBitsLeft()>=8;){e.skipBits(1);let n=e.readBits(4),i=e.readBits(1),s=e.readBits(1);e.skipBits(1),i&&e.skipBits(8);let a;if(s){let o=r();if(o===null)return;a=o}else a=Math.floor(e.getBitsLeft()/8);F(e.pos%8===0),yield{type:n,data:t.subarray(e.pos/8,e.pos/8+a)},e.skipBits(a*8)}},c3=t=>{for(let{type:e,data:r}of wve(t)){if(e!==1)continue;let n=new Ht(r),i=n.readBits(3),s=n.readBits(1),a=n.readBits(1),o=0,l=0,c=0;if(a)o=n.readBits(5);else{if(n.readBits(1)&&(n.skipBits(32),n.skipBits(32),n.readBits(1)))return null;let b=n.readBits(1);b&&(c=n.readBits(5),n.skipBits(32),n.skipBits(5),n.skipBits(5));let y=n.readBits(5);for(let x=0;x<=y;x++){n.skipBits(12);let w=n.readBits(5);if(x===0&&(o=w),w>7){let O=n.readBits(1);x===0&&(l=O)}if(b&&n.readBits(1)){let S=c+1;n.skipBits(S),n.skipBits(S),n.skipBits(1)}n.readBits(1)&&n.skipBits(4)}}let u=n.readBits(1),d=8;i===2&&u?d=n.readBits(1)?12:10:i<=2&&(d=u?10:8);let f=0;i!==1&&(f=n.readBits(1));let p=1,h=1,m=0;return f||(i===0?(p=1,h=1):i===1?(p=0,h=0):d===12&&(p=n.readBits(1),p&&(h=n.readBits(1))),p&&h&&(m=n.readBits(2))),{profile:i,level:o,tier:l,bitDepth:d,monochrome:f,chromaSubsamplingX:p,chromaSubsamplingY:h,chromaSamplePosition:m}}return null},kve=t=>{let e=fr(t),r=e.getUint8(9),n=e.getUint16(10,!0),i=e.getUint32(12,!0),s=e.getInt16(16,!0),a=e.getUint8(18),o=null;return a&&(o=t.subarray(19,21+r)),{outputChannelCount:r,preSkip:n,inputSampleRate:i,outputGain:s,channelMappingFamily:a,channelMappingTable:o}},QYe=[480,960,1920,2880,480,960,1920,2880,480,960,1920,2880,480,960,480,960,120,240,480,960,120,240,480,960,120,240,480,960,120,240,480,960],Sve=t=>{let e=t[0]>>3;return{durationInSamples:QYe[e]}},Cve=t=>{if(t.length<7)throw new Error("Setup header is too short.");if(t[0]!==5)throw new Error("Wrong packet type in Setup header.");if(String.fromCharCode(...t.slice(1,7))!=="vorbis")throw new Error("Invalid packet signature in Setup header.");let r=t.length,n=new Uint8Array(r);for(let d=0;d<r;d++)n[d]=t[r-1-d];let i=new Ht(n),s=0;for(;i.getBitsLeft()>97;)if(i.readBits(1)===1){s=i.pos;break}if(s===0)throw new Error("Invalid Setup header: framing bit not found.");let a=0,o=!1,l=0;for(;i.getBitsLeft()>=97;){let d=i.pos,f=i.readBits(8),p=i.readBits(16),h=i.readBits(16);if(f>63||p!==0||h!==0){i.pos=d;break}if(i.skipBits(1),a++,a>64)break;i.clone().readBits(6)+1===a&&(o=!0,l=a)}if(!o)throw new Error("Invalid Setup header: mode header not found.");if(l>63)throw new Error(`Unsupported mode count: ${l}.`);let c=l;i.pos=0,i.skipBits(s);let u=Array(c).fill(0);for(let d=c-1;d>=0;d--)i.skipBits(40),u[d]=i.readBits(1);return{modeBlockflags:u}},Tve=async(t,e)=>{switch(F(t.codec),t.codec){case"avc":{let r=await t.getDecoderConfig();return F(r),zYe(e.data,r).some(s=>a3(s)===gv.IDR)?"key":"delta"}case"hevc":{let r=await t.getDecoderConfig();return F(r),qYe(e.data,r).some(s=>{let a=Oh(s);return Va.BLA_W_LP<=a&&a<=Va.RSV_IRAP_VCL23})?"key":"delta"}case"vp8":return(e.data[0]&1)===0?"key":"delta";case"vp9":{let r=new Ht(e.data);if(r.readBits(2)!==2)return null;let n=r.readBits(1);return(r.readBits(1)<<1)+n===3&&r.skipBits(1),r.readBits(1)?null:r.readBits(1)===0?"key":"delta"}case"av1":{let r=!1;for(let{type:n,data:i}of wve(e.data))if(n===1){let s=new Ht(i);s.skipBits(4),r=!!s.readBits(1)}else if(n===3||n===6||n===7){if(r)return"key";let s=new Ht(i);return s.readBits(1)?null:s.readBits(2)===0?"key":"delta"}return null}default:Qd(t.codec),F(!1)}},Jd;(function(t){t[t.STREAMINFO=0]="STREAMINFO",t[t.VORBIS_COMMENT=4]="VORBIS_COMMENT",t[t.PICTURE=6]="PICTURE"})(Jd||(Jd={}));var ES=(t,e)=>{let r=fr(t),n=0,i=r.getUint32(n,!0);n+=4;let s=kn.decode(t.subarray(n,n+i));n+=i,i>0&&(e.raw??={},e.raw.vendor??=s);let a=r.getUint32(n,!0);n+=4;for(let o=0;o<a;o++){let l=r.getUint32(n,!0);n+=4;let c=kn.decode(t.subarray(n,n+l));n+=l;let u=c.indexOf("=");if(u===-1)continue;let d=c.slice(0,u).toUpperCase(),f=c.slice(u+1);switch(e.raw??={},e.raw[d]??=f,d){case"TITLE":e.title??=f;break;case"DESCRIPTION":e.description??=f;break;case"ARTIST":e.artist??=f;break;case"ALBUM":e.album??=f;break;case"ALBUMARTIST":e.albumArtist??=f;break;case"COMMENT":e.comment??=f;break;case"LYRICS":e.lyrics??=f;break;case"TRACKNUMBER":{let p=f.split("/"),h=Number.parseInt(p[0],10),m=p[1]&&Number.parseInt(p[1],10);Number.isInteger(h)&&h>0&&(e.trackNumber??=h),m&&Number.isInteger(m)&&m>0&&(e.tracksTotal??=m)}break;case"TRACKTOTAL":{let p=Number.parseInt(f,10);Number.isInteger(p)&&p>0&&(e.tracksTotal??=p)}break;case"DISCNUMBER":{let p=f.split("/"),h=Number.parseInt(p[0],10),m=p[1]&&Number.parseInt(p[1],10);Number.isInteger(h)&&h>0&&(e.discNumber??=h),m&&Number.isInteger(m)&&m>0&&(e.discsTotal??=m)}break;case"DISCTOTAL":{let p=Number.parseInt(f,10);Number.isInteger(p)&&p>0&&(e.discsTotal??=p)}break;case"DATE":{let p=new Date(f);Number.isNaN(p.getTime())||(e.date??=p)}break;case"GENRE":e.genre??=f;break;case"METADATA_BLOCK_PICTURE":{let p=pve(f),h=fr(p),m=h.getUint32(0,!1),v=h.getUint32(4,!1),b=String.fromCharCode(...p.subarray(8,8+v)),y=h.getUint32(8+v,!1),x=kn.decode(p.subarray(12+v,12+v+y)),w=h.getUint32(v+y+28),C=p.subarray(v+y+32,v+y+32+w);e.images??=[],e.images.push({data:C,mimeType:b,kind:m===3?"coverFront":m===4?"coverBack":"unknown",name:void 0,description:x||void 0})}break}}};var ai=class{constructor(e){this.input=e}};var Eve=[],Ive=[];var Cn=new Uint8Array(0),ir=class t{constructor(e,r,n,i,s=-1,a){if(this.data=e,this.type=r,this.timestamp=n,this.duration=i,this.sequenceNumber=s,e===Cn&&a===void 0)throw new Error("Internal error: byteLength must be explicitly provided when constructing metadata-only packets.");if(a===void 0&&(a=e.byteLength),!(e instanceof Uint8Array))throw new TypeError("data must be a Uint8Array.");if(r!=="key"&&r!=="delta")throw new TypeError('type must be either "key" or "delta".');if(!Number.isFinite(n))throw new TypeError("timestamp must be a number.");if(!Number.isFinite(i)||i<0)throw new TypeError("duration must be a non-negative number.");if(!Number.isFinite(s))throw new TypeError("sequenceNumber must be a number.");if(!Number.isInteger(a)||a<0)throw new TypeError("byteLength must be a non-negative integer.");this.byteLength=a}get isMetadataOnly(){return this.data===Cn}get microsecondTimestamp(){return Math.trunc(Uj*this.timestamp)}get microsecondDuration(){return Math.trunc(Uj*this.duration)}toEncodedVideoChunk(){if(this.isMetadataOnly)throw new TypeError("Metadata-only packets cannot be converted to a video chunk.");if(typeof EncodedVideoChunk>"u")throw new Error("Your browser does not support EncodedVideoChunk.");return new EncodedVideoChunk({data:this.data,type:this.type,timestamp:this.microsecondTimestamp,duration:this.microsecondDuration})}toEncodedAudioChunk(){if(this.isMetadataOnly)throw new TypeError("Metadata-only packets cannot be converted to an audio chunk.");if(typeof EncodedAudioChunk>"u")throw new Error("Your browser does not support EncodedAudioChunk.");return new EncodedAudioChunk({data:this.data,type:this.type,timestamp:this.microsecondTimestamp,duration:this.microsecondDuration})}static fromEncodedChunk(e){if(!(e instanceof EncodedVideoChunk||e instanceof EncodedAudioChunk))throw new TypeError("chunk must be an EncodedVideoChunk or EncodedAudioChunk.");let r=new Uint8Array(e.byteLength);return e.copyTo(r),new t(r,e.type,e.timestamp/1e6,(e.duration??0)/1e6)}clone(e){if(e!==void 0&&(typeof e!="object"||e===null))throw new TypeError("options, when provided, must be an object.");if(e?.timestamp!==void 0&&!Number.isFinite(e.timestamp))throw new TypeError("options.timestamp, when provided, must be a number.");if(e?.duration!==void 0&&!Number.isFinite(e.duration))throw new TypeError("options.duration, when provided, must be a number.");return new t(this.data,this.type,e?.timestamp??this.timestamp,e?.duration??this.duration,this.sequenceNumber,this.byteLength)}};var yv=t=>{if(!t||typeof t!="object")throw new TypeError("options must be an object.");if(t.metadataOnly!==void 0&&typeof t.metadataOnly!="boolean")throw new TypeError("options.metadataOnly, when defined, must be a boolean.");if(t.verifyKeyPackets!==void 0&&typeof t.verifyKeyPackets!="boolean")throw new TypeError("options.verifyKeyPackets, when defined, must be a boolean.");if(t.verifyKeyPackets&&t.metadataOnly)throw new TypeError("options.verifyKeyPackets and options.metadataOnly cannot be enabled together.")},Ave=t=>{if(typeof t!="number"||Number.isNaN(t))throw new TypeError("timestamp must be a number.")},Kj=(t,e,r)=>r.verifyKeyPackets?e.then(async n=>{if(!n||n.type==="delta")return n;let i=await t.determinePacketType(n);return i&&(n.type=i),n}):e,u3=class{constructor(e){if(!(e instanceof vv))throw new TypeError("track must be an InputTrack.");this._track=e}getFirstPacket(e={}){if(yv(e),this._track.input._disposed)throw new zn;return Kj(this._track,this._track._backing.getFirstPacket(e),e)}getPacket(e,r={}){if(Ave(e),yv(r),this._track.input._disposed)throw new zn;return Kj(this._track,this._track._backing.getPacket(e,r),r)}getNextPacket(e,r={}){if(!(e instanceof ir))throw new TypeError("packet must be an EncodedPacket.");if(yv(r),this._track.input._disposed)throw new zn;return Kj(this._track,this._track._backing.getNextPacket(e,r),r)}async getKeyPacket(e,r={}){if(Ave(e),yv(r),this._track.input._disposed)throw new zn;if(!r.verifyKeyPackets)return this._track._backing.getKeyPacket(e,r);let n=await this._track._backing.getKeyPacket(e,r);return!n||n.type==="delta"?n:await this._track.determinePacketType(n)==="delta"?this.getKeyPacket(n.timestamp-1/this._track.timeResolution,r):n}async getNextKeyPacket(e,r={}){if(!(e instanceof ir))throw new TypeError("packet must be an EncodedPacket.");if(yv(r),this._track.input._disposed)throw new zn;if(!r.verifyKeyPackets)return this._track._backing.getNextKeyPacket(e,r);let n=await this._track._backing.getNextKeyPacket(e,r);return!n||n.type==="delta"?n:await this._track.determinePacketType(n)==="delta"?this.getNextKeyPacket(n,r):n}packets(e,r,n={}){if(e!==void 0&&!(e instanceof ir))throw new TypeError("startPacket must be an EncodedPacket.");if(e!==void 0&&e.isMetadataOnly&&!n?.metadataOnly)throw new TypeError("startPacket can only be metadata-only if options.metadataOnly is enabled.");if(r!==void 0&&!(r instanceof ir))throw new TypeError("endPacket must be an EncodedPacket.");if(yv(n),this._track.input._disposed)throw new zn;let i=[],{promise:s,resolve:a}=Ph(),{promise:o,resolve:l}=Ph(),c=!1,u=!1,d=null,f=[],p=()=>Math.max(2,f.length);(async()=>{let m=e??await this.getFirstPacket(n);for(;m&&!u&&!this._track.input._disposed&&!(r&&m.sequenceNumber>=r?.sequenceNumber);){if(i.length>p()){({promise:o,resolve:l}=Ph()),await o;continue}i.push(m),a(),{promise:s,resolve:a}=Ph(),m=await this.getNextPacket(m,n)}c=!0,a()})().catch(m=>{d||(d=m,a())});let h=this._track;return{async next(){for(;;){if(h.input._disposed)throw new zn;if(u)return{value:void 0,done:!0};if(d)throw d;if(i.length>0){let m=i.shift(),v=performance.now();for(f.push(v);f.length>0&&v-f[0]>=1e3;)f.shift();return l(),{value:m,done:!1}}else{if(c)return{value:void 0,done:!0};await s}}},async return(){return u=!0,l(),a(),{value:void 0,done:!0}},async throw(m){throw m},[Symbol.asyncIterator](){return this}}}};var vv=class{constructor(e,r){this.input=e,this._backing=r}isVideoTrack(){return this instanceof ef}isAudioTrack(){return this instanceof Tn}get id(){return this._backing.getId()}get internalCodecId(){return this._backing.getInternalCodecId()}get languageCode(){return this._backing.getLanguageCode()}get name(){return this._backing.getName()}get timeResolution(){return this._backing.getTimeResolution()}getFirstTimestamp(){return this._backing.getFirstTimestamp()}computeDuration(){return this._backing.computeDuration()}async computePacketStats(e=1/0){let r=new u3(this),n=1/0,i=-1/0,s=0,a=0;for await(let o of r.packets(void 0,void 0,{metadataOnly:!0})){if(s>=e&&o.timestamp>=i)break;n=Math.min(n,o.timestamp),i=Math.max(i,o.timestamp+o.duration),s++,a+=o.byteLength}return{packetCount:s,averagePacketRate:s?Number((s/(i-n)).toPrecision(16)):0,averageBitrate:s?Number((8*a/(i-n)).toPrecision(16)):0}}},ef=class extends vv{constructor(e,r){super(e,r),this._backing=r}get type(){return"video"}get codec(){return this._backing.getCodec()}get codedWidth(){return this._backing.getCodedWidth()}get codedHeight(){return this._backing.getCodedHeight()}get rotation(){return this._backing.getRotation()}get displayWidth(){return this._backing.getRotation()%180===0?this._backing.getCodedWidth():this._backing.getCodedHeight()}get displayHeight(){return this._backing.getRotation()%180===0?this._backing.getCodedHeight():this._backing.getCodedWidth()}getColorSpace(){return this._backing.getColorSpace()}async hasHighDynamicRange(){let e=await this._backing.getColorSpace();return e.primaries==="bt2020"||e.primaries==="smpte432"||e.transfer==="pg"||e.transfer==="hlg"||e.matrix==="bt2020-ncl"}getDecoderConfig(){return this._backing.getDecoderConfig()}async getCodecParameterString(){return(await this._backing.getDecoderConfig())?.codec??null}async canDecode(){try{let e=await this._backing.getDecoderConfig();if(!e)return!1;let r=this._backing.getCodec();return F(r!==null),Eve.some(i=>i.supports(r,e))?!0:typeof VideoDecoder>"u"?!1:(await VideoDecoder.isConfigSupported(e)).supported===!0}catch(e){return console.error("Error during decodability check:",e),!1}}async determinePacketType(e){if(!(e instanceof ir))throw new TypeError("packet must be an EncodedPacket.");if(e.isMetadataOnly)throw new TypeError("packet must not be metadata-only to determine its type.");return this.codec===null?null:Tve(this,e)}},Tn=class extends vv{constructor(e,r){super(e,r),this._backing=r}get type(){return"audio"}get codec(){return this._backing.getCodec()}get numberOfChannels(){return this._backing.getNumberOfChannels()}get sampleRate(){return this._backing.getSampleRate()}getDecoderConfig(){return this._backing.getDecoderConfig()}async getCodecParameterString(){return(await this._backing.getDecoderConfig())?.codec??null}async canDecode(){try{let e=await this._backing.getDecoderConfig();if(!e)return!1;let r=this._backing.getCodec();return F(r!==null),Ive.some(n=>n.supports(r,e))||e.codec.startsWith("pcm-")?!0:typeof AudioDecoder>"u"?!1:(await AudioDecoder.isConfigSupported(e)).supported===!0}catch(e){return console.error("Error during decodability check:",e),!1}}async determinePacketType(e){if(!(e instanceof ir))throw new TypeError("packet must be an EncodedPacket.");return this.codec===null?null:"key"}};var Pve=t=>{let r=(t.hasVideo?"video/":t.hasAudio?"audio/":"application/")+(t.isQuickTime?"quicktime":"mp4");if(t.codecStrings.length>0){let n=[...new Set(t.codecStrings)];r+=`; codecs="${n.join(", ")}"`}return r};var Zc=8,Dh=16,Ml=t=>{let e=ie(t),r=br(t,4),n=8;e===1&&(e=Xs(t),n=16);let s=e-n;return s<0?null:{name:r,totalSize:e,headerSize:n,contentSize:s}},tf=t=>Jc(t)/65536,d3=t=>Jc(t)/1073741824,f3=t=>{let e=0;for(let r=0;r<4;r++){e<<=7;let n=ge(t);if(e|=n&127,(n&128)===0)break}return e},Do=t=>{let e=on(t);return t.skip(2),kn.decode(xe(t,e))},Rve=t=>{let e=Ml(t);if(!e||e.name!=="data")return null;let r=ie(t);t.skip(4);let n=xe(t,e.contentSize-8);switch(r){case 1:return kn.decode(n);case 2:return new TextDecoder("utf-16be").decode(n);case 13:return new Zd(n,"image/jpeg");case 14:return new Zd(n,"image/png");case 27:return new Zd(n,"image/bmp");default:return n}};var ZYe=new Set(["@day","@mak","@mod","@swr","@xyz","CAME","CNCV","CNFV","CNMN","FIRM","FOV\0","GoPr","LENS","PXMN","SIGM","SNum","TAGS","albm","albr","angl","auth","ccid","cdis","clfn","clid","clsf","cmid","cmnm","coll","cprt","cver","cvru","date","dscp","fsid","gnre","hinv","icnu","info","infu","kgtt","loci","lrcu","mcvr","name","perf","pmcc","reel","rtng","scen","shot","slno","thmb","titl","tnam","urat","uuid","vndr","yrrc","\xA9ART","\xA9TIM","\xA9TSC","\xA9TSZ","\xA9alb","\xA9arg","\xA9ark","\xA9cmt","\xA9cok","\xA9com","\xA9cpy","\xA9day","\xA9dir","\xA9ed1","\xA9ed2","\xA9ed3","\xA9ed4","\xA9ed5","\xA9ed6","\xA9ed7","\xA9ed8","\xA9ed9","\xA9enc","\xA9fmt","\xA9fpt","\xA9frl","\xA9fyw","\xA9gen","\xA9gpt","\xA9grl","\xA9grp","\xA9gyw","\xA9inf","\xA9isr","\xA9lab","\xA9lal","\xA9lyr","\xA9mak","\xA9mal","\xA9mdl","\xA9mod","\xA9nam","\xA9pdk","\xA9phg","\xA9prd","\xA9prf","\xA9prk","\xA9prl","\xA9req","\xA9snk","\xA9snm","\xA9src","\xA9swf","\xA9swk","\xA9swr","\xA9too","\xA9trk","\xA9wrt","\xA9xsp","\xA9xyz","\xA9ysp","\xA9zsp"]),p3=class extends ai{constructor(e){super(e),this.moovSlice=null,this.currentTrack=null,this.tracks=[],this.metadataPromise=null,this.movieTimescale=-1,this.movieDurationInTimescale=-1,this.isQuickTime=!1,this.metadataTags={},this.currentMetadataKeys=null,this.isFragmented=!1,this.fragmentTrackDefaults=[],this.fragments=[],this.currentFragment=null,this.fragmentLookupMutex=new cs,this.reader=e._reader}async computeDuration(){let e=await this.getTracks(),r=await Promise.all(e.map(n=>n.computeDuration()));return Math.max(0,...r)}async getTracks(){return await this.readMetadata(),this.tracks.map(e=>e.inputTrack)}async getMimeType(){await this.readMetadata();let e=await Promise.all(this.tracks.map(r=>r.inputTrack.getCodecParameterString()));return Pve({isQuickTime:this.isQuickTime,hasVideo:this.tracks.some(r=>r.info?.type==="video"),hasAudio:this.tracks.some(r=>r.info?.type==="audio"),codecStrings:e.filter(Boolean)})}async getMetadataTags(){return await this.readMetadata(),this.metadataTags}readMetadata(){return this.metadataPromise??=(async()=>{let e=0;for(;;){let r=this.reader.requestSliceRange(e,Zc,Dh);if(r instanceof Promise&&(r=await r),!r)break;let n=e,i=Ml(r);if(!i)break;if(i.name==="ftyp"){let s=br(r,4);this.isQuickTime=s==="qt "}else if(i.name==="moov"){let s=this.reader.requestSlice(r.filePos,i.contentSize);if(s instanceof Promise&&(s=await s),!s)break;this.moovSlice=s,this.readContiguousBoxes(this.moovSlice);for(let a of this.tracks){let o=a.editListPreviousSegmentDurations/this.movieTimescale;a.editListOffset-=Math.round(o*a.timescale)}break}e=n+i.totalSize}if(this.isFragmented&&this.reader.fileSize!==null){let r=this.reader.requestSlice(this.reader.fileSize-4,4);r instanceof Promise&&(r=await r),F(r);let n=ie(r),i=this.reader.fileSize-n;if(i>=0&&i<=this.reader.fileSize-Dh){let s=this.reader.requestSliceRange(i,Zc,Dh);if(s instanceof Promise&&(s=await s),s){let a=Ml(s);if(a&&a.name==="mfra"){let o=this.reader.requestSlice(s.filePos,a.contentSize);o instanceof Promise&&(o=await o),o&&this.readContiguousBoxes(o)}}}}})()}getSampleTableForTrack(e){if(e.sampleTable)return e.sampleTable;let r={sampleTimingEntries:[],sampleCompositionTimeOffsets:[],sampleSizes:[],keySampleIndices:null,chunkOffsets:[],sampleToChunk:[],presentationTimestamps:null,presentationTimestampIndexMap:null};e.sampleTable=r,F(this.moovSlice);let n=this.moovSlice.slice(e.sampleTableByteOffset);if(this.currentTrack=e,this.traverseBox(n),this.currentTrack=null,e.info?.type==="audio"&&e.info.codec&&TS.includes(e.info.codec)&&r.sampleCompositionTimeOffsets.length===0){F(e.info?.type==="audio");let s=gve(e.info.codec),a=[],o=[];for(let l=0;l<r.sampleToChunk.length;l++){let c=r.sampleToChunk[l],u=r.sampleToChunk[l+1],d=(u?u.startChunkIndex:r.chunkOffsets.length)-c.startChunkIndex;for(let f=0;f<d;f++){let p=c.startSampleIndex+f*c.samplesPerChunk,h=p+c.samplesPerChunk,m=dt(r.sampleTimingEntries,p,T=>T.startIndex),v=r.sampleTimingEntries[m],b=dt(r.sampleTimingEntries,h,T=>T.startIndex),y=r.sampleTimingEntries[b],x=v.startDecodeTimestamp+(p-v.startIndex)*v.delta,C=y.startDecodeTimestamp+(h-y.startIndex)*y.delta-x,O=Li(a);O&&O.delta===C?O.count++:a.push({startIndex:c.startChunkIndex+f,startDecodeTimestamp:x,count:1,delta:C});let S=c.samplesPerChunk*s.sampleSize*e.info.numberOfChannels;o.push(S)}c.startSampleIndex=c.startChunkIndex,c.samplesPerChunk=1}r.sampleTimingEntries=a,r.sampleSizes=o}if(r.sampleCompositionTimeOffsets.length>0){r.presentationTimestamps=[];for(let s of r.sampleTimingEntries)for(let a=0;a<s.count;a++)r.presentationTimestamps.push({presentationTimestamp:s.startDecodeTimestamp+a*s.delta,sampleIndex:s.startIndex+a});for(let s of r.sampleCompositionTimeOffsets)for(let a=0;a<s.count;a++){let o=s.startIndex+a,l=r.presentationTimestamps[o];l&&(l.presentationTimestamp+=s.offset)}r.presentationTimestamps.sort((s,a)=>s.presentationTimestamp-a.presentationTimestamp),r.presentationTimestampIndexMap=Array(r.presentationTimestamps.length).fill(-1);for(let s=0;s<r.presentationTimestamps.length;s++)r.presentationTimestampIndexMap[r.presentationTimestamps[s].sampleIndex]=s}return r}async readFragment(e){let r=this.reader.requestSliceRange(e,Zc,Dh);r instanceof Promise&&(r=await r),F(r);let n=Ml(r);F(n?.name==="moof");let i=this.reader.requestSlice(e,n.totalSize);i instanceof Promise&&(i=await i),F(i),this.traverseBox(i);let s=vr(this.fragments,e,o=>o.moofOffset);F(s!==-1);let a=this.fragments[s];F(a.moofOffset===e);for(let[o,l]of a.trackData){if(l.startTimestampIsFinal)continue;let c=this.tracks.find(m=>m.id===o),u=0,d=null,f=null,p=dt(c.fragments,e-1,m=>m.moofOffset);p!==-1&&(d=c.fragments[p],f=d,u=d.moofOffset+d.moofSize);let h=u===0;for(;u<=e-Zc;){if(d?.nextFragment)d=d.nextFragment,u=d.moofOffset+d.moofSize;else{let m=this.reader.requestSliceRange(u,Zc,Dh);if(m instanceof Promise&&(m=await m),!m)break;let v=u,b=Ml(m);if(!b)break;if(b.name==="moof"){let y=vr(this.fragments,v,w=>w.moofOffset),x;y===-1?x=await this.readFragment(v):x=this.fragments[y],d&&(d.nextFragment=x),d=x,h&&(x.isKnownToBeFirstFragment=!0,h=!1)}u=v+b.totalSize}d&&d.trackData.has(o)&&(f=d)}if(f){let m=f.trackData.get(o);F(m.startTimestampIsFinal),Mve(l,m.endTimestamp)}l.startTimestampIsFinal=!0}return a}readContiguousBoxes(e){let r=e.filePos;for(;e.filePos-r<=e.length-Zc&&this.traverseBox(e););}*iterateContiguousBoxes(e){let r=e.filePos;for(;e.filePos-r<=e.length-Zc;){let n=e.filePos,i=Ml(e);if(!i)break;yield{boxInfo:i,slice:e},e.filePos=n+i.totalSize}}traverseBox(e){let r=e.filePos,n=Ml(e);if(!n)return!1;let i=e.filePos,s=r+n.totalSize;switch(n.name){case"mdia":case"minf":case"dinf":case"mfra":case"edts":this.readContiguousBoxes(e.slice(i,n.contentSize));break;case"mvhd":{let a=ge(e);e.skip(3),a===1?(e.skip(16),this.movieTimescale=ie(e),this.movieDurationInTimescale=Xs(e)):(e.skip(8),this.movieTimescale=ie(e),this.movieDurationInTimescale=ie(e))}break;case"trak":{let a={id:-1,demuxer:this,inputTrack:null,info:null,timescale:-1,durationInMovieTimescale:-1,durationInMediaTimescale:-1,rotation:0,internalCodecId:null,name:null,languageCode:Sn,sampleTableByteOffset:-1,sampleTable:null,fragmentLookupTable:null,currentFragmentState:null,fragments:[],fragmentsWithKeyFrame:[],editListPreviousSegmentDurations:0,editListOffset:0};if(this.currentTrack=a,this.readContiguousBoxes(e.slice(i,n.contentSize)),a.id!==-1&&a.timescale!==-1&&a.info!==null){if(a.info.type==="video"&&a.info.width!==-1){let o=a;a.inputTrack=new ef(this.input,new Yj(o)),this.tracks.push(a)}else if(a.info.type==="audio"&&a.info.numberOfChannels!==-1){let o=a;a.inputTrack=new Tn(this.input,new Xj(o)),this.tracks.push(a)}}this.currentTrack=null}break;case"tkhd":{let a=this.currentTrack;if(!a)break;let o=ge(e);if(!((rf(e)&1)!==0))break;if(o===0)e.skip(8),a.id=ie(e),e.skip(4),a.durationInMovieTimescale=ie(e);else if(o===1)e.skip(16),a.id=ie(e),e.skip(4),a.durationInMovieTimescale=Xs(e);else throw new Error(`Incorrect track header version ${o}.`);e.skip(2*4+2+2+2+2);let u=[tf(e),tf(e),d3(e),tf(e),tf(e),d3(e),tf(e),tf(e),d3(e)],d=XL(dve(rXe(u),90));F(d===0||d===90||d===180||d===270),a.rotation=d}break;case"elst":{let a=this.currentTrack;if(!a)break;let o=ge(e);e.skip(3);let l=!1,c=0,u=ie(e);for(let d=0;d<u;d++){let f=o===1?Xs(e):ie(e),p=o===1?Ove(e):Jc(e),h=tf(e);if(f!==0){if(l){console.warn("Unsupported edit list: multiple edits are not currently supported. Only using first edit.");break}if(p===-1){c+=f;continue}if(h!==1){console.warn("Unsupported edit list entry: media rate must be 1.");break}a.editListPreviousSegmentDurations=c,a.editListOffset=p,l=!0}}}break;case"mdhd":{let a=this.currentTrack;if(!a)break;let o=ge(e);e.skip(3),o===0?(e.skip(8),a.timescale=ie(e),a.durationInMediaTimescale=ie(e)):o===1&&(e.skip(16),a.timescale=ie(e),a.durationInMediaTimescale=Xs(e));let l=on(e);if(l>0){a.languageCode="";for(let c=0;c<3;c++)a.languageCode=String.fromCharCode(96+(l&31))+a.languageCode,l>>=5;t3(a.languageCode)||(a.languageCode=Sn)}}break;case"hdlr":{let a=this.currentTrack;if(!a)break;e.skip(8);let o=br(e,4);o==="vide"?a.info={type:"video",width:-1,height:-1,codec:null,codecDescription:null,colorSpace:null,avcCodecInfo:null,hevcCodecInfo:null,vp9CodecInfo:null,av1CodecInfo:null}:o==="soun"&&(a.info={type:"audio",numberOfChannels:-1,sampleRate:-1,codec:null,codecDescription:null,aacCodecInfo:null})}break;case"stbl":{let a=this.currentTrack;if(!a)break;a.sampleTableByteOffset=r,this.readContiguousBoxes(e.slice(i,n.contentSize))}break;case"stsd":{let a=this.currentTrack;if(!a||a.info===null||a.sampleTable)break;let o=ge(e);e.skip(3);let l=ie(e);for(let c=0;c<l;c++){let u=e.filePos,d=Ml(e);if(!d)break;a.internalCodecId=d.name;let f=d.name.toLowerCase();if(a.info.type==="video")f==="avc1"?a.info.codec="avc":f==="hvc1"||f==="hev1"?a.info.codec="hevc":f==="vp08"?a.info.codec="vp8":f==="vp09"?a.info.codec="vp9":f==="av01"?a.info.codec="av1":console.warn(`Unsupported video codec (sample entry type '${d.name}').`),e.skip(6*1+2+2+2+3*4),a.info.width=on(e),a.info.height=on(e),e.skip(50),this.readContiguousBoxes(e.slice(e.filePos,u+d.totalSize-e.filePos));else{f==="mp4a"||(f==="opus"?a.info.codec="opus":f==="flac"?a.info.codec="flac":f==="twos"||f==="sowt"||f==="raw "||f==="in24"||f==="in32"||f==="fl32"||f==="fl64"||f==="lpcm"||f==="ipcm"||f==="fpcm"||(f==="ulaw"?a.info.codec="ulaw":f==="alaw"?a.info.codec="alaw":console.warn(`Unsupported audio codec (sample entry type '${d.name}').`))),e.skip(6*1+2);let p=on(e);e.skip(3*2);let h=on(e),m=on(e);e.skip(2*2);let v=ie(e)/65536;if(o===0&&p>0){if(p===1)e.skip(4),m=8*ie(e),e.skip(2*4);else if(p===2){e.skip(4),v=m3(e),h=ie(e),e.skip(4),m=ie(e);let b=ie(e);if(e.skip(2*4),f==="lpcm"){let y=m+7>>3,x=!!(b&1),w=!!(b&2),C=b&4?-1:0;m>0&&m<=64&&(x?m===32&&(a.info.codec=w?"pcm-f32be":"pcm-f32"):C&1<<y-1?y===1?a.info.codec="pcm-s8":y===2?a.info.codec=w?"pcm-s16be":"pcm-s16":y===3?a.info.codec=w?"pcm-s24be":"pcm-s24":y===4&&(a.info.codec=w?"pcm-s32be":"pcm-s32"):y===1&&(a.info.codec="pcm-u8")),a.info.codec===null&&console.warn("Unsupported PCM format.")}}}a.info.codec==="opus"&&(v=_h),a.info.numberOfChannels=h,a.info.sampleRate=v,f==="twos"?m===8?a.info.codec="pcm-s8":m===16?a.info.codec="pcm-s16be":(console.warn(`Unsupported sample size ${m} for codec 'twos'.`),a.info.codec=null):f==="sowt"?m===8?a.info.codec="pcm-s8":m===16?a.info.codec="pcm-s16":(console.warn(`Unsupported sample size ${m} for codec 'sowt'.`),a.info.codec=null):f==="raw "?a.info.codec="pcm-u8":f==="in24"?a.info.codec="pcm-s24be":f==="in32"?a.info.codec="pcm-s32be":f==="fl32"?a.info.codec="pcm-f32be":f==="fl64"?a.info.codec="pcm-f64be":f==="ipcm"?a.info.codec="pcm-s16be":f==="fpcm"&&(a.info.codec="pcm-f32be"),this.readContiguousBoxes(e.slice(e.filePos,u+d.totalSize-e.filePos))}}}break;case"avcC":{let a=this.currentTrack;if(!a)break;F(a.info),a.info.codecDescription=xe(e,n.contentSize)}break;case"hvcC":{let a=this.currentTrack;if(!a)break;F(a.info),a.info.codecDescription=xe(e,n.contentSize)}break;case"vpcC":{let a=this.currentTrack;if(!a)break;F(a.info?.type==="video"),e.skip(4);let o=ge(e),l=ge(e),c=ge(e),u=c>>4,d=c>>1&7,f=c&1,p=ge(e),h=ge(e),m=ge(e);a.info.vp9CodecInfo={profile:o,level:l,bitDepth:u,chromaSubsampling:d,videoFullRangeFlag:f,colourPrimaries:p,transferCharacteristics:h,matrixCoefficients:m}}break;case"av1C":{let a=this.currentTrack;if(!a)break;F(a.info?.type==="video"),e.skip(1);let o=ge(e),l=o>>5,c=o&31,u=ge(e),d=u>>7,f=u>>6&1,p=u>>5&1,h=u>>4&1,m=u>>3&1,v=u>>2&1,b=u&3,y=l===2&&f?p?12:10:f?10:8;a.info.av1CodecInfo={profile:l,level:c,tier:d,bitDepth:y,monochrome:h,chromaSubsamplingX:m,chromaSubsamplingY:v,chromaSamplePosition:b}}break;case"colr":{let a=this.currentTrack;if(!a||(F(a.info?.type==="video"),br(e,4)!=="nclx"))break;let l=on(e),c=on(e),u=on(e),d=!!(ge(e)&128);a.info.colorSpace={primaries:QL[l],transfer:ZL[c],matrix:JL[u],fullRange:d}}break;case"wave":this.readContiguousBoxes(e.slice(i,n.contentSize));break;case"esds":{let a=this.currentTrack;if(!a)break;F(a.info?.type==="audio"),e.skip(4);let o=ge(e);F(o===3),f3(e),e.skip(2);let l=ge(e),c=(l&128)!==0,u=(l&64)!==0,d=(l&32)!==0;if(c&&e.skip(2),u){let v=ge(e);e.skip(v)}d&&e.skip(2);let f=ge(e);F(f===4);let p=f3(e),h=e.filePos,m=ge(e);if(m===64||m===103?(a.info.codec="aac",a.info.aacCodecInfo={isMpeg2:m===103}):m===105||m===107?a.info.codec="mp3":m===221?a.info.codec="vorbis":console.warn(`Unsupported audio codec (objectTypeIndication ${m}) - discarding track.`),e.skip(12),p>e.filePos-h){let v=ge(e);F(v===5);let b=f3(e);if(a.info.codecDescription=xe(e,b),a.info.codec==="aac"){let y=Gj(a.info.codecDescription);y.numberOfChannels!==null&&(a.info.numberOfChannels=y.numberOfChannels),y.sampleRate!==null&&(a.info.sampleRate=y.sampleRate)}}}break;case"enda":{let a=this.currentTrack;if(!a)break;F(a.info?.type==="audio"),on(e)&255&&(a.info.codec==="pcm-s16be"?a.info.codec="pcm-s16":a.info.codec==="pcm-s24be"?a.info.codec="pcm-s24":a.info.codec==="pcm-s32be"?a.info.codec="pcm-s32":a.info.codec==="pcm-f32be"?a.info.codec="pcm-f32":a.info.codec==="pcm-f64be"&&(a.info.codec="pcm-f64"))}break;case"pcmC":{let a=this.currentTrack;if(!a)break;F(a.info?.type==="audio"),e.skip(4);let l=!!(ge(e)&1),c=ge(e);a.info.codec==="pcm-s16be"?l?c===16?a.info.codec="pcm-s16":c===24?a.info.codec="pcm-s24":c===32?a.info.codec="pcm-s32":(console.warn(`Invalid ipcm sample size ${c}.`),a.info.codec=null):c===16?a.info.codec="pcm-s16be":c===24?a.info.codec="pcm-s24be":c===32?a.info.codec="pcm-s32be":(console.warn(`Invalid ipcm sample size ${c}.`),a.info.codec=null):a.info.codec==="pcm-f32be"&&(l?c===32?a.info.codec="pcm-f32":c===64?a.info.codec="pcm-f64":(console.warn(`Invalid fpcm sample size ${c}.`),a.info.codec=null):c===32?a.info.codec="pcm-f32be":c===64?a.info.codec="pcm-f64be":(console.warn(`Invalid fpcm sample size ${c}.`),a.info.codec=null));break}case"dOps":{let a=this.currentTrack;if(!a)break;F(a.info?.type==="audio"),e.skip(1);let o=ge(e),l=on(e),c=ie(e),u=IS(e),d=ge(e),f;d!==0?f=xe(e,2+o):f=new Uint8Array(0);let p=new Uint8Array(19+f.byteLength),h=new DataView(p.buffer);h.setUint32(0,1332770163,!1),h.setUint32(4,1214603620,!1),h.setUint8(8,1),h.setUint8(9,o),h.setUint16(10,l,!0),h.setUint32(12,c,!0),h.setInt16(16,u,!0),h.setUint8(18,d),p.set(f,19),a.info.codecDescription=p,a.info.numberOfChannels=o}break;case"dfLa":{let a=this.currentTrack;if(!a)break;F(a.info?.type==="audio"),e.skip(4);let o=127,l=128,c=e.filePos;for(;e.filePos<s;){let h=ge(e),m=rf(e);if((h&o)===Jd.STREAMINFO){e.skip(10);let b=ie(e),y=b>>>12,x=(b>>9&7)+1;a.info.sampleRate=y,a.info.numberOfChannels=x,e.skip(20)}else e.skip(m);if(h&l)break}let u=e.filePos;e.filePos=c;let d=xe(e,u-c),f=new Uint8Array(4+d.byteLength);new DataView(f.buffer).setUint32(0,1716281667,!1),f.set(d,4),a.info.codecDescription=f}break;case"stts":{let a=this.currentTrack;if(!a||!a.sampleTable)break;e.skip(4);let o=ie(e),l=0,c=0;for(let u=0;u<o;u++){let d=ie(e),f=ie(e);a.sampleTable.sampleTimingEntries.push({startIndex:l,startDecodeTimestamp:c,count:d,delta:f}),l+=d,c+=d*f}}break;case"ctts":{let a=this.currentTrack;if(!a||!a.sampleTable)break;e.skip(4);let o=ie(e),l=0;for(let c=0;c<o;c++){let u=ie(e),d=Jc(e);a.sampleTable.sampleCompositionTimeOffsets.push({startIndex:l,count:u,offset:d}),l+=u}}break;case"stsz":{let a=this.currentTrack;if(!a||!a.sampleTable)break;e.skip(4);let o=ie(e),l=ie(e);if(o===0)for(let c=0;c<l;c++){let u=ie(e);a.sampleTable.sampleSizes.push(u)}else a.sampleTable.sampleSizes.push(o)}break;case"stz2":{let a=this.currentTrack;if(!a||!a.sampleTable)break;e.skip(4),e.skip(3);let o=ge(e),l=ie(e),c=xe(e,Math.ceil(l*o/8)),u=new Ht(c);for(let d=0;d<l;d++){let f=u.readBits(o);a.sampleTable.sampleSizes.push(f)}}break;case"stss":{let a=this.currentTrack;if(!a||!a.sampleTable)break;e.skip(4),a.sampleTable.keySampleIndices=[];let o=ie(e);for(let l=0;l<o;l++){let c=ie(e)-1;a.sampleTable.keySampleIndices.push(c)}a.sampleTable.keySampleIndices[0]!==0&&a.sampleTable.keySampleIndices.unshift(0)}break;case"stsc":{let a=this.currentTrack;if(!a||!a.sampleTable)break;e.skip(4);let o=ie(e);for(let c=0;c<o;c++){let u=ie(e)-1,d=ie(e),f=ie(e);a.sampleTable.sampleToChunk.push({startSampleIndex:-1,startChunkIndex:u,samplesPerChunk:d,sampleDescriptionIndex:f})}let l=0;for(let c=0;c<a.sampleTable.sampleToChunk.length;c++)if(a.sampleTable.sampleToChunk[c].startSampleIndex=l,c<a.sampleTable.sampleToChunk.length-1){let d=a.sampleTable.sampleToChunk[c+1].startChunkIndex-a.sampleTable.sampleToChunk[c].startChunkIndex;l+=d*a.sampleTable.sampleToChunk[c].samplesPerChunk}}break;case"stco":{let a=this.currentTrack;if(!a||!a.sampleTable)break;e.skip(4);let o=ie(e);for(let l=0;l<o;l++){let c=ie(e);a.sampleTable.chunkOffsets.push(c)}}break;case"co64":{let a=this.currentTrack;if(!a||!a.sampleTable)break;e.skip(4);let o=ie(e);for(let l=0;l<o;l++){let c=Xs(e);a.sampleTable.chunkOffsets.push(c)}}break;case"mvex":this.isFragmented=!0,this.readContiguousBoxes(e.slice(i,n.contentSize));break;case"mehd":{let a=ge(e);e.skip(3);let o=a===1?Xs(e):ie(e);this.movieDurationInTimescale=o}break;case"trex":{e.skip(4);let a=ie(e),o=ie(e),l=ie(e),c=ie(e),u=ie(e);this.fragmentTrackDefaults.push({trackId:a,defaultSampleDescriptionIndex:o,defaultSampleDuration:l,defaultSampleSize:c,defaultSampleFlags:u})}break;case"tfra":{let a=ge(e);e.skip(3);let o=ie(e),l=this.tracks.find(y=>y.id===o);if(!l)break;l.fragmentLookupTable=[];let c=ie(e),u=(c&48)>>4,d=(c&12)>>2,f=c&3,p=[ge,on,rf,ie],h=p[u],m=p[d],v=p[f],b=ie(e);for(let y=0;y<b;y++){let x=a===1?Xs(e):ie(e),w=a===1?Xs(e):ie(e);h(e),m(e),v(e),l.fragmentLookupTable.push({timestamp:x,moofOffset:w})}}break;case"moof":{this.currentFragment={moofOffset:r,moofSize:n.totalSize,implicitBaseDataOffset:r,trackData:new Map,dataStart:1/0,dataEnd:0,nextFragment:null,isKnownToBeFirstFragment:!1},this.readContiguousBoxes(e.slice(i,n.contentSize)),Qc(this.fragments,this.currentFragment,a=>a.moofOffset);for(let[,a]of this.currentFragment.trackData){let o=a.samples[0],l=Li(a.samples);this.currentFragment.dataStart=Math.min(this.currentFragment.dataStart,o.byteOffset),this.currentFragment.dataEnd=Math.max(this.currentFragment.dataEnd,l.byteOffset+l.byteSize)}this.currentFragment=null}break;case"traf":if(F(this.currentFragment),this.readContiguousBoxes(e.slice(i,n.contentSize)),this.currentTrack){let a=this.currentFragment.trackData.get(this.currentTrack.id);if(a){Qc(this.currentTrack.fragments,this.currentFragment,c=>c.moofOffset),a.firstKeyFrameTimestamp!==null&&Qc(this.currentTrack.fragmentsWithKeyFrame,this.currentFragment,c=>c.moofOffset);let{currentFragmentState:l}=this.currentTrack;F(l),l.startTimestamp!==null&&(Mve(a,l.startTimestamp),a.startTimestampIsFinal=!0)}this.currentTrack.currentFragmentState=null,this.currentTrack=null}break;case"tfhd":{F(this.currentFragment),e.skip(1);let a=rf(e),o=!!(a&1),l=!!(a&2),c=!!(a&8),u=!!(a&16),d=!!(a&32),f=!!(a&65536),p=!!(a&131072),h=ie(e),m=this.tracks.find(b=>b.id===h);if(!m)break;let v=this.fragmentTrackDefaults.find(b=>b.trackId===h);this.currentTrack=m,m.currentFragmentState={baseDataOffset:this.currentFragment.implicitBaseDataOffset,sampleDescriptionIndex:v?.defaultSampleDescriptionIndex??null,defaultSampleDuration:v?.defaultSampleDuration??null,defaultSampleSize:v?.defaultSampleSize??null,defaultSampleFlags:v?.defaultSampleFlags??null,startTimestamp:null},o?m.currentFragmentState.baseDataOffset=Xs(e):p&&(m.currentFragmentState.baseDataOffset=this.currentFragment.moofOffset),l&&(m.currentFragmentState.sampleDescriptionIndex=ie(e)),c&&(m.currentFragmentState.defaultSampleDuration=ie(e)),u&&(m.currentFragmentState.defaultSampleSize=ie(e)),d&&(m.currentFragmentState.defaultSampleFlags=ie(e)),f&&(m.currentFragmentState.defaultSampleDuration=0)}break;case"tfdt":{let a=this.currentTrack;if(!a)break;F(a.currentFragmentState);let o=ge(e);e.skip(3);let l=o===0?ie(e):Xs(e);a.currentFragmentState.startTimestamp=l}break;case"trun":{let a=this.currentTrack;if(!a)break;if(F(this.currentFragment),F(a.currentFragmentState),this.currentFragment.trackData.has(a.id)){console.warn("Can't have two trun boxes for the same track in one fragment. Ignoring...");break}let o=ge(e),l=rf(e),c=!!(l&1),u=!!(l&4),d=!!(l&256),f=!!(l&512),p=!!(l&1024),h=!!(l&2048),m=ie(e),v=a.currentFragmentState.baseDataOffset;c&&(v+=Jc(e));let b=null;u&&(b=ie(e));let y=v;if(m===0){this.currentFragment.implicitBaseDataOffset=y;break}let x=0,w={startTimestamp:0,endTimestamp:0,firstKeyFrameTimestamp:null,samples:[],presentationTimestamps:[],startTimestampIsFinal:!1};this.currentFragment.trackData.set(a.id,w);for(let S=0;S<m;S++){let T;d?T=ie(e):(F(a.currentFragmentState.defaultSampleDuration!==null),T=a.currentFragmentState.defaultSampleDuration);let E;f?E=ie(e):(F(a.currentFragmentState.defaultSampleSize!==null),E=a.currentFragmentState.defaultSampleSize);let P;p?P=ie(e):(F(a.currentFragmentState.defaultSampleFlags!==null),P=a.currentFragmentState.defaultSampleFlags),S===0&&b!==null&&(P=b);let R=0;h&&(o===0?R=ie(e):R=Jc(e));let I=!(P&65536);w.samples.push({presentationTimestamp:x+R,duration:T,byteOffset:y,byteSize:E,isKeyFrame:I}),y+=E,x+=T}w.presentationTimestamps=w.samples.map((S,T)=>({presentationTimestamp:S.presentationTimestamp,sampleIndex:T})).sort((S,T)=>S.presentationTimestamp-T.presentationTimestamp);for(let S=0;S<w.presentationTimestamps.length;S++){let T=w.presentationTimestamps[S],E=w.samples[T.sampleIndex];if(w.firstKeyFrameTimestamp===null&&E.isKeyFrame&&(w.firstKeyFrameTimestamp=E.presentationTimestamp),S<w.presentationTimestamps.length-1){let P=w.presentationTimestamps[S+1];E.duration=P.presentationTimestamp-T.presentationTimestamp}}let C=w.samples[w.presentationTimestamps[0].sampleIndex],O=w.samples[Li(w.presentationTimestamps).sampleIndex];w.startTimestamp=C.presentationTimestamp,w.endTimestamp=O.presentationTimestamp+O.duration,this.currentFragment.implicitBaseDataOffset=y}break;case"udta":{let a=this.iterateContiguousBoxes(e.slice(i,n.contentSize));for(let{boxInfo:o,slice:l}of a){if(o.name!=="meta"&&!this.currentTrack){let c=l.filePos;this.metadataTags.raw??={},ZYe.has(o.name)?this.metadataTags.raw[o.name]??=Do(l):this.metadataTags.raw[o.name]??=xe(l,o.contentSize),l.filePos=c}switch(o.name){case"meta":l.skip(-o.headerSize),this.traverseBox(l);break;case"\xA9nam":case"name":this.currentTrack?this.currentTrack.name=kn.decode(xe(l,o.contentSize)):this.metadataTags.title??=Do(l);break;case"\xA9des":this.currentTrack||(this.metadataTags.description??=Do(l));break;case"\xA9ART":this.currentTrack||(this.metadataTags.artist??=Do(l));break;case"\xA9alb":this.currentTrack||(this.metadataTags.album??=Do(l));break;case"albr":this.currentTrack||(this.metadataTags.albumArtist??=Do(l));break;case"\xA9gen":this.currentTrack||(this.metadataTags.genre??=Do(l));break;case"\xA9day":if(!this.currentTrack){let c=new Date(Do(l));Number.isNaN(c.getTime())||(this.metadataTags.date??=c)}break;case"\xA9cmt":this.currentTrack||(this.metadataTags.comment??=Do(l));break;case"\xA9lyr":this.currentTrack||(this.metadataTags.lyrics??=Do(l));break}}}break;case"meta":{if(this.currentTrack)break;let o=ie(e)!==0;this.currentMetadataKeys=new Map,o?this.readContiguousBoxes(e.slice(i,n.contentSize)):this.readContiguousBoxes(e.slice(i+4,n.contentSize-4)),this.currentMetadataKeys=null}break;case"keys":{if(!this.currentMetadataKeys)break;e.skip(4);let a=ie(e);for(let o=0;o<a;o++){let l=ie(e);e.skip(4);let c=kn.decode(xe(e,l-8));this.currentMetadataKeys.set(o+1,c)}}break;case"ilst":{if(!this.currentMetadataKeys)break;let a=this.iterateContiguousBoxes(e.slice(i,n.contentSize));for(let{boxInfo:o,slice:l}of a){let c=o.name,u=(c.charCodeAt(0)<<24)+(c.charCodeAt(1)<<16)+(c.charCodeAt(2)<<8)+c.charCodeAt(3);this.currentMetadataKeys.has(u)&&(c=this.currentMetadataKeys.get(u));let d=Rve(l);switch(this.metadataTags.raw??={},this.metadataTags.raw[c]??=d,c){case"\xA9nam":case"titl":case"com.apple.quicktime.title":case"title":typeof d=="string"&&(this.metadataTags.title??=d);break;case"\xA9des":case"desc":case"dscp":case"com.apple.quicktime.description":case"description":typeof d=="string"&&(this.metadataTags.description??=d);break;case"\xA9ART":case"com.apple.quicktime.artist":case"artist":typeof d=="string"&&(this.metadataTags.artist??=d);break;case"\xA9alb":case"albm":case"com.apple.quicktime.album":case"album":typeof d=="string"&&(this.metadataTags.album??=d);break;case"aART":case"album_artist":typeof d=="string"&&(this.metadataTags.albumArtist??=d);break;case"\xA9cmt":case"com.apple.quicktime.comment":case"comment":typeof d=="string"&&(this.metadataTags.comment??=d);break;case"\xA9gen":case"gnre":case"com.apple.quicktime.genre":case"genre":typeof d=="string"&&(this.metadataTags.genre??=d);break;case"\xA9lyr":case"lyrics":typeof d=="string"&&(this.metadataTags.lyrics??=d);break;case"\xA9day":case"rldt":case"com.apple.quicktime.creationdate":case"date":if(typeof d=="string"){let f=new Date(d);Number.isNaN(f.getTime())||(this.metadataTags.date??=f)}break;case"covr":case"com.apple.quicktime.artwork":d instanceof Zd?(this.metadataTags.images??=[],this.metadataTags.images.push({data:d.data,kind:"coverFront",mimeType:d.mimeType})):d instanceof Uint8Array&&(this.metadataTags.images??=[],this.metadataTags.images.push({data:d,kind:"coverFront",mimeType:"image/*"}));break;case"track":if(typeof d=="string"){let f=d.split("/"),p=Number.parseInt(f[0],10),h=f[1]&&Number.parseInt(f[1],10);Number.isInteger(p)&&p>0&&(this.metadataTags.trackNumber??=p),h&&Number.isInteger(h)&&h>0&&(this.metadataTags.tracksTotal??=h)}break;case"trkn":if(d instanceof Uint8Array&&d.length>=6){let f=fr(d),p=f.getUint16(2,!1),h=f.getUint16(4,!1);p>0&&(this.metadataTags.trackNumber??=p),h>0&&(this.metadataTags.tracksTotal??=h)}break;case"disc":case"disk":if(d instanceof Uint8Array&&d.length>=6){let f=fr(d),p=f.getUint16(2,!1),h=f.getUint16(4,!1);p>0&&(this.metadataTags.discNumber??=p),h>0&&(this.metadataTags.discsTotal??=h)}break}}}break}return e.filePos=s,!0}},h3=class{constructor(e){this.internalTrack=e,this.packetToSampleIndex=new WeakMap,this.packetToFragmentLocation=new WeakMap}getId(){return this.internalTrack.id}getCodec(){throw new Error("Not implemented on base class.")}getInternalCodecId(){return this.internalTrack.internalCodecId}getName(){return this.internalTrack.name}getLanguageCode(){return this.internalTrack.languageCode}getTimeResolution(){return this.internalTrack.timescale}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}async getFirstTimestamp(){return(await this.getFirstPacket({metadataOnly:!0}))?.timestamp??0}async getFirstPacket(e){let r=await this.fetchPacketForSampleIndex(0,e);return r||!this.internalTrack.demuxer.isFragmented?r:this.performFragmentedLookup(()=>{let n=this.internalTrack.demuxer.fragments[0]??null;if(n?.isKnownToBeFirstFragment){let i=n;for(;i;){if(i.trackData.get(this.internalTrack.id))return{fragmentIndex:vr(this.internalTrack.fragments,i.moofOffset,a=>a.moofOffset),sampleIndex:0,correctSampleFound:!0};i=i.nextFragment}}return{fragmentIndex:-1,sampleIndex:-1,correctSampleFound:!1}},-1/0,1/0,e)}mapTimestampIntoTimescale(e){return Rh(e*this.internalTrack.timescale,14)+this.internalTrack.editListOffset}async getPacket(e,r){let n=this.mapTimestampIntoTimescale(e),i=this.internalTrack.demuxer.getSampleTableForTrack(this.internalTrack),s=Lve(i,n),a=await this.fetchPacketForSampleIndex(s,r);return!_ve(i)||!this.internalTrack.demuxer.isFragmented?a:this.performFragmentedLookup(()=>this.findSampleInFragmentsForTimestamp(n),n,n,r)}async getNextPacket(e,r){let n=this.packetToSampleIndex.get(e);if(n!==void 0)return this.fetchPacketForSampleIndex(n+1,r);let i=this.packetToFragmentLocation.get(e);if(i===void 0)throw new Error("Packet was not created from this track.");let s=i.fragment.trackData.get(this.internalTrack.id),a=vr(this.internalTrack.fragments,i.fragment.moofOffset,o=>o.moofOffset);return F(a!==-1),this.performFragmentedLookup(()=>{if(i.sampleIndex+1<s.samples.length)return{fragmentIndex:a,sampleIndex:i.sampleIndex+1,correctSampleFound:!0};{let o=i.fragment;for(;o.nextFragment;)if(o=o.nextFragment,o.trackData.get(this.internalTrack.id)){let c=vr(this.internalTrack.fragments,o.moofOffset,u=>u.moofOffset);return F(c!==-1),{fragmentIndex:c,sampleIndex:0,correctSampleFound:!0}}return{fragmentIndex:a,sampleIndex:-1,correctSampleFound:!1}}},-1/0,1/0,r)}async getKeyPacket(e,r){let n=this.mapTimestampIntoTimescale(e),i=this.internalTrack.demuxer.getSampleTableForTrack(this.internalTrack),s=Lve(i,n),a=s===-1?-1:eXe(i,s),o=await this.fetchPacketForSampleIndex(a,r);return!_ve(i)||!this.internalTrack.demuxer.isFragmented?o:this.performFragmentedLookup(()=>this.findKeySampleInFragmentsForTimestamp(n),n,n,r)}async getNextKeyPacket(e,r){let n=this.packetToSampleIndex.get(e);if(n!==void 0){let o=this.internalTrack.demuxer.getSampleTableForTrack(this.internalTrack),l=tXe(o,n);return this.fetchPacketForSampleIndex(l,r)}let i=this.packetToFragmentLocation.get(e);if(i===void 0)throw new Error("Packet was not created from this track.");let s=i.fragment.trackData.get(this.internalTrack.id),a=vr(this.internalTrack.fragments,i.fragment.moofOffset,o=>o.moofOffset);return F(a!==-1),this.performFragmentedLookup(()=>{let o=s.samples.findIndex((l,c)=>l.isKeyFrame&&c>i.sampleIndex);if(o!==-1)return{fragmentIndex:a,sampleIndex:o,correctSampleFound:!0};{let l=i.fragment;for(;l.nextFragment;){l=l.nextFragment;let c=l.trackData.get(this.internalTrack.id);if(c&&c.firstKeyFrameTimestamp!==null){let u=vr(this.internalTrack.fragments,l.moofOffset,f=>f.moofOffset);F(u!==-1);let d=c.samples.findIndex(f=>f.isKeyFrame);return F(d!==-1),{fragmentIndex:u,sampleIndex:d,correctSampleFound:!0}}}return{fragmentIndex:a,sampleIndex:-1,correctSampleFound:!1}}},-1/0,1/0,r)}async fetchPacketForSampleIndex(e,r){if(e===-1)return null;let n=this.internalTrack.demuxer.getSampleTableForTrack(this.internalTrack),i=JYe(n,e);if(!i)return null;let s;if(r.metadataOnly)s=Cn;else{let c=this.internalTrack.demuxer.reader.requestSlice(i.sampleOffset,i.sampleSize);c instanceof Promise&&(c=await c),F(c),s=xe(c,i.sampleSize)}let a=(i.presentationTimestamp-this.internalTrack.editListOffset)/this.internalTrack.timescale,o=i.duration/this.internalTrack.timescale,l=new ir(s,i.isKeyFrame?"key":"delta",a,o,e,i.sampleSize);return this.packetToSampleIndex.set(l,e),l}async fetchPacketInFragment(e,r,n){if(r===-1)return null;let s=e.trackData.get(this.internalTrack.id).samples[r];F(s);let a;if(n.metadataOnly)a=Cn;else{let u=this.internalTrack.demuxer.reader.requestSlice(s.byteOffset,s.byteSize);u instanceof Promise&&(u=await u),F(u),a=xe(u,s.byteSize)}let o=(s.presentationTimestamp-this.internalTrack.editListOffset)/this.internalTrack.timescale,l=s.duration/this.internalTrack.timescale,c=new ir(a,s.isKeyFrame?"key":"delta",o,l,e.moofOffset+r,s.byteSize);return this.packetToFragmentLocation.set(c,{fragment:e,sampleIndex:r}),c}findSampleInFragmentsForTimestamp(e){let r=dt(this.internalTrack.fragments,e,s=>s.trackData.get(this.internalTrack.id).startTimestamp),n=-1,i=!1;if(r!==-1){let a=this.internalTrack.fragments[r].trackData.get(this.internalTrack.id),o=dt(a.presentationTimestamps,e,l=>l.presentationTimestamp);F(o!==-1),n=a.presentationTimestamps[o].sampleIndex,i=e<a.endTimestamp}return{fragmentIndex:r,sampleIndex:n,correctSampleFound:i}}findKeySampleInFragmentsForTimestamp(e){let r=dt(this.internalTrack.fragmentsWithKeyFrame,e,a=>a.trackData.get(this.internalTrack.id).startTimestamp),n=-1,i=-1,s=!1;if(r!==-1){let a=this.internalTrack.fragmentsWithKeyFrame[r];n=vr(this.internalTrack.fragments,a.moofOffset,u=>u.moofOffset),F(n!==-1);let o=a.trackData.get(this.internalTrack.id),l=e3(o.presentationTimestamps,u=>o.samples[u.sampleIndex].isKeyFrame&&u.presentationTimestamp<=e);F(l!==-1),i=o.presentationTimestamps[l].sampleIndex,s=e<o.endTimestamp}return{fragmentIndex:n,sampleIndex:i,correctSampleFound:s}}async performFragmentedLookup(e,r,n,i){let s=this.internalTrack.demuxer,a=await s.fragmentLookupMutex.acquire();try{let{fragmentIndex:o,sampleIndex:l,correctSampleFound:c}=e();if(c){let y=this.internalTrack.fragments[o];return this.fetchPacketInFragment(y,l,i)}let u=null,d=o,f=l,p=this.internalTrack.fragmentLookupTable?dt(this.internalTrack.fragmentLookupTable,r,y=>y.timestamp):-1,h=p!==-1?this.internalTrack.fragmentLookupTable[p]:null,m,v=!1;if(o===-1)m=h?.moofOffset??0,v=m===0;else{let y=this.internalTrack.fragments[o];!h||y.moofOffset>=h.moofOffset?(m=y.moofOffset+y.moofSize,u=y):m=h.moofOffset}for(;;){if(u){let C=u.trackData.get(this.internalTrack.id);if(C&&C.startTimestamp>n)break;if(u.nextFragment){m=u.nextFragment.moofOffset+u.nextFragment.moofSize,u=u.nextFragment;continue}}let y=s.reader.requestSliceRange(m,Zc,Dh);if(y instanceof Promise&&(y=await y),!y)break;let x=m,w=Ml(y);if(!w)break;if(w.name==="moof"){let C=vr(s.fragments,x,P=>P.moofOffset),O;C===-1?O=await s.readFragment(x):O=s.fragments[C],u&&(u.nextFragment=O),u=O,v&&(O.isKnownToBeFirstFragment=!0,v=!1);let{fragmentIndex:S,sampleIndex:T,correctSampleFound:E}=e();if(E){let P=this.internalTrack.fragments[S];return this.fetchPacketInFragment(P,T,i)}S!==-1&&(d=S,f=T)}m=x+w.totalSize}let b=d!==-1?this.internalTrack.fragments[d]:null;if(h&&(!b||b.moofOffset<h.moofOffset)){let x=this.internalTrack.fragmentLookupTable[p-1]?.timestamp??-1/0;return this.performFragmentedLookup(e,x,n,i)}return b?this.fetchPacketInFragment(b,f,i):null}finally{a()}}},Yj=class extends h3{constructor(e){super(e),this.decoderConfigPromise=null,this.internalTrack=e}getCodec(){return this.internalTrack.info.codec}getCodedWidth(){return this.internalTrack.info.width}getCodedHeight(){return this.internalTrack.info.height}getRotation(){return this.internalTrack.rotation}async getColorSpace(){return{primaries:this.internalTrack.info.colorSpace?.primaries,transfer:this.internalTrack.info.colorSpace?.transfer,matrix:this.internalTrack.info.colorSpace?.matrix,fullRange:this.internalTrack.info.colorSpace?.fullRange}}async getDecoderConfig(){return this.internalTrack.info.codec?this.decoderConfigPromise??=(async()=>{if(this.internalTrack.info.codec==="vp9"&&!this.internalTrack.info.vp9CodecInfo){let e=await this.getFirstPacket({});this.internalTrack.info.vp9CodecInfo=e&&l3(e.data)}else if(this.internalTrack.info.codec==="av1"&&!this.internalTrack.info.av1CodecInfo){let e=await this.getFirstPacket({});this.internalTrack.info.av1CodecInfo=e&&c3(e.data)}return{codec:i3(this.internalTrack.info),codedWidth:this.internalTrack.info.width,codedHeight:this.internalTrack.info.height,description:this.internalTrack.info.codecDescription??void 0,colorSpace:this.internalTrack.info.colorSpace??void 0}})():null}},Xj=class extends h3{constructor(e){super(e),this.decoderConfig=null,this.internalTrack=e}getCodec(){return this.internalTrack.info.codec}getNumberOfChannels(){return this.internalTrack.info.numberOfChannels}getSampleRate(){return this.internalTrack.info.sampleRate}async getDecoderConfig(){return this.internalTrack.info.codec?this.decoderConfig??={codec:s3(this.internalTrack.info),numberOfChannels:this.internalTrack.info.numberOfChannels,sampleRate:this.internalTrack.info.sampleRate,description:this.internalTrack.info.codecDescription??void 0}:null}},Lve=(t,e)=>{if(t.presentationTimestamps){let r=dt(t.presentationTimestamps,e,n=>n.presentationTimestamp);return r===-1?-1:t.presentationTimestamps[r].sampleIndex}else{let r=dt(t.sampleTimingEntries,e,i=>i.startDecodeTimestamp);if(r===-1)return-1;let n=t.sampleTimingEntries[r];return n.startIndex+Math.min(Math.floor((e-n.startDecodeTimestamp)/n.delta),n.count-1)}},JYe=(t,e)=>{let r=dt(t.sampleTimingEntries,e,b=>b.startIndex),n=t.sampleTimingEntries[r];if(!n||n.startIndex+n.count<=e)return null;let s=n.startDecodeTimestamp+(e-n.startIndex)*n.delta,a=dt(t.sampleCompositionTimeOffsets,e,b=>b.startIndex),o=t.sampleCompositionTimeOffsets[a];o&&e-o.startIndex<o.count&&(s+=o.offset);let l=t.sampleSizes[Math.min(e,t.sampleSizes.length-1)],c=dt(t.sampleToChunk,e,b=>b.startSampleIndex),u=t.sampleToChunk[c];F(u);let d=u.startChunkIndex+Math.floor((e-u.startSampleIndex)/u.samplesPerChunk),f=t.chunkOffsets[d],p=u.startSampleIndex+(d-u.startChunkIndex)*u.samplesPerChunk,h=0,m=f;if(t.sampleSizes.length===1)m+=l*(e-p),h+=l*u.samplesPerChunk;else for(let b=p;b<p+u.samplesPerChunk;b++){let y=t.sampleSizes[b];b<e&&(m+=y),h+=y}let v=n.delta;if(t.presentationTimestamps){let b=t.presentationTimestampIndexMap[e];F(b!==void 0),b<t.presentationTimestamps.length-1&&(v=t.presentationTimestamps[b+1].presentationTimestamp-s)}return{presentationTimestamp:s,duration:v,sampleOffset:m,sampleSize:l,chunkOffset:f,chunkSize:h,isKeyFrame:t.keySampleIndices?vr(t.keySampleIndices,e,b=>b)!==-1:!0}},eXe=(t,e)=>{if(!t.keySampleIndices)return e;let r=dt(t.keySampleIndices,e,n=>n);return t.keySampleIndices[r]??-1},tXe=(t,e)=>{if(!t.keySampleIndices)return e+1;let r=dt(t.keySampleIndices,e,n=>n);return t.keySampleIndices[r+1]??-1},Mve=(t,e)=>{t.startTimestamp+=e,t.endTimestamp+=e;for(let r of t.samples)r.presentationTimestamp+=e;for(let r of t.presentationTimestamps)r.presentationTimestamp+=e},rXe=t=>{let[e,,,r]=t,n=Math.hypot(e,r),i=e/n,s=r/n,a=-Math.atan2(s,i)*(180/Math.PI);return Number.isFinite(a)?a:0},_ve=t=>t.sampleSizes.length===0;var Q;(function(t){t[t.EBML=440786851]="EBML",t[t.EBMLVersion=17030]="EBMLVersion",t[t.EBMLReadVersion=17143]="EBMLReadVersion",t[t.EBMLMaxIDLength=17138]="EBMLMaxIDLength",t[t.EBMLMaxSizeLength=17139]="EBMLMaxSizeLength",t[t.DocType=17026]="DocType",t[t.DocTypeVersion=17031]="DocTypeVersion",t[t.DocTypeReadVersion=17029]="DocTypeReadVersion",t[t.Void=236]="Void",t[t.Segment=408125543]="Segment",t[t.SeekHead=290298740]="SeekHead",t[t.Seek=19899]="Seek",t[t.SeekID=21419]="SeekID",t[t.SeekPosition=21420]="SeekPosition",t[t.Duration=17545]="Duration",t[t.Info=357149030]="Info",t[t.TimestampScale=2807729]="TimestampScale",t[t.MuxingApp=19840]="MuxingApp",t[t.WritingApp=22337]="WritingApp",t[t.Tracks=374648427]="Tracks",t[t.TrackEntry=174]="TrackEntry",t[t.TrackNumber=215]="TrackNumber",t[t.TrackUID=29637]="TrackUID",t[t.TrackType=131]="TrackType",t[t.FlagEnabled=185]="FlagEnabled",t[t.FlagDefault=136]="FlagDefault",t[t.FlagForced=21930]="FlagForced",t[t.FlagLacing=156]="FlagLacing",t[t.Name=21358]="Name",t[t.Language=2274716]="Language",t[t.LanguageBCP47=2274717]="LanguageBCP47",t[t.CodecID=134]="CodecID",t[t.CodecPrivate=25506]="CodecPrivate",t[t.CodecDelay=22186]="CodecDelay",t[t.SeekPreRoll=22203]="SeekPreRoll",t[t.DefaultDuration=2352003]="DefaultDuration",t[t.Video=224]="Video",t[t.PixelWidth=176]="PixelWidth",t[t.PixelHeight=186]="PixelHeight",t[t.Audio=225]="Audio",t[t.SamplingFrequency=181]="SamplingFrequency",t[t.Channels=159]="Channels",t[t.BitDepth=25188]="BitDepth",t[t.SimpleBlock=163]="SimpleBlock",t[t.BlockGroup=160]="BlockGroup",t[t.Block=161]="Block",t[t.BlockAdditions=30113]="BlockAdditions",t[t.BlockMore=166]="BlockMore",t[t.BlockAdditional=165]="BlockAdditional",t[t.BlockAddID=238]="BlockAddID",t[t.BlockDuration=155]="BlockDuration",t[t.ReferenceBlock=251]="ReferenceBlock",t[t.Cluster=524531317]="Cluster",t[t.Timestamp=231]="Timestamp",t[t.Cues=475249515]="Cues",t[t.CuePoint=187]="CuePoint",t[t.CueTime=179]="CueTime",t[t.CueTrackPositions=183]="CueTrackPositions",t[t.CueTrack=247]="CueTrack",t[t.CueClusterPosition=241]="CueClusterPosition",t[t.Colour=21936]="Colour",t[t.MatrixCoefficients=21937]="MatrixCoefficients",t[t.TransferCharacteristics=21946]="TransferCharacteristics",t[t.Primaries=21947]="Primaries",t[t.Range=21945]="Range",t[t.Projection=30320]="Projection",t[t.ProjectionType=30321]="ProjectionType",t[t.ProjectionPoseRoll=30325]="ProjectionPoseRoll",t[t.Attachments=423732329]="Attachments",t[t.AttachedFile=24999]="AttachedFile",t[t.FileDescription=18046]="FileDescription",t[t.FileName=18030]="FileName",t[t.FileMediaType=18016]="FileMediaType",t[t.FileData=18012]="FileData",t[t.FileUID=18094]="FileUID",t[t.Chapters=272869232]="Chapters",t[t.Tags=307544935]="Tags",t[t.Tag=29555]="Tag",t[t.Targets=25536]="Targets",t[t.TargetTypeValue=26826]="TargetTypeValue",t[t.TargetType=25546]="TargetType",t[t.TagTrackUID=25541]="TagTrackUID",t[t.TagEditionUID=25545]="TagEditionUID",t[t.TagChapterUID=25540]="TagChapterUID",t[t.TagAttachmentUID=25542]="TagAttachmentUID",t[t.SimpleTag=26568]="SimpleTag",t[t.TagName=17827]="TagName",t[t.TagLanguage=17530]="TagLanguage",t[t.TagString=17543]="TagString",t[t.TagBinary=17541]="TagBinary",t[t.ContentEncodings=28032]="ContentEncodings",t[t.ContentEncoding=25152]="ContentEncoding",t[t.ContentEncodingOrder=20529]="ContentEncodingOrder",t[t.ContentEncodingScope=20530]="ContentEncodingScope",t[t.ContentCompression=20532]="ContentCompression",t[t.ContentCompAlgo=16980]="ContentCompAlgo",t[t.ContentCompSettings=16981]="ContentCompSettings",t[t.ContentEncryption=20533]="ContentEncryption"})(Q||(Q={}));var nXe=[Q.EBML,Q.Segment],bv=[Q.SeekHead,Q.Info,Q.Cluster,Q.Tracks,Q.Cues,Q.Attachments,Q.Chapters,Q.Tags],g3=[...nXe,...bv];var Qj=8,us=2,No=2*Qj,Zj=t=>{let e=ge(t);if(t.skip(-1),e===0)return null;let r=1,n=128;for(;(e&n)===0;)r++,n>>=1;return r},xv=t=>{let e=ge(t);if(e===0)return null;let r=1,n=128;for(;(e&n)===0;)r++,n>>=1;let i=e&n-1;for(let s=1;s<r;s++)i*=256,i+=ge(t);return i},ft=(t,e)=>{if(e<1||e>8)throw new Error("Bad unsigned int size "+e);let r=0;for(let n=0;n<e;n++)r*=256,r+=ge(t);return r},Dve=(t,e)=>{if(e<1)throw new Error("Bad unsigned int size "+e);let r=0n;for(let n=0;n<e;n++)r<<=8n,r+=BigInt(ge(t));return r},Nve=(t,e)=>{let r=ft(t,e);return r&1<<e*8-1&&(r-=2**(e*8)),r},y3=t=>{let e=Zj(t);return e===null?null:ft(t,e)},Jj=t=>{let e=ge(t);return e===255?e=null:(t.skip(-1),e=xv(t),e===72057594037927940&&(e=null)),e},Fo=t=>{let e=y3(t);if(e===null)return null;let r=Jj(t);return{id:e,size:r}},nf=(t,e)=>{let r=xe(t,e),n=0;for(;n<e&&r[n]!==0;)n+=1;return String.fromCharCode(...r.subarray(0,n))},wv=(t,e)=>{let r=xe(t,e),n=0;for(;n<e&&r[n]!==0;)n+=1;return kn.decode(r.subarray(0,n))},v3=(t,e)=>{if(e===0)return 0;if(e!==4&&e!==8)throw new Error("Bad float size "+e);return e===4?Fve(t):m3(t)},b3=async(t,e,r,n)=>{let i=new Set(r),s=e;for(;n===null||s<n;){let a=t.requestSliceRange(s,us,No);if(a instanceof Promise&&(a=await a),!a)break;let o=Fo(a);if(!o)break;if(i.has(o.id))return{pos:s,found:!0};eu(o.size),s=a.filePos+o.size}return{pos:n!==null&&n>s?n:s,found:!1}},e$=async(t,e,r,n)=>{let s=new Set(r),a=e;for(;a<n;){let o=t.requestSliceRange(a,0,Math.min(65536,n-a));if(o instanceof Promise&&(o=await o),!o||o.length<Qj)break;for(let l=0;l<o.length-Qj;l++){o.filePos=a;let c=y3(o);if(c!==null&&s.has(c))return a;a++}}return null},Bo={avc:"V_MPEG4/ISO/AVC",hevc:"V_MPEGH/ISO/HEVC",vp8:"V_VP8",vp9:"V_VP9",av1:"V_AV1",aac:"A_AAC",mp3:"A_MPEG/L3",opus:"A_OPUS",vorbis:"A_VORBIS",flac:"A_FLAC","pcm-u8":"A_PCM/INT/LIT","pcm-s16":"A_PCM/INT/LIT","pcm-s16be":"A_PCM/INT/BIG","pcm-s24":"A_PCM/INT/LIT","pcm-s24be":"A_PCM/INT/BIG","pcm-s32":"A_PCM/INT/LIT","pcm-s32be":"A_PCM/INT/BIG","pcm-f32":"A_PCM/FLOAT/IEEE","pcm-f64":"A_PCM/FLOAT/IEEE",webvtt:"S_TEXT/WEBVTT"};function eu(t){if(t===null)throw new Error("Undefined element size is used in a place where it is not supported.")}var Bve=t=>{let r=(t.hasVideo?"video/":t.hasAudio?"audio/":"application/")+(t.isWebM?"webm":"x-matroska");if(t.codecStrings.length>0){let n=[...new Set(t.codecStrings.filter(Boolean))];r+=`; codecs="${n.join(", ")}"`}return r};var tu;(function(t){t[t.None=0]="None",t[t.Xiph=1]="Xiph",t[t.FixedSize=2]="FixedSize",t[t.Ebml=3]="Ebml"})(tu||(tu={}));var x3;(function(t){t[t.Block=1]="Block",t[t.Private=2]="Private",t[t.Next=4]="Next"})(x3||(x3={}));var AS;(function(t){t[t.Zlib=0]="Zlib",t[t.Bzlib=1]="Bzlib",t[t.lzo1x=2]="lzo1x",t[t.HeaderStripping=3]="HeaderStripping"})(AS||(AS={}));var t$=[{id:Q.SeekHead,flag:"seekHeadSeen"},{id:Q.Info,flag:"infoSeen"},{id:Q.Tracks,flag:"tracksSeen"},{id:Q.Cues,flag:"cuesSeen"}],Vve=10*2**20,w3=class extends ai{constructor(e){super(e),this.readMetadataPromise=null,this.segments=[],this.currentSegment=null,this.currentTrack=null,this.currentCluster=null,this.currentBlock=null,this.currentCueTime=null,this.currentDecodingInstruction=null,this.currentTagTargetIsMovie=!0,this.currentSimpleTagName=null,this.currentAttachedFile=null,this.isWebM=!1,this.reader=e._reader}async computeDuration(){let e=await this.getTracks(),r=await Promise.all(e.map(n=>n.computeDuration()));return Math.max(0,...r)}async getTracks(){return await this.readMetadata(),this.segments.flatMap(e=>e.tracks.map(r=>r.inputTrack))}async getMimeType(){await this.readMetadata();let e=await this.getTracks(),r=await Promise.all(e.map(n=>n.getCodecParameterString()));return Bve({isWebM:this.isWebM,hasVideo:this.segments.some(n=>n.tracks.some(i=>i.info?.type==="video")),hasAudio:this.segments.some(n=>n.tracks.some(i=>i.info?.type==="audio")),codecStrings:r.filter(Boolean)})}async getMetadataTags(){await this.readMetadata();for(let r of this.segments)r.metadataTagsCollected||(this.reader.fileSize!==null&&await this.loadSegmentMetadata(r),r.metadataTagsCollected=!0);let e={};for(let r of this.segments)e={...e,...r.metadataTags};return e}readMetadata(){return this.readMetadataPromise??=(async()=>{let e=0;for(;;){let r=this.reader.requestSliceRange(e,us,No);if(r instanceof Promise&&(r=await r),!r)break;let n=Fo(r);if(!n)break;let i=n.id,s=n.size,a=r.filePos;if(i===Q.EBML){eu(s);let o=this.reader.requestSlice(a,s);if(o instanceof Promise&&(o=await o),!o)break;this.readContiguousElements(o)}else if(i===Q.Segment){if(await this.readSegment(a,s),s===null||this.reader.fileSize===null)break}else if(i===Q.Cluster){if(this.reader.fileSize===null)break;s===null&&(s=(await b3(this.reader,a,g3,this.reader.fileSize)).pos-a);let o=Li(this.segments);o&&(o.elementEndPos=a+s)}eu(s),e=a+s}})()}async readSegment(e,r){this.currentSegment={seekHeadSeen:!1,infoSeen:!1,tracksSeen:!1,cuesSeen:!1,tagsSeen:!1,attachmentsSeen:!1,timestampScale:-1,timestampFactor:-1,duration:-1,seekEntries:[],tracks:[],cuePoints:[],dataStartPos:e,elementEndPos:r===null?null:e+r,clusterSeekStartPos:e,clusters:[],clusterLookupMutex:new cs,metadataTags:{},metadataTagsCollected:!1},this.segments.push(this.currentSegment);let n=e;for(;this.currentSegment.elementEndPos===null||n<this.currentSegment.elementEndPos;){let l=this.reader.requestSliceRange(n,us,No);if(l instanceof Promise&&(l=await l),!l)break;let c=n,u=Fo(l);if(!u||!bv.includes(u.id)&&u.id!==Q.Void){let m=await e$(this.reader,c,bv,Math.min(this.currentSegment.elementEndPos??1/0,c+Vve));if(m){n=m;continue}else break}let{id:d,size:f}=u,p=l.filePos,h=t$.findIndex(m=>m.id===d);if(h!==-1){let m=t$[h].flag;this.currentSegment[m]=!0,eu(f);let v=this.reader.requestSlice(p,f);v instanceof Promise&&(v=await v),v&&this.readContiguousElements(v)}else if(d===Q.Tags||d===Q.Attachments){d===Q.Tags?this.currentSegment.tagsSeen=!0:this.currentSegment.attachmentsSeen=!0,eu(f);let m=this.reader.requestSlice(p,f);m instanceof Promise&&(m=await m),m&&this.readContiguousElements(m)}else if(d===Q.Cluster){this.currentSegment.clusterSeekStartPos=c;break}if(f===null)break;n=p+f}if(this.currentSegment.seekEntries.sort((l,c)=>l.segmentPosition-c.segmentPosition),this.reader.fileSize!==null)for(let l of this.currentSegment.seekEntries){let c=t$.find(m=>m.id===l.id);if(!c||this.currentSegment[c.flag])continue;let u=this.reader.requestSliceRange(e+l.segmentPosition,us,No);if(u instanceof Promise&&(u=await u),!u)continue;let d=Fo(u);if(!d)continue;let{id:f,size:p}=d;if(f!==c.id)continue;eu(p),this.currentSegment[c.flag]=!0;let h=this.reader.requestSlice(u.filePos,p);h instanceof Promise&&(h=await h),h&&this.readContiguousElements(h)}this.currentSegment.timestampScale===-1&&(this.currentSegment.timestampScale=1e6,this.currentSegment.timestampFactor=1e9/1e6),this.currentSegment.tracks.sort((l,c)=>Number(c.isDefault)-Number(l.isDefault)),this.currentSegment.cuePoints.sort((l,c)=>l.clusterPosition-c.clusterPosition);let i=this.currentSegment.tracks.map(l=>l.id),s=new Set,a=null,o=null;for(let l of this.currentSegment.cuePoints){if(l.clusterPosition!==a){for(let u of s)F(o),this.currentSegment.tracks.find(f=>f.id===u).cuePoints.push(o);for(let u of i)s.add(u)}if(o=l,!s.has(l.trackId))continue;this.currentSegment.tracks.find(u=>u.id===l.trackId).cuePoints.push(l),s.delete(l.trackId),a=l.clusterPosition}for(let l of s)F(o),this.currentSegment.tracks.find(u=>u.id===l).cuePoints.push(o);for(let l of this.currentSegment.tracks)l.cuePoints.sort((c,u)=>c.time-u.time);this.currentSegment=null}async readCluster(e,r){let n=this.reader.requestSliceRange(e,us,No);n instanceof Promise&&(n=await n),F(n);let i=e,s=Fo(n);F(s);let a=s.id,o=s.size,l=n.filePos;o===null&&(o=(await b3(this.reader,l,g3,r.elementEndPos)).pos-l),F(a===Q.Cluster);let c=this.reader.requestSlice(l,o);c instanceof Promise&&(c=await c);let u={segment:r,elementStartPos:i,elementEndPos:l+o,dataStartPos:l,timestamp:-1,trackData:new Map,nextCluster:null,isKnownToBeFirstCluster:!1};this.currentCluster=u,c&&this.readContiguousElements(c);for(let[,d]of u.trackData){let f=d.track;F(d.blocks.length>0);let p=!1,h=!1;for(let y=0;y<d.blocks.length;y++){let x=d.blocks[y];x.timestamp+=u.timestamp,p||=x.referencedTimestamps.length>0,h||=x.lacing!==tu.None}p&&(d.blocks=iXe(d.blocks)),d.presentationTimestamps=d.blocks.map((y,x)=>({timestamp:y.timestamp,blockIndex:x})).sort((y,x)=>y.timestamp-x.timestamp);for(let y=0;y<d.presentationTimestamps.length;y++){let x=d.presentationTimestamps[y],w=d.blocks[x.blockIndex];if(d.firstKeyFrameTimestamp===null&&w.isKeyFrame&&(d.firstKeyFrameTimestamp=w.timestamp),y<d.presentationTimestamps.length-1){let C=d.presentationTimestamps[y+1];w.duration=C.timestamp-w.timestamp}else w.duration===0&&f.defaultDuration!=null&&w.lacing===tu.None&&(w.duration=f.defaultDuration)}h&&(this.expandLacedBlocks(d.blocks,f),d.presentationTimestamps=d.blocks.map((y,x)=>({timestamp:y.timestamp,blockIndex:x})).sort((y,x)=>y.timestamp-x.timestamp));let m=d.blocks[d.presentationTimestamps[0].blockIndex],v=d.blocks[Li(d.presentationTimestamps).blockIndex];d.startTimestamp=m.timestamp,d.endTimestamp=v.timestamp+v.duration,Qc(f.clusters,u,y=>y.elementStartPos),d.firstKeyFrameTimestamp!==null&&Qc(f.clustersWithKeyFrame,u,y=>y.elementStartPos)}return Qc(r.clusters,u,d=>d.elementStartPos),this.currentCluster=null,u}getTrackDataInCluster(e,r){let n=e.trackData.get(r);if(!n){let i=e.segment.tracks.find(s=>s.id===r);if(!i)return null;n={track:i,startTimestamp:0,endTimestamp:0,firstKeyFrameTimestamp:null,blocks:[],presentationTimestamps:[]},e.trackData.set(r,n)}return n}expandLacedBlocks(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.lacing===tu.None)continue;i.decoded||(i.data=this.decodeBlockData(r,i.data),i.decoded=!0);let s=kv.tempFromBytes(i.data),a=[],o=ge(s)+1;switch(i.lacing){case tu.Xiph:{let l=0;for(let c=0;c<o-1;c++){let u=0;for(;s.bufferPos<s.length;){let d=ge(s);if(u+=d,d<255){a.push(u),l+=u;break}}}a.push(s.length-(s.bufferPos+l))}break;case tu.FixedSize:{let l=s.length-1,c=Math.floor(l/o);for(let u=0;u<o;u++)a.push(c)}break;case tu.Ebml:{let l=xv(s);F(l!==null);let c=l;a.push(c);let u=c;for(let d=1;d<o-1;d++){let f=s.bufferPos,p=xv(s);F(p!==null);let h=p,v=(1<<(s.bufferPos-f)*7-1)-1,b=h-v;c+=b,a.push(c),u+=c}a.push(s.length-(s.bufferPos+u))}break;default:F(!1)}F(a.length===o),e.splice(n,1);for(let l=0;l<o;l++){let c=a[l],u=xe(s,c),d=i.duration||o*(r.defaultDuration??0),f=i.timestamp+d*l/o,p=d/o;e.splice(n+l,0,{timestamp:f,duration:p,isKeyFrame:i.isKeyFrame,referencedTimestamps:i.referencedTimestamps,data:u,lacing:tu.None,decoded:!0})}n+=o,n--}}async loadSegmentMetadata(e){for(let r of e.seekEntries){if(!(r.id===Q.Tags&&!e.tagsSeen)){if(!(r.id===Q.Attachments&&!e.attachmentsSeen))continue}let n=this.reader.requestSliceRange(e.dataStartPos+r.segmentPosition,us,No);if(n instanceof Promise&&(n=await n),!n)continue;let i=Fo(n);if(!i||i.id!==r.id)continue;let{size:s}=i;eu(s),F(!this.currentSegment),this.currentSegment=e;let a=this.reader.requestSlice(n.filePos,s);a instanceof Promise&&(a=await a),a&&this.readContiguousElements(a),this.currentSegment=null,r.id===Q.Tags?e.tagsSeen=!0:r.id===Q.Attachments&&(e.attachmentsSeen=!0)}}readContiguousElements(e){let r=e.filePos;for(;e.filePos-r<=e.length-us&&this.traverseElement(e););}traverseElement(e){let r=Fo(e);if(!r)return!1;let{id:n,size:i}=r,s=e.filePos;switch(eu(i),n){case Q.DocType:this.isWebM=nf(e,i)==="webm";break;case Q.Seek:{if(!this.currentSegment)break;let a={id:-1,segmentPosition:-1};this.currentSegment.seekEntries.push(a),this.readContiguousElements(e.slice(s,i)),(a.id===-1||a.segmentPosition===-1)&&this.currentSegment.seekEntries.pop()}break;case Q.SeekID:{let a=this.currentSegment?.seekEntries[this.currentSegment.seekEntries.length-1];if(!a)break;a.id=ft(e,i)}break;case Q.SeekPosition:{let a=this.currentSegment?.seekEntries[this.currentSegment.seekEntries.length-1];if(!a)break;a.segmentPosition=ft(e,i)}break;case Q.TimestampScale:{if(!this.currentSegment)break;this.currentSegment.timestampScale=ft(e,i),this.currentSegment.timestampFactor=1e9/this.currentSegment.timestampScale}break;case Q.Duration:{if(!this.currentSegment)break;this.currentSegment.duration=v3(e,i)}break;case Q.TrackEntry:{if(!this.currentSegment)break;if(this.currentTrack={id:-1,segment:this.currentSegment,demuxer:this,clusters:[],clustersWithKeyFrame:[],cuePoints:[],isDefault:!1,inputTrack:null,codecId:null,codecPrivate:null,defaultDuration:null,name:null,languageCode:Sn,decodingInstructions:[],info:null},this.readContiguousElements(e.slice(s,i)),this.currentTrack.decodingInstructions.some(a=>a.data?.type!=="decompress"||a.scope!==x3.Block||a.data.algorithm!==AS.HeaderStripping)&&(console.warn(`Track #${this.currentTrack.id} has an unsupported content encoding; dropping.`),this.currentTrack=null),this.currentTrack&&this.currentTrack.id!==-1&&this.currentTrack.codecId&&this.currentTrack.info){let a=this.currentTrack.codecId.indexOf("/"),o=a===-1?this.currentTrack.codecId:this.currentTrack.codecId.slice(0,a);if(this.currentTrack.info.type==="video"&&this.currentTrack.info.width!==-1&&this.currentTrack.info.height!==-1){this.currentTrack.codecId===Bo.avc?(this.currentTrack.info.codec="avc",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):this.currentTrack.codecId===Bo.hevc?(this.currentTrack.info.codec="hevc",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):o===Bo.vp8?this.currentTrack.info.codec="vp8":o===Bo.vp9?this.currentTrack.info.codec="vp9":o===Bo.av1&&(this.currentTrack.info.codec="av1");let l=this.currentTrack,c=new ef(this.input,new r$(l));this.currentTrack.inputTrack=c,this.currentSegment.tracks.push(this.currentTrack)}else if(this.currentTrack.info.type==="audio"&&this.currentTrack.info.numberOfChannels!==-1&&this.currentTrack.info.sampleRate!==-1){o===Bo.aac?(this.currentTrack.info.codec="aac",this.currentTrack.info.aacCodecInfo={isMpeg2:this.currentTrack.codecId.includes("MPEG2")},this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):this.currentTrack.codecId===Bo.mp3?this.currentTrack.info.codec="mp3":o===Bo.opus?(this.currentTrack.info.codec="opus",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate,this.currentTrack.info.sampleRate=_h):o===Bo.vorbis?(this.currentTrack.info.codec="vorbis",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):o===Bo.flac?(this.currentTrack.info.codec="flac",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):this.currentTrack.codecId==="A_PCM/INT/LIT"?this.currentTrack.info.bitDepth===8?this.currentTrack.info.codec="pcm-u8":this.currentTrack.info.bitDepth===16?this.currentTrack.info.codec="pcm-s16":this.currentTrack.info.bitDepth===24?this.currentTrack.info.codec="pcm-s24":this.currentTrack.info.bitDepth===32&&(this.currentTrack.info.codec="pcm-s32"):this.currentTrack.codecId==="A_PCM/INT/BIG"?this.currentTrack.info.bitDepth===8?this.currentTrack.info.codec="pcm-u8":this.currentTrack.info.bitDepth===16?this.currentTrack.info.codec="pcm-s16be":this.currentTrack.info.bitDepth===24?this.currentTrack.info.codec="pcm-s24be":this.currentTrack.info.bitDepth===32&&(this.currentTrack.info.codec="pcm-s32be"):this.currentTrack.codecId==="A_PCM/FLOAT/IEEE"&&(this.currentTrack.info.bitDepth===32?this.currentTrack.info.codec="pcm-f32":this.currentTrack.info.bitDepth===64&&(this.currentTrack.info.codec="pcm-f64"));let l=this.currentTrack,c=new Tn(this.input,new n$(l));this.currentTrack.inputTrack=c,this.currentSegment.tracks.push(this.currentTrack)}}this.currentTrack=null}break;case Q.TrackNumber:{if(!this.currentTrack)break;this.currentTrack.id=ft(e,i)}break;case Q.TrackType:{if(!this.currentTrack)break;let a=ft(e,i);a===1?this.currentTrack.info={type:"video",width:-1,height:-1,rotation:0,codec:null,codecDescription:null,colorSpace:null}:a===2&&(this.currentTrack.info={type:"audio",numberOfChannels:-1,sampleRate:-1,bitDepth:-1,codec:null,codecDescription:null,aacCodecInfo:null})}break;case Q.FlagEnabled:{if(!this.currentTrack)break;ft(e,i)||(this.currentSegment.tracks.pop(),this.currentTrack=null)}break;case Q.FlagDefault:{if(!this.currentTrack)break;this.currentTrack.isDefault=!!ft(e,i)}break;case Q.CodecID:{if(!this.currentTrack)break;this.currentTrack.codecId=nf(e,i)}break;case Q.CodecPrivate:{if(!this.currentTrack)break;this.currentTrack.codecPrivate=xe(e,i)}break;case Q.DefaultDuration:{if(!this.currentTrack)break;this.currentTrack.defaultDuration=this.currentTrack.segment.timestampFactor*ft(e,i)/1e9}break;case Q.Name:{if(!this.currentTrack)break;this.currentTrack.name=wv(e,i)}break;case Q.Language:{if(!this.currentTrack||this.currentTrack.languageCode!==Sn)break;this.currentTrack.languageCode=nf(e,i),t3(this.currentTrack.languageCode)||(this.currentTrack.languageCode=Sn)}break;case Q.LanguageBCP47:{if(!this.currentTrack)break;let o=nf(e,i).split("-")[0];o?this.currentTrack.languageCode=o:this.currentTrack.languageCode=Sn}break;case Q.Video:{if(this.currentTrack?.info?.type!=="video")break;this.readContiguousElements(e.slice(s,i))}break;case Q.PixelWidth:{if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.width=ft(e,i)}break;case Q.PixelHeight:{if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.height=ft(e,i)}break;case Q.Colour:{if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.colorSpace={},this.readContiguousElements(e.slice(s,i))}break;case Q.MatrixCoefficients:{if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;let a=ft(e,i),o=JL[a]??null;this.currentTrack.info.colorSpace.matrix=o}break;case Q.Range:{if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;this.currentTrack.info.colorSpace.fullRange=ft(e,i)===2}break;case Q.TransferCharacteristics:{if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;let a=ft(e,i),o=ZL[a]??null;this.currentTrack.info.colorSpace.transfer=o}break;case Q.Primaries:{if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;let a=ft(e,i),o=QL[a]??null;this.currentTrack.info.colorSpace.primaries=o}break;case Q.Projection:{if(this.currentTrack?.info?.type!=="video")break;this.readContiguousElements(e.slice(s,i))}break;case Q.ProjectionPoseRoll:{if(this.currentTrack?.info?.type!=="video")break;let o=-v3(e,i);try{this.currentTrack.info.rotation=XL(o)}catch{}}break;case Q.Audio:{if(this.currentTrack?.info?.type!=="audio")break;this.readContiguousElements(e.slice(s,i))}break;case Q.SamplingFrequency:{if(this.currentTrack?.info?.type!=="audio")break;this.currentTrack.info.sampleRate=v3(e,i)}break;case Q.Channels:{if(this.currentTrack?.info?.type!=="audio")break;this.currentTrack.info.numberOfChannels=ft(e,i)}break;case Q.BitDepth:{if(this.currentTrack?.info?.type!=="audio")break;this.currentTrack.info.bitDepth=ft(e,i)}break;case Q.CuePoint:{if(!this.currentSegment)break;this.readContiguousElements(e.slice(s,i)),this.currentCueTime=null}break;case Q.CueTime:this.currentCueTime=ft(e,i);break;case Q.CueTrackPositions:{if(this.currentCueTime===null)break;F(this.currentSegment);let a={time:this.currentCueTime,trackId:-1,clusterPosition:-1};this.currentSegment.cuePoints.push(a),this.readContiguousElements(e.slice(s,i)),(a.trackId===-1||a.clusterPosition===-1)&&this.currentSegment.cuePoints.pop()}break;case Q.CueTrack:{let a=this.currentSegment?.cuePoints[this.currentSegment.cuePoints.length-1];if(!a)break;a.trackId=ft(e,i)}break;case Q.CueClusterPosition:{let a=this.currentSegment?.cuePoints[this.currentSegment.cuePoints.length-1];if(!a)break;F(this.currentSegment),a.clusterPosition=this.currentSegment.dataStartPos+ft(e,i)}break;case Q.Timestamp:{if(!this.currentCluster)break;this.currentCluster.timestamp=ft(e,i)}break;case Q.SimpleBlock:{if(!this.currentCluster)break;let a=xv(e);if(a===null)break;let o=this.getTrackDataInCluster(this.currentCluster,a);if(!o)break;let l=IS(e),c=ge(e),u=!!(c&128),d=c>>1&3,f=xe(e,i-(e.filePos-s)),p=o.track.decodingInstructions.length>0;o.blocks.push({timestamp:l,duration:0,isKeyFrame:u,referencedTimestamps:[],data:f,lacing:d,decoded:!p})}break;case Q.BlockGroup:{if(!this.currentCluster)break;if(this.readContiguousElements(e.slice(s,i)),this.currentBlock){for(let a=0;a<this.currentBlock.referencedTimestamps.length;a++)this.currentBlock.referencedTimestamps[a]+=this.currentBlock.timestamp;this.currentBlock=null}}break;case Q.Block:{if(!this.currentCluster)break;let a=xv(e);if(a===null)break;let o=this.getTrackDataInCluster(this.currentCluster,a);if(!o)break;let l=IS(e),u=ge(e)>>1&3,d=xe(e,i-(e.filePos-s)),f=o.track.decodingInstructions.length>0;this.currentBlock={timestamp:l,duration:0,isKeyFrame:!0,referencedTimestamps:[],data:d,lacing:u,decoded:!f},o.blocks.push(this.currentBlock)}break;case Q.BlockDuration:{if(!this.currentBlock)break;this.currentBlock.duration=ft(e,i)}break;case Q.ReferenceBlock:{if(!this.currentBlock)break;this.currentBlock.isKeyFrame=!1;let a=Nve(e,i);this.currentBlock.referencedTimestamps.push(a)}break;case Q.Tag:this.currentTagTargetIsMovie=!0,this.readContiguousElements(e.slice(s,i));break;case Q.Targets:this.readContiguousElements(e.slice(s,i));break;case Q.TargetTypeValue:ft(e,i)!==50&&(this.currentTagTargetIsMovie=!1);break;case Q.TagTrackUID:case Q.TagEditionUID:case Q.TagChapterUID:case Q.TagAttachmentUID:this.currentTagTargetIsMovie=!1;break;case Q.SimpleTag:{if(!this.currentTagTargetIsMovie)break;this.currentSimpleTagName=null,this.readContiguousElements(e.slice(s,i))}break;case Q.TagName:this.currentSimpleTagName=wv(e,i);break;case Q.TagString:{if(!this.currentSimpleTagName)break;let a=wv(e,i);this.processTagValue(this.currentSimpleTagName,a)}break;case Q.TagBinary:{if(!this.currentSimpleTagName)break;let a=xe(e,i);this.processTagValue(this.currentSimpleTagName,a)}break;case Q.AttachedFile:{if(!this.currentSegment)break;this.currentAttachedFile={fileUid:null,fileName:null,fileMediaType:null,fileData:null,fileDescription:null},this.readContiguousElements(e.slice(s,i));let a=this.currentSegment.metadataTags;if(this.currentAttachedFile.fileUid&&this.currentAttachedFile.fileData&&(a.raw??={},a.raw[this.currentAttachedFile.fileUid.toString()]=new n3(this.currentAttachedFile.fileData,this.currentAttachedFile.fileMediaType??void 0,this.currentAttachedFile.fileName??void 0,this.currentAttachedFile.fileDescription??void 0)),this.currentAttachedFile.fileMediaType?.startsWith("image/")&&this.currentAttachedFile.fileData){let o=this.currentAttachedFile.fileName,l="unknown";if(o){let c=o.toLowerCase();c.startsWith("cover.")?l="coverFront":c.startsWith("back.")&&(l="coverBack")}a.images??=[],a.images.push({data:this.currentAttachedFile.fileData,mimeType:this.currentAttachedFile.fileMediaType,kind:l,name:this.currentAttachedFile.fileName??void 0,description:this.currentAttachedFile.fileDescription??void 0})}this.currentAttachedFile=null}break;case Q.FileUID:{if(!this.currentAttachedFile)break;this.currentAttachedFile.fileUid=Dve(e,i)}break;case Q.FileName:{if(!this.currentAttachedFile)break;this.currentAttachedFile.fileName=wv(e,i)}break;case Q.FileMediaType:{if(!this.currentAttachedFile)break;this.currentAttachedFile.fileMediaType=nf(e,i)}break;case Q.FileData:{if(!this.currentAttachedFile)break;this.currentAttachedFile.fileData=xe(e,i)}break;case Q.FileDescription:{if(!this.currentAttachedFile)break;this.currentAttachedFile.fileDescription=wv(e,i)}break;case Q.ContentEncodings:{if(!this.currentTrack)break;this.readContiguousElements(e.slice(s,i)),this.currentTrack.decodingInstructions.sort((a,o)=>o.order-a.order)}break;case Q.ContentEncoding:this.currentDecodingInstruction={order:0,scope:x3.Block,data:null},this.readContiguousElements(e.slice(s,i)),this.currentDecodingInstruction.data&&this.currentTrack.decodingInstructions.push(this.currentDecodingInstruction),this.currentDecodingInstruction=null;break;case Q.ContentEncodingOrder:{if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.order=ft(e,i)}break;case Q.ContentEncodingScope:{if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.scope=ft(e,i)}break;case Q.ContentCompression:{if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.data={type:"decompress",algorithm:AS.Zlib,settings:null},this.readContiguousElements(e.slice(s,i))}break;case Q.ContentCompAlgo:{if(this.currentDecodingInstruction?.data?.type!=="decompress")break;this.currentDecodingInstruction.data.algorithm=ft(e,i)}break;case Q.ContentCompSettings:{if(this.currentDecodingInstruction?.data?.type!=="decompress")break;this.currentDecodingInstruction.data.settings=xe(e,i)}break;case Q.ContentEncryption:{if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.data={type:"decrypt"}}break}return e.filePos=s+i,!0}decodeBlockData(e,r){F(e.decodingInstructions.length>0);let n=r;for(let i of e.decodingInstructions)switch(F(i.data),i.data.type){case"decompress":switch(i.data.algorithm){case AS.HeaderStripping:if(i.data.settings&&i.data.settings.length>0){let s=i.data.settings,a=new Uint8Array(s.length+n.length);a.set(s,0),a.set(n,s.length),n=a}break;default:}break;default:}return n}processTagValue(e,r){if(!this.currentSegment?.metadataTags)return;let n=this.currentSegment.metadataTags;if(n.raw??={},n.raw[e]??=r,typeof r=="string")switch(e.toLowerCase()){case"title":n.title??=r;break;case"description":n.description??=r;break;case"artist":n.artist??=r;break;case"album":n.album??=r;break;case"album_artist":n.albumArtist??=r;break;case"genre":n.genre??=r;break;case"comment":n.comment??=r;break;case"lyrics":n.lyrics??=r;break;case"date":{let i=new Date(r);Number.isNaN(i.getTime())||(n.date??=i)}break;case"track_number":case"part_number":{let i=r.split("/"),s=Number.parseInt(i[0],10),a=i[1]&&Number.parseInt(i[1],10);Number.isInteger(s)&&s>0&&(n.trackNumber??=s),a&&Number.isInteger(a)&&a>0&&(n.tracksTotal??=a)}break;case"disc_number":case"disc":{let i=r.split("/"),s=Number.parseInt(i[0],10),a=i[1]&&Number.parseInt(i[1],10);Number.isInteger(s)&&s>0&&(n.discNumber??=s),a&&Number.isInteger(a)&&a>0&&(n.discsTotal??=a)}break}}},k3=class{constructor(e){this.internalTrack=e,this.packetToClusterLocation=new WeakMap}getId(){return this.internalTrack.id}getCodec(){throw new Error("Not implemented on base class.")}getInternalCodecId(){return this.internalTrack.codecId}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getName(){return this.internalTrack.name}getLanguageCode(){return this.internalTrack.languageCode}async getFirstTimestamp(){return(await this.getFirstPacket({metadataOnly:!0}))?.timestamp??0}getTimeResolution(){return this.internalTrack.segment.timestampFactor}async getFirstPacket(e){return this.performClusterLookup(()=>{let r=this.internalTrack.segment.clusters[0]??null;if(r?.isKnownToBeFirstCluster){let n=r;for(;n;){if(n.trackData.get(this.internalTrack.id))return{clusterIndex:vr(this.internalTrack.clusters,n.elementStartPos,s=>s.elementStartPos),blockIndex:0,correctBlockFound:!0};n=n.nextCluster}}return{clusterIndex:-1,blockIndex:-1,correctBlockFound:!1}},-1/0,1/0,e)}intoTimescale(e){return Rh(e*this.internalTrack.segment.timestampFactor,14)}async getPacket(e,r){let n=this.intoTimescale(e);return this.performClusterLookup(()=>this.findBlockInClustersForTimestamp(n),n,n,r)}async getNextPacket(e,r){let n=this.packetToClusterLocation.get(e);if(n===void 0)throw new Error("Packet was not created from this track.");let i=n.cluster.trackData.get(this.internalTrack.id),s=vr(this.internalTrack.clusters,n.cluster.elementStartPos,a=>a.elementStartPos);return F(s!==-1),this.performClusterLookup(()=>{if(n.blockIndex+1<i.blocks.length)return{clusterIndex:s,blockIndex:n.blockIndex+1,correctBlockFound:!0};{let a=n.cluster;for(;a.nextCluster;)if(a=a.nextCluster,a.trackData.get(this.internalTrack.id)){let l=vr(this.internalTrack.clusters,a.elementStartPos,c=>c.elementStartPos);return F(l!==-1),{clusterIndex:l,blockIndex:0,correctBlockFound:!0}}return{clusterIndex:s,blockIndex:-1,correctBlockFound:!1}}},-1/0,1/0,r)}async getKeyPacket(e,r){let n=this.intoTimescale(e);return this.performClusterLookup(()=>this.findKeyBlockInClustersForTimestamp(n),n,n,r)}async getNextKeyPacket(e,r){let n=this.packetToClusterLocation.get(e);if(n===void 0)throw new Error("Packet was not created from this track.");let i=n.cluster.trackData.get(this.internalTrack.id),s=vr(this.internalTrack.clusters,n.cluster.elementStartPos,a=>a.elementStartPos);return F(s!==-1),this.performClusterLookup(()=>{let a=i.blocks.findIndex((o,l)=>o.isKeyFrame&&l>n.blockIndex);if(a!==-1)return{clusterIndex:s,blockIndex:a,correctBlockFound:!0};{let o=n.cluster;for(;o.nextCluster;){o=o.nextCluster;let l=o.trackData.get(this.internalTrack.id);if(l&&l.firstKeyFrameTimestamp!==null){let c=vr(this.internalTrack.clusters,o.elementStartPos,d=>d.elementStartPos);F(c!==-1);let u=l.blocks.findIndex(d=>d.isKeyFrame);return F(u!==-1),{clusterIndex:c,blockIndex:u,correctBlockFound:!0}}}return{clusterIndex:s,blockIndex:-1,correctBlockFound:!1}}},-1/0,1/0,r)}async fetchPacketInCluster(e,r,n){if(r===-1)return null;let s=e.trackData.get(this.internalTrack.id).blocks[r];F(s),s.decoded||(s.data=this.internalTrack.demuxer.decodeBlockData(this.internalTrack,s.data),s.decoded=!0);let a=n.metadataOnly?Cn:s.data,o=s.timestamp/this.internalTrack.segment.timestampFactor,l=s.duration/this.internalTrack.segment.timestampFactor,c=new ir(a,s.isKeyFrame?"key":"delta",o,l,e.dataStartPos+r,s.data.byteLength);return this.packetToClusterLocation.set(c,{cluster:e,blockIndex:r}),c}findBlockInClustersForTimestamp(e){let r=dt(this.internalTrack.clusters,e,s=>s.trackData.get(this.internalTrack.id).startTimestamp),n=-1,i=!1;if(r!==-1){let a=this.internalTrack.clusters[r].trackData.get(this.internalTrack.id),o=dt(a.presentationTimestamps,e,l=>l.timestamp);F(o!==-1),n=a.presentationTimestamps[o].blockIndex,i=e<a.endTimestamp}return{clusterIndex:r,blockIndex:n,correctBlockFound:i}}findKeyBlockInClustersForTimestamp(e){let r=dt(this.internalTrack.clustersWithKeyFrame,e,a=>a.trackData.get(this.internalTrack.id).firstKeyFrameTimestamp),n=-1,i=-1,s=!1;if(r!==-1){let a=this.internalTrack.clustersWithKeyFrame[r];n=vr(this.internalTrack.clusters,a.elementStartPos,u=>u.elementStartPos),F(n!==-1);let o=a.trackData.get(this.internalTrack.id),l=e3(o.presentationTimestamps,u=>o.blocks[u.blockIndex].isKeyFrame&&u.timestamp<=e);F(l!==-1),i=o.presentationTimestamps[l].blockIndex,s=e<o.endTimestamp}return{clusterIndex:n,blockIndex:i,correctBlockFound:s}}async performClusterLookup(e,r,n,i){let{demuxer:s,segment:a}=this.internalTrack,o=await a.clusterLookupMutex.acquire();try{let{clusterIndex:l,blockIndex:c,correctBlockFound:u}=e();if(u){let x=this.internalTrack.clusters[l];return this.fetchPacketInCluster(x,c,i)}let d=null,f=l,p=c,h=dt(this.internalTrack.cuePoints,r,x=>x.time),m=h!==-1?this.internalTrack.cuePoints[h]:null,v,b=!1;if(l===-1)v=m?.clusterPosition??a.clusterSeekStartPos,b=v===a.clusterSeekStartPos;else{let x=this.internalTrack.clusters[l];!m||x.elementStartPos>=m.clusterPosition?(v=x.elementEndPos,d=x):v=m.clusterPosition}for(;a.elementEndPos===null||v<=a.elementEndPos-us;){if(d){let E=d.trackData.get(this.internalTrack.id);if(E&&E.startTimestamp>n)break;if(d.nextCluster){v=d.nextCluster.elementEndPos,d=d.nextCluster;continue}}let x=s.reader.requestSliceRange(v,us,No);if(x instanceof Promise&&(x=await x),!x)break;let w=v,C=Fo(x);if(!C||!bv.includes(C.id)&&C.id!==Q.Void){let E=await e$(s.reader,w,bv,Math.min(a.elementEndPos??1/0,w+Vve));if(E){v=E;continue}else break}let O=C.id,S=C.size,T=x.filePos;if(O===Q.Cluster){let E=vr(a.clusters,w,M=>M.elementStartPos),P;E===-1?P=await s.readCluster(w,a):P=a.clusters[E],d&&(d.nextCluster=P),d=P,b&&(P.isKnownToBeFirstCluster=!0,b=!1);let{clusterIndex:R,blockIndex:I,correctBlockFound:B}=e();if(B){let M=this.internalTrack.clusters[R];return this.fetchPacketInCluster(M,I,i)}R!==-1&&(f=R,p=I)}if(S===null){O===Q.Cluster?(F(d),S=d.elementEndPos-T):S=(await b3(s.reader,T,g3,a.elementEndPos)).pos-T;let E=T+S;if(a.elementEndPos!==null&&E>a.elementEndPos-us)break;{let P=s.reader.requestSliceRange(E,us,No);if(P instanceof Promise&&(P=await P),!P)break;if(y3(P)===Q.Segment){a.elementEndPos=E;break}}}v=T+S}let y=f!==-1?this.internalTrack.clusters[f]:null;if(m&&(!y||y.elementStartPos<m.clusterPosition)){let w=this.internalTrack.cuePoints[h-1]?.time??-1/0;return this.performClusterLookup(e,w,n,i)}return y?this.fetchPacketInCluster(y,p,i):null}finally{o()}}},r$=class extends k3{constructor(e){super(e),this.decoderConfigPromise=null,this.internalTrack=e}getCodec(){return this.internalTrack.info.codec}getCodedWidth(){return this.internalTrack.info.width}getCodedHeight(){return this.internalTrack.info.height}getRotation(){return this.internalTrack.info.rotation}async getColorSpace(){return{primaries:this.internalTrack.info.colorSpace?.primaries,transfer:this.internalTrack.info.colorSpace?.transfer,matrix:this.internalTrack.info.colorSpace?.matrix,fullRange:this.internalTrack.info.colorSpace?.fullRange}}async getDecoderConfig(){return this.internalTrack.info.codec?this.decoderConfigPromise??=(async()=>{let e=null;return(this.internalTrack.info.codec==="vp9"||this.internalTrack.info.codec==="av1"||this.internalTrack.info.codec==="avc"&&!this.internalTrack.info.codecDescription||this.internalTrack.info.codec==="hevc"&&!this.internalTrack.info.codecDescription)&&(e=await this.getFirstPacket({})),{codec:i3({width:this.internalTrack.info.width,height:this.internalTrack.info.height,codec:this.internalTrack.info.codec,codecDescription:this.internalTrack.info.codecDescription,colorSpace:this.internalTrack.info.colorSpace,avcCodecInfo:this.internalTrack.info.codec==="avc"&&e?bve(e.data):null,hevcCodecInfo:this.internalTrack.info.codec==="hevc"&&e?xve(e.data):null,vp9CodecInfo:this.internalTrack.info.codec==="vp9"&&e?l3(e.data):null,av1CodecInfo:this.internalTrack.info.codec==="av1"&&e?c3(e.data):null}),codedWidth:this.internalTrack.info.width,codedHeight:this.internalTrack.info.height,description:this.internalTrack.info.codecDescription??void 0,colorSpace:this.internalTrack.info.colorSpace??void 0}})():null}},n$=class extends k3{constructor(e){super(e),this.decoderConfig=null,this.internalTrack=e}getCodec(){return this.internalTrack.info.codec}getNumberOfChannels(){return this.internalTrack.info.numberOfChannels}getSampleRate(){return this.internalTrack.info.sampleRate}async getDecoderConfig(){return this.internalTrack.info.codec?this.decoderConfig??={codec:s3({codec:this.internalTrack.info.codec,codecDescription:this.internalTrack.info.codecDescription,aacCodecInfo:this.internalTrack.info.aacCodecInfo}),numberOfChannels:this.internalTrack.info.numberOfChannels,sampleRate:this.internalTrack.info.sampleRate,description:this.internalTrack.info.codecDescription??void 0}:null}},iXe=t=>{let e=new Map;for(let s=0;s<t.length;s++){let a=t[s];e.set(a.timestamp,a)}let r=new Set,n=[],i=s=>{if(!r.has(s)){r.add(s);for(let a=0;a<s.referencedTimestamps.length;a++){let o=s.referencedTimestamps[a],l=e.get(o);l&&i(l)}n.push(s)}};for(let s=0;s<t.length;s++)i(t[s]);return n};var sXe=[44100,48e3,32e3],aXe=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1,-1,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1,-1,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1,-1,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1,-1,32,48,56,64,80,96,112,128,144,160,176,192,224,256,-1],jve=1483304551,$ve=1231971951,oXe=(t,e,r,n,i)=>e===0?0:e===1?Math.floor(144*r/(n<<t))+i:e===2?Math.floor(144*r/n)+i:(Math.floor(12*r/n)+i)*4,Uve=(t,e)=>t===3?e===3?21:36:e===3?13:21,zve=(t,e)=>{let r=t>>>24,n=t>>>16&255,i=t>>>8&255,s=t&255;if(r!==255&&n!==255&&i!==255&&s!==255)return{header:null,bytesAdvanced:4};if(r!==255)return{header:null,bytesAdvanced:1};if((n&224)!==224)return{header:null,bytesAdvanced:1};let a=0,o=0;n&16?a=n&8?0:1:(a=1,o=1);let l=n>>3&3,c=n>>1&3,u=i>>4&15,d=(i>>2&3)%3,f=i>>1&1,p=s>>6&3,h=s>>4&3,m=s>>3&1,v=s>>2&1,b=s&3,y=aXe[a*16*4+c*16+u];if(y===-1)return{header:null,bytesAdvanced:1};let x=y*1e3,w=sXe[d]>>a+o,C=oXe(a,c,x,w,f);if(e!==null&&e<C)return{header:null,bytesAdvanced:1};let O;return l===3?O=c===3?384:1152:c===3?O=384:c===2?O=1152:O=576,{header:{totalSize:C,mpegVersionId:l,layer:c,bitrate:x,frequencyIndex:d,sampleRate:w,channel:p,modeExtension:h,copyright:m,original:v,emphasis:b,audioSamplesInFrame:O},bytesAdvanced:1}};var S3=t=>{let e=2130706432,r=0;for(;e!==0;)r>>=1,r|=t&e,e>>=8;return r};var Cv;(function(t){t[t.Unsynchronisation=128]="Unsynchronisation",t[t.ExtendedHeader=64]="ExtendedHeader",t[t.ExperimentalIndicator=32]="ExperimentalIndicator",t[t.Footer=16]="Footer"})(Cv||(Cv={}));var Tv;(function(t){t[t.ISO_8859_1=0]="ISO_8859_1",t[t.UTF_16_WITH_BOM=1]="UTF_16_WITH_BOM",t[t.UTF_16_BE_NO_BOM=2]="UTF_16_BE_NO_BOM",t[t.UTF_8=3]="UTF_8"})(Tv||(Tv={}));var PS=128,Iv=10,Ev=["Blues","Classic rock","Country","Dance","Disco","Funk","Grunge","Hip-hop","Jazz","Metal","New age","Oldies","Other","Pop","Rhythm and blues","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death metal","Pranks","Soundtrack","Euro-techno","Ambient","Trip-hop","Vocal","Jazz & funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound clip","Gospel","Noise","Alternative rock","Bass","Soul","Punk","Space","Meditative","Instrumental pop","Instrumental rock","Ethnic","Gothic","Darkwave","Techno-industrial","Electronic","Pop-folk","Eurodance","Dream","Southern rock","Comedy","Cult","Gangsta","Top 40","Christian rap","Pop/funk","Jungle music","Native US","Cabaret","New wave","Psychedelic","Rave","Showtunes","Trailer","Lo-fi","Tribal","Acid punk","Acid jazz","Polka","Retro","Musical","Rock 'n' roll","Hard rock","Folk","Folk rock","National folk","Swing","Fast fusion","Bebop","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic rock","Progressive rock","Psychedelic rock","Symphonic rock","Slow rock","Big band","Chorus","Easy listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber music","Sonata","Symphony","Booty bass","Primus","Porn groove","Satire","Slow jam","Club","Tango","Samba","Folklore","Ballad","Power ballad","Rhythmic Soul","Freestyle","Duet","Punk rock","Drum solo","A cappella","Euro-house","Dance hall","Goa music","Drum & bass","Club-house","Hardcore techno","Terror","Indie","Britpop","Negerpunk","Polsk punk","Beat","Christian gangsta rap","Heavy metal","Black metal","Crossover","Contemporary Christian","Christian rock","Merengue","Salsa","Thrash metal","Anime","Jpop","Synthpop","Christmas","Art rock","Baroque","Bhangra","Big beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math rock","New romantic","Nu-breakz","Post-punk","Post-rock","Psytrance","Shoegaze","Space rock","Trop rock","World music","Neoclassical","Audiobook","Audio theatre","Neue Deutsche Welle","Podcast","Indie rock","G-Funk","Dubstep","Garage rock","Psybient"],qve=(t,e)=>{let r=t.filePos;e.raw??={},e.raw.TAG??=xe(t,PS-3),t.filePos=r;let n=Sv(t,30);n&&(e.title??=n);let i=Sv(t,30);i&&(e.artist??=i);let s=Sv(t,30);s&&(e.album??=s);let a=Sv(t,4),o=Number.parseInt(a,10);Number.isInteger(o)&&o>0&&(e.date??=new Date(o,0,1));let l=xe(t,30),c;if(l[28]===0&&l[29]!==0){let d=l[29];d>0&&(e.trackNumber??=d),t.skip(-30),c=Sv(t,28),t.skip(2)}else t.skip(-30),c=Sv(t,30);c&&(e.comment??=c);let u=ge(t);u<Ev.length&&(e.genre??=Ev[u])},Sv=(t,e)=>{let r=xe(t,e),n=Lh(r.indexOf(0),r.length),i=r.subarray(0,n),s="";for(let a=0;a<i.length;a++)s+=String.fromCharCode(i[a]);return s.trimEnd()},Nh=t=>{let e=t.filePos,r=br(t,3),n=ge(t),i=ge(t),s=ge(t),a=ie(t);if(r!=="ID3"||n===255||i===255||(a&2155905152)!==0)return t.filePos=e,null;let o=S3(a);return{majorVersion:n,revision:i,flags:s,size:o}},C3=(t,e,r)=>{if(![2,3,4].includes(e.majorVersion)){console.warn(`Unsupported ID3v2 major version: ${e.majorVersion}`);return}let n=xe(t,e.size),i=new i$(e,n);if(e.flags&Cv.Footer&&i.removeFooter(),e.flags&Cv.Unsynchronisation&&e.majorVersion===3&&i.ununsynchronizeAll(),e.flags&Cv.ExtendedHeader){let s=i.readU32();e.majorVersion===3?i.pos+=s:i.pos+=s-4}for(;i.pos<=i.bytes.length-i.frameHeaderSize();){let s=i.readId3V2Frame();if(!s)break;let a=i.pos,o=i.pos+s.size,l=!1,c=!1,u=!1;if(e.majorVersion===3?(l=!!(s.flags&64),c=!!(s.flags&128)):e.majorVersion===4&&(l=!!(s.flags&4),c=!!(s.flags&8),u=!!(s.flags&2)||!!(e.flags&Cv.Unsynchronisation)),l){console.warn(`Skipping encrypted ID3v2 frame ${s.id}`),i.pos=o;continue}if(c){console.warn(`Skipping compressed ID3v2 frame ${s.id}`),i.pos=o;continue}switch(u&&i.ununsynchronizeRegion(i.pos,o),r.raw??={},s.id[0]==="T"?r.raw[s.id]??=i.readId3V2EncodingAndText(o):r.raw[s.id]??=i.readBytes(s.size),i.pos=a,s.id){case"TIT2":case"TT2":r.title??=i.readId3V2EncodingAndText(o);break;case"TIT3":case"TT3":r.description??=i.readId3V2EncodingAndText(o);break;case"TPE1":case"TP1":r.artist??=i.readId3V2EncodingAndText(o);break;case"TALB":case"TAL":r.album??=i.readId3V2EncodingAndText(o);break;case"TPE2":case"TP2":r.albumArtist??=i.readId3V2EncodingAndText(o);break;case"TRCK":case"TRK":{let f=i.readId3V2EncodingAndText(o).split("/"),p=Number.parseInt(f[0],10),h=f[1]&&Number.parseInt(f[1],10);Number.isInteger(p)&&p>0&&(r.trackNumber??=p),h&&Number.isInteger(h)&&h>0&&(r.tracksTotal??=h)}break;case"TPOS":case"TPA":{let f=i.readId3V2EncodingAndText(o).split("/"),p=Number.parseInt(f[0],10),h=f[1]&&Number.parseInt(f[1],10);Number.isInteger(p)&&p>0&&(r.discNumber??=p),h&&Number.isInteger(h)&&h>0&&(r.discsTotal??=h)}break;case"TCON":case"TCO":{let d=i.readId3V2EncodingAndText(o),f=/^\((\d+)\)/.exec(d);if(f){let p=Number.parseInt(f[1]);if(Ev[p]!==void 0){r.genre??=Ev[p];break}}if(f=/^\d+$/.exec(d),f){let p=Number.parseInt(f[0]);if(Ev[p]!==void 0){r.genre??=Ev[p];break}}r.genre??=d}break;case"TDRC":case"TDAT":{let d=i.readId3V2EncodingAndText(o),f=new Date(d);Number.isNaN(f.getTime())||(r.date??=f)}break;case"TYER":case"TYE":{let d=i.readId3V2EncodingAndText(o),f=Number.parseInt(d,10);Number.isInteger(f)&&(r.date??=new Date(f,0,1))}break;case"USLT":case"ULT":{let d=i.readU8();i.pos+=3,i.readId3V2Text(d,o),r.lyrics??=i.readId3V2Text(d,o)}break;case"COMM":case"COM":{let d=i.readU8();i.pos+=3,i.readId3V2Text(d,o),r.comment??=i.readId3V2Text(d,o)}break;case"APIC":case"PIC":{let d=i.readId3V2TextEncoding(),f;if(e.majorVersion===2){let v=i.readAscii(3);f=v==="PNG"?"image/png":v==="JPG"?"image/jpeg":"image/*"}else f=i.readId3V2Text(d,o);let p=i.readU8(),h=i.readId3V2Text(d,o).trimEnd(),m=o-i.pos;if(m>=0){let v=i.readBytes(m);r.images||(r.images=[]),r.images.push({data:v,mimeType:f,kind:p===3?"coverFront":p===4?"coverBack":"unknown",description:h})}}break;default:i.pos+=s.size;break}i.pos=o}},i$=class{constructor(e,r){this.header=e,this.bytes=r,this.pos=0,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength)}frameHeaderSize(){return this.header.majorVersion===2?6:10}ununsynchronizeAll(){let e=[];for(let r=0;r<this.bytes.length;r++){let n=this.bytes[r];e.push(n),n===255&&r!==this.bytes.length-1&&this.bytes[r]===0&&r++}this.bytes=new Uint8Array(e),this.view=new DataView(this.bytes.buffer)}ununsynchronizeRegion(e,r){let n=[];for(let a=e;a<r;a++){let o=this.bytes[a];n.push(o),o===255&&a!==r-1&&this.bytes[a+1]===0&&a++}let i=this.bytes.subarray(0,e),s=this.bytes.subarray(r);this.bytes=new Uint8Array(i.length+n.length+s.length),this.bytes.set(i,0),this.bytes.set(n,i.length),this.bytes.set(s,i.length+n.length),this.view=new DataView(this.bytes.buffer)}removeFooter(){this.bytes=this.bytes.subarray(0,this.bytes.length-Iv),this.view=new DataView(this.bytes.buffer)}readBytes(e){let r=this.bytes.subarray(this.pos,this.pos+e);return this.pos+=e,r}readU8(){let e=this.view.getUint8(this.pos);return this.pos+=1,e}readU16(){let e=this.view.getUint16(this.pos,!1);return this.pos+=2,e}readU24(){let e=this.view.getUint16(this.pos,!1),r=this.view.getUint8(this.pos+1);return this.pos+=3,e*256+r}readU32(){let e=this.view.getUint32(this.pos,!1);return this.pos+=4,e}readAscii(e){let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(this.view.getUint8(this.pos+n));return this.pos+=e,r}readId3V2Frame(){if(this.header.majorVersion===2){let e=this.readAscii(3);if(e==="\0\0\0")return null;let r=this.readU24();return{id:e,size:r,flags:0}}else{let e=this.readAscii(4);if(e==="\0\0\0\0")return null;let r=this.readU32(),n=this.header.majorVersion===4?S3(r):r,i=this.readU16(),s=this.pos,a=o=>{let l=this.pos+o;if(l>this.bytes.length)return!1;if(l<=this.bytes.length-this.frameHeaderSize()){this.pos+=o;let c=this.readAscii(4);if(c!=="\0\0\0\0"&&!/[0-9A-Z]{4}/.test(c))return!1}return!0};if(!a(n)){let o=this.header.majorVersion===4?r:S3(r);a(o)&&(n=o)}return this.pos=s,{id:e,size:n,flags:i}}}readId3V2TextEncoding(){let e=this.readU8();if(e>3)throw new Error(`Unsupported text encoding: ${e}`);return e}readId3V2Text(e,r){let n=this.pos,i=this.readBytes(r-this.pos);switch(e){case Tv.ISO_8859_1:{let s="";for(let a=0;a<i.length;a++){let o=i[a];if(o===0){this.pos=n+a+1;break}s+=String.fromCharCode(o)}return s}case Tv.UTF_16_WITH_BOM:if(i[0]===255&&i[1]===254){let s=new TextDecoder("utf-16le"),a=Lh(i.findIndex((o,l)=>o===0&&i[l+1]===0&&l%2===0),i.length);return this.pos=n+Math.min(a+2,i.length),s.decode(i.subarray(2,a))}else if(i[0]===254&&i[1]===255){let s=new TextDecoder("utf-16be"),a=Lh(i.findIndex((o,l)=>o===0&&i[l+1]===0&&l%2===0),i.length);return this.pos=n+Math.min(a+2,i.length),s.decode(i.subarray(2,a))}else{let s=Lh(i.findIndex(a=>a===0),i.length);return this.pos=n+Math.min(s+1,i.length),kn.decode(i.subarray(0,s))}case Tv.UTF_16_BE_NO_BOM:{let s=new TextDecoder("utf-16be"),a=Lh(i.findIndex((o,l)=>o===0&&i[l+1]===0&&l%2===0),i.length);return this.pos=n+Math.min(a+2,i.length),s.decode(i.subarray(0,a))}case Tv.UTF_8:{let s=Lh(i.findIndex(a=>a===0),i.length);return this.pos=n+Math.min(s+1,i.length),kn.decode(i.subarray(0,s))}}}readId3V2EncodingAndText(e){if(this.pos>=e)return"";let r=this.readId3V2TextEncoding();return this.readId3V2Text(r,e)}};var RS=async(t,e,r)=>{let n=e;for(;r===null||n<r;){let i=t.requestSlice(n,4);if(i instanceof Promise&&(i=await i),!i)break;let s=ie(i),a=zve(s,t.fileSize!==null?t.fileSize-n:null);if(a.header)return{header:a.header,startPos:n};n+=a.bytesAdvanced}return null};var T3=class extends ai{constructor(e){super(e),this.metadataPromise=null,this.firstFrameHeader=null,this.loadedSamples=[],this.metadataTags=null,this.tracks=[],this.readingMutex=new cs,this.lastSampleLoaded=!1,this.lastLoadedPos=0,this.nextTimestampInSamples=0,this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{for(;!this.firstFrameHeader&&!this.lastSampleLoaded;)await this.advanceReader();if(!this.firstFrameHeader)throw new Error("No valid MP3 frame found.");this.tracks=[new Tn(this.input,new s$(this))]})()}async advanceReader(){if(this.lastLoadedPos===0)for(;;){let o=this.reader.requestSlice(this.lastLoadedPos,Iv);if(o instanceof Promise&&(o=await o),!o){this.lastSampleLoaded=!0;return}let l=Nh(o);if(!l)break;this.lastLoadedPos=o.filePos+l.size}let e=await RS(this.reader,this.lastLoadedPos,this.reader.fileSize);if(!e){this.lastSampleLoaded=!0;return}let r=e.header;this.lastLoadedPos=e.startPos+r.totalSize-1;let n=Uve(r.mpegVersionId,r.channel),i=this.reader.requestSlice(e.startPos+n,4);if(i instanceof Promise&&(i=await i),i){let o=ie(i);if(o===jve||o===$ve)return}this.firstFrameHeader||(this.firstFrameHeader=r),r.sampleRate!==this.firstFrameHeader.sampleRate&&console.warn(`MP3 changed sample rate mid-file: ${this.firstFrameHeader.sampleRate} Hz to ${r.sampleRate} Hz. Might be a bug, so please report this file.`);let s=r.audioSamplesInFrame/this.firstFrameHeader.sampleRate,a={timestamp:this.nextTimestampInSamples/this.firstFrameHeader.sampleRate,duration:s,dataStart:e.startPos,dataSize:r.totalSize};this.loadedSamples.push(a),this.nextTimestampInSamples+=r.audioSamplesInFrame}async getMimeType(){return"audio/mpeg"}async getTracks(){return await this.readMetadata(),this.tracks}async computeDuration(){await this.readMetadata();let e=this.tracks[0];return F(e),e.computeDuration()}async getMetadataTags(){let e=await this.readingMutex.acquire();try{if(await this.readMetadata(),this.metadataTags)return this.metadataTags;this.metadataTags={};let r=0,n=!1;for(;;){let i=this.reader.requestSlice(r,Iv);if(i instanceof Promise&&(i=await i),!i)break;let s=Nh(i);if(!s)break;n=!0;let a=this.reader.requestSlice(i.filePos,s.size);if(a instanceof Promise&&(a=await a),!a)break;C3(a,s,this.metadataTags),r=i.filePos+s.size}if(!n&&this.reader.fileSize!==null&&this.reader.fileSize>=PS){let i=this.reader.requestSlice(this.reader.fileSize-PS,PS);i instanceof Promise&&(i=await i),F(i),br(i,3)==="TAG"&&qve(i,this.metadataTags)}return this.metadataTags}finally{e()}}},s$=class{constructor(e){this.demuxer=e}getId(){return 1}async getFirstTimestamp(){return 0}getTimeResolution(){return F(this.demuxer.firstFrameHeader),this.demuxer.firstFrameHeader.sampleRate/this.demuxer.firstFrameHeader.audioSamplesInFrame}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getName(){return null}getLanguageCode(){return Sn}getCodec(){return"mp3"}getInternalCodecId(){return null}getNumberOfChannels(){return F(this.demuxer.firstFrameHeader),this.demuxer.firstFrameHeader.channel===3?1:2}getSampleRate(){return F(this.demuxer.firstFrameHeader),this.demuxer.firstFrameHeader.sampleRate}async getDecoderConfig(){return F(this.demuxer.firstFrameHeader),{codec:"mp3",numberOfChannels:this.demuxer.firstFrameHeader.channel===3?1:2,sampleRate:this.demuxer.firstFrameHeader.sampleRate}}async getPacketAtIndex(e,r){if(e===-1)return null;let n=this.demuxer.loadedSamples[e];if(!n)return null;let i;if(r.metadataOnly)i=Cn;else{let s=this.demuxer.reader.requestSlice(n.dataStart,n.dataSize);if(s instanceof Promise&&(s=await s),!s)return null;i=xe(s,n.dataSize)}return new ir(i,"key",n.timestamp,n.duration,e,n.dataSize)}getFirstPacket(e){return this.getPacketAtIndex(0,e)}async getNextPacket(e,r){let n=await this.demuxer.readingMutex.acquire();try{let i=vr(this.demuxer.loadedSamples,e.timestamp,a=>a.timestamp);if(i===-1)throw new Error("Packet was not created from this track.");let s=i+1;for(;s>=this.demuxer.loadedSamples.length&&!this.demuxer.lastSampleLoaded;)await this.demuxer.advanceReader();return this.getPacketAtIndex(s,r)}finally{n()}}async getPacket(e,r){let n=await this.demuxer.readingMutex.acquire();try{for(;;){let i=dt(this.demuxer.loadedSamples,e,s=>s.timestamp);if(i===-1&&this.demuxer.loadedSamples.length>0)return null;if(this.demuxer.lastSampleLoaded)return this.getPacketAtIndex(i,r);if(i>=0&&i+1<this.demuxer.loadedSamples.length)return this.getPacketAtIndex(i,r);await this.demuxer.advanceReader()}}finally{n()}}getKeyPacket(e,r){return this.getPacket(e,r)}getNextKeyPacket(e,r){return this.getNextPacket(e,r)}};var a$=1399285583,lXe=79764919,Gve=new Uint32Array(256);for(let t=0;t<256;t++){let e=t<<24;for(let r=0;r<8;r++)e=e&2147483648?e<<1^lXe:e<<1;Gve[t]=e>>>0&4294967295}var Wve=t=>{let e=fr(t),r=e.getUint32(22,!0);e.setUint32(22,0,!0);let n=0;for(let i=0;i<t.length;i++){let s=t[i];n=(n<<8^Gve[n>>>24^s])>>>0}return e.setUint32(22,r,!0),n},Kve=(t,e,r)=>{let n=0,i=null;if(t.length>0)if(e.codec==="vorbis"){F(e.vorbisInfo);let s=e.vorbisInfo.modeBlockflags.length,o=(1<<fve(s-1))-1<<1,l=(t[0]&o)>>1;if(l>=e.vorbisInfo.modeBlockflags.length)throw new Error("Invalid mode number.");let c=r,u=e.vorbisInfo.modeBlockflags[l];if(i=e.vorbisInfo.blocksizes[u],u===1){let d=(o|1)+1,f=t[0]&d?1:0;c=e.vorbisInfo.blocksizes[f]}n=c!==null?c+i>>2:0}else e.codec==="opus"&&(n=Sve(t).durationInSamples);return{durationInSamples:n,vorbisBlockSize:i}},Yve=t=>{let e="audio/ogg";if(t.codecStrings){let r=[...new Set(t.codecStrings)];e+=`; codecs="${r.join(", ")}"`}return e};var sf=27,Bh=282,Xve=Bh+255*255,Av=t=>{let e=t.filePos;if(Fh(t)!==a$)return null;t.skip(1);let n=ge(t),i=Zve(t),s=Fh(t),a=Fh(t),o=Fh(t),l=ge(t),c=new Uint8Array(l);for(let p=0;p<l;p++)c[p]=ge(t);let u=27+l,d=c.reduce((p,h)=>p+h,0),f=u+d;return{headerStartPos:e,totalSize:f,dataStartPos:e+u,dataSize:d,headerType:n,granulePosition:i,serialNumber:s,sequenceNumber:a,checksum:o,lacingValues:c}},Qve=(t,e)=>{for(;t.filePos<e-3;){let r=Fh(t),n=r&255,i=r>>>8&255,s=r>>>16&255,a=r>>>24&255,o=79;if(!(n!==o&&i!==o&&s!==o&&a!==o)){if(t.skip(-4),r===a$)return!0;t.skip(1)}}return!1};var E3=class extends ai{constructor(e){super(e),this.metadataPromise=null,this.bitstreams=[],this.tracks=[],this.metadataTags={},this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{let e=0;for(;;){let r=this.reader.requestSliceRange(e,sf,Bh);if(r instanceof Promise&&(r=await r),!r)break;let n=Av(r);if(!n||!!!(n.headerType&2))break;this.bitstreams.push({serialNumber:n.serialNumber,bosPage:n,description:null,numberOfChannels:-1,sampleRate:-1,codecInfo:{codec:null,vorbisInfo:null,opusInfo:null},lastMetadataPacket:null}),e=n.headerStartPos+n.totalSize}for(let r of this.bitstreams){let n=await this.readPacket(r.bosPage,0);n&&(n.data.byteLength>=7&&n.data[0]===1&&n.data[1]===118&&n.data[2]===111&&n.data[3]===114&&n.data[4]===98&&n.data[5]===105&&n.data[6]===115?await this.readVorbisMetadata(n,r):n.data.byteLength>=8&&n.data[0]===79&&n.data[1]===112&&n.data[2]===117&&n.data[3]===115&&n.data[4]===72&&n.data[5]===101&&n.data[6]===97&&n.data[7]===100&&await this.readOpusMetadata(n,r),r.codecInfo.codec!==null&&this.tracks.push(new Tn(this.input,new o$(r,this))))}})()}async readVorbisMetadata(e,r){let n=await this.findNextPacketStart(e);if(!n)return;let i=await this.readPacket(n.startPage,n.startSegmentIndex);if(!i||(n=await this.findNextPacketStart(i),!n))return;let s=await this.readPacket(n.startPage,n.startSegmentIndex);if(!s||i.data[0]!==3||s.data[0]!==5)return;let a=[],o=d=>{for(;a.push(Math.min(255,d)),!(d<255);)d-=255};o(e.data.length),o(i.data.length);let l=new Uint8Array(1+a.length+e.data.length+i.data.length+s.data.length);l[0]=2,l.set(a,1),l.set(e.data,1+a.length),l.set(i.data,1+a.length+e.data.length),l.set(s.data,1+a.length+e.data.length+i.data.length),r.codecInfo.codec="vorbis",r.description=l,r.lastMetadataPacket=s;let c=fr(e.data);r.numberOfChannels=c.getUint8(11),r.sampleRate=c.getUint32(12,!0);let u=c.getUint8(28);r.codecInfo.vorbisInfo={blocksizes:[1<<(u&15),1<<(u>>4)],modeBlockflags:Cve(s.data).modeBlockflags},ES(i.data.subarray(7),this.metadataTags)}async readOpusMetadata(e,r){let n=await this.findNextPacketStart(e);if(!n)return;let i=await this.readPacket(n.startPage,n.startSegmentIndex);if(!i)return;r.codecInfo.codec="opus",r.description=e.data,r.lastMetadataPacket=i;let s=kve(e.data);r.numberOfChannels=s.outputChannelCount,r.sampleRate=_h,r.codecInfo.opusInfo={preSkip:s.preSkip},ES(i.data.subarray(8),this.metadataTags)}async readPacket(e,r){F(r<e.lacingValues.length);let n=0;for(let d=0;d<r;d++)n+=e.lacingValues[d];let i=e,s=n,a=r,o=[];e:for(;;){let d=this.reader.requestSlice(i.dataStartPos,i.dataSize);d instanceof Promise&&(d=await d),F(d);let f=xe(d,i.dataSize);for(;;){if(a===i.lacingValues.length){o.push(f.subarray(n,s));break}let h=i.lacingValues[a];if(s+=h,h<255){o.push(f.subarray(n,s));break e}a++}let p=i.headerStartPos+i.totalSize;for(;;){let h=this.reader.requestSliceRange(p,sf,Bh);if(h instanceof Promise&&(h=await h),!h)return null;let m=Av(h);if(!m)return null;if(i=m,i.serialNumber===e.serialNumber)break;p=i.headerStartPos+i.totalSize}n=0,s=0,a=0}let l=o.reduce((d,f)=>d+f.length,0),c=new Uint8Array(l),u=0;for(let d=0;d<o.length;d++){let f=o[d];c.set(f,u),u+=f.length}return{data:c,endPage:i,endSegmentIndex:a}}async findNextPacketStart(e){if(e.endSegmentIndex<e.endPage.lacingValues.length-1)return{startPage:e.endPage,startSegmentIndex:e.endSegmentIndex+1};if(!!(e.endPage.headerType&4))return null;let n=e.endPage.headerStartPos+e.endPage.totalSize;for(;;){let i=this.reader.requestSliceRange(n,sf,Bh);if(i instanceof Promise&&(i=await i),!i)return null;let s=Av(i);if(!s)return null;if(s.serialNumber===e.endPage.serialNumber)return{startPage:s,startSegmentIndex:0};n=s.headerStartPos+s.totalSize}}async getMimeType(){await this.readMetadata();let e=await Promise.all(this.tracks.map(r=>r.getCodecParameterString()));return Yve({codecStrings:e.filter(Boolean)})}async getTracks(){return await this.readMetadata(),this.tracks}async computeDuration(){let e=await this.getTracks(),r=await Promise.all(e.map(n=>n.computeDuration()));return Math.max(0,...r)}async getMetadataTags(){return await this.readMetadata(),this.metadataTags}},o$=class{constructor(e,r){this.bitstream=e,this.demuxer=r,this.encodedPacketToMetadata=new WeakMap,this.sequentialScanCache=[],this.sequentialScanMutex=new cs,this.internalSampleRate=e.codecInfo.codec==="opus"?_h:e.sampleRate}getId(){return this.bitstream.serialNumber}getNumberOfChannels(){return this.bitstream.numberOfChannels}getSampleRate(){return this.bitstream.sampleRate}getTimeResolution(){return this.bitstream.sampleRate}getCodec(){return this.bitstream.codecInfo.codec}getInternalCodecId(){return null}async getDecoderConfig(){return F(this.bitstream.codecInfo.codec),{codec:this.bitstream.codecInfo.codec,numberOfChannels:this.bitstream.numberOfChannels,sampleRate:this.bitstream.sampleRate,description:this.bitstream.description??void 0}}getName(){return null}getLanguageCode(){return Sn}async getFirstTimestamp(){return 0}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}granulePositionToTimestampInSamples(e){return this.bitstream.codecInfo.codec==="opus"?(F(this.bitstream.codecInfo.opusInfo),e-this.bitstream.codecInfo.opusInfo.preSkip):e}createEncodedPacketFromOggPacket(e,r,n){if(!e)return null;let{durationInSamples:i,vorbisBlockSize:s}=Kve(e.data,this.bitstream.codecInfo,r.vorbisLastBlocksize),a=new ir(n.metadataOnly?Cn:e.data,"key",Math.max(0,r.timestampInSamples)/this.internalSampleRate,i/this.internalSampleRate,e.endPage.headerStartPos+e.endSegmentIndex,e.data.byteLength);return this.encodedPacketToMetadata.set(a,{packet:e,timestampInSamples:r.timestampInSamples,durationInSamples:i,vorbisLastBlockSize:r.vorbisLastBlocksize,vorbisBlockSize:s}),a}async getFirstPacket(e){F(this.bitstream.lastMetadataPacket);let r=await this.demuxer.findNextPacketStart(this.bitstream.lastMetadataPacket);if(!r)return null;let n=0;this.bitstream.codecInfo.codec==="opus"&&(F(this.bitstream.codecInfo.opusInfo),n-=this.bitstream.codecInfo.opusInfo.preSkip);let i=await this.demuxer.readPacket(r.startPage,r.startSegmentIndex);return this.createEncodedPacketFromOggPacket(i,{timestampInSamples:n,vorbisLastBlocksize:null},e)}async getNextPacket(e,r){let n=this.encodedPacketToMetadata.get(e);if(!n)throw new Error("Packet was not created from this track.");let i=await this.demuxer.findNextPacketStart(n.packet);if(!i)return null;let s=n.timestampInSamples+n.durationInSamples,a=await this.demuxer.readPacket(i.startPage,i.startSegmentIndex);return this.createEncodedPacketFromOggPacket(a,{timestampInSamples:s,vorbisLastBlocksize:n.vorbisBlockSize},r)}async getPacket(e,r){if(this.demuxer.reader.fileSize===null)return this.getPacketSequential(e,r);let n=Rh(e*this.internalSampleRate,14);if(n===0)return this.getFirstPacket(r);if(n<0)return null;F(this.bitstream.lastMetadataPacket);let i=await this.demuxer.findNextPacketStart(this.bitstream.lastMetadataPacket);if(!i)return null;let s=i.startPage,a=this.demuxer.reader.fileSize,o=[s];e:for(;s.headerStartPos+s.totalSize<a;){let y=s.headerStartPos,x=Math.floor((y+a)/2),w=x;for(;;){let C=Math.min(w+Xve,a-sf),O=this.demuxer.reader.requestSlice(w,C-w);if(O instanceof Promise&&(O=await O),F(O),!Qve(O,C)){a=x+sf;continue e}let T=this.demuxer.reader.requestSliceRange(O.filePos,sf,Bh);T instanceof Promise&&(T=await T),F(T);let E=Av(T);F(E);let P=!1;if(E.serialNumber===this.bitstream.serialNumber)P=!0;else{let I=this.demuxer.reader.requestSlice(E.headerStartPos,E.totalSize);I instanceof Promise&&(I=await I),F(I);let B=xe(I,E.totalSize);P=Wve(B)===E.checksum}if(!P){w=E.headerStartPos+4;continue}if(P&&E.serialNumber!==this.bitstream.serialNumber){w=E.headerStartPos+E.totalSize;continue}if(E.granulePosition===-1){w=E.headerStartPos+E.totalSize;continue}this.granulePositionToTimestampInSamples(E.granulePosition)>n?a=E.headerStartPos:(s=E,o.push(E));continue e}}let l=i.startPage;for(let y of o){if(y.granulePosition===s.granulePosition)break;(!l||y.headerStartPos>l.headerStartPos)&&(l=y)}let c=l,u=[c];for(;!(c.serialNumber===this.bitstream.serialNumber&&c.granulePosition===s.granulePosition);){let y=c.headerStartPos+c.totalSize,x=this.demuxer.reader.requestSliceRange(y,sf,Bh);x instanceof Promise&&(x=await x),F(x);let w=Av(x);F(w),c=w,c.serialNumber===this.bitstream.serialNumber&&u.push(c)}F(c.granulePosition!==-1);let d=null,f,p,h=c,m=0;if(c.headerStartPos===i.startPage.headerStartPos)f=this.granulePositionToTimestampInSamples(0),p=!0,d=0;else{f=0,p=!1;for(let w=c.lacingValues.length-1;w>=0;w--)if(c.lacingValues[w]<255){d=w+1;break}if(d===null)throw new Error("Invalid page with granule position: no packets end on this page.");m=d-1;let y={data:Cn,endPage:h,endSegmentIndex:m};if(await this.demuxer.findNextPacketStart(y)){let w=ebe(u,c,d);F(w);let C=Jve(u,w.page,w.segmentIndex);C&&(c=C.page,d=C.segmentIndex)}else for(;;){let w=ebe(u,c,d);if(!w)break;let C=Jve(u,w.page,w.segmentIndex);if(!C)break;if(c=C.page,d=C.segmentIndex,w.page.headerStartPos!==h.headerStartPos){h=w.page,m=w.segmentIndex;break}}}let v=null,b=null;for(;c!==null;){F(d!==null);let y=await this.demuxer.readPacket(c,d);if(!y)break;if(!(c.headerStartPos===i.startPage.headerStartPos&&d<i.startSegmentIndex)){let C=this.createEncodedPacketFromOggPacket(y,{timestampInSamples:f,vorbisLastBlocksize:b?.vorbisBlockSize??null},r);F(C);let O=this.encodedPacketToMetadata.get(C);if(F(O),!p&&y.endPage.headerStartPos===h.headerStartPos&&y.endSegmentIndex===m?(f=this.granulePositionToTimestampInSamples(c.granulePosition),p=!0,C=this.createEncodedPacketFromOggPacket(y,{timestampInSamples:f-O.durationInSamples,vorbisLastBlocksize:b?.vorbisBlockSize??null},r),F(C),O=this.encodedPacketToMetadata.get(C),F(O)):f+=O.durationInSamples,v=C,b=O,p&&(Math.max(f,0)>n||Math.max(O.timestampInSamples,0)===n))break}let w=await this.demuxer.findNextPacketStart(y);if(!w)break;c=w.startPage,d=w.startSegmentIndex}return v}async getPacketSequential(e,r){let n=await this.sequentialScanMutex.acquire();try{let i=Rh(e*this.internalSampleRate,14);e=i/this.internalSampleRate;let s=dt(this.sequentialScanCache,i,l=>l.timestampInSamples),a;if(s!==-1){let l=this.sequentialScanCache[s];a=this.createEncodedPacketFromOggPacket(l.packet,{timestampInSamples:l.timestampInSamples,vorbisLastBlocksize:l.vorbisLastBlockSize},r)}else a=await this.getFirstPacket(r);let o=0;for(;a&&a.timestamp<e;){let l=await this.getNextPacket(a,r);if(!l||l.timestamp>e)break;if(a=l,o++,o===100){o=0;let c=this.encodedPacketToMetadata.get(a);F(c),this.sequentialScanCache.length>0&&F(Li(this.sequentialScanCache).timestampInSamples<=c.timestampInSamples),this.sequentialScanCache.push(c)}}return a}finally{n()}}getKeyPacket(e,r){return this.getPacket(e,r)}getNextKeyPacket(e,r){return this.getNextPacket(e,r)}},Jve=(t,e,r)=>{let n=e,i=r;e:for(;;){for(i--,i;i>=0;i--)if(n.lacingValues[i]<255){i++;break e}if(F(i===-1),!(n.headerType&1)){i=0;break}let a=jj(t,o=>o.headerStartPos<n.headerStartPos);if(!a)return null;n=a,i=n.lacingValues.length}if(F(i!==-1),i===n.lacingValues.length){let s=t[t.indexOf(n)+1];F(s),n=s,i=0}return{page:n,segmentIndex:i}},ebe=(t,e,r)=>{if(r>0)return{page:e,segmentIndex:r-1};let n=jj(t,i=>i.headerStartPos<e.headerStartPos);return n?{page:n,segmentIndex:n.lacingValues.length-1}:null};var ru;(function(t){t[t.PCM=1]="PCM",t[t.IEEE_FLOAT=3]="IEEE_FLOAT",t[t.ALAW=6]="ALAW",t[t.MULAW=7]="MULAW",t[t.EXTENSIBLE=65534]="EXTENSIBLE"})(ru||(ru={}));var I3=class extends ai{constructor(e){super(e),this.metadataPromise=null,this.dataStart=-1,this.dataSize=-1,this.audioInfo=null,this.tracks=[],this.lastKnownPacketIndex=0,this.metadataTags={},this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{let e=this.reader.requestSlice(0,12);e instanceof Promise&&(e=await e),F(e);let r=br(e,4),n=r!=="RIFX",i=r==="RF64",s=nu(e,n),a=i?this.reader.fileSize:Math.min(s+8,this.reader.fileSize??1/0);if(br(e,4)!=="WAVE")throw new Error("Invalid WAVE file - wrong format");let l=0,c=null,u=e.filePos;for(;a===null||u<a;){let f=this.reader.requestSlice(u,8);if(f instanceof Promise&&(f=await f),!f)break;let p=br(f,4),h=nu(f,n),m=f.filePos;if(i&&l===0&&p!=="ds64")throw new Error('Invalid RF64 file: First chunk must be "ds64".');if(p==="fmt ")await this.parseFmtChunk(m,h,n);else if(p==="data"){if(c??=h,this.dataStart=f.filePos,this.dataSize=Math.min(c,(a??1/0)-this.dataStart),this.reader.fileSize===null)break}else if(p==="ds64"){let v=c$(f,n);c=c$(f,n),a=Math.min(v+8,this.reader.fileSize??1/0)}else p==="LIST"?await this.parseListChunk(m,h,n):(p==="ID3 "||p==="id3 ")&&await this.parseId3Chunk(m,h);u=m+h+(h&1),l++}if(!this.audioInfo)throw new Error('Invalid WAVE file - missing "fmt " chunk');if(this.dataStart===-1)throw new Error('Invalid WAVE file - missing "data" chunk');let d=this.audioInfo.blockSizeInBytes;this.dataSize=Math.floor(this.dataSize/d)*d,this.tracks.push(new Tn(this.input,new l$(this)))})()}async parseFmtChunk(e,r,n){let i=this.reader.requestSlice(e,r);if(i instanceof Promise&&(i=await i),!i)return;let s=Rv(i,n),a=Rv(i,n),o=nu(i,n);i.skip(4);let l=Rv(i,n),c;if(r===14?c=8:c=Rv(i,n),r>=18&&s!==357){let u=Rv(i,n),d=r-18;if(Math.min(d,u)>=22&&s===ru.EXTENSIBLE){i.skip(6);let p=xe(i,16);s=p[0]|p[1]<<8}}(s===ru.MULAW||s===ru.ALAW)&&(c=8),this.audioInfo={format:s,numberOfChannels:a,sampleRate:o,sampleSizeInBytes:Math.ceil(c/8),blockSizeInBytes:l}}async parseListChunk(e,r,n){let i=this.reader.requestSlice(e,r);if(i instanceof Promise&&(i=await i),!i)return;let s=br(i,4);if(s!=="INFO"&&s!=="INF0")return;let a=i.filePos;for(;a<=e+r-8;){i.filePos=a;let o=br(i,4),l=nu(i,n),c=xe(i,l),u=0;for(let f=0;f<c.length&&c[f]!==0;f++)u++;let d=String.fromCharCode(...c.subarray(0,u));switch(this.metadataTags.raw??={},this.metadataTags.raw[o]=d,o){case"INAM":case"TITL":this.metadataTags.title??=d;break;case"TIT3":this.metadataTags.description??=d;break;case"IART":this.metadataTags.artist??=d;break;case"IPRD":this.metadataTags.album??=d;break;case"IPRT":case"ITRK":case"TRCK":{let f=d.split("/"),p=Number.parseInt(f[0],10),h=f[1]&&Number.parseInt(f[1],10);Number.isInteger(p)&&p>0&&(this.metadataTags.trackNumber??=p),h&&Number.isInteger(h)&&h>0&&(this.metadataTags.tracksTotal??=h)}break;case"ICRD":case"IDIT":{let f=new Date(d);Number.isNaN(f.getTime())||(this.metadataTags.date??=f)}break;case"YEAR":{let f=Number.parseInt(d,10);Number.isInteger(f)&&f>0&&(this.metadataTags.date??=new Date(f,0,1))}break;case"IGNR":case"GENR":this.metadataTags.genre??=d;break;case"ICMT":case"CMNT":case"COMM":this.metadataTags.comment??=d;break}a+=8+l+(l&1)}}async parseId3Chunk(e,r){let n=this.reader.requestSlice(e,r);if(n instanceof Promise&&(n=await n),!n)return;let i=Nh(n);if(i){let s=n.slice(e+10,i.size);C3(s,i,this.metadataTags)}}getCodec(){if(F(this.audioInfo),this.audioInfo.format===ru.MULAW)return"ulaw";if(this.audioInfo.format===ru.ALAW)return"alaw";if(this.audioInfo.format===ru.PCM){if(this.audioInfo.sampleSizeInBytes===1)return"pcm-u8";if(this.audioInfo.sampleSizeInBytes===2)return"pcm-s16";if(this.audioInfo.sampleSizeInBytes===3)return"pcm-s24";if(this.audioInfo.sampleSizeInBytes===4)return"pcm-s32"}return this.audioInfo.format===ru.IEEE_FLOAT&&this.audioInfo.sampleSizeInBytes===4?"pcm-f32":null}async getMimeType(){return"audio/wav"}async computeDuration(){await this.readMetadata();let e=this.tracks[0];return F(e),e.computeDuration()}async getTracks(){return await this.readMetadata(),this.tracks}async getMetadataTags(){return await this.readMetadata(),this.metadataTags}},Pv=2048,l$=class{constructor(e){this.demuxer=e}getId(){return 1}getCodec(){return this.demuxer.getCodec()}getInternalCodecId(){return F(this.demuxer.audioInfo),this.demuxer.audioInfo.format}async getDecoderConfig(){let e=this.demuxer.getCodec();return e?(F(this.demuxer.audioInfo),{codec:e,numberOfChannels:this.demuxer.audioInfo.numberOfChannels,sampleRate:this.demuxer.audioInfo.sampleRate}):null}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getNumberOfChannels(){return F(this.demuxer.audioInfo),this.demuxer.audioInfo.numberOfChannels}getSampleRate(){return F(this.demuxer.audioInfo),this.demuxer.audioInfo.sampleRate}getTimeResolution(){return F(this.demuxer.audioInfo),this.demuxer.audioInfo.sampleRate}getName(){return null}getLanguageCode(){return Sn}async getFirstTimestamp(){return 0}async getPacketAtIndex(e,r){F(this.demuxer.audioInfo);let n=e*Pv*this.demuxer.audioInfo.blockSizeInBytes;if(n>=this.demuxer.dataSize)return null;let i=Math.min(Pv*this.demuxer.audioInfo.blockSizeInBytes,this.demuxer.dataSize-n);if(this.demuxer.reader.fileSize===null){let l=this.demuxer.reader.requestSlice(this.demuxer.dataStart+n,i);if(l instanceof Promise&&(l=await l),!l)return null}let s;if(r.metadataOnly)s=Cn;else{let l=this.demuxer.reader.requestSlice(this.demuxer.dataStart+n,i);l instanceof Promise&&(l=await l),F(l),s=xe(l,i)}let a=e*Pv/this.demuxer.audioInfo.sampleRate,o=i/this.demuxer.audioInfo.blockSizeInBytes/this.demuxer.audioInfo.sampleRate;return this.demuxer.lastKnownPacketIndex=Math.max(e,a),new ir(s,"key",a,o,e,i)}getFirstPacket(e){return this.getPacketAtIndex(0,e)}async getPacket(e,r){F(this.demuxer.audioInfo);let n=Math.floor(Math.min(e*this.demuxer.audioInfo.sampleRate/Pv,(this.demuxer.dataSize-1)/(Pv*this.demuxer.audioInfo.blockSizeInBytes))),i=await this.getPacketAtIndex(n,r);if(i)return i;if(n===0)return null;F(this.demuxer.reader.fileSize===null);let s=await this.getPacketAtIndex(this.demuxer.lastKnownPacketIndex,r);for(;s;){let a=await this.getNextPacket(s,r);if(!a)break;s=a}return s}getNextPacket(e,r){F(this.demuxer.audioInfo);let n=Math.round(e.timestamp*this.demuxer.audioInfo.sampleRate/Pv);return this.getPacketAtIndex(n+1,r)}getKeyPacket(e,r){return this.getPacket(e,r)}getNextKeyPacket(e,r){return this.getNextPacket(e,r)}};var Lv=7,Mv=9,LS=t=>{let e=t.filePos,r=xe(t,9),n=new Ht(r);if(n.readBits(12)!==4095||(n.skipBits(1),n.readBits(2)!==0))return null;let a=n.readBits(1),o=n.readBits(2)+1,l=n.readBits(4);if(l===15)return null;n.skipBits(1);let c=n.readBits(3);if(c===0)throw new Error("ADTS frames with channel configuration 0 are not supported.");n.skipBits(1),n.skipBits(1),n.skipBits(1),n.skipBits(1);let u=n.readBits(13);n.skipBits(11);let d=n.readBits(2)+1;if(d!==1)throw new Error("ADTS frames with more than one AAC frame are not supported.");let f=null;return a===1?t.filePos-=2:f=n.readBits(16),{objectType:o,samplingFrequencyIndex:l,channelConfiguration:c,frameLength:u,numberOfAacFrames:d,crcCheck:f,startPos:e}};var u$=1024,A3=class extends ai{constructor(e){super(e),this.metadataPromise=null,this.firstFrameHeader=null,this.loadedSamples=[],this.tracks=[],this.readingMutex=new cs,this.lastSampleLoaded=!1,this.lastLoadedPos=0,this.nextTimestampInSamples=0,this.reader=e._reader}async readMetadata(){return this.metadataPromise??=(async()=>{for(;!this.firstFrameHeader&&!this.lastSampleLoaded;)await this.advanceReader();F(this.firstFrameHeader),this.tracks=[new Tn(this.input,new d$(this))]})()}async advanceReader(){let e=this.reader.requestSliceRange(this.lastLoadedPos,Lv,Mv);if(e instanceof Promise&&(e=await e),!e){this.lastSampleLoaded=!0;return}let r=LS(e);if(!r){this.lastSampleLoaded=!0;return}if(this.reader.fileSize!==null&&r.startPos+r.frameLength>this.reader.fileSize){this.lastSampleLoaded=!0;return}this.firstFrameHeader||(this.firstFrameHeader=r);let n=CS[r.samplingFrequencyIndex];F(n!==void 0);let i=u$/n,s=r.crcCheck?Mv:Lv,a={timestamp:this.nextTimestampInSamples/n,duration:i,dataStart:r.startPos+s,dataSize:r.frameLength-s};this.loadedSamples.push(a),this.nextTimestampInSamples+=u$,this.lastLoadedPos=r.startPos+r.frameLength}async getMimeType(){return"audio/aac"}async getTracks(){return await this.readMetadata(),this.tracks}async computeDuration(){await this.readMetadata();let e=this.tracks[0];return F(e),e.computeDuration()}async getMetadataTags(){return{}}},d$=class{constructor(e){this.demuxer=e}getId(){return 1}async getFirstTimestamp(){return 0}getTimeResolution(){return this.getSampleRate()/u$}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getName(){return null}getLanguageCode(){return Sn}getCodec(){return"aac"}getInternalCodecId(){return F(this.demuxer.firstFrameHeader),this.demuxer.firstFrameHeader.objectType}getNumberOfChannels(){F(this.demuxer.firstFrameHeader);let e=Hj[this.demuxer.firstFrameHeader.channelConfiguration];return F(e!==void 0),e}getSampleRate(){F(this.demuxer.firstFrameHeader);let e=CS[this.demuxer.firstFrameHeader.samplingFrequencyIndex];return F(e!==void 0),e}async getDecoderConfig(){F(this.demuxer.firstFrameHeader);let e=new Uint8Array(3),r=new Ht(e),{objectType:n,samplingFrequencyIndex:i,channelConfiguration:s}=this.demuxer.firstFrameHeader;return n>31?(r.writeBits(5,31),r.writeBits(6,n-32)):r.writeBits(5,n),r.writeBits(4,i),r.writeBits(4,s),{codec:`mp4a.40.${this.demuxer.firstFrameHeader.objectType}`,numberOfChannels:this.getNumberOfChannels(),sampleRate:this.getSampleRate(),description:e.subarray(0,Math.ceil((r.pos-1)/8))}}async getPacketAtIndex(e,r){if(e===-1)return null;let n=this.demuxer.loadedSamples[e];if(!n)return null;let i;if(r.metadataOnly)i=Cn;else{let s=this.demuxer.reader.requestSlice(n.dataStart,n.dataSize);if(s instanceof Promise&&(s=await s),!s)return null;i=xe(s,n.dataSize)}return new ir(i,"key",n.timestamp,n.duration,e,n.dataSize)}getFirstPacket(e){return this.getPacketAtIndex(0,e)}async getNextPacket(e,r){let n=await this.demuxer.readingMutex.acquire();try{let i=vr(this.demuxer.loadedSamples,e.timestamp,a=>a.timestamp);if(i===-1)throw new Error("Packet was not created from this track.");let s=i+1;for(;s>=this.demuxer.loadedSamples.length&&!this.demuxer.lastSampleLoaded;)await this.demuxer.advanceReader();return this.getPacketAtIndex(s,r)}finally{n()}}async getPacket(e,r){let n=await this.demuxer.readingMutex.acquire();try{for(;;){let i=dt(this.demuxer.loadedSamples,e,s=>s.timestamp);if(i===-1&&this.demuxer.loadedSamples.length>0)return null;if(this.demuxer.lastSampleLoaded)return this.getPacketAtIndex(i,r);if(i>=0&&i+1<this.demuxer.loadedSamples.length)return this.getPacketAtIndex(i,r);await this.demuxer.advanceReader()}}finally{n()}}getKeyPacket(e,r){return this.getPacket(e,r)}getNextKeyPacket(e,r){return this.getNextPacket(e,r)}};var tbe=t=>t===0?null:t===1?192:t>=2&&t<=5?144*2**t:t===6?"uncommon-u8":t===7?"uncommon-u16":t>=8&&t<=15?2**t:null,rbe=(t,e)=>{switch(t){case 0:return e;case 1:return 88200;case 2:return 176400;case 3:return 192e3;case 4:return 8e3;case 5:return 16e3;case 6:return 22050;case 7:return 24e3;case 8:return 32e3;case 9:return 44100;case 10:return 48e3;case 11:return 96e3;case 12:return"uncommon-u8";case 13:return"uncommon-u16";case 14:return"uncommon-u16-10";default:return null}},nbe=t=>{let e=0,r=new Ht(xe(t,1));for(;r.readBits(1)===1;)e++;if(e===0)return r.readBits(7);let n=[],i=e-1,s=new Ht(xe(t,i)),a=8-e-1;for(let l=0;l<a;l++)n.unshift(r.readBits(1));for(let l=0;l<i;l++)for(let c=0;c<8;c++){let u=s.readBits(1);c<2||n.unshift(u)}return n.reduce((l,c,u)=>l|c<<u,0)},ibe=(t,e)=>{if(e==="uncommon-u16")return on(t)+1;if(e==="uncommon-u8")return ge(t)+1;if(typeof e=="number")return e;Qd(e),F(!1)},sbe=(t,e)=>e==="uncommon-u16"?on(t):e==="uncommon-u16-10"?on(t)*10:e==="uncommon-u8"?ge(t):typeof e=="number"?e:null,abe=t=>{let r=0;for(let n of t){r^=n;for(let i=0;i<8;i++)(r&128)!==0?r=r<<1^7:r<<=1,r&=255}return r};var P3=class extends ai{constructor(e){super(e),this.loadedSamples=[],this.metadataPromise=null,this.track=null,this.metadataTags={},this.audioInfo=null,this.lastLoadedPos=null,this.blockingBit=null,this.readingMutex=new cs,this.lastSampleLoaded=!1,this.reader=e._reader}async computeDuration(){return await this.readMetadata(),F(this.track),this.track.computeDuration()}async getMetadataTags(){return await this.readMetadata(),this.metadataTags}async getTracks(){return await this.readMetadata(),F(this.track),[this.track]}async getMimeType(){return"audio/flac"}async readMetadata(){let e=4;return this.metadataPromise??=(async()=>{for(;this.reader.fileSize===null||e<this.reader.fileSize;){let r=this.reader.requestSlice(e,4);if(r instanceof Promise&&(r=await r),e+=4,r===null)throw new Error(`Metadata block at position ${e} is too small! Corrupted file.`);F(r);let n=ge(r),i=rf(r),s=(n&128)!==0;switch(n&127){case Jd.STREAMINFO:{let o=this.reader.requestSlice(e,i);if(o instanceof Promise&&(o=await o),F(o),o===null)throw new Error(`StreamInfo block at position ${e} is too small! Corrupted file.`);let l=xe(o,34),c=new Ht(l),u=c.readBits(16),d=c.readBits(16),f=c.readBits(24),p=c.readBits(24),h=c.readBits(20),m=c.readBits(3)+1;c.readBits(5);let v=c.readBits(36);c.skipBits(16*8);let b=new Uint8Array(42);b.set(new Uint8Array([102,76,97,67]),0),b.set(new Uint8Array([128,0,0,34]),4),b.set(l,8),this.audioInfo={numberOfChannels:m,sampleRate:h,totalSamples:v,minimumBlockSize:u,maximumBlockSize:d,minimumFrameSize:f,maximumFrameSize:p,description:b},this.track=new Tn(this.input,new f$(this));break}case Jd.VORBIS_COMMENT:{let o=this.reader.requestSlice(e,i);o instanceof Promise&&(o=await o),F(o),ES(xe(o,i),this.metadataTags);break}case Jd.PICTURE:{let o=this.reader.requestSlice(e,i);o instanceof Promise&&(o=await o),F(o);let l=ie(o),c=ie(o),u=kn.decode(xe(o,c)),d=ie(o),f=kn.decode(xe(o,d));o.skip(16);let p=ie(o),h=xe(o,p);this.metadataTags.images??=[],this.metadataTags.images.push({data:h,mimeType:u,kind:l===3?"coverFront":l===4?"coverBack":"unknown",description:f});break}default:break}if(e+=i,s){this.lastLoadedPos=e;break}}})()}async readNextFlacFrame({startPos:e,isFirstPacket:r}){F(this.audioInfo);let n=6,s=this.audioInfo.maximumFrameSize+16,a=await this.reader.requestSliceRange(e,this.audioInfo.minimumFrameSize,s);if(!a)return null;let o=this.readFlacFrameHeader({slice:a,isFirstPacket:r});if(!o)return null;for(a.filePos=e+this.audioInfo.minimumFrameSize;;){if(a.filePos>a.end-n)return{num:o.num,blockSize:o.blockSize,sampleRate:o.sampleRate,size:a.end-e,isLastFrame:!0};if(ge(a)===255){let c=ge(a),u=this.blockingBit===1?249:248;if(c!==u){a.skip(-1);continue}a.skip(-2);let d=a.filePos-e;if(!this.readFlacFrameHeader({slice:a,isFirstPacket:!1})){a.skip(-1);continue}return{num:o.num,blockSize:o.blockSize,sampleRate:o.sampleRate,size:d,isLastFrame:!1}}}}readFlacFrameHeader({slice:e,isFirstPacket:r}){let n=e.filePos,i=xe(e,4),s=new Ht(i);if(s.readBits(15)!==32764)return null;if(this.blockingBit===null){F(r);let v=s.readBits(1);this.blockingBit=v}else if(this.blockingBit===1){if(F(!r),s.readBits(1)!==1)return null}else if(this.blockingBit===0){if(F(!r),s.readBits(1)!==0)return null}else throw new Error("Invalid blocking bit");let o=tbe(s.readBits(4));if(!o)return null;F(this.audioInfo);let l=rbe(s.readBits(4),this.audioInfo.sampleRate);if(!l||(s.readBits(4),s.readBits(3),s.readBits(1)!==0))return null;let u=nbe(e),d=ibe(e,o),f=sbe(e,l);if(f===null)return null;let p=e.filePos-n,h=ge(e);e.skip(-p),e.skip(-1);let m=abe(xe(e,p));return h!==m?null:{num:u,blockSize:d,sampleRate:f}}async advanceReader(){await this.readMetadata(),F(this.lastLoadedPos!==null),F(this.audioInfo);let e=this.lastLoadedPos,r=await this.readNextFlacFrame({startPos:e,isFirstPacket:this.loadedSamples.length===0});if(!r){this.lastSampleLoaded=!0;return}let n=this.loadedSamples[this.loadedSamples.length-1],s={blockOffset:n?n.blockOffset+n.blockSize:0,blockSize:r.blockSize,byteOffset:e,byteSize:r.size};if(this.lastLoadedPos=this.lastLoadedPos+r.size,this.loadedSamples.push(s),r.isLastFrame){this.lastSampleLoaded=!0;return}}},f$=class{constructor(e){this.demuxer=e}getId(){return 1}getCodec(){return"flac"}getInternalCodecId(){return null}getNumberOfChannels(){return F(this.demuxer.audioInfo),this.demuxer.audioInfo.numberOfChannels}async computeDuration(){let e=await this.getPacket(1/0,{metadataOnly:!0});return(e?.timestamp??0)+(e?.duration??0)}getSampleRate(){return F(this.demuxer.audioInfo),this.demuxer.audioInfo.sampleRate}getName(){return null}getLanguageCode(){return Sn}getTimeResolution(){return F(this.demuxer.audioInfo),this.demuxer.audioInfo.sampleRate}async getFirstTimestamp(){return 0}async getDecoderConfig(){return F(this.demuxer.audioInfo),{codec:"flac",numberOfChannels:this.demuxer.audioInfo.numberOfChannels,sampleRate:this.demuxer.audioInfo.sampleRate,description:this.demuxer.audioInfo.description}}async getPacket(e,r){if(F(this.demuxer.audioInfo),e<0)throw new Error("Timestamp cannot be negative");let n=await this.demuxer.readingMutex.acquire();try{for(;;){let i=dt(this.demuxer.loadedSamples,e,l=>l.blockOffset/this.demuxer.audioInfo.sampleRate);if(i===-1){await this.demuxer.advanceReader();continue}let s=this.demuxer.loadedSamples[i],a=s.blockOffset/this.demuxer.audioInfo.sampleRate,o=s.blockSize/this.demuxer.audioInfo.sampleRate;if(a+o<=e){if(this.demuxer.lastSampleLoaded)return this.getPacketAtIndex(this.demuxer.loadedSamples.length-1,r);await this.demuxer.advanceReader();continue}return this.getPacketAtIndex(i,r)}}finally{n()}}async getNextPacket(e,r){let n=await this.demuxer.readingMutex.acquire();try{let i=e.sequenceNumber+1;if(this.demuxer.lastSampleLoaded&&i>=this.demuxer.loadedSamples.length)return null;for(;i>=this.demuxer.loadedSamples.length&&!this.demuxer.lastSampleLoaded;)await this.demuxer.advanceReader();return this.getPacketAtIndex(i,r)}finally{n()}}getKeyPacket(e,r){return this.getPacket(e,r)}getNextKeyPacket(e,r){return this.getNextPacket(e,r)}async getPacketAtIndex(e,r){let n=this.demuxer.loadedSamples[e];if(!n)return null;let i;if(r.metadataOnly)i=Cn;else{let o=this.demuxer.reader.requestSlice(n.byteOffset,n.byteSize);if(o instanceof Promise&&(o=await o),!o)return null;i=xe(o,n.byteSize)}F(this.demuxer.audioInfo);let s=n.blockOffset/this.demuxer.audioInfo.sampleRate,a=n.blockSize/this.demuxer.audioInfo.sampleRate;return new ir(i,"key",s,a,e,n.byteSize)}async getFirstPacket(e){for(;this.demuxer.loadedSamples.length===0&&!this.demuxer.lastSampleLoaded;)await this.demuxer.advanceReader();return this.getPacketAtIndex(0,e)}};var ja=class{},MS=class extends ja{async _getMajorBrand(e){let r=e._reader.requestSlice(0,12);return r instanceof Promise&&(r=await r),!r||(r.skip(4),br(r,4)!=="ftyp")?null:br(r,4)}_createDemuxer(e){return new p3(e)}},R3=class extends MS{async _canReadInput(e){let r=await this._getMajorBrand(e);return!!r&&r!=="qt "}get name(){return"MP4"}get mimeType(){return"video/mp4"}},L3=class extends MS{async _canReadInput(e){return await this._getMajorBrand(e)==="qt "}get name(){return"QuickTime File Format"}get mimeType(){return"video/quicktime"}},_S=class extends ja{async isSupportedEBMLOfDocType(e,r){let n=e._reader.requestSlice(0,No);if(n instanceof Promise&&(n=await n),!n)return!1;let i=Zj(n);if(i===null||i<1||i>8||ft(n,i)!==Q.EBML)return!1;let a=Jj(n);if(a===null)return!1;let o=e._reader.requestSlice(n.filePos,a);if(o instanceof Promise&&(o=await o),!o)return!1;let l=n.filePos;for(;o.filePos<=l+a-us;){let c=Fo(o);if(!c)break;let{id:u,size:d}=c,f=o.filePos;if(d===null)return!1;switch(u){case Q.EBMLVersion:if(ft(o,d)!==1)return!1;break;case Q.EBMLReadVersion:if(ft(o,d)!==1)return!1;break;case Q.DocType:if(nf(o,d)!==r)return!1;break;case Q.DocTypeVersion:if(ft(o,d)>4)return!1;break}o.filePos=f+d}return!0}_canReadInput(e){return this.isSupportedEBMLOfDocType(e,"matroska")}_createDemuxer(e){return new w3(e)}get name(){return"Matroska"}get mimeType(){return"video/x-matroska"}},M3=class extends _S{_canReadInput(e){return this.isSupportedEBMLOfDocType(e,"webm")}get name(){return"WebM"}get mimeType(){return"video/webm"}},_3=class extends ja{async _canReadInput(e){let r=e._reader.requestSlice(0,10);if(r instanceof Promise&&(r=await r),!r)return!1;let n=0,i=!1;for(;;){let c=e._reader.requestSlice(n,Iv);if(c instanceof Promise&&(c=await c),!c)break;let u=Nh(c);if(!u)break;i=!0,n=c.filePos+u.size}let s=await RS(e._reader,n,n+4096);if(!s)return!1;if(i)return!0;n=s.startPos+s.header.totalSize;let a=await RS(e._reader,n,n+4);if(!a)return!1;let o=s.header,l=a.header;return!(o.channel!==l.channel||o.sampleRate!==l.sampleRate)}_createDemuxer(e){return new T3(e)}get name(){return"MP3"}get mimeType(){return"audio/mpeg"}},O3=class extends ja{async _canReadInput(e){let r=e._reader.requestSlice(0,12);if(r instanceof Promise&&(r=await r),!r)return!1;let n=br(r,4);return n!=="RIFF"&&n!=="RIFX"&&n!=="RF64"?!1:(r.skip(4),br(r,4)==="WAVE")}_createDemuxer(e){return new I3(e)}get name(){return"WAVE"}get mimeType(){return"audio/wav"}},D3=class extends ja{async _canReadInput(e){let r=e._reader.requestSlice(0,4);return r instanceof Promise&&(r=await r),r?br(r,4)==="OggS":!1}_createDemuxer(e){return new E3(e)}get name(){return"Ogg"}get mimeType(){return"application/ogg"}},N3=class extends ja{async _canReadInput(e){let r=e._reader.requestSlice(0,4);return r instanceof Promise&&(r=await r),r?br(r,4)==="fLaC":!1}get name(){return"FLAC"}get mimeType(){return"audio/flac"}_createDemuxer(e){return new P3(e)}},F3=class extends ja{async _canReadInput(e){let r=e._reader.requestSliceRange(0,Lv,Mv);if(r instanceof Promise&&(r=await r),!r)return!1;let n=LS(r);if(!n||(r=e._reader.requestSliceRange(n.frameLength,Lv,Mv),r instanceof Promise&&(r=await r),!r))return!1;let i=LS(r);return i?n.objectType===i.objectType&&n.samplingFrequencyIndex===i.samplingFrequencyIndex&&n.channelConfiguration===i.channelConfiguration:!1}_createDemuxer(e){return new A3(e)}get name(){return"ADTS"}get mimeType(){return"audio/aac"}},obe=new R3,lbe=new L3,cbe=new _S,ube=new M3,dbe=new _3,fbe=new O3,pbe=new D3,hbe=new F3,mbe=new N3,p$=[obe,lbe,cbe,ube,fbe,pbe,mbe,dbe,hbe];var af=class{constructor(){this._disposed=!1,this._sizePromise=null,this.onread=null}async getSizeOrNull(){if(this._disposed)throw new zn;return this._sizePromise??=Promise.resolve(this._retrieveSize())}async getSize(){if(this._disposed)throw new zn;let e=await this.getSizeOrNull();if(e===null)throw new Error("Cannot determine the size of an unsized source.");return e}},OS=class extends af{constructor(e){if(!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("buffer must be an ArrayBuffer or ArrayBufferView.");super(),this._onreadCalled=!1,this._bytes=kS(e),this._view=fr(e)}_retrieveSize(){return this._bytes.byteLength}_read(){return this._onreadCalled||(this.onread?.(0,this._bytes.byteLength),this._onreadCalled=!0),{bytes:this._bytes,view:this._view,offset:0}}_dispose(){}};var gbe=.5*2**20,cXe=t=>Math.min(2**(t-2),16),DS=class extends af{constructor(e,r={}){if(typeof e!="string"&&!(e instanceof URL)&&!(typeof Request<"u"&&e instanceof Request))throw new TypeError("url must be a string, URL or Request.");if(!r||typeof r!="object")throw new TypeError("options must be an object.");if(r.requestInit!==void 0&&(!r.requestInit||typeof r.requestInit!="object"))throw new TypeError("options.requestInit, when provided, must be an object.");if(r.getRetryDelay!==void 0&&typeof r.getRetryDelay!="function")throw new TypeError("options.getRetryDelay, when provided, must be a function.");if(r.maxCacheSize!==void 0&&(!Number.isInteger(r.maxCacheSize)||r.maxCacheSize<0))throw new TypeError("options.maxCacheSize, when provided, must be a non-negative integer.");if(r.fetchFn!==void 0&&typeof r.fetchFn!="function")throw new TypeError("options.fetchFn, when provided, must be a function.");super(),this._existingResponses=new WeakMap,this._url=e,this._options=r,this._getRetryDelay=r.getRetryDelay??cXe,this._orchestrator=new B3({maxCacheSize:r.maxCacheSize??64*2**20,maxWorkerCount:2,runWorker:this._runWorker.bind(this),prefetchProfile:ybe.network})}async _retrieveSize(){let e=new AbortController,r=await qj(this._options.fetchFn??fetch,this._url,zj(this._options.requestInit??{},{headers:{Range:"bytes=0-"},signal:e.signal}),this._getRetryDelay);if(!r.ok)throw new Error(`Error fetching ${String(this._url)}: ${r.status} ${r.statusText}`);let n,i;if(r.status===206)i=this._getPartialLengthFromRangeResponse(r),n=this._orchestrator.createWorker(0,Math.min(i,gbe));else{let s=r.headers.get("Content-Length");if(s)i=Number(s),n=this._orchestrator.createWorker(0,i),this._orchestrator.options.maxCacheSize=1/0,console.warn("HTTP server did not respond with 206 Partial Content, meaning the entire remote resource now has to be downloaded. For efficient media file streaming across a network, please make sure your server supports range requests.");else throw new Error(`HTTP response (status ${r.status}) must surface Content-Length header.`)}return this._orchestrator.fileSize=i,this._existingResponses.set(n,{response:r,abortController:e}),this._orchestrator.runWorker(n),i}_read(e,r){return this._orchestrator.read(e,r)}async _runWorker(e){for(;!e.aborted;){let r=this._existingResponses.get(e);this._existingResponses.delete(e);let n=r?.abortController,i=r?.response;if(n||(n=new AbortController,i=await qj(this._options.fetchFn??fetch,this._url,zj(this._options.requestInit??{},{headers:{Range:`bytes=${e.currentPos}-`},signal:n.signal}),this._getRetryDelay)),F(i),!i.ok)throw new Error(`Error fetching ${String(this._url)}: ${i.status} ${i.statusText}`);if(e.currentPos>0&&i.status!==206)throw new Error("HTTP server did not respond with 206 Partial Content to a range request. To enable efficient media file streaming across a network, please make sure your server supports range requests.");let s=this._getPartialLengthFromRangeResponse(i),a=e.targetPos-e.currentPos;if(s<a)throw new Error(`HTTP response unexpectedly too short: Needed at least ${a} bytes, got only ${s}.`);if(!i.body)throw new Error("Missing HTTP response body stream. The used fetch function must provide the response body as a ReadableStream.");let o=i.body.getReader();for(;;){if(e.currentPos>=e.targetPos||e.aborted){n.abort(),e.running=!1;return}let l;try{l=await o.read()}catch(d){let f=this._getRetryDelay(1,d);if(f!==null){console.error("Error while reading response stream. Attempting to resume.",d),await new Promise(p=>setTimeout(p,1e3*f));break}else throw d}let{done:c,value:u}=l;if(c){if(this._orchestrator.forgetWorker(e),e.currentPos<e.targetPos)throw new Error("Response stream reader stopped unexpectedly before all requested data was read.");e.running=!1;return}this.onread?.(e.currentPos,e.currentPos+u.length),this._orchestrator.supplyWorkerData(e,u)}}e.running=!1}_getPartialLengthFromRangeResponse(e){let r=e.headers.get("Content-Range");if(r){let n=/\/(\d+)/.exec(r);if(n)return Number(n[1]);throw new Error(`Invalid Content-Range header: ${r}`)}else{let n=e.headers.get("Content-Length");if(n)return Number(n);throw new Error("Partial HTTP response (status 206) must surface either Content-Range or Content-Length header.")}}_dispose(){this._orchestrator.dispose()}};var NS=class extends af{constructor(e){if(!e||typeof e!="object")throw new TypeError("options must be an object.");if(typeof e.getSize!="function")throw new TypeError("options.getSize must be a function.");if(typeof e.read!="function")throw new TypeError("options.read must be a function.");if(e.dispose!==void 0&&typeof e.dispose!="function")throw new TypeError("options.dispose, when provided, must be a function.");if(e.maxCacheSize!==void 0&&(!Number.isInteger(e.maxCacheSize)||e.maxCacheSize<0))throw new TypeError("options.maxCacheSize, when provided, must be a non-negative integer.");if(e.prefetchProfile&&!["none","fileSystem","network"].includes(e.prefetchProfile))throw new TypeError("options.prefetchProfile, when provided, must be one of 'none', 'fileSystem' or 'network'.");super(),this._options=e,this._orchestrator=new B3({maxCacheSize:e.maxCacheSize??8*2**20,maxWorkerCount:2,prefetchProfile:ybe[e.prefetchProfile??"none"],runWorker:this._runWorker.bind(this)})}_retrieveSize(){let e=this._options.getSize();if(e instanceof Promise)return e.then(r=>{if(!Number.isInteger(r)||r<0)throw new TypeError("options.getSize must return or resolve to a non-negative integer.");return this._orchestrator.fileSize=r,r});if(!Number.isInteger(e)||e<0)throw new TypeError("options.getSize must return or resolve to a non-negative integer.");return this._orchestrator.fileSize=e,e}_read(e,r){return this._orchestrator.read(e,r)}async _runWorker(e){for(;e.currentPos<e.targetPos&&!e.aborted;){let r=e.currentPos,n=e.targetPos,i=this._options.read(e.currentPos,n);if(i instanceof Promise&&(i=await i),i instanceof Uint8Array){if(i.length!==n-e.currentPos)throw new Error(`options.read returned a Uint8Array with unexpected length: Requested ${n-e.currentPos} bytes, but got ${i.length}.`);this.onread?.(e.currentPos,e.currentPos+i.length),this._orchestrator.supplyWorkerData(e,i)}else if(i instanceof ReadableStream){let s=i.getReader();for(;e.currentPos<n&&!e.aborted;){let{done:a,value:o}=await s.read();if(a){if(e.currentPos<n)throw new Error(`ReadableStream returned by options.read ended before supplying enough data. Requested ${n-r} bytes, but got ${e.currentPos-r}`);break}if(!(o instanceof Uint8Array))throw new TypeError("ReadableStream returned by options.read must yield Uint8Array chunks.");this.onread?.(e.currentPos,e.currentPos+o.length),this._orchestrator.supplyWorkerData(e,o)}}else throw new TypeError("options.read must return or resolve to a Uint8Array or a ReadableStream.")}e.running=!1}_dispose(){this._orchestrator.dispose(),this._options.dispose?.()}};var ybe={none:(t,e)=>({start:t,end:e}),fileSystem:(t,e)=>(t=Math.floor((t-65536)/65536)*65536,e=Math.ceil((e+65536)/65536)*65536,{start:t,end:e}),network:(t,e,r)=>{t=Math.max(0,Math.floor((t-65536)/65536)*65536);for(let i of r){let a=Math.max((i.startPos+i.targetPos)/2,i.targetPos-8388608);if(r3(t,e,a,i.targetPos)){let o=i.targetPos-i.startPos,l=Math.ceil((o+1)/8388608)*8388608,c=2**Math.ceil(Math.log2(o+1)),u=Math.min(c,l);e=Math.max(e,i.startPos+u)}}return e=Math.max(e,t+gbe),{start:t,end:e}}},B3=class{constructor(e){this.options=e,this.fileSize=null,this.nextAge=0,this.workers=[],this.cache=[],this.currentCacheSize=0}read(e,r){F(this.fileSize!==null);let n=this.options.prefetchProfile(e,r,this.workers),i=Math.max(n.start,0),s=Math.min(n.end,this.fileSize);F(i<=e&&r<=s);let a=null,o=dt(this.cache,e,y=>y.start),l=o!==-1?this.cache[o]:null;l&&l.start<=e&&r<=l.end&&(l.age=this.nextAge++,a={bytes:l.bytes,view:l.view,offset:l.start});let c=dt(this.cache,i,y=>y.start),u=a?null:new Uint8Array(r-e),d=0,f=i,p=[];if(c!==-1){for(let y=c;y<this.cache.length;y++){let x=this.cache[y];if(x.start>=s)break;if(x.end<=i)continue;let w=Math.max(i,x.start),C=Math.min(s,x.end);if(F(w<=C),f<w&&p.push({start:f,end:w}),f=C,u){let O=Math.max(e,x.start),S=Math.min(r,x.end);if(O<S){let T=O-e;u.set(x.bytes.subarray(O-x.start,S-x.start),T),T===d&&(d=S-e)}}x.age=this.nextAge++}f<s&&p.push({start:f,end:s})}else p.push({start:i,end:s});if(u&&d>=u.length&&(a={bytes:u,view:fr(u),offset:e}),p.length===0)return F(a),a;let{promise:h,resolve:m,reject:v}=Ph(),b=[];for(let y of p){let x=Math.max(e,y.start),w=Math.min(r,y.end);x===y.start&&w===y.end?b.push(y):x<w&&b.push({start:x,end:w})}for(let y of p){let x=u&&{start:e,bytes:u,holes:b,resolve:m,reject:v},w=!1;for(let C of this.workers)if(r3(y.start-131072,y.start,C.currentPos,C.targetPos)){C.targetPos=Math.max(C.targetPos,y.end),w=!0,x&&!C.pendingSlices.includes(x)&&C.pendingSlices.push(x),C.running||this.runWorker(C);break}if(!w){let C=this.createWorker(y.start,y.end);x&&(C.pendingSlices=[x]),this.runWorker(C)}}return a||(F(u),a=h.then(y=>({bytes:y,view:fr(y),offset:e}))),a}createWorker(e,r){let n={startPos:e,currentPos:e,targetPos:r,running:!1,aborted:!1,pendingSlices:[],age:this.nextAge++};for(this.workers.push(n);this.workers.length>this.options.maxWorkerCount;){let i=0,s=this.workers[0];for(let a=1;a<this.workers.length;a++){let o=this.workers[a];o.age<s.age&&(i=a,s=o)}if(s.running&&s.pendingSlices.length>0)break;s.aborted=!0,this.workers.splice(i,1)}return n}runWorker(e){F(!e.running),F(e.currentPos<e.targetPos),e.running=!0,e.age=this.nextAge++,this.options.runWorker(e).catch(r=>{if(e.running=!1,e.pendingSlices.length>0)e.pendingSlices.forEach(n=>n.reject(r)),e.pendingSlices.length=0;else throw r})}supplyWorkerData(e,r){let n=e.currentPos,i=n+r.length;this.insertIntoCache({start:n,end:i,bytes:r,view:fr(r),age:this.nextAge++}),e.currentPos+=r.length,e.targetPos=Math.max(e.targetPos,e.currentPos);for(let s=0;s<e.pendingSlices.length;s++){let a=e.pendingSlices[s],o=Math.max(n,a.start),l=Math.min(i,a.start+a.bytes.length);o<l&&a.bytes.set(r.subarray(o-n,l-n),o-a.start);for(let c=0;c<a.holes.length;c++){let u=a.holes[c];n<=u.start&&i>u.start&&(u.start=i),u.end<=u.start&&(a.holes.splice(c,1),c--)}a.holes.length===0&&(a.resolve(a.bytes),e.pendingSlices.splice(s,1),s--)}for(let s=0;s<this.workers.length;s++){let a=this.workers[s];e===a||a.running||r3(n,i,a.currentPos,a.targetPos)&&(this.workers.splice(s,1),s--)}}forgetWorker(e){let r=this.workers.indexOf(e);F(r!==-1),this.workers.splice(r,1)}insertIntoCache(e){if(this.options.maxCacheSize===0)return;let r=dt(this.cache,e.start,n=>n.start)+1;if(r>0){let n=this.cache[r-1];if(n.end>=e.end)return;if(n.end>e.start){let i=new Uint8Array(e.end-n.start);i.set(n.bytes,0),i.set(e.bytes,e.start-n.start),this.currentCacheSize+=e.end-n.end,n.bytes=i,n.view=fr(i),n.end=e.end,r--,e=n}else this.cache.splice(r,0,e),this.currentCacheSize+=e.bytes.length}else this.cache.splice(r,0,e),this.currentCacheSize+=e.bytes.length;for(let n=r+1;n<this.cache.length;n++){let i=this.cache[n];if(e.end<=i.start)break;if(e.end>=i.end){this.cache.splice(n,1),this.currentCacheSize-=i.bytes.length,n--;continue}let s=new Uint8Array(i.end-e.start);s.set(e.bytes,0),s.set(i.bytes,i.start-e.start),this.currentCacheSize-=e.end-i.start,e.bytes=s,e.view=fr(s),e.end=i.end,this.cache.splice(n,1);break}for(;this.currentCacheSize>this.options.maxCacheSize;){let n=0,i=this.cache[0];for(let s=1;s<this.cache.length;s++){let a=this.cache[s];a.age<i.age&&(n=s,i=a)}if(this.currentCacheSize-i.bytes.length<=this.options.maxCacheSize)break;this.cache.splice(n,1),this.currentCacheSize-=i.bytes.length}}dispose(){for(let e of this.workers)e.aborted=!0;this.workers.length=0,this.cache.length=0}};Symbol.dispose??=Symbol("Symbol.dispose");var FS=class{get disposed(){return this._disposed}constructor(e){if(this._demuxerPromise=null,this._format=null,this._disposed=!1,!e||typeof e!="object")throw new TypeError("options must be an object.");if(!Array.isArray(e.formats)||e.formats.some(r=>!(r instanceof ja)))throw new TypeError("options.formats must be an array of InputFormat.");if(!(e.source instanceof af))throw new TypeError("options.source must be a Source.");if(e.source._disposed)throw new Error("options.source must not be disposed.");this._formats=e.formats,this._source=e.source,this._reader=new V3(e.source)}_getDemuxer(){return this._demuxerPromise??=(async()=>{this._reader.fileSize=await this._source.getSizeOrNull();for(let e of this._formats)if(await e._canReadInput(this))return this._format=e,e._createDemuxer(this);throw new Error("Input has an unsupported or unrecognizable format.")})()}get source(){return this._source}async getFormat(){return await this._getDemuxer(),F(this._format),this._format}async computeDuration(){return(await this._getDemuxer()).computeDuration()}async getTracks(){return(await this._getDemuxer()).getTracks()}async getVideoTracks(){return(await this.getTracks()).filter(r=>r.isVideoTrack())}async getAudioTracks(){return(await this.getTracks()).filter(r=>r.isAudioTrack())}async getPrimaryVideoTrack(){return(await this.getTracks()).find(r=>r.isVideoTrack())??null}async getPrimaryAudioTrack(){return(await this.getTracks()).find(r=>r.isAudioTrack())??null}async getMimeType(){return(await this._getDemuxer()).getMimeType()}async getMetadataTags(){return(await this._getDemuxer()).getMetadataTags()}dispose(){this._disposed||(this._disposed=!0,this._source._disposed=!0,this._source._dispose())}[Symbol.dispose](){this.dispose()}},zn=class extends Error{constructor(e="Input has been disposed."){super(e),this.name="InputDisposedError"}};var V3=class{constructor(e){this.source=e}requestSlice(e,r){if(this.source._disposed)throw new zn;if(this.fileSize!==null&&e+r>this.fileSize)return null;let n=e+r,i=this.source._read(e,n);return i instanceof Promise?i.then(s=>s?new kv(s.bytes,s.view,s.offset,e,n):null):i?new kv(i.bytes,i.view,i.offset,e,n):null}requestSliceRange(e,r,n){if(this.source._disposed)throw new zn;if(this.fileSize!==null)return this.requestSlice(e,$j(this.fileSize-e,r,n));{let i=this.requestSlice(e,n),s=a=>{if(a)return a;let o=c=>(F(c!==null),this.requestSlice(e,$j(c-e,r,n))),l=this.source._retrieveSize();return l instanceof Promise?l.then(o):o(l)};return i instanceof Promise?i.then(s):s(i)}}},kv=class t{constructor(e,r,n,i,s){this.bytes=e,this.view=r,this.offset=n,this.start=i,this.end=s,this.bufferPos=i-n}static tempFromBytes(e){return new t(e,fr(e),0,0,e.length)}get length(){return this.end-this.start}get filePos(){return this.offset+this.bufferPos}set filePos(e){this.bufferPos=e-this.offset}skip(e){this.bufferPos+=e}slice(e,r=this.end-e){if(e<this.start||e+r>this.end)throw new RangeError("Slicing outside of original slice.");return new t(this.bytes,this.view,this.offset,e,e+r)}},xe=(t,e)=>{let r=t.bytes.subarray(t.bufferPos,t.bufferPos+e);return t.bufferPos+=e,r},ge=t=>t.view.getUint8(t.bufferPos++),Rv=(t,e)=>{let r=t.view.getUint16(t.bufferPos,e);return t.bufferPos+=2,r},on=t=>{let e=t.view.getUint16(t.bufferPos,!1);return t.bufferPos+=2,e},rf=t=>{let e=SS(t.view,t.bufferPos,!1);return t.bufferPos+=3,e},IS=t=>{let e=t.view.getInt16(t.bufferPos,!1);return t.bufferPos+=2,e},nu=(t,e)=>{let r=t.view.getUint32(t.bufferPos,e);return t.bufferPos+=4,r},ie=t=>{let e=t.view.getUint32(t.bufferPos,!1);return t.bufferPos+=4,e},Fh=t=>{let e=t.view.getUint32(t.bufferPos,!0);return t.bufferPos+=4,e},Jc=t=>{let e=t.view.getInt32(t.bufferPos,!1);return t.bufferPos+=4,e},uXe=t=>{let e=t.view.getInt32(t.bufferPos,!0);return t.bufferPos+=4,e},c$=(t,e)=>{let r,n;return e?(r=nu(t,!0),n=nu(t,!0)):(n=nu(t,!1),r=nu(t,!1)),n*4294967296+r},Xs=t=>{let e=ie(t),r=ie(t);return e*4294967296+r},Ove=t=>{let e=Jc(t),r=ie(t);return e*4294967296+r},Zve=t=>{let e=Fh(t);return uXe(t)*4294967296+e},Fve=t=>{let e=t.view.getFloat32(t.bufferPos,!1);return t.bufferPos+=4,e},m3=t=>{let e=t.view.getFloat64(t.bufferPos,!1);return t.bufferPos+=8,e},br=(t,e)=>{if(t.bufferPos+e>t.bytes.length)throw new RangeError("Reading past end of slice.");let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t.bytes[t.bufferPos++]);return r};var of=require("obsidian");var BS=class extends NS{fileHandle=null;constructor(e,r={}){super({getSize:async()=>(this.fileHandle=await ia().open(e,"r"),(await this.fileHandle.stat()).size),read:async(n,i)=>{WQ(this.fileHandle);let s=new Uint8Array(i-n);return await this.fileHandle.read(s,0,i-n,n),s},maxCacheSize:r.maxCacheSize,prefetchProfile:"fileSystem"})}};var j3=class{app;constructor(e){this.app=e.app}loadCoverResourceUri(e){return e instanceof of.TFile?this.app.vault.getResourcePath(e):Bt(e)?of.Platform.isDesktopApp?VL(e).toString():null:e.toString()}canExtractMetadata(e){return e.type==="file"||e.type==="url:direct"&&!(Bt(e.url)&&!of.Platform.isDesktopApp)}async#e(e){if(e.type==="url:hosted")return null;try{if(e.type==="file"){if(this.app.vault.adapter instanceof of.FileSystemAdapter){let n=this.app.vault.adapter.getFullPath(e.file.path);return new BS(n)}let r=await this.app.vault.readBinary(e.file);return new OS(r)}if(e.type==="url:direct"){if(Bt(e.url)){if(!of.Platform.isDesktopApp)return null;let r=Vi().fileURLToPath(e.url);return new BS(r)}return new DS(e.url,{getRetryDelay:r=>r>=3?null:Math.min(2**(r-2),8)})}Be(e)}catch(r){return console.error("Failed to get input",r),null}}async getInput(e){let r=await this.#e(e);return r?new FS({formats:p$,source:r}):null}async extractFormats(e){let[r,n]=await Promise.all([e.getPrimaryVideoTrack(),e.computeDuration()]);return r&&r.displayHeight>0&&r.displayWidth>0?{type:"video",aspectRatio:pl(r.displayWidth,r.displayHeight),duration:n}:{type:"audio",aspectRatio:null,duration:n}}extractCover(e){let r={coverFront:0,coverBack:1,unknown:2},n=e.images?.toSorted((i,s)=>(r[i.kind]??2)-(r[s.kind]??2)).at(0);return n?new VS(n):null}},VS=class{constructor(e){this.data=e.data,this.type=e.mimeType,this.name=e.name,this.description=e.description}data;type;get base64Uri(){return`data:${this.type};base64,${ave(this.data)}`}get blob(){return new Blob([this.data],{type:this.type})}name;description};var h$=require("obsidian");var $3=class{app;trackInfoParser;mediaParser;constructor(e){this.app=e.app,this.trackInfoParser=e.trackInfoParser,this.mediaParser=e.mediaParser}getMediaFromMeta(e,r){let n=mA(e.frontmatter);return n?this.#r(e,n,{sourcePath:r}):null}getMediaMeta(e){let r=this.app.metadataCache.getFileCache(e);if(!r)return null;let n=r.frontmatter?.[Oo];if(!n||typeof n!="string")return null;let i={sourcePath:e.path},s=mA(r.frontmatter);if(!s)return null;let a=this.#r(r,s,i);if(!a)return null;let o=this;return{src:a,uid:n.trim(),meta:this.#e(r,s,i),get textTracks(){return o.trackInfoParser.parseTextTrackFields(r)}}}#e(e,r,n){let i=g8(e.frontmatter),s=v8(e.frontmatter,n.mappings);return{...i,...s,cover:this.#t(e,s,n),title:s.title||dXe(e),type:r.type}}#t({frontmatterLinks:e},r,n){if(!r.cover)return null;let i=e?.find(s=>s.key==="cover");if(i){let{path:s}=(0,h$.parseLinktext)(i.link);return this.app.metadataCache.getFirstLinkpathDest(s,n.sourcePath)}return an(r.cover)}#r({frontmatterLinks:e},r,n){let i=r.type??"media",s=e?.find(a=>a.key===i);if(s){let{path:a,subpath:o}=(0,h$.parseLinktext)(s.link),l=this.app.metadataCache.getFirstLinkpathDest(a,n.sourcePath),c=this.mediaParser.parseFile(l);if(c)return{info:c,hash:this.mediaParser.parseHash(o)}}return this.mediaParser.parseUrl(r.src)}};function dXe(t){let e=t.headings?.find(r=>r.level===1)?.heading?.trim();if(e)return e}var Sbe=require("obsidian");var U3=require("obsidian");var iu=class extends U3.Notice{constructor(e,{content:r="Sign in to access online features",duration:n=5e3}){super(createFragment(i=>{let s=i.createEl("div",{cls:"mx-login-notice"}),a=s.createEl("div",{cls:"mx-login-notice-header",text:r}),o=s.createEl("div",{cls:"mx-login-notice-action"});new U3.ButtonComponent(o).setButtonText("Continue").onClick(()=>{Hd.open(e)})}),n)}};var vbe=require("obsidian");var lf=Z(Ge(),1),fXe=["clip","title","type","autoPlay","loop","muted","volume","audioGain","playbackRate","preservePitch","aspectRatio","flip","crossOrigin"],z3=class extends si{#e;#t;constructor(e,r){super(e.app),this.modalEl.addClass("meta-editor"),this.titleEl.setText("Edit Media Metadata"),this.#e=r,this.#t=e.settings}get#r(){let{crossOrigin:e,tempFragment:r,type:n}=this.#e,i=fl(r)?TL(r):void 0;return{...Yf(this.#e,["title","autoPlay","loop","muted","volume","audioGain","playbackRate","preservePitch","aspectRatio","flip"]),type:n,crossOrigin:e===!1?"disabled":e,...i}}#n(e){let r=this.#e,n=e.aspectRatio&&pl(e.aspectRatio.width,e.aspectRatio.height),i=e.crossOrigin==="disabled"?!1:e.crossOrigin,s=e.clip&&EL(e.clip);return{control:{autoPlay:e.autoPlay??(r.autoPlay?null:void 0),loop:e.loop??(r.loop?null:void 0),muted:e.muted??(r.muted?null:void 0),volume:e.volume??(r.volume?null:void 0),audioGain:e.audioGain??(r.audioGain?null:void 0),playbackRate:e.playbackRate??(r.playbackRate?null:void 0),preservePitch:e.preservePitch??(r.preservePitch?null:void 0),flip:e.flip??(r.flip?null:void 0),crossOrigin:i??(r.crossOrigin?null:void 0),aspectRatio:n??(r.aspectRatio?null:void 0),tempFragment:s??(r.tempFragment?null:void 0)},metadata:{title:e.title??(r.title?null:void 0)},cover:null,type:e.type??"media"}}async renderContent(){let e=await this.#t.loaded,r=this.#r,n=CL(e);return(0,lf.jsx)(()=>{let s=SL({resolver:uv(GA),defaultValues:r});return(0,lf.jsx)(KA,{form:s,defaultValues:r,fallbackValues:n,onSubmit:a=>{this.resolveWith(this.#n(a))},onError:()=>{new vbe.Notice("Failed to save changes, fix errors before confirm")},settingItems:fXe,description:(0,lf.jsxs)(lf.Fragment,{children:["Configure media metadata.",(0,lf.jsx)("br",{})," Dotted options are explictly included in frontmatter. To exclude them, click reset button in each option or the pills in the header."]}),fields:{title:{description:"Custom title for the media"},autoPlay:{description:"Start playback by default when media is opened. Disable this will make sure media keep play/paused."},muted:{description:"Mute the media by default."},audioGain:{description:"Amplify audio above maximum volume level."},volume:{description:"Default volume level when link is opened."},playbackRate:{description:"Default playback rate when link is opened."}}})},{})}};function pXe(t){let e=t.trim().toLowerCase();return e=e.replace(/\s+/g,"-").replace(/[^a-z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,""),/^[a-z_]/.test(e)||(e=`_${e}`),e.length===0||e.length>50?null:e}function bbe(t){return KT(t.map(pXe).filter(e=>e!==null),e=>e.toLocaleLowerCase()).slice(0,15)}function xbe(t,e=500){let r=t.replace(/\r\n/g,`
`).replace(/\r/g,`
`).replace(/\n{3,}/g,`
`).trim();if(r.length<=e)return r;let n=r.substring(0,e),i=n.lastIndexOf(" ");return i>e*.8?`${n.substring(0,i)}...`:`${n}...`}function wbe(t){if(!t||typeof t!="object")return null;let e=["maxres","high","standard","medium","default"];for(let r of e){let n=an(t[r]?.url);if(n)return n}return null}function kbe(t){let e=Pn(S1,t);return e.success?e.output:null}var H3=class{app;youTubeApi;auth;mediaNote;extractor;imageCache;#e;constructor(e){this.app=e.app,this.youTubeApi=e.youTubeApi,this.auth=e.auth,this.mediaNote=e.mediaNote,this.extractor=e.metadataExtractor,this.imageCache=e.imageCache,this.#e=r=>new z3(e,r).requestInput()}supportUpdate(e){return ua(e)&&Io()||this.extractor.canExtractMetadata(e)}async updateImageCache(e,r){let n=r.cover;n instanceof VS&&await this.imageCache.set(e,n.blob)}async#t(e){let r=await this.youTubeApi.getVideoMetadata(e);return{type:"media",control:{aspectRatio:r.aspect_ratio},cover:wbe(r.thumbnails),metadata:{title:r.title||void 0,description:xbe(r.description)||void 0,mediaDate:new Date(r.published_at),creator:r.uploader_name,duration:kbe(r.duration),view_count:r.view_count,like_count:r.like_count,language:r.language||null,tags:bbe(r.tags)}}}async#r(e,r){let n=await this.#t(e),i=q3(n);await this.app.fileManager.processFrontMatter(r,s=>{Object.assign(s,a0(i,["tags"])),m$(s,n.type)})}async#n(e,r){return await gt(this.#r(e,r),{loading:"Fetching YouTube metadata...",success:`YouTube metadata updated successfully: ${r.path}`,error:(n,i)=>{if(i instanceof Ro){new iu(this.auth,{content:"You need to login to get latest YouTube metadata"});return}return`Failed to fetch YouTube metadata: ${n}`}})}async#i(e){var s=[];try{let r=J(s,await this.extractor.getInput(e));if(!r)return null;let[n,i]=await Promise.all([this.extractor.extractFormats(r),r.getMetadataTags()]);return{type:n.type,control:{aspectRatio:n.aspectRatio},cover:this.extractor.extractCover(i),metadata:{duration:n.duration,creator:i.artist,album:i.album,albumArtist:i.albumArtist,trackNumber:i.trackNumber,tracksTotal:i.tracksTotal,discNumber:i.discNumber,discsTotal:i.discsTotal,genre:i.genre,mediaDate:i.date,comment:i.comment}}}catch(a){var o=a,l=!0}finally{ee(s,o,l)}}async#s(e,r){let n=await this.#i(e);if(!n)return;let i=q3(n);await this.app.fileManager.processFrontMatter(r,s=>{Object.assign(s,i),m$(s,n.type)}),await this.updateImageCache(r.path,n)}async#a(e,r){return await gt(this.#s(e,r),{loading:"Fetching file metadata...",success:`File metadata updated successfully: ${r.path}`,error:n=>`Failed to fetch file metadata: ${n}`})}async#o(e){return this.supportUpdate(e)?ua(e)?await gt(this.#t(e.vid.vid),{loading:"Fetching YouTube metadata...",error:(r,n)=>{if(n instanceof Ro){new iu(this.auth,{content:"You need to login to fetch YouTube metadata"});return}return`Failed to fetch YouTube metadata: ${r}`},loadingDelay:500,swallowError:!1}):this.extractor.canExtractMetadata(e)?await gt(this.#i(e),{loading:"Fetching file metadata...",error:r=>`Failed to fetch file metadata: ${r}`,loadingDelay:500,swallowError:!1}):null:null}async getFrontmatterFields(e){let r=await this.#o(e);if(!r)return null;let n=r.cover instanceof URL?r.cover.toString():void 0,i=a0(q3({metadata:{...r.metadata,cover:n},control:r.control}),[Oo,r.type]);return{fields:r,typeField:r.type,type:r.type!=="media"?r.type:void 0,serialized:i}}async updateMetadata(e){if(!this.supportUpdate(e)){new Sbe.Notice("Metadata update not supported for this media.");return}let{note:r}=await this.mediaNote.ensureMediaNote(e);if(ua(e))await this.#n(e.vid.vid,r);else if(this.extractor.canExtractMetadata(e))await this.#a(e,r);else throw new Error("Metadata update not supported for this media.")}async editMetadata(e){let{note:r,meta:n}=await this.mediaNote.ensureMediaNote(e),i=await this.#e(n),s=q3(i);await this.app.fileManager.processFrontMatter(r,a=>{Object.assign(a,s),m$(a,i.type)})}};function q3(t){return Hn({...b8(t.metadata),...y8(t.control)},r=>r??void 0)}function m$(t,e){let r=t.video?"video":t.audio?"audio":"media";if(r===e)return;let n=t[r];t[r]=void 0,t[e]=n}var Cbe=Z(Ej(),1);var G3=class{app;metaParser;constructor(e){this.app=e.app,this.metaParser=e.metadataParser}async migrate(){return await gt(this.#e(),{loading:"Migrating media notes from old format...",success:e=>`Migrated ${e.length} media notes`,error:e=>`Error migrating media notes from old format: ${e}`})}async#e(){let e=[];for(let r of fv(this.app.vault.getRoot())){let n=this.app.metadataCache.getFileCache(r);!n||n.frontmatter?.[Oo]||!this.metaParser.getMediaFromMeta(n,r.path)||e.push(this.#t(r))}return await Promise.all(e)}async#t(e){return await this.app.fileManager.processFrontMatter(e,r=>{Oo in r||(r[Oo]=(0,Cbe.createId)())}),e}};var bxe=Z(mxe(),1);var WS=require("obsidian");function gxe(t){let e=new WS.Notice("",0),r=e.messageEl;r.addClass("mx-release-note-notice");let n=r.createDiv("mx-release-note-content");n.createDiv("mx-release-note-text").setText(`Media Extended has been updated to v${t}.`);let s=n.createDiv("mx-release-note-buttons");return new WS.ButtonComponent(s).setButtonText("View Release Notes").setCta().onClick(()=>{window.open(`https://mx.pkmer.net/changelog#v${t}`),e.hide()}),new WS.ButtonComponent(s).setButtonText("Dismiss").onClick(()=>{e.hide()}),e}var Dv="mx-welcome";var iM=require("obsidian");function Nv(t,e){let r="target"in t?t.target:t;if(!r.instanceOf?.(HTMLElement))return;let n=r.getBoundingClientRect();return e.setParentElement(r).showAtPosition({x:n.x,y:n.bottom,width:n.width,overlap:!0,left:!0},r.doc)}var yxe=Z(Ge(),1),KS=class extends iM.ItemView{#e;#t;#r;#n;constructor(e,r){super(r),this.containerEl.addClass("mx-welcome-view"),this.#e=e.cradle.workspaceOpen,this.#t=e.cradle.mediaParser,this.#r=e.cradle.plugin,this.#n=()=>e.cradle.mediaSwitcherModal.open()}getViewType(){return Dv}#i=null;getDisplayText(){return"Media Extended onboarding"}getIcon(){return"home"}async onOpen(){this.#i?.[Symbol.dispose](),this.#i=tv({children:(0,yxe.jsx)(qce,{docBaseUrl:"https://mx.pkmer.net",onTryExample:e=>{let r=new iM.Menu;this.onTryExampleMenu(r),Nv(e.nativeEvent,r)},onOpenNewNote:()=>{this.#r.app.workspace.openLinkText("First Media Note","","split")}}),target:this.contentEl})}onTryExampleMenu(e){let r=this.#t.parseUrl("https://www.youtube.com/watch?v=UF8uR6Z6KLc"),n=this.#r.app.vault.getFiles().filter(s=>p0(s)&&s.extension!=="webm").sort((s,a)=>a.stat.mtime-s.stat.mtime).at(0),i=n&&this.#t.parseFile(n);e.addItem(s=>s.setTitle(`"Steve Jobs' 2005 Stanford Commencement Address" from YouTube`).setIcon("youtube").onClick(()=>{this.#e.openMedia(r,{fromUser:!1,newLeaf:"split"})})),i&&e.addItem(s=>s.setTitle(`"${i.file.name}" from vault`).setIcon("file-video").onClick(()=>{this.#e.openMedia({info:i},{fromUser:!1,newLeaf:"split"})})),e.addSeparator(),e.addItem(s=>s.setTitle("Select video file from vault").setIcon("file-search").onClick(()=>{this.#r.app.commands.executeCommandById("switcher:open")})).addItem(s=>s.setTitle("Open external media").setIcon("file-symlink").onClick(()=>{this.#n()}))}async onClose(){this.#i?.[Symbol.dispose]()}};function vxe(t){let{plugin:e}=t.cradle;e.registerView(Dv,r=>new KS(t,r))}var YS=class{plugin;settings;#e;constructor(e){this.plugin=e.plugin,this.settings=e.settings,this.#e=new DisposableStack,dm(this.plugin).then(()=>{this.checkVersion()}),this.#t()}[Symbol.dispose](){this.#e.dispose()}get currentVersion(){return this.plugin.manifest.version}async checkVersion(){let e=await this.settings.loaded,r=e["release.previous-version"],n=e["release.show-release-notes"];r?(0,bxe.gt)(this.currentVersion,r)&&n&&this.showReleaseNote():this.showWelcomePage(),this.settings.set("release.previous-version",this.currentVersion)}showWelcomePage(){this.plugin.app.workspace.getLeaf().setViewState({type:Dv})}showReleaseNote(){gxe(this.currentVersion)}#t(){this.plugin.addCommand({id:"show-release-notes",name:"Show release note of the current version",callback:()=>this.showReleaseNote()}),this.plugin.addCommand({id:"show-welcome",name:"Show welcome page",callback:()=>this.showWelcomePage()})}};var sM=require("obsidian");var xxe="mx-open",aM=class{plugin;workspace;mediaParser;#e;constructor(e){var n=[];try{this.plugin=e.plugin;this.workspace=e.workspaceOpen;this.mediaParser=e.mediaParser;let r=J(n,new DisposableStack);this.patchGlobalProtocolHandler(r);this.plugin.registerObsidianProtocolHandler("mx-open",async o=>{let l=this.mediaParser.parseUrl(o.url||"");if(!l){new sM.Notice(`Invalid URL to open in Media Extended: ${o.url}`);return}await this.#n(l)});this.#e=r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}[Symbol.dispose](){this.#e.dispose()}patchGlobalProtocolHandler(e){if(!window.OBS_ACT)return;let r=this;e.defer(pr(window,{OBS_ACT:n=>function(s,...a){if(s.action.startsWith(`${xxe}/`)){r.#t(s);return}return n.call(this,s,...a)}}))}async#t(e){let r=this.#r(e,xxe);if(!r){new sM.Notice(`Invalid URL to open in Media Extended: ${e.action}`);return}await this.#n(r)}#r(e,r){let n=e.action.substring(r.length+1),i=an(n);if(!i)return null;let s=new URLSearchParams(e);return s.delete("action"),i.search=s.toString(),this.mediaParser.parseUrl(i)}async#n(e){new O$(e),await this.workspace.openMedia(e,{newLeaf:"tab"})}},O$=class extends sM.Notice{constructor(e){super(createFragment(r=>{r.appendText("Opening URL from browser: "),r.createEl("br");let n=e.info.url.href;r.createEl("a",{text:n.length>50?`${n.slice(0,25)}...${n.slice(-25)}`:n,href:n})}))}};var O4t=new TextEncoder;var cJe="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),uJe=[];cJe.forEach((t,e)=>uJe[t.charCodeAt(0)]=e);var H4t="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split("");var Q4t=new TextEncoder().encode("0123456789abcdef"),Z4t=new TextEncoder,J4t=new TextDecoder;var wxe=new ArrayBuffer(8),tFt=new Uint32Array(wxe),rFt=new BigUint64Array(wxe);async function kxe(t,{format:e="image/jpeg",quality:r=.92}={}){if(t.readyState<2)throw new Error("Video not ready");let n=document.createElement("canvas");if(!t.videoWidth||!t.videoHeight)throw new Error("Video has no width or height");let i={width:t.videoWidth,height:t.videoHeight};Object.assign(n,i);let s=n.getContext("2d",{alpha:!1});if(!s)throw new Error("Canvas context creation failed");let a=t.currentTime;s.drawImage(t,0,0);let o=await new Promise((c,u)=>{try{n.toBlob(d=>d?c(d):u(new Error("Blob conversion failed")),e,r)}catch(d){u(d)}});return{blob:{arrayBuffer:await o.arrayBuffer(),type:o.type},timestamp:a,size:i}}function Sxe(t){switch(t.type){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/vnd.microsoft.icon":return"ico";case"image/avif":return"avif";case"image/heic":return"heic";case"image/heif":return"heif";default:throw new Error(`Unknown mime type for screenshot: ${t.type}`)}}var Bv=require("obsidian");async function Cxe(t){await navigator.clipboard.write([new ClipboardItem({[t.type]:t})])}var Fv=class extends Error{constructor(e){super(`Failed to save file to ${e}: file already exists`)}},cf=class extends Error{constructor(){super("No markdown editor is ready for insertion")}};var Txe=Z(Ge(),1),lM=class extends si{#e;#t;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.modalEl.addClass("image-clip"),this.titleEl.setText("Clip Image")}renderContent(){return(0,Txe.jsx)(Nle,{imageBlob:this.#e,outputSpec:this.#t,onSave:(e,r)=>{this.resolveWith({action:"save",result:r})}})}};function Exe(t){let e=5381;for(let r=0;r<t.length;r++)e=(e<<5)+e^t.charCodeAt(r);return e>>>0}var cM=class{settings;app;mediaNote;saveFolder;textExtractionApi;constructor(e){this.settings=e.settings,this.app=e.app,this.mediaNote=e.mediaNote,this.saveFolder=e.attachement,this.textExtractionApi=e.textExtractionApi}async extractText(e){let r=await this.#e(e,{clip:!0,...Bv.Platform.isIosApp?{format:"image/jpeg",quality:.92}:{format:"image/webp",quality:.8}}),n=new File([r.blob],"screenshot.png",{type:r.blob.type}),i=await this.textExtractionApi.extractText(n);return console.debug("text extraction result",i),{content:i,...r}}async copyScreenshot(e,r={}){var i=[];try{let n=J(i,await this.#e(e,{format:"image/png",clip:r.clip}),!0);await Cxe(n.blob)}catch(s){var a=s,o=!0}finally{var l=ee(i,a,o);l&&await l}}async saveScreenshot(e,{clip:r}={}){let n=await this.#e(e,{clip:r}),i=await this.#t(n,{comp:e});return{...n,file:i.file}}async#e(e,r){var u=[];try{let n=await this.settings.loaded;if(!e.supportsScreenshot)throw new Error("Capture screenshot not supported");let i={format:r?.format??n["playback.screenshot.format"],quality:r?.quality??n["playback.screenshot.quality"]};let s=await e.captureScreenshot(i);if(!r?.clip)return{...s,[Symbol.asyncDispose]:async()=>{}};let a=J(u,new AsyncDisposableStack,!0);a.use(e.pausePlayback());let o=await new lM(this.app,s.blob,i).requestInput();let l=await o.result.blob;if(!l)throw new Error("Failed to clip screenshot");let c=a.move();return{...s,blob:l,rect:{type:"clip",x:o.result.rect.x,y:o.result.rect.y,width:o.result.rect.width,height:o.result.rect.height,originalWidth:s.rect.width,originalHeight:s.rect.height},[Symbol.asyncDispose]:async()=>await c.disposeAsync()}}catch(d){var f=d,p=!0}finally{var h=ee(u,f,p);h&&await h}}async#t(e,r){let{comp:n}=r;if(!n.player)throw new Error("Player not initialized");let s=n.media;if(!s)throw new Error("No media is opened");let[{uid:a,meta:o},l]=await Promise.all([this.mediaNote.ensureMediaNote(s),this.settings.loaded]),c=await this.saveFolder.getAttachmentFolder({folderPath:l["playback.screenshot.folder-path"],sourcePath:s.type==="file"?s.file.path:""}),u=e.rect.type==="clip"?`-${pJe(e.rect)}`:"",d=Use(e.timestamp).toLowerCase().replaceAll(".","_"),f=`mx-img-${a}-${d}${u}.${Sxe(e.blob)}`;return{file:await this.#r((0,Bv.normalizePath)(`${c.path}/${f}`),e.blob),media:{uid:a,meta:o}}}async#r(e,r){let n=this.app.vault.getAbstractFileByPath(e),i=await r.arrayBuffer();if(n instanceof Bv.TFile)return await this.app.vault.modifyBinary(n,i),n;if(n!==null)throw new Fv(e);return await this.app.vault.createBinary(e,i)}};function pJe(t){let e=[t.x,t.y,t.width,t.height,t.originalWidth,t.originalHeight].join("-");return Exe(e).toString(36)}var uf=/^(?<lang>[a-z]{2})(?:-([A-Za-z]+))*$/;function Axe(t){return uf.test(t)}function uM(t){if(!t)return null;let e=t.trim().match(uf);if(!e)return null;let[,r,...n]=e;return{lang:r,extlang:n}}var Ixe={"zh-Hans":["CN","SG","MY"],"zh-Hant":["TW","HK","MO"]};function D$(t){return t.toLowerCase()==="hans"||Ixe["zh-Hans"]?.includes(t.toUpperCase())?"zh-Hans":t.toLowerCase()==="hant"||Ixe["zh-Hant"]?.includes(t.toUpperCase())?"zh-Hant":"zh"}var dM=Zo([f0(),Qo(!1),Pt(["split-horizontal","tab","split","window"])]),Pxe=Pt(["image/png","image/jpeg","image/webp"]),hJe=Pt(["before-cursor","after-cursor"]),Rxe=Pt(["play","eager"]),mJe=Pt(["browser","iframe"]),gJe={__VERSION__:1},fM=An({__VERSION__:Qo(1),"release.previous-version":Vt(ks(ke()),void 0),"release.show-release-notes":Vt(wr(),!0),"playback.default-volume":Vt(yo,100),"playback.speed-step":Vt(Ee(hr(),Xa(0),xs(1)),.1),"playback.preserve-pitch":Vt(wr(),!0),"playback.track.default-enabled":Vt(wr(),!1),"playback.track.folder-path":Vt(ks(ke()),void 0),"playback.track.default-languages":Vt(Wl(Ee(ke(),d0(uf,"Invalid language code"))),[]),"playback.screenshot.format":Vt(Pxe,"image/jpeg"),"playback.screenshot.quality":Vt(Ee(hr(),Xa(0),xs(1)),.8),"playback.screenshot.folder-path":Vt(ks(ke()),void 0),"note.embed-load-strategy":Vt(Rxe,"eager"),"link.click-behavior":Vt(dM,"split"),"link.altclick-behavior":Vt(dM,"window"),"link.handle-hosted":Vt(wr(),!0),"link.handle-direct-url":Vt(wr(),!0),"link.hosted-prefer":Vt(mJe,"browser"),"note.template.timestamp":Vt(ke(),`
- {{TIMESTAMP}} `),"note.template.timestamp-offset":Vt(hr(),0),"note.template.screenshot":Vt(ke(),`
- !{{SCREENSHOT}} {{TIMESTAMP}} `),"note.template.screenshot-embed":Vt(ke(),"{{TITLE}}{{DURATION}}|50"),"note.template.insert-at":Vt(hJe,"after-cursor"),"media-lib.folder-path":Vt(ke(),"media-lib"),"cache.cover-image.max-size-mb":Vt(Ee(hr(),Xa(1),xs(1e3)),100)});function Lxe(t){let e=t,r=Za(fM,gJe);if(e.defaultVolume!==void 0&&(r["playback.default-volume"]=e.defaultVolume),e.speedStep!==void 0&&(r["playback.speed-step"]=e.speedStep),e.enableSubtitle!==void 0&&(r["playback.track.default-enabled"]=e.enableSubtitle),e.subtitleFolderPath!==void 0&&(r["playback.track.folder-path"]=e.subtitleFolderPath),e.defaultLanguage!==void 0&&(r["playback.track.default-languages"]=e.defaultLanguage?[e.defaultLanguage]:[]),e.screenshotFormat!==void 0){let n=e.screenshotFormat;ws(Pxe,n)&&(r["playback.screenshot.format"]=n)}if(e.screenshotQuality!==void 0&&(r["playback.screenshot.quality"]=e.screenshotQuality),e.screenshotFolderPath!==void 0&&(r["playback.screenshot.folder-path"]=e.screenshotFolderPath),e.loadStrategy!==void 0){let n=e.loadStrategy;ws(Rxe,n)&&(r["note.embed-load-strategy"]=n)}if(e.defaultMxLinkClick?.click!==void 0){let n=e.defaultMxLinkClick.click;ws(dM,n)&&(r["link.click-behavior"]=n)}if(e.defaultMxLinkClick?.alt!==void 0){let n=e.defaultMxLinkClick.alt;ws(dM,n)&&(r["link.altclick-behavior"]=n)}return e.timestampTemplate!==void 0&&(r["note.template.timestamp"]=e.timestampTemplate),e.timestampOffset!==void 0&&(r["note.template.timestamp-offset"]=e.timestampOffset),e.screenshotTemplate!==void 0&&(r["note.template.screenshot"]=e.screenshotTemplate),e.screenshotEmbedTemplate!==void 0&&(r["note.template.screenshot-embed"]=e.screenshotEmbedTemplate),e.insertBefore!==void 0&&(r["note.template.insert-at"]=e.insertBefore?"before-cursor":"after-cursor"),Za(fM,r)}var Mxe=Zo([f0(),Qo(!1),Pt(["split-horizontal","tab","split","window"])]),yJe=Pt(["image/png","image/jpeg","image/webp"]),vJe=Pt(["before-cursor","after-cursor"]),bJe=Pt(["browser","iframe"]),_xe=An({__VERSION__:Qo(2),...Qu({"release.previous-version":oa(ke()),"release.show-release-notes":wr(),"playback.default-volume":yo,"playback.speed-step":Ee(hr(),Xa(0),xs(1)),"playback.preserve-pitch":wr(),"playback.track.default-enabled":wr(),"playback.track.folder-path":oa(ke()),"playback.track.default-languages":Wl(Ee(ke(),d0(uf,"Invalid language code"))),"playback.screenshot.format":yJe,"playback.screenshot.quality":Ee(hr(),Xa(0),xs(1)),"playback.screenshot.folder-path":oa(ke()),"note.embed.load-strategy":Up,"note.embed.handle-hosted":wr(),"note.embed.handle-direct-url":wr(),"link.click-behavior":Mxe,"link.altclick-behavior":Mxe,"link.handle-hosted":wr(),"link.handle-direct-url":wr(),"link.hosted-prefer":bJe,"note.template.timestamp":ke(),"note.template.timestamp-offset":hr(),"note.template.screenshot":ke(),"note.template.screenshot-embed":ke(),"note.template.insert-at":vJe,"media-lib.folder-path":ke(),"cache.cover-image.max-size-mb":Ee(hr(),Xa(1),xs(1e3))}).entries}),N$={__VERSION__:2,"release.previous-version":null,"release.show-release-notes":!0,"playback.default-volume":100,"playback.speed-step":.1,"playback.preserve-pitch":!0,"playback.track.default-enabled":!1,"playback.track.folder-path":null,"playback.track.default-languages":[],"playback.screenshot.format":"image/jpeg","playback.screenshot.quality":.8,"playback.screenshot.folder-path":null,"note.embed.load-strategy":"eager","link.click-behavior":"split","link.altclick-behavior":"window","link.handle-hosted":!0,"link.handle-direct-url":!0,"link.hosted-prefer":"browser","note.template.timestamp":`
- {{TIMESTAMP}} `,"note.template.timestamp-offset":0,"note.template.screenshot":`
- !{{SCREENSHOT}} {{TIMESTAMP}} `,"note.template.screenshot-embed":"{{TITLE}}{{DURATION}}|50","note.template.insert-at":"after-cursor","media-lib.folder-path":"media-lib","cache.cover-image.max-size-mb":100,"note.embed.handle-hosted":!0,"note.embed.handle-direct-url":!0};function Oxe(t){return{...N$,...YT(t,e=>e!==void 0)}}function Dxe(t){return Za(_xe,t)}function Nxe(){return{...N$,__VERSION__:2}}function Fxe(t){let e=Za(fM,t),r={__VERSION__:2},n=dD(xJe,s=>{let[a,o]=s,l=e[a],c=N$[o];return l===void 0||Yl(l,c)?[o,void 0]:[o,l]});return Za(_xe,{...r,...n})}var xJe={"release.previous-version":"release.previous-version","release.show-release-notes":"release.show-release-notes","playback.default-volume":"playback.default-volume","playback.speed-step":"playback.speed-step","playback.preserve-pitch":"playback.preserve-pitch","playback.track.default-enabled":"playback.track.default-enabled","playback.track.folder-path":"playback.track.folder-path","playback.track.default-languages":"playback.track.default-languages","playback.screenshot.format":"playback.screenshot.format","playback.screenshot.quality":"playback.screenshot.quality","playback.screenshot.folder-path":"playback.screenshot.folder-path","note.embed-load-strategy":"note.embed.load-strategy","link.click-behavior":"link.click-behavior","link.altclick-behavior":"link.altclick-behavior","link.handle-hosted":"link.handle-hosted","link.handle-direct-url":"link.handle-direct-url","link.hosted-prefer":"link.hosted-prefer","note.template.timestamp":"note.template.timestamp","note.template.timestamp-offset":"note.template.timestamp-offset","note.template.screenshot":"note.template.screenshot","note.template.screenshot-embed":"note.template.screenshot-embed","note.template.insert-at":"note.template.insert-at","media-lib.folder-path":"media-lib.folder-path","cache.cover-image.max-size-mb":"cache.cover-image.max-size-mb"};var wJe={1:Lxe,2:Fxe},Bxe=t=>{let e=re(null),r=kJe(t),n=re(null,async(s,a)=>{let{value:o,migrated:l}=await SJe(t);l&&await r(o),a(e,o)});return{atom:re(s=>{let a=s(e);return a?Oxe(a):null},(s,a,o)=>{if(o===YQ){a(n);return}let l=s(e);if(l===null)return;let c=typeof o=="function"?o(l):o,u={...l,...c};a(e,u),r(u)}),reload:n}};function kJe(t){let e=!1,r=null;return async function n(i){if(e){r=i;return}e=!0;try{if(await t.saveData(i),r!==null){let s=r;r=null,await n(s)}}finally{e=!1}}}async function SJe(t){let e=Nxe();try{let r=await t.loadData();if(!r)return{value:e,migrated:!1};let n=r,i=n.__VERSION__??0,s=e.__VERSION__;if(i===s)return{value:Dxe(n),migrated:!1};let a={...n};for(let o=i+1;o<=s;o++){let l=wJe[o];if(l)a=l(a);else throw new Error(`No migration function found for version ${o}`)}return{value:a,migrated:!0}}catch(r){return console.error("Failed to load plugin data:",r),{value:e,migrated:!1}}}var XS=class{plugin;settingsAtoms;store=Kf();#e;#t;constructor(e){this.plugin=e.plugin,this.settingsAtoms=Bxe(this.plugin),this.loadSettings(),this.#e=new DisposableStack,this.#t=this.#e.use(new hu)}[Symbol.dispose](){this.#e.dispose()}async loadSettings(){await this.store.set(this.settingsAtoms.reload)}get value(){return this.store.get(this.settingsAtoms.atom)}get loaded(){return this.#r()}async#r(){var i=[];try{let e=J(i,new DisposableStack);let r=this.store.get(this.settingsAtoms.atom);if(r)return r;let n=new Promise(l=>{e.defer(this.store.sub(this.settingsAtoms.atom,()=>{let c=this.store.get(this.settingsAtoms.atom);c&&l(c)}))});return await Vr(n,this.#t.signal)}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}set(e,r){this.store.set(this.settingsAtoms.atom,n=>({...n,[e]:r}))}subscribe(e,r){var a=[];try{let n=this.store.get(this.settingsAtoms.atom);let i=n?n[e]:su;let s=J(a,new DisposableStack);s.defer(this.store.sub(this.settingsAtoms.atom,()=>{let u=this.store.get(this.settingsAtoms.atom);if(!u||!(e in u))return;let d=u[e];r(d,i,u),i=d}));return s.move()}catch(o){var l=o,c=!0}finally{ee(a,l,c)}}},su=Symbol("na");var pM=class{app;settings;template;constructor(e){this.app=e.app,this.settings=e.settings,this.template=e.template}async insertTimestamp(e,r,{file:n,editor:i}){if(!i)return;let s=await this.settings.loaded,a=this.template.renderTimestampInsertion({currentTime:e,src:r},{sourcePath:n?.path??"",settings:s});this.#e(a,i,s)}async insertScreenshotEmbed(e,r,{file:n,editor:i}){if(!i)return;let s=await this.settings.loaded,a=this.template.renderScreenshotInsertion({currentTime:e.timestamp,screenshotFile:e.file,src:r.src,meta:{uid:r.uid,title:r.title}},{sourcePath:n?.path||"",settings:s});this.#e(a,i,s)}#e(e,r,n){n["note.template.insert-at"]==="before-cursor"?dL(e,r):uL(e,r)}};var hM=class{app;get fileManager(){return this.app.fileManager}constructor(e){this.app=e.app}renderTimestampInsertion(e,r){let n=r.settings["note.template.timestamp"],i=r.settings["note.template.timestamp-offset"],s={timestamp:this.renderTimestampLink(e,{sourcePath:r.sourcePath,timestampOffset:i})};return this.#t(n,s)}renderScreenshotInsertion(e,r){let n=r.settings["note.template.screenshot-embed"],i=r.settings["note.template.screenshot"],s=r.settings["note.template.timestamp-offset"],a={timestamp:this.renderTimestampLink(e,{sourcePath:r.sourcePath,timestampOffset:s}),screenshot:this.#e(e,{sourcePath:r.sourcePath,template:n,timestampOffset:s})};return this.#t(i,a)}#e({screenshotFile:e,currentTime:r,meta:n},i){let s=Vxe(r,i.timestampOffset),a=this.#r(i.template,{timestamp:s,title:n.title||n.uid});return this.fileManager.generateMarkdownLink(e,i.sourcePath,"",a).replace(/^!/,"")}renderTimestampLink({currentTime:e,src:r},n){let i=Vxe(e,n.timestampOffset),s=c8(i),a=Zu({tempFragment:{start:i,end:-1}}).toString();if(r.type==="file"){let{file:l}=r;return this.fileManager.generateMarkdownLink(l,n.sourcePath,a?`#${a}`:void 0,s).replace(/^!/,"")}let o=this.renderExternalLink(r,{tempFragment:{start:i,end:-1}});return`[${s}](${o})`}renderExternalLink(e,r){if(e.type==="url:direct")return rS(e.url,r);if(e.type==="url:hosted")return Ud(e.vid,r);Be(e)}#t(e,r){let n=e.replace("{{TIMESTAMP}}",r.timestamp);return r.screenshot&&(n=n.replace("{{SCREENSHOT}}",r.screenshot)),n}#r(e,r){let n=r.timestamp>0?` - ${c8(r.timestamp)}`:"";return e.replaceAll("{{TITLE}}",r.title).replaceAll("{{DURATION}}",n)}};function Vxe(t,e){return Math.max(0,t+(e??0))}var gM=require("obsidian");var CJe=new Set(["file:","http:","https:"]);function jxe(t,e){return e.has(t)?e.get(t):[]}function $xe(t,e){return((0,gM.parseFrontMatterStringArray)(e,t)??[]).map(r=>an(r)).filter(r=>r!==null&&CJe.has(r.protocol))}var mM=class{fileHelper;app;constructor(e){this.fileHelper=e.fileService,this.app=e.app}parseTextTrackFields(e){let r=e.frontmatter??{},n=$xe(Vs,r),i=$xe(js,r),s=Map.groupBy(e.frontmatterLinks??[],l=>l.key.split(".").at(0)),a=jxe(Vs,s);return[...jxe(js,s).map(l=>this.internalLinkToTrackLink(l,"captions")),...i.map(l=>this.urlToTrack(l,{kind:"captions"})),...a.map(l=>this.internalLinkToTrackLink(l,"subtitles")),...n.map(l=>this.urlToTrack(l,{kind:"subtitles"}))].filter(l=>l!==null)}parseTrackMeta(e,r){let n=new URLSearchParams(e.replace(/^#/,"")),i=Za(Gce,{id:n.get("id"),format:n.get("format"),kind:n.get("kind"),language:n.get("lang")||n.get("language"),label:n.get("label"),wid:n.get(Hce),isDefault:n.get("default")==="true"||n.get("default")===""});return{...i,kind:i.kind||r.kind,format:i.format||r.format||"vtt",language:i.language||r.language||null}}parseTextTrackInfo(e,{sourcePath:r,kind:n="captions"}){let i=an(e);if(i)return this.urlToTrack(i,{kind:n});if(e.startsWith("[[")&&e.endsWith("]]")){let s=e.slice(2,-2),{link:a,displayText:o}=TJe(s),l=this.internalLinkToTrackLink({link:a,displayText:o},n);return l?this.resolveTrackLink(l,{sourcePath:r}):null}return null}resolveTrackLink(e,r){let n=this.app.metadataCache.getFirstLinkpathDest(e.path,r.sourcePath);if(!n)return null;let i=this.inferFromPath(n);return i?{type:"internal.resolved",src:n,basename:i.basename,meta:{...e.meta,format:e.meta.format||i.format,language:e.meta.language||i.language}}:null}urlToTrack(e,{kind:r,...n}){try{let i=this.inferFromPath(e,{urlEncoded:!0}),s=this.parseTrackMeta(e.hash,{kind:r,format:i?.format,language:i?.language});if(!Bt(e))return{type:"url",src:e,meta:{...s,...n}};if(!i)return null;let a=this.fileHelper.safeResolveFileUri(e);if(!a.success)return null;let{sep:o}=vs(),l=So(a.path,{sep:o});return{type:"file",basename:l.basename,src:l,meta:{...s,...n}}}catch(i){return i instanceof Am?console.warn(`Invalid track link: ${e}`,i.issues):console.warn(`Invalid track link: ${e}`,i),null}}fileToTrack(e,{kind:r,...n}){let i=this.inferFromPath(e);if(!i)return null;let s=this.parseTrackMeta("",{kind:r,format:i.format,language:i.language});return{type:"internal.resolved",basename:i.basename,src:e,meta:{...s,...n}}}internalLinkToTrackLink(e,r){try{let{path:n,subpath:i}=(0,gM.parseLinktext)(e.link),s=this.inferFromPath({path:n});if(!s)return null;let a=this.parseTrackMeta(i,{kind:r,format:s.format,language:s.language});return{type:"internal",path:n,basename:s.basename,meta:a,displayText:e.displayText}}catch(n){return n instanceof Am?console.warn(`Invalid track link: ${e.link}`,n.issues):console.warn(`Invalid track link: ${e.link}`,n),null}}inferFromPath(e,{sep:r="/",urlEncoded:n=!1}={}){let i=pd(e,{sep:r,urlEncoded:n});if(!ZT(i))return null;let s=EJe(i);return{basename:s?.basename??i.basename,language:s?.language??null,format:i.extension}}};function TJe(t){let e=t.match(/\\?\|/);return e?.index?{link:t.slice(0,e.index),displayText:t.slice(e.index+e[0].length)}:{link:t}}function EJe(t){let e=t.basename.split(".");if(e.length<=1)return null;let r=e.pop();return Axe(r)?{basename:e.join("."),language:r}:null}var Vv=require("obsidian");var IJe=["vtt","srt","ssa","ass"];function F$(t){return[...Map.groupBy(t,r=>r.meta.language).values()].map(r=>{for(let n of IJe){let i=r.find(s=>s.meta.format===n);if(i)return i}return r[0]}).filter(r=>r!==void 0)}async function*B$(t,e=[]){let{opendir:r}=ia(),n=vs(),i=new Set(e),s=await r(t,{encoding:"utf-8"});for await(let a of s)!(a.isFile()||a.isSymbolicLink())||i.has(a.name)||(yield So(n.join(t,a.name),{sep:n.sep}))}var yM=class{parser;constructor(e){this.parser=e.trackInfoParser}async resolveLocalMediaForTrack(e){if(!Vv.Platform.isDesktopApp)return null;let r=vs(),n=[];for await(let s of B$(r.dirname(e.src.path),[e.src.basename]))s.basename!==e.basename||!Kl(s)||n.push(s);let{pathToFileURL:i}=Vi();for(let s of Ja){let a=n.find(o=>o.extension===s);if(a)return{type:"url:direct",url:i(a.path)}}return null}resolveVaultMediaForTrack(e){let r=e.src.parent;if(!r)return null;let n=r.children.map(i=>i instanceof Vv.TFile&&i.name!==e.src.name&&i.basename===e.basename&&Kl(i)?i:null).filter(i=>!!i);for(let i of Ja){let s=n.find(a=>a.extension===i);if(s)return{type:"file",file:s}}return null}async resolveLocalFileTracks(e){if(!Vv.Platform.isDesktopApp||!Bt(e.url))return[];let r=vs(),{fileURLToPath:n}=Vi(),i=n(e.url),s=So(i,{sep:r.sep}),a=[];for await(let o of B$(s.parent,[s.name])){let l=this.parser.inferFromPath(o,{sep:r.sep});!l||l.basename!==s.basename||a.push({type:"file",src:o,basename:o.basename,meta:{format:l.format,kind:"subtitles",language:l.language,label:null,id:null,isDefault:!1,wid:null}})}return F$(a)}resolveVaultTracks({file:e}){if(!e.parent)return[];let r=e.parent.children.map(n=>{if(!(n instanceof Vv.TFile))return null;let i=this.parser.fileToTrack(n,{kind:"subtitles"});return!i||i.basename!==e.basename?null:i}).filter(n=>!!n);return F$(r)}};var Uxe=require("obsidian");var vM=class{app;constructor(e){this.app=e.app}encodeUrlTrack(e){switch(e.type){case"url":return new URL(e.src.toString()+this.#e(e.meta));case"file":{if(!Uxe.Platform.isDesktopApp)throw new Error("File tracks are only supported on desktop");let{pathToFileURL:r}=Vi(),n=r(e.src.path);return new URL(n.toString()+this.#e(e.meta,{includeFormat:!1}))}default:Be(e)}}encodeVaultTrack(e,r){let n=this.app.metadataCache.fileToLinktext(e.src,r.sourcePath),i=this.#e(e.meta,{includeFormat:!1});return`[[${n}${i}]]`}encode(e,r){switch(e.type){case"url":case"file":return this.encodeUrlTrack(e).toString();case"internal.resolved":return this.encodeVaultTrack(e,r);default:Be(e)}}#e(e,{includeKind:r=!1,includeFormat:n=!0}={}){let i=new URLSearchParams;e.id&&i.set("id",e.id),n&&e.format&&i.set("format",e.format),e.language&&i.set("lang",e.language),e.label&&i.set("label",e.label),e.wid&&i.set("wid",e.wid),e.isDefault&&i.set("default","true"),r&&e.kind&&i.set("kind",e.kind);let s=i.toString();return s?`#${s}`:""}async addTracksToFrontmatter(e,r){await this.app.fileManager.processFrontMatter(r.note,n=>{let i=e.filter(a=>a.meta.kind==="captions").map(a=>this.encode(a,{sourcePath:r.note.path}));i.length>0&&(typeof n[js]=="string"?n[js]=[n[js],...i]:Array.isArray(n[js])?n[js]=[...n[js],...i]:(console.warn(`Invalid caption field: ${js}, overwrite with new value`,n[js]),n[js]=i));let s=e.filter(a=>a.meta.kind==="subtitles").map(a=>this.encode(a,{sourcePath:r.note.path}));s.length>0&&(typeof n[Vs]=="string"?n[Vs]=[n[Vs],...s]:Array.isArray(n[Vs])?n[Vs]=[...n[Vs],...s]:(console.warn(`Invalid subtitle field: ${Vs}, overwrite with new value`,n[Vs]),n[Vs]=s))})}};var jv=require("obsidian");var zxe=AJe().compareBy(t=>t.language,{nullsFirst:!1}).compareBy(t=>t.label).build();function AJe(){let t=[],e={compareBy:(r,n={})=>(t.push((i,s)=>{if(i===null&&s===null)return 0;if(i===null)return 1;if(s===null)return-1;let a=r(i),o=r(s);return!a&&!o?0:a&&!o?n.nullsFirst?1:-1:!a&&o?n.nullsFirst?-1:1:a.localeCompare(o,void 0,n.ignoreCase?{sensitivity:"base"}:void 0)}),e),build:()=>(r,n)=>{for(let i of t){let s=i(r,n);if(s!==0)return s}return 0}};return e}function qxe(t,e){if(t.label)return t.label;if(t.language){if(t.kind==="subtitles")return t.language;if(t.kind==="captions")return`${t.language} (CC)`;Be(t.kind)}return`${t.kind} ${e+1}`}var Hxe=[["vtt","text/vtt"],["srt","application/x-subrip"],["ssa","application/x-ssa"],["ass","application/x-ass"]],PJe=new Map(Hxe),RJe=new Map(Hxe.map(([t,e])=>[e,t]));function Gxe(t){return RJe.get(t??"")}function Wxe(t){return PJe.get(t)}function Kxe(t,e){return new Response(new ReadableStream({async start(r){try{let n=await e();r.enqueue(n),r.close()}catch(n){r.error(n)}}}).pipeThrough(new TextEncoderStream),{headers:{"Content-Type":Wxe(t)}})}var LJe=require("obsidian");var Yxe={"&":"&amp;","<":"&lt;",">":"&gt;","=":"&#61;",":":"&#58;"},F5t=new RegExp(`[${RegExp.escape(Object.keys(Yxe).join(""))}]`,"g"),Xxe=Object.fromEntries(Object.entries(Yxe).map(([t,e])=>[e,t])),MJe=new RegExp(`(${Object.keys(Xxe).map(t=>RegExp.escape(t)).join("|")})`,"g");function _Je(t){return t.replaceAll(MJe,e=>Xxe[e])}async function Qxe(t,e){let r=await o8(t,e);return r.metadata=Hn(r.metadata,n=>_Je(n)),r}var bM=class{mediaLib;app;settings;resolver;constructor(e){this.app=e.app,this.mediaLib=e.mediaLib,this.settings=e.settings,this.resolver=e.trackInfoResolver}async#e(e){if(e instanceof jv.TFile)return await this.app.vault.cachedRead(e);if(!jv.Platform.isDesktopApp)throw new Error("Cannot read file system on mobile");let{readFile:r}=ia();return await r(e.path,"utf-8")}async#t(e){return(await(0,jv.requestUrl)({url:e.toString(),method:"GET"})).text}async loadAndParseTrack(e){let r=await this.loadTrack(e);return await Qxe(r,{type:e.meta.format})}async loadTrack(e){return e.src instanceof URL?await this.#t(e.src):await this.#e(e.src)}async getLocalTracks(e){return e.type==="url:direct"?await this.resolver.resolveLocalFileTracks(e).catch(r=>(console.error("Failed to get tracks from file system for",e,r),[])):e.type==="file"?this.resolver.resolveVaultTracks(e):[]}async getTracks(e){let r=this.mediaLib.findTracksByMedia(e);return[...(await this.getLocalTracks(e)).filter(i=>!r.some(s=>rP(i,s))),...r]}async getLinkedMedia(e){let r=this.mediaLib.findMediaByTrack(e).map(n=>n.src);if(e.type==="internal.resolved"){let n=this.resolver.resolveVaultMediaForTrack(e);n&&r.push(n)}else if(e.type==="file"){let n=await this.resolver.resolveLocalMediaForTrack(e).catch(i=>(console.error("Failed to find related media from fs for",e,i),null));n&&r.push(n)}return r}async loadTracks(e){let[r,n]=await Promise.all([this.settings.loaded,this.getTracks(e)]);n.sort((s,a)=>zxe(s.meta,a.meta));let i=(()=>{if(!r["playback.track.default-enabled"])return-1;let s=n.findIndex(l=>l.meta.isDefault);if(s!==-1)return s;let a=r["playback.track.default-languages"],o=Map.groupBy(n.map((l,c)=>({data:l,idx:c})),l=>uM(l.data.meta.language)?.lang);for(let l of a){let c=n.findIndex(d=>d.meta.language?.trim()===l);if(c!==-1)return c;let u=uM(l);if(u?.lang==="zh"&&u.extlang[0]){let d=D$(u.extlang[0]),f=n.findIndex(p=>{let h=uM(p.meta.language);return h&&h.lang==="zh"&&h.extlang[0]&&D$(h.extlang[0])===d});if(f!==-1)return f}if(u&&o.has(u.lang))return o.get(u.lang).at(0).idx}return 0})();return{tracks:n.map((s,a)=>{let{meta:o,src:l,type:c}=s;return new Kn({kind:o.kind,type:o.format,src:c==="internal.resolved"?`<VAULT_FILE:${l.path}>`:c==="file"?`<LOCAL_FILE:${l.path}>`:`<REMOTE:${l}>`,default:i===a,label:qxe(o,a),language:o.language?.trim(),id:Ia(s),fetch:async()=>Kxe(o.format,()=>this.loadTrack(s))})}),trackInfo:n}}};var EM=require("obsidian");var wM=require("obsidian");var Zxe=require("obsidian");var ewe=Z(Ge(),1),Jxe=({onChange:t,onCancel:e,...r})=>{if(!Zxe.Platform.isDesktopApp)throw new Error("Not supported on this platform");return(0,ewe.jsx)("button",{...r,type:"button",onClick:async()=>{let{dialog:n}=Wo(),{basename:i}=vs();try{let s=await n.showOpenDialog({properties:["openFile","noResolveAliases"],message:"Select a subtitle file to import",filters:[{name:"Subtitle files",extensions:QT}]}),a=s.filePaths[0];s.canceled||!a?e?.():t({path:a,name:i(a)})}catch(s){console.error("Failed to open electron file picker",s),e?.()}},...r})};var $v=Z(Ge(),1),xM=class extends si{app;trackInfoParser;constructor(e){super(e.app),this.app=e.app,this.trackInfoParser=e.trackInfoParser,this.modalEl.addClass("track-import","track-file-import"),this.titleEl.setText("Import Text Track File")}renderContent(){return(0,$v.jsx)(_ce,{onSubmit:e=>{this.resolveWith(e)},inferDefaults:e=>{let r=this.trackInfoParser.inferFromPath(e);return r?{label:r.basename,language:r.language||void 0,"track-kind":r.language&&!r.language.startsWith(wM.moment.locale())?"subtitles":"captions"}:{}},renderFilePicker:({onChange:e,value:r,disabled:n})=>wM.Platform.isDesktopApp?(0,$v.jsx)(Jxe,{className:"contents",disabled:n,onChange:e,onCancel:()=>e(null),children:(0,$v.jsx)(R9,{value:r})}):(0,$v.jsx)(Oce,{className:"contents",disabled:n,onChange:e,onCancel:()=>e(null),children:(0,$v.jsx)(R9,{value:r})})})}};var twe=Z(Ge(),1),kM=class extends si{constructor(e){super(e.app),this.modalEl.addClass("track-import","track-url-import"),this.titleEl.setText("Import Text Track from URL")}renderContent(){return(0,twe.jsx)(Dce,{onSubmit:e=>{this.resolveWith(e)}})}};async function rwe(t){return await new xM(t).requestInput()}async function nwe(t){return await new kM(t).requestInput()}var iwe=require("obsidian"),CM=Z(Te(),1);var V$=Z(Ge(),1),SM=class extends si{#e;#t;#r;constructor(e,{onImport:r,onOpen:n,app:i}){super(i),this.#e=e,this.#t=r,this.#r=n,this.modalEl.addClass("youtube-subtitle-import"),this.titleEl.setText("Import YouTube Subtitle")}renderContent(){return(0,V$.jsx)(OJe,{subtitles:this.#e,onImport:this.#t,onOpen:this.#r})}};function OJe({subtitles:t,onImport:e,onOpen:r}){let[n,i]=(0,CM.useState)(t.map(a=>({data:a,state:{status:"idle"}}))),s=(0,CM.useMemo)(()=>{if(e)return a=>{e(a,o=>{i(l=>l.map(c=>c.data.id===a?{...c,state:o}:c))})}},[e]);return(0,V$.jsx)(Nce,{subtitles:n,userLanguage:(iwe.moment.locale()||navigator.language).split("-")[0],onImport:s,onOpen:r,onRetry:s})}var TM=class{app;mediaNote;settings;parser;stringifier;auth;youTubeApi;saveFolder;constructor(e){this.app=e.app,this.mediaNote=e.mediaNote,this.settings=e.settings,this.parser=e.trackInfoParser,this.stringifier=e.trackInfoEncoder,this.auth=e.auth,this.youTubeApi=e.youTubeApi,this.saveFolder=e.attachement}async importYouTubeSubtitles(e,{errorText:r="Failed to import YouTube subtitles",loadingText:n,onNotFound:i}){let s=e.vid.vid,a=await gt(this.youTubeApi.getSubtitlesList(s),{loading:n,error:(c,u)=>{if(u instanceof Ro){new iu(this.auth,{content:"You need to login to import YouTube subtitles"});return}return`${r}: ${c}`},swallowError:!1}),o=new Map,l=new SM(a.subtitles,{app:this.app,onImport:async(c,u)=>{let d=a.subtitles.find(h=>h.id===c);if(!d){u({status:"error",error:"Subtitle not found"}),i?.();return}u({status:"importing",progress:0});let f=await this.youTubeApi.getSubtitleContent(s,c);u({status:"importing",progress:50});let{track:p}=await this.saveSubtitleContent({media:e,content:f,meta:{kind:"subtitles",format:"vtt",language:FA(d.lang),label:L9(d.name||""),isDefault:!1}});o.set(c,p.src),u({status:"success"})},onOpen:async c=>{if(!o.has(c)){i?.();return}let u=o.get(c);await this.app.workspace.openLinkText(u.path,"","split"),l.close()}});l.open()}async#e(e){if(e instanceof File)return await e.text();if(EM.Platform.isDesktopApp)return await ia().readFile(e.path,"utf-8");throw new Error("Reading file path is not supported on mobile")}async importTranscriptUrl(e){let r=await nwe({app:this.app});if(r["should-download"]){let s=await(0,EM.requestUrl)(r.url),a=new URL(r.url),o=this.parser.inferFromPath(a,{urlEncoded:!0}),l=r.format||Gxe(s.headers["content-type"])||o?.format;if(!l)throw new Error("Could not determine subtitle format from URL");let{track:c}=await this.saveSubtitleContent({media:e,content:s.text,meta:{kind:r["track-kind"],format:l,language:r.language||o?.language||null,label:r.label||"",isDefault:r["default-enable"]}});return c}let n=await this.mediaNote.ensureMediaNote(e),i=this.parser.urlToTrack(new URL(r.url),{kind:r["track-kind"],language:r.language,label:r.label,isDefault:r["default-enable"],id:swe()});if(!i)throw new Error("Failed to parse track info from URL");return await this.stringifier.addTracksToFrontmatter([i],{note:n.note}),i}async importTranscriptFile(e){let r=await rwe({app:this.app,trackInfoParser:this.parser}),n=this.parser.inferFromPath(r.file);if(!n)throw new Error("Failed to infer track info from file");let{track:i}=await this.saveSubtitleContent({media:e,content:await this.#e(r.file),meta:{kind:r["track-kind"],format:n.format,language:r.language||n.language,label:r.label||"",isDefault:r["default-enable"]}});return i}async saveSubtitleContent({media:e,content:r,meta:n}){let i=await this.mediaNote.ensureMediaNote(e),s=[i.uid,swe(),n.language].filter(u=>!!u).join("."),a=await this.settings.loaded,o=await this.saveFolder.getAttachmentFolder({sourcePath:i.note.path,folderPath:a["playback.track.folder-path"]}),l=await this.#t(`${o.path}/${s}.${n.format}`,r),c=this.parser.fileToTrack(l,n);if(!c)throw new $$(l.path);return await this.stringifier.addTracksToFrontmatter([c],{note:i.note}),{track:c}}async#t(e,r){if(this.app.vault.getAbstractFileByPath(e))throw new Fv(e);try{return await this.app.vault.create(e,r)}catch(i){throw new j$(e,{cause:i})}}};function swe(){return Xr(4)}var j$=class extends Error{constructor(e,r){super(`Failed to save text track in ${e}: ${r instanceof Error?r.message:r}`,{cause:r})}},$$=class extends Error{constructor(e,r){super(`Invalid track in ${e}: ${r instanceof Error?r.message:r}`,{cause:r})}};var BM=require("obsidian");var U$=re(),IM=re(t=>{let e=t(U$),r=t(jt)?.flip,n=t(qt)?.flip;return e??r??n??"none"});var z$=re(),q$=re(t=>{let e=t(z$),r=t(Tt).settings.value?.["playback.preserve-pitch"],n=t(jt)?.preservePitch,i=t(qt)?.preservePitch;return e??n??i??r??!0}),jh=fn(re(!1),(t,e)=>{if(!("preservesPitch"in HTMLMediaElement.prototype)){e(jh,!1);return}let r=t(mt);if(!r){e(jh,!1);return}return r.listen("provider-change",({detail:n})=>{e(jh,ho(n)||po(n))})}),awe=$i(t=>{let e=t(mt);if(!e)return;let r=t(q$),n=i=>{i&&(ho(i)||po(i))&&(i.media.preservesPitch=r)};return n(e.provider),e.listen("provider-change",i=>{n(i.detail)})});var owe=m0(qt,t=>t?.cover),df=fn(re(),(t,e)=>{let r=t(Kt);if(!r)return;let{metadataExtractor:n}=t(Tt),i=new AbortController;return(async()=>{var o=[];try{let s=J(o,await n.getInput(r));i.signal.addEventListener("abort",()=>{s?.disposed===!1&&s.dispose()});if(!s)return;let a=await s.getMetadataTags();e(df,a)}catch(l){var c=l,u=!0}finally{ee(o,c,u)}})().catch(s=>{console.warn("Failed to extract metadata",s),e(df,null)}),()=>{e(df,null),i.abort()}}),AM=fn(re(null),(t,e)=>{let r=t(df);if(!r)return;let{metadataExtractor:n}=t(Tt),i=n.extractCover(r);if(!i)return;let s=URL.createObjectURL(i.blob);return e(AM,s),()=>{e(AM,null),URL.revokeObjectURL(s)}});var Uv=re(t=>{let e=t(jt)?.title,r=t(qt)?.title,n=t(df)?.title,i=t($d)?.title,s=t(Tt).mediaAttr.getFallbackTitle(t(Kt));return e??r??n??i??s??"Media"});var lwe='"use strict";(()=>{var _a=Object.create;var ot=Object.defineProperty;var ja=Object.getOwnPropertyDescriptor;var ka=Object.getOwnPropertyNames;var Ma=Object.getPrototypeOf,Na=Object.prototype.hasOwnProperty;var tt=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),nt=e=>{throw TypeError(e)};var i=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Ba=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of ka(r))!Na.call(e,o)&&o!==t&&ot(e,o,{get:()=>r[o],enumerable:!(n=ja(r,o))||n.enumerable});return e};var Da=(e,r,t)=>(t=e!=null?_a(Ma(e)):{},Ba(r||!e||!e.__esModule?ot(t,"default",{value:e,enumerable:!0}):t,e));var Le=(e,r,t)=>{if(r!=null){typeof r!="object"&&typeof r!="function"&&nt("Object expected");var n,o;t&&(n=r[tt("asyncDispose")]),n===void 0&&(n=r[tt("dispose")],t&&(o=n)),typeof n!="function"&&nt("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(a){return Promise.reject(a)}}),e.push([t,n,r])}else t&&e.push([t]);return r},Fe=(e,r,t)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,u,c,f){return f=Error(c),f.name="SuppressedError",f.error=s,f.suppressed=u,f},o=s=>r=t?new n(s,r,"An error was suppressed during disposal"):(t=!0,s),a=s=>{for(;s=e.pop();)try{var u=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(u).then(a,c=>(o(c),a()))}catch(c){o(c)}if(t)throw r};return a()};var p=i((Ue,it)=>{"use strict";var B=function(e){return e&&e.Math===Math&&e};it.exports=B(typeof globalThis=="object"&&globalThis)||B(typeof window=="object"&&window)||B(typeof self=="object"&&self)||B(typeof global=="object"&&global)||B(typeof Ue=="object"&&Ue)||function(){return this}()||Function("return this")()});var y=i((jp,at)=>{"use strict";at.exports=function(e){try{return!!e()}catch{return!0}}});var b=i((kp,st)=>{"use strict";var La=y();st.exports=!La(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var Q=i((Mp,ut)=>{"use strict";var Fa=y();ut.exports=!Fa(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var I=i((Np,ct)=>{"use strict";var Ua=Q(),ee=Function.prototype.call;ct.exports=Ua?ee.bind(ee):function(){return ee.apply(ee,arguments)}});var vt=i(pt=>{"use strict";var ft={}.propertyIsEnumerable,lt=Object.getOwnPropertyDescriptor,$a=lt&&!ft.call({1:2},1);pt.f=$a?function(r){var t=lt(this,r);return!!t&&t.enumerable}:ft});var D=i((Dp,dt)=>{"use strict";dt.exports=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}});var h=i((Lp,mt)=>{"use strict";var ht=Q(),yt=Function.prototype,$e=yt.call,Ka=ht&&yt.bind.bind($e,$e);mt.exports=ht?Ka:function(e){return function(){return $e.apply(e,arguments)}}});var re=i((Fp,bt)=>{"use strict";var gt=h(),Va=gt({}.toString),Ga=gt("".slice);bt.exports=function(e){return Ga(Va(e),8,-1)}});var wt=i((Up,xt)=>{"use strict";var Wa=h(),Ha=y(),Ya=re(),Ke=Object,za=Wa("".split);xt.exports=Ha(function(){return!Ke("z").propertyIsEnumerable(0)})?function(e){return Ya(e)==="String"?za(e,""):Ke(e)}:Ke});var te=i(($p,St)=>{"use strict";St.exports=function(e){return e==null}});var ne=i((Kp,Et)=>{"use strict";var Za=te(),Xa=TypeError;Et.exports=function(e){if(Za(e))throw new Xa("Can\'t call method on "+e);return e}});var L=i((Vp,qt)=>{"use strict";var Ja=wt(),Qa=ne();qt.exports=function(e){return Ja(Qa(e))}});var d=i((Gp,Ot)=>{"use strict";var Ve=typeof document=="object"&&document.all;Ot.exports=typeof Ve>"u"&&Ve!==void 0?function(e){return typeof e=="function"||e===Ve}:function(e){return typeof e=="function"}});var E=i((Wp,Tt)=>{"use strict";var es=d();Tt.exports=function(e){return typeof e=="object"?e!==null:es(e)}});var P=i((Hp,Pt)=>{"use strict";var Ge=p(),rs=d(),ts=function(e){return rs(e)?e:void 0};Pt.exports=function(e,r){return arguments.length<2?ts(Ge[e]):Ge[e]&&Ge[e][r]}});var oe=i((Yp,It)=>{"use strict";var ns=h();It.exports=ns({}.isPrototypeOf)});var _t=i((zp,Ct)=>{"use strict";var os=p(),At=os.navigator,Rt=At&&At.userAgent;Ct.exports=Rt?String(Rt):""});var He=i((Zp,Dt)=>{"use strict";var Bt=p(),We=_t(),jt=Bt.process,kt=Bt.Deno,Mt=jt&&jt.versions||kt&&kt.version,Nt=Mt&&Mt.v8,x,ie;Nt&&(x=Nt.split("."),ie=x[0]>0&&x[0]<4?1:+(x[0]+x[1]));!ie&&We&&(x=We.match(/Edge\\/(\\d+)/),(!x||x[1]>=74)&&(x=We.match(/Chrome\\/(\\d+)/),x&&(ie=+x[1])));Dt.exports=ie});var Ye=i((Xp,Ft)=>{"use strict";var Lt=He(),is=y(),as=p(),ss=as.String;Ft.exports=!!Object.getOwnPropertySymbols&&!is(function(){var e=Symbol("symbol detection");return!ss(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Lt&&Lt<41})});var ze=i((Jp,Ut)=>{"use strict";var us=Ye();Ut.exports=us&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ze=i((Qp,$t)=>{"use strict";var cs=P(),fs=d(),ls=oe(),ps=ze(),vs=Object;$t.exports=ps?function(e){return typeof e=="symbol"}:function(e){var r=cs("Symbol");return fs(r)&&ls(r.prototype,vs(e))}});var Vt=i((ev,Kt)=>{"use strict";var ds=String;Kt.exports=function(e){try{return ds(e)}catch{return"Object"}}});var A=i((rv,Gt)=>{"use strict";var hs=d(),ys=Vt(),ms=TypeError;Gt.exports=function(e){if(hs(e))return e;throw new ms(ys(e)+" is not a function")}});var F=i((tv,Wt)=>{"use strict";var gs=A(),bs=te();Wt.exports=function(e,r){var t=e[r];return bs(t)?void 0:gs(t)}});var Yt=i((nv,Ht)=>{"use strict";var Xe=I(),Je=d(),Qe=E(),xs=TypeError;Ht.exports=function(e,r){var t,n;if(r==="string"&&Je(t=e.toString)&&!Qe(n=Xe(t,e))||Je(t=e.valueOf)&&!Qe(n=Xe(t,e))||r!=="string"&&Je(t=e.toString)&&!Qe(n=Xe(t,e)))return n;throw new xs("Can\'t convert object to primitive value")}});var U=i((ov,zt)=>{"use strict";zt.exports=!1});var ae=i((iv,Xt)=>{"use strict";var Zt=p(),ws=Object.defineProperty;Xt.exports=function(e,r){try{ws(Zt,e,{value:r,configurable:!0,writable:!0})}catch{Zt[e]=r}return r}});var $=i((av,en)=>{"use strict";var Ss=U(),Es=p(),qs=ae(),Jt="__core-js_shared__",Qt=en.exports=Es[Jt]||qs(Jt,{});(Qt.versions||(Qt.versions=[])).push({version:"3.41.0",mode:Ss?"pure":"global",copyright:"\\xA9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var er=i((sv,tn)=>{"use strict";var rn=$();tn.exports=function(e,r){return rn[e]||(rn[e]=r||{})}});var rr=i((uv,nn)=>{"use strict";var Os=ne(),Ts=Object;nn.exports=function(e){return Ts(Os(e))}});var g=i((cv,on)=>{"use strict";var Ps=h(),Is=rr(),As=Ps({}.hasOwnProperty);on.exports=Object.hasOwn||function(r,t){return As(Is(r),t)}});var tr=i((fv,an)=>{"use strict";var Rs=h(),Cs=0,_s=Math.random(),js=Rs(1 .toString);an.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+js(++Cs+_s,36)}});var m=i((lv,un)=>{"use strict";var ks=p(),Ms=er(),sn=g(),Ns=tr(),Bs=Ye(),Ds=ze(),_=ks.Symbol,nr=Ms("wks"),Ls=Ds?_.for||_:_&&_.withoutSetter||Ns;un.exports=function(e){return sn(nr,e)||(nr[e]=Bs&&sn(_,e)?_[e]:Ls("Symbol."+e)),nr[e]}});var pn=i((pv,ln)=>{"use strict";var Fs=I(),cn=E(),fn=Ze(),Us=F(),$s=Yt(),Ks=m(),Vs=TypeError,Gs=Ks("toPrimitive");ln.exports=function(e,r){if(!cn(e)||fn(e))return e;var t=Us(e,Gs),n;if(t){if(r===void 0&&(r="default"),n=Fs(t,e,r),!cn(n)||fn(n))return n;throw new Vs("Can\'t convert object to primitive value")}return r===void 0&&(r="number"),$s(e,r)}});var or=i((vv,vn)=>{"use strict";var Ws=pn(),Hs=Ze();vn.exports=function(e){var r=Ws(e,"string");return Hs(r)?r:r+""}});var ar=i((dv,hn)=>{"use strict";var Ys=p(),dn=E(),ir=Ys.document,zs=dn(ir)&&dn(ir.createElement);hn.exports=function(e){return zs?ir.createElement(e):{}}});var sr=i((hv,yn)=>{"use strict";var Zs=b(),Xs=y(),Js=ar();yn.exports=!Zs&&!Xs(function(){return Object.defineProperty(Js("div"),"a",{get:function(){return 7}}).a!==7})});var K=i(gn=>{"use strict";var Qs=b(),eu=I(),ru=vt(),tu=D(),nu=L(),ou=or(),iu=g(),au=sr(),mn=Object.getOwnPropertyDescriptor;gn.f=Qs?mn:function(r,t){if(r=nu(r),t=ou(t),au)try{return mn(r,t)}catch{}if(iu(r,t))return tu(!eu(ru.f,r,t),r[t])}});var ur=i((mv,bn)=>{"use strict";var su=b(),uu=y();bn.exports=su&&uu(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var j=i((gv,xn)=>{"use strict";var cu=E(),fu=String,lu=TypeError;xn.exports=function(e){if(cu(e))return e;throw new lu(fu(e)+" is not an object")}});var q=i(Sn=>{"use strict";var pu=b(),vu=sr(),du=ur(),se=j(),wn=or(),hu=TypeError,cr=Object.defineProperty,yu=Object.getOwnPropertyDescriptor,fr="enumerable",lr="configurable",pr="writable";Sn.f=pu?du?function(r,t,n){if(se(r),t=wn(t),se(n),typeof r=="function"&&t==="prototype"&&"value"in n&&pr in n&&!n[pr]){var o=yu(r,t);o&&o[pr]&&(r[t]=n.value,n={configurable:lr in n?n[lr]:o[lr],enumerable:fr in n?n[fr]:o[fr],writable:!1})}return cr(r,t,n)}:cr:function(r,t,n){if(se(r),t=wn(t),se(n),vu)try{return cr(r,t,n)}catch{}if("get"in n||"set"in n)throw new hu("Accessors not supported");return"value"in n&&(r[t]=n.value),r}});var V=i((xv,En)=>{"use strict";var mu=b(),gu=q(),bu=D();En.exports=mu?function(e,r,t){return gu.f(e,r,bu(1,t))}:function(e,r,t){return e[r]=t,e}});var Tn=i((wv,On)=>{"use strict";var vr=b(),xu=g(),qn=Function.prototype,wu=vr&&Object.getOwnPropertyDescriptor,dr=xu(qn,"name"),Su=dr&&function(){}.name==="something",Eu=dr&&(!vr||vr&&wu(qn,"name").configurable);On.exports={EXISTS:dr,PROPER:Su,CONFIGURABLE:Eu}});var In=i((Sv,Pn)=>{"use strict";var qu=h(),Ou=d(),hr=$(),Tu=qu(Function.toString);Ou(hr.inspectSource)||(hr.inspectSource=function(e){return Tu(e)});Pn.exports=hr.inspectSource});var Cn=i((Ev,Rn)=>{"use strict";var Pu=p(),Iu=d(),An=Pu.WeakMap;Rn.exports=Iu(An)&&/native code/.test(String(An))});var ue=i((qv,jn)=>{"use strict";var Au=er(),Ru=tr(),_n=Au("keys");jn.exports=function(e){return _n[e]||(_n[e]=Ru(e))}});var ce=i((Ov,kn)=>{"use strict";kn.exports={}});var pe=i((Tv,Bn)=>{"use strict";var Cu=Cn(),Nn=p(),_u=E(),ju=V(),yr=g(),mr=$(),ku=ue(),Mu=ce(),Mn="Object already initialized",gr=Nn.TypeError,Nu=Nn.WeakMap,fe,G,le,Bu=function(e){return le(e)?G(e):fe(e,{})},Du=function(e){return function(r){var t;if(!_u(r)||(t=G(r)).type!==e)throw new gr("Incompatible receiver, "+e+" required");return t}};Cu||mr.state?(w=mr.state||(mr.state=new Nu),w.get=w.get,w.has=w.has,w.set=w.set,fe=function(e,r){if(w.has(e))throw new gr(Mn);return r.facade=e,w.set(e,r),r},G=function(e){return w.get(e)||{}},le=function(e){return w.has(e)}):(R=ku("state"),Mu[R]=!0,fe=function(e,r){if(yr(e,R))throw new gr(Mn);return r.facade=e,ju(e,R,r),r},G=function(e){return yr(e,R)?e[R]:{}},le=function(e){return yr(e,R)});var w,R;Bn.exports={set:fe,get:G,has:le,enforce:Bu,getterFor:Du}});var wr=i((Pv,Fn)=>{"use strict";var xr=h(),Lu=y(),Fu=d(),ve=g(),br=b(),Uu=Tn().CONFIGURABLE,$u=In(),Ln=pe(),Ku=Ln.enforce,Vu=Ln.get,Dn=String,de=Object.defineProperty,Gu=xr("".slice),Wu=xr("".replace),Hu=xr([].join),Yu=br&&!Lu(function(){return de(function(){},"length",{value:8}).length!==8}),zu=String(String).split("String"),Zu=Fn.exports=function(e,r,t){Gu(Dn(r),0,7)==="Symbol("&&(r="["+Wu(Dn(r),/^Symbol\\(([^)]*)\\).*$/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!ve(e,"name")||Uu&&e.name!==r)&&(br?de(e,"name",{value:r,configurable:!0}):e.name=r),Yu&&t&&ve(t,"arity")&&e.length!==t.arity&&de(e,"length",{value:t.arity});try{t&&ve(t,"constructor")&&t.constructor?br&&de(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=Ku(e);return ve(n,"source")||(n.source=Hu(zu,typeof r=="string"?r:"")),e};Function.prototype.toString=Zu(function(){return Fu(this)&&Vu(this).source||$u(this)},"toString")});var O=i((Iv,Un)=>{"use strict";var Xu=d(),Ju=q(),Qu=wr(),ec=ae();Un.exports=function(e,r,t,n){n||(n={});var o=n.enumerable,a=n.name!==void 0?n.name:r;if(Xu(t)&&Qu(t,a,n),n.global)o?e[r]=t:ec(r,t);else{try{n.unsafe?e[r]&&(o=!0):delete e[r]}catch{}o?e[r]=t:Ju.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}});var Kn=i((Av,$n)=>{"use strict";var rc=Math.ceil,tc=Math.floor;$n.exports=Math.trunc||function(r){var t=+r;return(t>0?tc:rc)(t)}});var Sr=i((Rv,Vn)=>{"use strict";var nc=Kn();Vn.exports=function(e){var r=+e;return r!==r||r===0?0:nc(r)}});var Wn=i((Cv,Gn)=>{"use strict";var oc=Sr(),ic=Math.max,ac=Math.min;Gn.exports=function(e,r){var t=oc(e);return t<0?ic(t+r,0):ac(t,r)}});var Yn=i((_v,Hn)=>{"use strict";var sc=Sr(),uc=Math.min;Hn.exports=function(e){var r=sc(e);return r>0?uc(r,9007199254740991):0}});var Zn=i((jv,zn)=>{"use strict";var cc=Yn();zn.exports=function(e){return cc(e.length)}});var Qn=i((kv,Jn)=>{"use strict";var fc=L(),lc=Wn(),pc=Zn(),Xn=function(e){return function(r,t,n){var o=fc(r),a=pc(o);if(a===0)return!e&&-1;var s=lc(n,a),u;if(e&&t!==t){for(;a>s;)if(u=o[s++],u!==u)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===t)return e||s||0;return!e&&-1}};Jn.exports={includes:Xn(!0),indexOf:Xn(!1)}});var qr=i((Mv,ro)=>{"use strict";var vc=h(),Er=g(),dc=L(),hc=Qn().indexOf,yc=ce(),eo=vc([].push);ro.exports=function(e,r){var t=dc(e),n=0,o=[],a;for(a in t)!Er(yc,a)&&Er(t,a)&&eo(o,a);for(;r.length>n;)Er(t,a=r[n++])&&(~hc(o,a)||eo(o,a));return o}});var he=i((Nv,to)=>{"use strict";to.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var oo=i(no=>{"use strict";var mc=qr(),gc=he(),bc=gc.concat("length","prototype");no.f=Object.getOwnPropertyNames||function(r){return mc(r,bc)}});var ao=i(io=>{"use strict";io.f=Object.getOwnPropertySymbols});var uo=i((Lv,so)=>{"use strict";var xc=P(),wc=h(),Sc=oo(),Ec=ao(),qc=j(),Oc=wc([].concat);so.exports=xc("Reflect","ownKeys")||function(r){var t=Sc.f(qc(r)),n=Ec.f;return n?Oc(t,n(r)):t}});var Or=i((Fv,fo)=>{"use strict";var co=g(),Tc=uo(),Pc=K(),Ic=q();fo.exports=function(e,r,t){for(var n=Tc(r),o=Ic.f,a=Pc.f,s=0;s<n.length;s++){var u=n[s];!co(e,u)&&!(t&&co(t,u))&&o(e,u,a(r,u))}}});var po=i((Uv,lo)=>{"use strict";var Ac=y(),Rc=d(),Cc=/#|\\.prototype\\./,W=function(e,r){var t=jc[_c(e)];return t===Mc?!0:t===kc?!1:Rc(r)?Ac(r):!!r},_c=W.normalize=function(e){return String(e).replace(Cc,".").toLowerCase()},jc=W.data={},kc=W.NATIVE="N",Mc=W.POLYFILL="P";lo.exports=W});var me=i(($v,vo)=>{"use strict";var ye=p(),Nc=K().f,Bc=V(),Dc=O(),Lc=ae(),Fc=Or(),Uc=po();vo.exports=function(e,r){var t=e.target,n=e.global,o=e.stat,a,s,u,c,f,l;if(n?s=ye:o?s=ye[t]||Lc(t,{}):s=ye[t]&&ye[t].prototype,s)for(u in r){if(f=r[u],e.dontCallGetSet?(l=Nc(s,u),c=l&&l.value):c=s[u],a=Uc(n?u:t+(o?".":"#")+u,e.forced),!a&&c!==void 0){if(typeof f==typeof c)continue;Fc(f,c)}(e.sham||c&&c.sham)&&Bc(f,"sham",!0),Dc(s,u,f,e)}}});var yo=i((Kv,ho)=>{"use strict";var $c=y();ho.exports=!$c(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})});var ge=i((Vv,go)=>{"use strict";var Kc=g(),Vc=d(),Gc=rr(),Wc=ue(),Hc=yo(),mo=Wc("IE_PROTO"),Tr=Object,Yc=Tr.prototype;go.exports=Hc?Tr.getPrototypeOf:function(e){var r=Gc(e);if(Kc(r,mo))return r[mo];var t=r.constructor;return Vc(t)&&r instanceof t?t.prototype:r instanceof Tr?Yc:null}});var xo=i((Gv,bo)=>{"use strict";var zc=h(),Zc=A();bo.exports=function(e,r,t){try{return zc(Zc(Object.getOwnPropertyDescriptor(e,r)[t]))}catch{}}});var So=i((Wv,wo)=>{"use strict";var Xc=E();wo.exports=function(e){return Xc(e)||e===null}});var qo=i((Hv,Eo)=>{"use strict";var Jc=So(),Qc=String,ef=TypeError;Eo.exports=function(e){if(Jc(e))return e;throw new ef("Can\'t set "+Qc(e)+" as a prototype")}});var To=i((Yv,Oo)=>{"use strict";var rf=xo(),tf=E(),nf=ne(),of=qo();Oo.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,r={},t;try{t=rf(Object.prototype,"__proto__","set"),t(r,[]),e=r instanceof Array}catch{}return function(o,a){return nf(o),of(a),tf(o)&&(e?t(o,a):o.__proto__=a),o}}():void 0)});var Io=i((zv,Po)=>{"use strict";var af=qr(),sf=he();Po.exports=Object.keys||function(r){return af(r,sf)}});var Ro=i(Ao=>{"use strict";var uf=b(),cf=ur(),ff=q(),lf=j(),pf=L(),vf=Io();Ao.f=uf&&!cf?Object.defineProperties:function(r,t){lf(r);for(var n=pf(t),o=vf(t),a=o.length,s=0,u;a>s;)ff.f(r,u=o[s++],n[u]);return r}});var _o=i((Xv,Co)=>{"use strict";var df=P();Co.exports=df("document","documentElement")});var we=i((Jv,Lo)=>{"use strict";var hf=j(),yf=Ro(),jo=he(),mf=ce(),gf=_o(),bf=ar(),xf=ue(),ko=">",Mo="<",Ir="prototype",Ar="script",Bo=xf("IE_PROTO"),Pr=function(){},Do=function(e){return Mo+Ar+ko+e+Mo+"/"+Ar+ko},No=function(e){e.write(Do("")),e.close();var r=e.parentWindow.Object;return e=null,r},wf=function(){var e=bf("iframe"),r="java"+Ar+":",t;return e.style.display="none",gf.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Do("document.F=Object")),t.close(),t.F},be,xe=function(){try{be=new ActiveXObject("htmlfile")}catch{}xe=typeof document<"u"?document.domain&&be?No(be):wf():No(be);for(var e=jo.length;e--;)delete xe[Ir][jo[e]];return xe()};mf[Bo]=!0;Lo.exports=Object.create||function(r,t){var n;return r!==null?(Pr[Ir]=hf(r),n=new Pr,Pr[Ir]=null,n[Bo]=r):n=xe(),t===void 0?n:yf.f(n,t)}});var Ko=i((Qv,$o)=>{"use strict";var Sf=h(),Fo=Error,Ef=Sf("".replace),qf=function(e){return String(new Fo(e).stack)}("zxcasd"),Uo=/\\n\\s*at [^:]*:[^\\n]*/,Of=Uo.test(qf);$o.exports=function(e,r){if(Of&&typeof e=="string"&&!Fo.prepareStackTrace)for(;r--;)e=Ef(e,Uo,"");return e}});var Go=i((ed,Vo)=>{"use strict";var Tf=y(),Pf=D();Vo.exports=!Tf(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",Pf(1,7)),e.stack!==7):!0})});var Yo=i((rd,Ho)=>{"use strict";var If=V(),Af=Ko(),Rf=Go(),Wo=Error.captureStackTrace;Ho.exports=function(e,r,t,n){Rf&&(Wo?Wo(e,r):If(e,"stack",Af(t,n)))}});var Xo=i((td,Zo)=>{"use strict";var Cf=m(),_f=Cf("toStringTag"),zo={};zo[_f]="z";Zo.exports=String(zo)==="[object z]"});var Qo=i((nd,Jo)=>{"use strict";var jf=Xo(),kf=d(),Se=re(),Mf=m(),Nf=Mf("toStringTag"),Bf=Object,Df=Se(function(){return arguments}())==="Arguments",Lf=function(e,r){try{return e[r]}catch{}};Jo.exports=jf?Se:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Lf(r=Bf(e),Nf))=="string"?t:Df?Se(r):(n=Se(r))==="Object"&&kf(r.callee)?"Arguments":n}});var ri=i((od,ei)=>{"use strict";var Ff=Qo(),Uf=String;ei.exports=function(e){if(Ff(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Uf(e)}});var ni=i((id,ti)=>{"use strict";var $f=ri();ti.exports=function(e,r){return e===void 0?arguments.length<2?"":r:$f(e)}});var ai=i(()=>{"use strict";var Kf=me(),Vf=p(),Gf=oe(),oi=ge(),qe=To(),Wf=Or(),ii=we(),Ee=V(),Rr=D(),Hf=Yo(),Yf=ni(),zf=m(),Zf=y(),Xf=U(),k=Vf.SuppressedError,Jf=zf("toStringTag"),Oe=Error,Qf=!!k&&k.length!==3,el=!!k&&Zf(function(){return new k(1,2,3,{cause:4}).cause===4}),Te=Qf||el,C=function(r,t,n){var o=Gf(H,this),a;return qe?a=Te&&(!o||oi(this)===H)?new k:qe(new Oe,o?oi(this):H):(a=o?this:ii(H),Ee(a,Jf,"Error")),n!==void 0&&Ee(a,"message",Yf(n)),Hf(a,C,a.stack,1),Ee(a,"error",r),Ee(a,"suppressed",t),a};qe?qe(C,Oe):Wf(C,Oe,{name:!0});var H=C.prototype=Te?k.prototype:ii(Oe.prototype,{constructor:Rr(1,C),message:Rr(1,""),name:Rr(1,"SuppressedError")});Te&&!Xf&&(H.constructor=C);Kf({global:!0,constructor:!0,arity:3,forced:Te},{SuppressedError:C})});var Cr=i((ud,si)=>{"use strict";var rl=oe(),tl=TypeError;si.exports=function(e,r){if(rl(r,e))return e;throw new tl("Incorrect invocation")}});var _r=i((cd,ui)=>{"use strict";var nl=O();ui.exports=function(e,r,t){for(var n in r)nl(e,n,r[n],t);return e}});var jr=i((fd,fi)=>{"use strict";var ci=wr(),ol=q();fi.exports=function(e,r,t){return t.get&&ci(t.get,r,{getter:!0}),t.set&&ci(t.set,r,{setter:!0}),ol.f(e,r,t)}});var pi=i((ld,li)=>{"use strict";var il=re(),al=h();li.exports=function(e){if(il(e)==="Function")return al(e)}});var hi=i((pd,di)=>{"use strict";var vi=pi(),sl=A(),ul=Q(),cl=vi(vi.bind);di.exports=function(e,r){return sl(e),r===void 0?e:ul?cl(e,r):function(){return e.apply(r,arguments)}}});var Mr=i((vd,xi)=>{"use strict";var fl=P(),ll=I(),pl=h(),vl=hi(),dl=j(),hl=A(),gi=te(),kr=F(),bi=m(),yl=bi("asyncDispose"),yi=bi("dispose"),ml=pl([].push),gl=function(e,r){if(r==="async-dispose"){var t=kr(e,yl);return t!==void 0||(t=kr(e,yi),t===void 0)?t:function(){var n=this,o=fl("Promise");return new o(function(a){ll(t,n),a(void 0)})}}return kr(e,yi)},mi=function(e,r,t){return arguments.length<3&&!gi(e)&&(t=hl(gl(dl(e),r))),t===void 0?function(){}:vl(t,e)};xi.exports=function(e,r,t,n){var o;if(arguments.length<4){if(gi(r)&&t==="sync-dispose")return;o=mi(r,t)}else o=mi(void 0,t,n);ml(e.stack,o)}});var Ii=i(()=>{"use strict";var bl=me(),Ie=b(),qi=P(),wi=A(),xl=Cr(),Oi=O(),wl=_r(),Sl=jr(),Ti=m(),Pi=pe(),Nr=Mr(),Si=He(),Ei=qi("Promise"),El=qi("SuppressedError"),ql=ReferenceError,Ol=Ti("asyncDispose"),Tl=Ti("toStringTag"),Re="AsyncDisposableStack",Pl=Pi.set,Ae=Pi.getterFor(Re),Br="async-dispose",Y="disposed",Il="pending",Pe=function(e){var r=Ae(e);if(r.state===Y)throw new ql(Re+" already disposed");return r},Dr=function(){Pl(xl(this,M),{type:Re,state:Il,stack:[]}),Ie||(this.disposed=!1)},M=Dr.prototype;wl(M,{disposeAsync:function(){var r=this;return new Ei(function(t,n){var o=Ae(r);if(o.state===Y)return t(void 0);o.state=Y,Ie||(r.disposed=!0);var a=o.stack,s=a.length,u=!1,c,f=function(v){u?c=new El(v,c):(u=!0,c=v),l()},l=function(){if(s){var v=a[--s];a[s]=null;try{Ei.resolve(v()).then(l,f)}catch(De){f(De)}}else o.stack=null,u?n(c):t(void 0)};l()})},use:function(r){return Nr(Pe(this),r,Br),r},adopt:function(r,t){var n=Pe(this);return wi(t),Nr(n,void 0,Br,function(){return t(r)}),r},defer:function(r){var t=Pe(this);wi(r),Nr(t,void 0,Br,r)},move:function(){var r=Pe(this),t=new Dr;return Ae(t).stack=r.stack,r.stack=[],r.state=Y,Ie||(this.disposed=!0),t}});Ie&&Sl(M,"disposed",{configurable:!0,get:function(){return Ae(this).state===Y}});Oi(M,Ol,M.disposeAsync,{name:"disposeAsync"});Oi(M,Tl,Re,{nonWritable:!0});var Al=Si&&Si<136;bl({global:!0,constructor:!0,forced:Al},{AsyncDisposableStack:Dr})});var Bi=i((yd,Ni)=>{"use strict";var ji=p(),ki=$(),Mi=d(),Rl=we(),Ce=ge(),Cl=O(),_l=m(),jl=U(),Ai="USE_FUNCTION_CONSTRUCTOR",Ri=_l("asyncIterator"),Ci=ji.AsyncIterator,_i=ki.AsyncIteratorPrototype,S,Lr;if(_i)S=_i;else if(Mi(Ci))S=Ci.prototype;else if(ki[Ai]||ji[Ai])try{Lr=Ce(Ce(Ce(Function("return async function*(){}()")()))),Ce(Lr)===Object.prototype&&(S=Lr)}catch{}S?jl&&(S=Rl(S)):S={};Mi(S[Ri])||Cl(S,Ri,function(){return this});Ni.exports=S});var Ui=i(()=>{"use strict";var kl=I(),Ml=O(),Nl=P(),Bl=F(),Dl=g(),Ll=m(),Di=Bi(),Li=Ll("asyncDispose"),Fi=Nl("Promise");Dl(Di,Li)||Ml(Di,Li,function(){var e=this;return new Fi(function(r,t){var n=Bl(e,"return");n?Fi.resolve(kl(n,e)).then(function(){r(void 0)},t):r(void 0)})})});var Wi=i(()=>{"use strict";var Fl=me(),je=b(),Ul=P(),$i=A(),$l=Cr(),Ki=O(),Kl=_r(),Vl=jr(),Vi=m(),Gi=pe(),Fr=Mr(),Gl=Ul("SuppressedError"),Wl=ReferenceError,Hl=Vi("dispose"),Yl=Vi("toStringTag"),Me="DisposableStack",zl=Gi.set,ke=Gi.getterFor(Me),Ur="sync-dispose",z="disposed",Zl="pending",_e=function(e){var r=ke(e);if(r.state===z)throw new Wl(Me+" already disposed");return r},$r=function(){zl($l(this,N),{type:Me,state:Zl,stack:[]}),je||(this.disposed=!1)},N=$r.prototype;Kl(N,{dispose:function(){var r=ke(this);if(r.state!==z){r.state=z,je||(this.disposed=!0);for(var t=r.stack,n=t.length,o=!1,a;n;){var s=t[--n];t[n]=null;try{s()}catch(u){o?a=new Gl(u,a):(o=!0,a=u)}}if(r.stack=null,o)throw a}},use:function(r){return Fr(_e(this),r,Ur),r},adopt:function(r,t){var n=_e(this);return $i(t),Fr(n,void 0,Ur,function(){t(r)}),r},defer:function(r){var t=_e(this);$i(r),Fr(t,void 0,Ur,r)},move:function(){var r=_e(this),t=new $r;return ke(t).stack=r.stack,r.stack=[],r.state=z,je||(this.disposed=!0),t}});je&&Vl(N,"disposed",{configurable:!0,get:function(){return ke(this).state===z}});Ki(N,Hl,N.dispose,{name:"dispose"});Ki(N,Yl,Me,{nonWritable:!0});Fl({global:!0,constructor:!0},{DisposableStack:$r})});var Zi=i((wd,zi)=>{"use strict";var Xl=y(),Jl=d(),Ql=E(),ep=we(),Hi=ge(),rp=O(),tp=m(),np=U(),Gr=tp("iterator"),Yi=!1,T,Kr,Vr;[].keys&&(Vr=[].keys(),"next"in Vr?(Kr=Hi(Hi(Vr)),Kr!==Object.prototype&&(T=Kr)):Yi=!0);var op=!Ql(T)||Xl(function(){var e={};return T[Gr].call(e)!==e});op?T={}:np&&(T=ep(T));Jl(T[Gr])||rp(T,Gr,function(){return this});zi.exports={IteratorPrototype:T,BUGGY_SAFARI_ITERATORS:Yi}});var Qi=i(()=>{"use strict";var ip=I(),ap=O(),sp=F(),up=g(),cp=m(),Xi=Zi().IteratorPrototype,Ji=cp("dispose");up(Xi,Ji)||ap(Xi,Ji,function(){var e=sp(this,"return");e&&ip(e,this)})});var ra=i((qd,ea)=>{"use strict";var fp=p();ea.exports=fp});var na=i(ta=>{"use strict";var lp=m();ta.f=lp});var Wr=i((Td,ia)=>{"use strict";var oa=ra(),pp=g(),vp=na(),dp=q().f;ia.exports=function(e){var r=oa.Symbol||(oa.Symbol={});pp(r,e)||dp(r,e,{value:vp.f(e)})}});var aa=i(()=>{"use strict";var hp=p(),yp=Wr(),mp=q().f,gp=K().f,Hr=hp.Symbol;yp("asyncDispose");Hr&&(Z=gp(Hr,"asyncDispose"),Z.enumerable&&Z.configurable&&Z.writable&&mp(Hr,"asyncDispose",{value:Z.value,enumerable:!1,configurable:!1,writable:!1}));var Z});var sa=i(()=>{"use strict";var bp=p(),xp=Wr(),wp=q().f,Sp=K().f,Yr=bp.Symbol;xp("dispose");Yr&&(X=Sp(Yr,"dispose"),X.enumerable&&X.configurable&&X.writable&&wp(Yr,"dispose",{value:X.value,enumerable:!1,configurable:!1,writable:!1}));var X});var ua=i(()=>{"use strict";ai();Ii();Ui();Wi();Qi();aa();sa()});var jd=Da(ua(),1);function zr(e){return e?.type==="TASK"}function ca(e){return e?.type==="RESULT"}function fa(e){return e?.type==="ERROR"}function Zr(e){return e?.type==="ABORT"}function Xr(e){return e?.type==="EVENT"}function la(e){if(typeof e!="object"||e===null)return!1;let r=e;return ca(r)||fa(r)||zr(r)||Zr(r)||Xr(r)}function pa(e,r){let t=r;return!t||Xr(t)?!1:t.taskId===e.taskId&&(ca(t)||fa(t))}var va=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),da=e=>{throw TypeError(e)},Jr=(e,r,t)=>{if(r!=null){typeof r!="object"&&typeof r!="function"&&da("Object expected");var n,o;t&&(n=r[va("asyncDispose")]),n===void 0&&(n=r[va("dispose")],t&&(o=n)),typeof n!="function"&&da("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(a){return Promise.reject(a)}}),e.push([t,n,r])}else t&&e.push([t]);return r},Qr=(e,r,t)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,u,c,f){return f=Error(c),f.name="SuppressedError",f.error=s,f.suppressed=u,f},o=s=>r=t?new n(s,r,"An error was suppressed during disposal"):(t=!0,s),a=s=>{for(;s=e.pop();)try{var u=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(u).then(a,c=>(o(c),a()))}catch(c){o(c)}if(t)throw r};return a()},J=class e{#e;#r=new Map;static init(r){return new e(r)}#t=new AbortController;#n;constructor(r){var t=[];try{this.#e=r;let a=Jr(t,new DisposableStack);a.use(this.#e.addMessageHandler(this.#i)),a.defer(()=>{this.#t.abort(new Error("Provider unloaded"));for(let s of this.#r.values())s.abort(new Error("Provider unloaded"));this.#r.clear()}),this.#n=a.move()}catch(a){var n=a,o=!0}finally{Qr(t,n,o)}}[Symbol.dispose](){this.#n.dispose()}#i=async(r,t)=>{var n=[];try{if(Zr(r))return this.#a(r);if(!zr(r))return;Jr(n,new DisposableStack).defer(()=>{this.#r.delete(r.taskId)});let{resp:u,options:c}=await this.#s(r);t?t(u,c):await this.#e.sendMessage(u,c)}catch(s){var o=s,a=!0}finally{Qr(n,o,a)}};#a(r){let t=this.#r.get(r.taskId);t&&(t.abort(new Error("Task aborted by client")),this.#r.delete(r.taskId))}async#s(r){var t=[];try{let a=new AbortController,s=Jr(t,new DisposableStack);this.#r.set(r.taskId,a),s.defer(()=>{this.#r.delete(r.taskId)});let u={signal:AbortSignal.any([a.signal,this.#t.signal])};try{let c=this.#o.respondWithOptions.get(r.fnName);if(c){let l=await(c.type==="fn"?c.fn:c.fnCreator(u)).apply(null,r.args),{options:v,payload:De}=l;return{resp:{type:"RESULT",taskId:r.taskId,value:De},options:v}}let f=this.#o.regular.get(r.fnName);if(f){let l=await(f.type==="fn"?f.fn:f.fnCreator(u)).apply(null,r.args);return{resp:{type:"RESULT",taskId:r.taskId,value:l}}}return{resp:{type:"ERROR",taskId:r.taskId,error:new ReferenceError(`Handler not defined: ${r.fnName}`)}}}catch(c){return console.error("Error in handler",c),{resp:{type:"ERROR",taskId:r.taskId,error:c instanceof Error?c:new Error(String(c))}}}}catch(a){var n=a,o=!0}finally{Qr(t,n,o)}}addFnHandler(r){let{fn:t,fnCreator:n,name:o,respWithOpts:a=!1}=r;if(!t&&!n)throw new Error("No handler implemented");if(!o)throw new Error("Function must have a name");if(this.#o.regular.has(o)||this.#o.respondWithOptions.has(o))throw new Error(`Function ${o} already registered`);if(a){let s=t?{type:"fn",fn:t}:{type:"fnCreator",fnCreator:n};this.#o.respondWithOptions.set(o,s)}else{let s=t?{type:"fn",fn:t}:{type:"fnCreator",fnCreator:n};this.#o.regular.set(o,s)}}#o={regular:new Map,respondWithOptions:new Map}};function ha(e){return la(e)?e:(console.warn("Received non-IPC message, ignoring",e),null)}function ya(e,{taskId:r,stack:t}){return new Promise(n=>{let o=()=>{n({type:"ERROR",taskId:r,error:new Error("Aborted")})};e?.addEventListener("abort",o,{once:!0}),t.defer(()=>{e?.removeEventListener("abort",o)})})}var ma=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),ga=e=>{throw TypeError(e)},ba=(e,r,t)=>{if(r!=null){typeof r!="object"&&typeof r!="function"&&ga("Object expected");var n,o;t&&(n=r[ma("asyncDispose")]),n===void 0&&(n=r[ma("dispose")],t&&(o=n)),typeof n!="function"&&ga("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(a){return Promise.reject(a)}}),e.push([t,n,r])}else t&&e.push([t]);return r},xa=(e,r,t)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,u,c,f){return f=Error(c),f.name="SuppressedError",f.error=s,f.suppressed=u,f},o=s=>r=t?new n(s,r,"An error was suppressed during disposal"):(t=!0,s),a=s=>{for(;s=e.pop();)try{var u=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(u).then(a,c=>(o(c),a()))}catch(c){o(c)}if(t)throw r};return a()},wa={parse:ha,stringify:e=>e},Ne=class{#e;constructor(r){this.#e=r}sendMessage(r,t){this.#e.postMessage(wa.stringify(r),t)}#r=!1;addMessageHandler(r){var t=[];try{let a=ba(t,new DisposableStack),s=u=>{let c=wa.parse(u.data);c&&r(c)};return this.#e.addEventListener("message",s),a.defer(()=>{this.#e.removeEventListener("message",s)}),this.#r||(this.#e.start(),this.#r=!0),a.move()}catch(a){var n=a,o=!0}finally{xa(t,n,o)}}async invoke(r,{signal:t,...n}={}){var o=[];try{this.sendMessage(r,n);let u=ba(o,new DisposableStack);return await Promise.race([new Promise(c=>{u.use(this.addMessageHandler(f=>{pa(r,f)&&c(f)}))}),ya(t,{taskId:r.taskId,stack:u})])}catch(u){var a=u,s=!0}finally{xa(o,a,s)}}[Symbol.dispose]=()=>{this.#e.close()}};function et(e,r){return e instanceof Promise?Ep(e,r):qp(e,r)}function Ep(e,r){let{promise:t,reject:n}=Promise.withResolvers(),o=()=>n(r.reason);return r.aborted&&o(),r.addEventListener("abort",o,{once:!0}),Promise.race([t,e]).finally(()=>{r.removeEventListener("abort",o)})}async function*qp(e,r){r.throwIfAborted();let{promise:t,reject:n}=Promise.withResolvers(),o=()=>n(r.reason);r.addEventListener("abort",o,{once:!0});let a=e[Symbol.asyncIterator]();try{for(;;){let s=Promise.race([t,a.next()]);s.catch(()=>{r.removeEventListener("abort",o)});let{done:u,value:c}=await s;if(u)return r.removeEventListener("abort",o),(await a.return?.(c))?.value;yield c}}catch(s){throw await a.return?.(),s}}var Ea;Ea=Symbol.asyncIterator;var Sa=class{#e=0;#r=[];#t=[];#n=Promise.withResolvers();add(r){++this.#e,this.#i(r[Symbol.asyncIterator]())}async#i(r){try{let{value:t,done:n}=await r.next();n?--this.#e:this.#r.push({iterator:r,value:t})}catch(t){this.#t.push(t)}this.#n.resolve()}async*iterate(){for(;this.#e>0;){await this.#n.promise;for(let{iterator:r,value:t}of this.#r)yield t,this.#i(r);if(this.#t.length)for(let r of this.#t)throw r;this.#r.length=0,this.#n=Promise.withResolvers()}}[Ea](){return this.iterate()}};var qa="toggle-pip:youtube-embed";var Op={name:qa,async fn(){let e=document.querySelector("#movie_player video");if(!e)throw new Error("Video element not found");if(document.pictureInPictureElement===e)await document.exitPictureInPicture();else{if(e.readyState<HTMLMediaElement.HAVE_METADATA)throw new Error("Video is not ready, start playing before toggling picture in picture");await e.requestPictureInPicture()}}},Oa=Op;var Ta="screenshot:youtube-embed";var Em=new TextEncoder;var Tp="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),Pp=[];Tp.forEach((e,r)=>Pp[e.charCodeAt(0)]=r);var km="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split("");var Fm=new TextEncoder().encode("0123456789abcdef"),Um=new TextEncoder,$m=new TextDecoder;var Pa=new ArrayBuffer(8),Vm=new Uint32Array(Pa),Gm=new BigUint64Array(Pa);async function Ia(e,{format:r="image/jpeg",quality:t=.92}={}){if(e.readyState<2)throw new Error("Video not ready");let n=document.createElement("canvas");if(!e.videoWidth||!e.videoHeight)throw new Error("Video has no width or height");let o={width:e.videoWidth,height:e.videoHeight};Object.assign(n,o);let a=n.getContext("2d",{alpha:!1});if(!a)throw new Error("Canvas context creation failed");let s=e.currentTime;a.drawImage(e,0,0);let u=await new Promise((f,l)=>{try{n.toBlob(v=>v?f(v):l(new Error("Blob conversion failed")),r,t)}catch(v){l(v)}});return{blob:{arrayBuffer:await u.arrayBuffer(),type:u.type},timestamp:s,size:o}}var Rp={name:Ta,respWithOpts:!0,async fn(e){let r=document.querySelector("#movie_player video");if(!r)throw new Error("Video element not found");let t=await Ia(r,e);return{payload:t,options:{transfer:[t.blob.arrayBuffer]}}}},Aa=Rp;var rt=process.env.MX_PORT_MESSAGE_NAME,Ra="app://obsidian.md";if(!rt)throw new Error("MX_PORT_MESSAGE_NAME is not set");var Ca=!1;async function Cp({signal:e}){var n=[];try{let r=Le(n,new DisposableStack);let t=new Promise((u,c)=>{let f=l=>{if(!(l.data!==rt||l.origin!==Ra)){Ca=!0;try{let v=new MessageChannel;window.parent.postMessage(rt,{targetOrigin:Ra,transfer:[v.port1]}),u(v.port2)}catch(v){c(v)}finally{Ca=!1}}};window.addEventListener("message",f),r.defer(()=>window.removeEventListener("message",f))});return await et(t,e)}catch(o){var a=o,s=!0}finally{Fe(n,a,s)}}Cp({signal:AbortSignal.timeout(1e4)}).then(e=>{var o=[];try{let r=Le(o,new DisposableStack);let t=new Ne(e);let n=r.use(J.init(t));n.addFnHandler(Aa);n.addFnHandler(Oa);return r.move()}catch(a){var s=a,u=!0}finally{Fe(o,s,u)}});})();\n';var cwe="toggle-pip:youtube-embed";var uwe="screenshot:youtube-embed";var dwe=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),fwe=t=>{throw TypeError(t)},pwe=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&fwe("Object expected");var n,i;r&&(n=e[dwe("asyncDispose")]),n===void 0&&(n=e[dwe("dispose")],r&&(i=n)),typeof n!="function"&&fwe("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},hwe=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,l,c){return c=Error(l),c.name="SuppressedError",c.error=a,c.suppressed=o,c},i=a=>e=r?new n(a,e,"An error was suppressed during disposal"):(r=!0,a),s=a=>{for(;a=t.pop();)try{var o=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(o).then(s,l=>(i(l),s()))}catch(l){i(l)}if(r)throw e};return s()},mwe={parse:DL,stringify:t=>t},PM=class{#e;constructor(e){this.#e=e}sendMessage(e,r){this.#e.postMessage(mwe.stringify(e),r)}#t=!1;addMessageHandler(e){var r=[];try{let s=pwe(r,new DisposableStack),a=o=>{let l=mwe.parse(o.data);l&&e(l)};return this.#e.addEventListener("message",a),s.defer(()=>{this.#e.removeEventListener("message",a)}),this.#t||(this.#e.start(),this.#t=!0),s.move()}catch(s){var n=s,i=!0}finally{hwe(r,n,i)}}async invoke(e,{signal:r,...n}={}){var i=[];try{this.sendMessage(e,n);let o=pwe(i,new DisposableStack);return await Promise.race([new Promise(l=>{o.use(this.addMessageHandler(c=>{ML(e,c)&&l(c)}))}),NL(r,{taskId:e.taskId,stack:o})])}catch(o){var s=o,a=!0}finally{hwe(i,s,a)}}[Symbol.dispose]=()=>{this.#e.close()}};var gwe=require("obsidian");var G$=QQ(()=>Xr()),Vo=fn(re({status:"pending"}),(t,e)=>{if(!gwe.Platform.isDesktopApp){e(Vo,{status:"na"});return}let r=t(mt),n=t(G$);if(!r){e(Vo,{status:"pending"});return}let i=null,s=async()=>{i?.abort(),i=new AbortController;let o=i.signal;try{if(!Bu(r.provider)){e(Vo,{status:"pending"});return}if(await BJe(r,{signal:o}),o.aborted)return;let l=Wo().getCurrentWebContents().mainFrame.frames.find(p=>p.name===n);if(!l)throw new Error(`Frame ${n} not found`);let c=l.frameTreeNodeId,u=()=>{let p=Wo().getCurrentWebContents().mainFrame.frames.find(h=>h.frameTreeNodeId===c);if(!p)throw new Error(`Frame ${c} not found`);return p},d=await NJe({provider:r.provider,frame:l,signal:o}),f=new H$(d,u);if(o.aborted)return;e(Vo,{status:"ready",connection:f})}catch(l){if(o.aborted)return;e(Vo,{status:"error",error:l})}};s();let a=r.listen("provider-change",s);return()=>{i?.abort(),a()}});async function NJe({provider:t,signal:e,frame:r}){var d=[];try{let n=t.iframe;if(!n.contentWindow)throw new Error("Iframe element has no content window");let i=n.contentWindow;let s=Xr();let a=new URL(n.src);let o=a.origin;r.executeJavaScript(lwe.replaceAll("process.env.MX_PORT_MESSAGE_NAME",JSON.stringify(s)),!0);let l=J(d,new DisposableStack);let c=window.setInterval(()=>{i.postMessage(s,o)},500);l.defer(()=>window.clearInterval(c));let u=await FJe(s,{targetOrigin:o,signal:AbortSignal.any([AbortSignal.timeout(1e4),...e?[e]:[]])});return u}catch(f){var p=f,h=!0}finally{ee(d,p,h)}}var H$=class{#e;constructor(e,r){this.#e=r;let n=new PM(e),i=hS(n);this.captureScreenshot=i.createRemoteFn(uwe);let s=i.createRemoteFn(cwe);this.togglePip=async()=>{try{await s()}catch(a){if(a instanceof Error&&a.name==="NotAllowedError")await this.#t(),await s();else throw a}}}captureScreenshot;togglePip;async#t(){await this.#e().executeJavaScript("1",!0)}};async function FJe(t,{targetOrigin:e,signal:r}){var s=[];try{let n=J(s,new DisposableStack);let i=new Promise((c,u)=>{let d=f=>{if(f.data!==t||f.origin!==e)return;let p=f.ports[0];if(!p){u(new Error("No port from payload"));return}c(p)};window.addEventListener("message",d),n.defer(()=>window.removeEventListener("message",d))});return await Vr(i,r)}catch(a){var o=a,l=!0}finally{ee(s,o,l)}}async function BJe(t,{signal:e}){var i=[];try{let r=J(i,new DisposableStack);let n=new Promise(l=>{r.defer(t.listen("can-play",()=>l()))});return await Vr(n,e)}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}var ou=require("obsidian");var ywe=re(t=>{let e=t(Kt);if(!e)return null;let r=t(W$);return t(Tt).mediaAttr.getMediaSrc(e,r)}),W$=re(t=>{let e=t(jt)?.type,r=t(qt)?.type;return e??r??void 0});var QS=fn(re(),(t,e)=>{let r=t(mt);if(!r){e(QS,void 0);return}let n=i=>{let s=i.target;s.videoHeight<=0||s.videoWidth<=0?e(QS,"audio"):e(QS,"video")};return r.listen("provider-change",i=>{if(e(QS,void 0),!ho(i.detail))return;i.detail.video.addEventListener("loadedmetadata",n,{once:!0})})}),au=re(t=>{let e=t(W$),r=t(Tt).mediaAttr.inferMediaType(t(Kt));return e??t(QS)??r});var VJe=re(t=>{let e=t(jt)?.aspectRatio,r=t(qt)?.aspectRatio;return e??r??void 0}),RM=fn(re(null),(t,e)=>{let r=t(mt);if(!r){e(RM,null);return}let n=i=>{let s=i.target;e(RM,pl(s.videoWidth,s.videoHeight))};return r.listen("provider-change",i=>{if(e(RM,null),!ho(i.detail))return;i.detail.video.addEventListener("loadedmetadata",n,{once:!0})})}),LM=re(t=>{if(t(au)!=="audio")return t(RM)??t(VJe)??void 0});var MM=re(t=>{let e=t(Kt);if(!e)return"lucide-file-video";if(e.type==="file")return`lucide-file-${t(au)??"video"}`;if(e.type==="url:direct"){let r=t(au);return r?`lucide-file-${r}`:"lucide-globe"}if(e.type==="url:hosted"){if(e.vid.host==="youtube")return"youtube";if(e.vid.host==="vimeo")return"vimeo";if(e.vid.host==="bilibili")return"bilibili";if(e.vid.host==="coursera")return"coursera";if(e.vid.host==="baidu-pan")return"baidu-pan";Be(e.vid)}Be(e)});var _M=require("obsidian"),ZS=Z(Te(),1);var vwe=re(t=>{if(!t(Tt).plugin.loaded)return!1;let e=!t(wu),r=t(jt)?.autoPlay,n=t(qt)?.autoPlay;return r??n??e}),bwe=re(t=>t(wu)?t(jt)?.showControls??!0:!0),xwe=re(t=>{let e=t(Tt).settings.value?.["playback.default-volume"],r=t(jt)?.volume,n=t(qt)?.volume,s=(r??n??e??100)/100;return Math.round(Math.max(0,Math.min(1,s))*100)/100}),wwe=re(t=>{let e=t(jt)?.muted,r=t(qt)?.muted;return e??r??!1}),kwe=re(t=>{let e=t(jt)?.loop,r=t(qt)?.loop;return e??r??!1}),Swe=re(t=>{let e=t(jt)?.crossOrigin,r=t(qt)?.crossOrigin;return e??r??!1});var Cwe=re(t=>{let e=t(owe),{metadataExtractor:r}=t(Tt);if(e){let n=r.loadCoverResourceUri(e);if(n)return n}return t(AM)});var Twe=re(t=>{let e=t(qt)?.creator,r=t(df),n=r?.artist||r?.albumArtist,i=t($d)?.author;return(e??n??i)?.trim()||void 0});var Ewe=re(t=>{if(!t(wu))return"eager";let r=t(jt)?.embedLoadStrategy,n=t(Tt).settings.value?.["note.embed.load-strategy"];return r??n??"eager"});var Iwe=re(null),jJe=re(async t=>{let{transcriptLoader:e}=t(Tt),r=t(Kt);return r?await e.loadTracks(r):null}),Awe=$i((t,e)=>{let r=t(mt);if(!r)return;let n=t(jJe),i=new AbortController;return Vr(n,i.signal).then(s=>{for(let a of s?.tracks??[])r.textTracks.add(a);e(Iwe,s)}).catch(s=>{kt.test(s)||console.error("error loading media tracks",s)}),()=>{i.abort(),e(Iwe,null),r.textTracks.clear(),r.textTracks._defaults={}}});var Pwe=$i(t=>{let e=t(mt),r=t(K1);if(!e||!r)return;let n=t(Qf);if(!n)return;let{autoPlay:i=!0,tempFragment:s}=n;if(s===void 0)return;let a=new tE(n),o=new AbortController,l=AbortSignal.any([o.signal,AbortSignal.timeout(5e3)]),c=async u=>{(e.state.ended||i)&&(await $Je(e,{signal:l}),await e.play(a)),r.seek(u,a)};if(Qi(s)){let u=s.start,{clipStartTime:d}=e.state,f=Math.max(0,u-d);c(f).catch(p=>{console.error("jump to timestamp error",p)})}else if(fl(s)){let u=K$(s);if(!u)return;r.changeClipStart(u.clipStartTime??0,a),r.changeClipEnd(u.clipEndTime??0,a),c(0).catch(d=>{console.error("seek to beginning of the clip error",d)})}else if(s===null){let u=!1;e.state.clipStartTime>0&&(r.changeClipStart(0,a),u=!0),e.state.clipEndTime>0&&(r.changeClipEnd(0,a),u=!0),u&&c(0).catch(d=>{console.error("reset time range error",d)})}return()=>{o.abort()}}),Rwe=re(t=>{let e=K$(t(jt)?.tempFragment),r=K$(t(qt)?.tempFragment);return e??r??null});async function $Je(t,{signal:e}){var i=[];try{if(t.state.canPlay)return;let r=J(i,new DisposableStack);let n=new Promise(l=>{r.defer(t.listen("can-play",()=>l()))});return await Vr(n,e).catch(()=>{})}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}function K$(t){return fl(t)?t.start<0?{clipStartTime:void 0,clipEndTime:t.end}:Number.isFinite(t.end)?{clipStartTime:t.start,clipEndTime:t.end}:{clipStartTime:t.start,clipEndTime:void 0}:null}function Lwe(){let t=St(Swe),e=St(Rwe);return{title:St(Uv),autoPlay:St(vwe),controls:St(bwe),volume:St(xwe),muted:St(wwe),loop:St(kwe),playbackRate:St(Xhe),crossOrigin:t===!1?void 0:t,load:St(Ewe),...e}}function Mwe(){return St(Cwe)||void 0}function _we(){return St(Twe)}function Owe(){sa(Pme),sa(Ame),sa(awe),sa(Awe),sa(g0),sa(Pwe),sa(jh)}function Dwe(){return{flip:St(IM),aspectRatio:St(LM)?.syntax}}function Nwe(){return St(ywe)}function Y$(){return St(au)??"unknown"}function Fwe(){return sa(Vo),{iframeProps:{name:St(G$)}}}function Bwe(){let t=St(iE),e=Im(nE);if(t)return e}var Vwe=require("obsidian"),jwe=Z(Te(),1);function $we(){let t=vu(),e=St(Kt),r=(0,jwe.useCallback)(()=>{gt(UJe(t),{swallowError:!0,loadingDelay:500,loading:"Toggling picture in picture...",error:n=>`Error toggling picture in picture: ${n}`})},[t]);if(Uwe(e))return r}function Uwe(t){return Vwe.Platform.isDesktopApp&&ua(t)}async function UJe(t){let e=t.get(Kt);if(!Uwe(e))throw new Error("Not supported");let r=t.get(Vo);if(r.status!=="ready")throw new Error("Youtube embed is not loaded, start playing before toggling picture in picture");await r.connection.togglePip()}var Oi=Z(Ge(),1),zwe=t=>{if(!t)return!1;let e=typeof t=="string"?t:t.type;return typeof e=="string"&&(!e||e.includes("vimeo")||e.includes("youtube"))};function zJe(){let t=(0,ZS.useRef)(null),e=(0,ZS.useRef)(!1),[r,n]=(0,ZS.useState)(!1);return{disabled:r,handleSourceChange:s=>{let a=t.current;t.current=s,a&&s&&!Yl(a,s)&&!zwe(a)&&!zwe(s)&&!e.current&&(e.current=!0,n(!0),sleep(100).then(()=>n(!1)).catch(()=>{}).finally(()=>{e.current=!1}))}}}function Hwe({checkInEditor:t,...e}){let r=mue(),n=zJe();Owe();let i=Nwe(),s=Y$(),{iframeProps:a}=Fwe(),{controls:o,...l}=Lwe(),c=Mwe(),u=_we(),d=Dwe(),f=$we(),p=Bwe();return(0,Oi.jsxs)("div",{className:"contents",onClick:e.onEditClick?h=>{t?.()&&(qJe(h.target)||h.nativeEvent.stopImmediatePropagation())}:void 0,children:[!i&&(0,Oi.jsx)("p",{children:"Not supported"}),(0,Oi.jsxs)(Xle,{keyDisabled:!0,className:"h-full",ref:r,onError:h=>{new _M.Notice("Error loading media, see console for details"),console.error("media error",i,h)},logLevel:"error",src:n.disabled||!i?void 0:i,onSourceChange:n.handleSourceChange,viewType:s,creator:u,coverImage:c,...l,...d,onTogglePip:f,onResetClip:p,children:[(0,Oi.jsx)(gF,{iframeProps:a}),o&&(0,Oi.jsx)(oce,{utilsSlot:(0,Oi.jsx)(qwe,{...e})}),o&&(0,Oi.jsx)(rce,{utilsSlot:(0,Oi.jsx)(qwe,{...e})})]})]})}function qwe({onEditClick:t,onPaneMenu:e}){let r=W1(),n=Y$(),i=vu();return(0,Oi.jsxs)(Oi.Fragment,{children:[(0,Oi.jsx)(Kle,{variant:n==="audio"?"ghost":"controls",onClick:s=>{if(!r||!i.get(Kt))return;let o=new _M.Menu;o.addSections(["open","action","view","danger","system"]),e(o),Nv(s.nativeEvent,o)}}),t&&(0,Oi.jsx)(Wle,{type:"button",part:"edit-button",variant:"ghost",onClick:t,[Gwe]:""})]})}var Gwe="data-lp-passthrough";function qJe(t){if(!(t instanceof Element))return!1;let e=t.closest("button");return e?e.hasAttribute(Gwe):!1}function Wwe(t,e){var s=[];try{let r=J(s,new DisposableStack);let n=c=>{let u=c.target;return u instanceof Element?u.matches('[contenteditable="true"], input, textarea')||u.closest('[contenteditable="true"], input, textarea')!==null:!1};let i=(c,u)=>{for(let d of c)um(r,e,d.modifiers,d.key,f=>n(f)?!0:(u(f),!1))};i([{modifiers:[],key:" "},{modifiers:[],key:"K"}],c=>{t.togglePaused(c)});i([{modifiers:[],key:"m"}],c=>{t.toggleMuted(c)});i([{modifiers:[],key:"f"}],c=>{t.toggleFullscreen(c)});i([{modifiers:[],key:"i"}],c=>{t.togglePictureInPicture(c)});i([{modifiers:[],key:"c"}],c=>{t.toggleCaptions(c)});i([{modifiers:[],key:"j"},{modifiers:[],key:"ArrowLeft"}],c=>{t.seekBackward(5,c)});i([{modifiers:[],key:"l"},{modifiers:[],key:"ArrowRight"}],c=>{t.seekForward(5,c)});i([{modifiers:[],key:"ArrowUp"}],c=>{t.volumeUp(.05,c)});i([{modifiers:[],key:"ArrowDown"}],c=>{t.volumeDown(.05,c)});i([{modifiers:["Shift"],key:"."}],c=>{t.speedUp(.1,c)});i([{modifiers:["Shift"],key:","}],c=>{t.slowDown(.1,c)});return r.move()}catch(a){var o=a,l=!0}finally{ee(s,o,l)}}var Kwe=Z(Ge(),1),OM=class{service;transcriptSaver;mediaNote;mediaLib;app;template;settings;remoter;store;screenshotAction;timestampAction;workspaceFind;constructor(e){this.service=e.service,this.mediaNote=e.mediaNote,this.store=e.store,this.app=e.app,this.transcriptSaver=e.transcriptSaver,this.mediaLib=e.mediaLib,this.template=e.template,this.settings=e.settings,this.remoter=e.remoter,this.screenshotAction=e.screenshotAction,this.timestampAction=e.timestampAction,this.workspaceFind=e.workspaceFind}registerScopes(e){let r=Wwe(this.remoter,e);return()=>r[Symbol.dispose]()}registerAspectRatioUpdater(e){return ca(r=>{let{width:n=16,height:i=9}=r(LM)??{};e.style.setProperty("--mx-ratio-w",n.toString()),e.style.setProperty("--mx-ratio-h",i.toString())},this.service.store)}registerViewTypeUpdater(e){return ca(r=>{let n=r(au);e.toggleClass("mx-audio-view",n==="audio"),e.toggleClass("mx-video-view",n!=="audio")},this.service.store)}render(e,{isEmbed:r=!1,checkInEditor:n,onEditClick:i}={}){return tv({ctx:{store:this.store,isEmbed:r},shadowRootClassName:"mx-player-shadow-root",target:e,children:(0,Kwe.jsx)(Hwe,{onPaneMenu:s=>this.onPaneMenu(s,r?"player-menu-embed":"player-menu-view"),checkInEditor:n,onEditClick:i})})}onPaneMenu(e,r){this.service.media&&this.app.workspace.trigger("mx:media-menu",e,this.service,r)}get icon(){return this.store.get(MM)}registerHeaderUpdater(e,{disableTitleUpdate:r}={}){return r?ca(n=>{n(MM),e.leaf.updateHeader()},this.store):ca(n=>{n(MM);let i=n(Uv);e.leaf.updateHeader(),e.titleEl.setText(i)},this.store)}addActions(e){var i=[];try{let r=J(i,new DisposableStack);e.addAction("star","Take timestamp in last active note",async()=>{if(!this.service.media){new ou.Notice("No media is opened");return}if(!this.service.player){new ou.Notice("No media is playing");return}let l=this.workspaceFind.getMostRecentEditorLeaf();if(!l){new ou.Notice("Please open a note before taking timestamp");return}await this.timestampAction.insertTimestamp({note:l.view})});r.use(this.#e(e));e.addAction("plus","Add resources",l=>{this.showAddResourcesMenu(l)});let n=r.move();return()=>n.dispose()}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}#e(e){var i=[];try{let r=J(i,new DisposableStack);let n=(l,c,u)=>{let d=e.addAction(l,c,u);d.style.display="none",r.defer(ca(f=>{let p=f(mt);if(!p)return;let h=m=>{X$(m)?d.style.display="":d.style.display="none"};return h(p.provider),p.listen("provider-change",m=>h(m.target.provider))},this.service.store))};for(let{clip:l,name:c,icon:u}of[{clip:!0,name:"Insert clipped screenshot to note",icon:"frame"},{clip:!1,name:"Insert screenshot to note",icon:"camera"}])n(u,c,()=>{this.screenshotAction.insertScreenshotEmbed({clip:l})});Io()&&n("scan-text","Extract text from screenshot",()=>{this.screenshotAction.extractTextToClipboard()});return r.move()}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}showAddResourcesMenu(e){let r=new ou.Menu;r.addSections(["action","view"]);let n=this.service.media;if(!n)return;r.addItem(s=>s.setSection("action").setTitle("Add text track").setIsLabel(!0)).addItem(s=>s.setIcon("file-plus").setSection("action").setTitle("from local file").onClick(async()=>{await gt(this.transcriptSaver.importTranscriptFile(n),{success:a=>`Transcript imported to ${a.src.path}`,error:a=>`Failed to import transcript: ${a}`})})).addItem(s=>s.setIcon("link").setSection("action").setTitle("from remote URL").onClick(async()=>{await gt(this.transcriptSaver.importTranscriptUrl(n),{success:a=>a.type==="internal.resolved"?`Transcript imported to ${a.src.path}`:"Transcript linked to media",error:a=>`Failed to import transcript: ${a}`})})),ua(n)&&Io()&&r.addItem(s=>s.setIcon("captions").setSection("action").setTitle("from YouTube").onClick(async()=>{try{await this.transcriptSaver.importYouTubeSubtitles(n,{onNotFound:()=>{new ou.Notice("Subtitle not found")},loadingText:"Fetching subtitles...",errorText:"Failed to load YouTube subtitles"})}catch(a){if(kt.test(a))return;new ou.Notice(`Failed to import YouTube subtitles: ${a}`)}}));let i=this.mediaLib.findNoteByMedia(n);i?r.addItem(s=>{s.setTitle("Open media properties").setIcon("table-properties").setSection("view").onClick(()=>{this.app.workspace.openLinkText(i.path,"","tab")})}):r.addItem(s=>{s.setTitle("Add to media library").setIcon("badge-plus").setSection("action").onClick(async()=>{let a=await this.mediaNote.ensureMediaNote(n);new ou.Notice(`Added to media library: ${a.note.path}`)})}),Nv(e,r)}};var DM=class{store;constructor(e){this.store=e.store}get#e(){let e=this.store.get(mt);if(!e)throw new Error("Player not found");return{state:e.state,remoter:e.remoteControl}}togglePaused(e){let{remoter:r}=this.#e;r.togglePaused(e)}play(e){let{remoter:r}=this.#e;r.play(e)}pause(e){let{remoter:r}=this.#e;r.pause(e)}toggleMuted(e){let{remoter:r}=this.#e;r.toggleMuted(e)}toggleFullscreen(e){let{remoter:r}=this.#e;r.toggleFullscreen("prefer-media",e)}togglePictureInPicture(e){let{remoter:r}=this.#e;r.togglePictureInPicture(e)}toggleCaptions(e){let{remoter:r}=this.#e;r.toggleCaptions(e)}seekBackward(e=5,r){let{state:n,remoter:i}=this.#e;i.seek(n.currentTime-e,r)}seekForward(e=5,r){let{state:n,remoter:i}=this.#e;i.seek(n.currentTime+e,r)}volumeUp(e=.05,r){let{state:n,remoter:i}=this.#e,s=Qwe(Ywe(n.volume+e));i.changeVolume(s,r)}volumeDown(e=.05,r){let{state:n,remoter:i}=this.#e,s=Qwe(Ywe(n.volume-e));i.changeVolume(s,r)}speedUp(e=.1,r){let{state:n,remoter:i}=this.#e,s=Xwe(n.playbackRate+e);i.changePlaybackRate(s,r)}slowDown(e=.1,r){let{state:n,remoter:i}=this.#e;if(n.playbackRate<=.1)return;let s=Xwe(n.playbackRate-e);i.changePlaybackRate(s,r)}setPlaybackRate(e,r){let{remoter:n}=this.#e;n.changePlaybackRate(e,r)}setAudioGain(e,r){let{remoter:n}=this.#e;n.changeAudioGain(e,r)}};function Ywe(t){return Math.round(t*100)/100}function Xwe(t){return Math.round(t*10)/10}function Qwe(t){return Math.max(0,Math.min(1,t))}var Zwe=require("obsidian");function ff(t){return t instanceof DOMException&&t.name==="SecurityError"&&/\btainted\b|\bcanvas/i.test(t.message)}var pf=createFragment(t=>{let e=t.createDiv();e.appendText("Cannot capture screenshot from this media due to CORS security policy, "),e.createEl("br"),e.appendText("See the troubleshooting guide for possible solutions"),new Zwe.ButtonComponent(e.createDiv({attr:{style:"margin-top: 10px"}})).setButtonText("Open guide").onClick(()=>{window.open("https://mx.pkmer.net/docs/faq/cors","_blank")})});var NM=class{screenshot;service;templateInsert;app;mediaNote;auth;workspaceFind;constructor(e){this.screenshot=e.screenshot,this.service=e.service,this.templateInsert=e.templateInsertion,this.app=e.app,this.mediaNote=e.mediaNote,this.auth=e.auth,this.workspaceFind=e.workspaceFind}async#e(){var r=[];try{let e=J(r,await this.screenshot.extractText(this.service),!0);await navigator.clipboard.writeText(e.content);return e}catch(n){var i=n,s=!0}finally{var a=ee(r,i,s);a&&await a}}async extractTextToClipboard(){return await gt(this.#e(),{loading:"Extracting text from screenshot...",success:"Text extracted from screenshot and copied to clipboard",error:(e,r)=>{if(r instanceof Ro){new iu(this.auth,{content:"You need to login to extract text from screenshot"});return}return r instanceof ov?"No text found in the screenshot":ff(r)?pf:`Failed to extract text from screenshot: ${e}`}})}async#t({clip:e,note:r}){var c=[];try{let n=r??this.app.workspace.activeEditor??this.workspaceFind.getMostRecentEditorLeaf()?.view;if(!n)throw new cf;let{file:i,editor:s}=n;let a=this.service.media;if(!a)throw new Error("No media is opened");let{uid:o}=await this.mediaNote.ensureMediaNote(a);let l=J(c,await this.screenshot.saveScreenshot(this.service,{clip:e}),!0);await this.templateInsert.insertScreenshotEmbed(l,{src:a,uid:o,title:this.service.title},{file:i,editor:s});return l}catch(u){var d=u,f=!0}finally{var p=ee(c,d,f);p&&await p}}async insertScreenshotEmbed({clip:e,note:r}){return await gt(this.#t({clip:e,note:r}),{loading:e?void 0:"Saving screenshot...",success:n=>`Screenshot saved in "${n.file.basename}"`,error:(n,i)=>ff(i)?pf:i instanceof cf?"Please open a note before taking screenshot":`Failed to insert screenshot embed: ${n}`})}async#r({clip:e}){var n=[];try{let r=J(n,await this.screenshot.saveScreenshot(this.service,{clip:e}),!0);return r}catch(i){var s=i,a=!0}finally{var o=ee(n,s,a);o&&await o}}async saveScreenshot({clip:e}){return await gt(this.#r({clip:e}),{loading:e?void 0:"Saving screenshot...",success:r=>`Screenshot saved in "${r.file.basename}"`,error:(r,n)=>ff(n)?pf:`Failed to save screenshot: ${r}`})}async#n({clip:e}){var i=[];try{let r=this.service.media;if(!r)throw new Error("No media is opened");let n=J(i,await this.screenshot.saveScreenshot(this.service,{clip:e}),!0);this.mediaNote.setAsCover(r,n.file);return n}catch(s){var a=s,o=!0}finally{var l=ee(i,a,o);l&&await l}}async setAsCover({clip:e}){return await gt(this.#n({clip:e}),{loading:e?void 0:"Saving screenshot as cover...",success:"Screenshot saved and set as media cover",error:(r,n)=>ff(n)?pf:`Failed to save screenshot as cover: ${r}`})}async copyScreenshot({clip:e}){return await gt(this.screenshot.copyScreenshot(this.service,{clip:e}),{loading:"Copying screenshot...",success:"Screenshot copied to clipboard",error:(r,n)=>ff(n)?pf:`Failed to copy screenshot: ${r}`})}};var FM=class{service;templateInsert;templateRender;app;workspaceFind;constructor(e){this.service=e.service,this.templateInsert=e.templateInsertion,this.app=e.app,this.workspaceFind=e.workspaceFind,this.templateRender=e.template}async#e(){let e=this.service.media;if(!e)throw new Error("No media is opened");if(!Xf(e))throw new Error("Only url media is supported");let{currentTime:r}=this.service.takeTimestamp();if(r<=0)throw new Error("Playback must be started before copying timestamp");let n=this.templateRender.renderExternalLink(e,{tempFragment:{start:r,end:-1}});navigator.clipboard.writeText(n.toString())}async copyTimestampedUrl(){return await gt(this.#e(),{loading:"Copying timestamped URL...",loadingDelay:1e3,success:"Timestamped URL copied to clipboard",error:e=>`Failed to copy timestamped URL: ${e}`})}async#t({note:e}){let r=e??this.app.workspace.activeEditor??this.workspaceFind.getMostRecentEditorLeaf()?.view;if(!r)throw new cf;let n=this.service.media;if(!n)throw new Error("No media is opened");let i=this.service.player;if(!i)throw new Error("No player is opened");await this.templateInsert.insertTimestamp(i.currentTime,n,r)}async insertTimestamp({note:e}){return await gt(this.#t({note:e}),{loading:"Inserting timestamp...",loadingDelay:1e3,error:(r,n)=>ff(n)?pf:n instanceof cf?"Please open a note before taking timestamp":`Failed to insert screenshot embed: ${r}`})}};function Q$(t){return{mx:Oe.serialize(t)}}function Z$(t){if(!t.mx)return null;try{return Oe.deserialize(t.mx)}catch(e){return console.warn("Failed to deserialize media view state",e),null}}var Ol=class{workspace;store;app;mediaLib;settings;screenshotAction;timestampAction;remoter;helper;mediaParser;#e;constructor(e){let r=e.createScope();r.register({service:Wf(this),helper:ji(OM).scoped(),remoter:ji(DM).scoped(),screenshotAction:ji(NM).scoped(),timestampAction:ji(FM).scoped()});let n=r.cradle;this.workspace=n.workspaceOpen,this.app=n.app,this.store=n.store,this.store.set(Tt,n),this.mediaLib=n.mediaLib,this.settings=n.settings,this.screenshotAction=n.screenshotAction,this.timestampAction=n.timestampAction,this.remoter=n.remoter,this.helper=n.helper,this.mediaParser=n.mediaParser,this.#e=r}[Symbol.dispose](){this.#e.dispose()}get preservePitch(){return this.store.get(jh)?this.store.get(q$):null}set preservePitch(e){this.store.set(z$,e)}get speedOptions(){return this.store.get(Yhe).toSorted((e,r)=>e-r)}isValidSpeed(e){let r=this.speedOptions,[n,i]=[r.at(0),r.at(-1)];return e>=n&&e<=i}get canSetAudioGain(){let e=this.player;return e?e.state.canSetAudioGain:!1}get media(){return this.store.get(Kt)}get player(){return this.store.get(mt)}get flip(){return this.store.get(IM)}set flip(e){this.store.set(U$,e)}get title(){return this.store.get(Uv)??""}loadFile(e,r){let n=this.mediaParser.parseFile(e);if(!n)throw new Error("File is not a media file");this.store.set(Jo,{info:n,hash:r?this.mediaParser.parseHash(r):void 0})}getFileState(){return Q$({hash:this.#t()})}setFileState(e){let r=Z$(e);r?.hash&&this.store.set(Jo,n=>n&&{...n,hash:r.hash})}setFileEphemeralState(e){let r=this.mediaParser.parseHashFromEphemeralState(e);r&&this.store.set(nZ,r)}#t(){let e=this.store.get(jt),r=this.store.get(Qf);return fl(r?.tempFragment)?{...e,tempFragment:r.tempFragment}:{...e}}getUrlState(){let e=this.store.get(Kt);return!e||!Xf(e)?{}:Q$({media:e,hash:this.#t()})}setUrlState(e){let r=Z$(e);r?.media&&this.store.set(Jo,{info:r.media,hash:r.hash})}loadUrl(e){this.store.set(Jo,e)}setUrlEphemeralState(e){let r=this.mediaParser.parseHashFromEphemeralState(e);r&&this.store.set(Qf,r)}pausePlayback(){let e=this.player;return!e||e.paused?{[Symbol.asyncDispose]:async()=>{}}:(e.pause(),{[Symbol.asyncDispose]:async()=>await e.play()})}get supportsScreenshot(){return this.player?X$(this.player.provider):!1}async captureScreenshot(e){let r=this.store.get(mt);if(!r)throw new Error("Load player with video first");if(ho(r.provider)){let n=await kxe(r.provider.video,e);return{blob:new Blob([n.blob.arrayBuffer],{type:n.blob.type}),rect:{type:"full",width:n.size.width,height:n.size.height},timestamp:n.timestamp}}if(Bu(r.provider)){let n=this.store.get(Vo);if(n.status==="na")throw new Error("Screenshot is not supported for YouTube on this device");if(n.status==="pending")throw new Error("YouTube player is not ready, try after start playing");if(n.status==="error")throw new Error("Failed to connect to YouTube player",{cause:n.error});let i=await n.connection.captureScreenshot(e);return{blob:new Blob([i.blob.arrayBuffer],{type:i.blob.type}),rect:{type:"full",width:i.size.width,height:i.size.height},timestamp:i.timestamp}}throw new Error(`Screenshot is not supported for ${r.provider?.type||"this media"}`)}takeTimestamp(){let e=this.store.get(mt);if(!e)throw new Error("Load player with video first");let r=e.currentTime,n=Math.max(0,e.state.clipStartTime);return{currentTime:r+n}}resetTimestamp(){this.store.set(nE)}canResetTimestamp(){if(!this.store.get(iE)||!this.player)return!1;let{clipStartTime:e,clipEndTime:r}=this.player.state;return e>0||r>0}};function X$(t){return t?ho(t)||Bu(t):!1}var hf=class extends BM.EditableFileView{allowNoFile=!1;scope;service;helper;constructor(e,r){super(e),this.contentEl.addClasses(["mx","custom","mx-media-view","mx-file-media-view"]),this.scope=new BM.Scope(this.app.scope),this.service=new Ol(r),this.helper=this.service.helper,this.register(()=>this.service[Symbol.dispose]()),this.register(this.helper.registerScopes(this.scope)),this.register(this.helper.registerHeaderUpdater(this,{disableTitleUpdate:!0})),this.register(this.helper.registerAspectRatioUpdater(this.contentEl)),this.register(this.helper.registerViewTypeUpdater(this.contentEl)),this.register(this.helper.addActions(this))}get player(){return this.service.player}#e(){this.#t?.[Symbol.dispose](),this.#t=null}async onOpen(){await super.onOpen(),this.#e(),this.#t=this.helper.render(this.contentEl)}async onClose(){this.#e(),await super.onClose()}getState(){return{...super.getState(),...this.service.getFileState()}}async setState(e,r){await super.setState(e,r),this.service.setFileState(e)}async onLoadFile(e){this.service.loadFile(e)}setEphemeralState(e){super.setEphemeralState(e),this.service.setFileEphemeralState(e)}onPaneMenu(e,r){super.onPaneMenu(e,r),this.helper.onPaneMenu(e,r)}#t=null;getIcon(){return this.helper.icon}getViewType(){return Yo}canAcceptExtension(e){return Kl({extension:e})}};var VM=require("obsidian");var mf=class extends VM.ItemView{scope;navigation=!0;service;helper;constructor(e,r){super(e),this.contentEl.addClasses(["mx","custom","mx-media-view","mx-url-media-view"]),this.scope=new VM.Scope(this.app.scope),this.service=new Ol(r),this.helper=this.service.helper,this.register(()=>this.service[Symbol.dispose]()),this.register(this.helper.registerScopes(this.scope)),this.register(this.helper.registerHeaderUpdater(this,{})),this.register(this.helper.registerAspectRatioUpdater(this.contentEl)),this.register(this.helper.registerViewTypeUpdater(this.contentEl)),this.register(this.helper.addActions(this))}getViewType(){return bs}getDisplayText(){return this.service.title||""}getIcon(){return this.helper.icon}render(){return this.helper.render(this.contentEl)}onPaneMenu(e,r){super.onPaneMenu(e,r),this.helper.onPaneMenu(e,r)}getState(){return{...super.getState(),...this.service.getUrlState()}}async setState(e,r){this.service.setUrlState(e),await super.setState(e,r)}setEphemeralState(e){super.setEphemeralState(e),this.service.setUrlEphemeralState(e)}async onOpen(){await super.onOpen(),this.#t(),this.#e=this.render()}#e=null;#t(){this.#e?.[Symbol.dispose](),this.#e=null}close(){return this.#t(),super.close()}async onClose(){return this.#t(),super.onClose()}};var jM=class{app;transcriptLoader;mediaParser;constructor(e){this.app=e.app,this.transcriptLoader=e.transcriptLoader,this.mediaParser=e.mediaParser}async findLinkedMediaLeaf(e){let r=(await this.transcriptLoader.getLinkedMedia(e)).at(0);if(r)return this.findMediaLeavesWithSameMedia(r).filter(o0).sort(zl(Xo)).at(0)}getPinnedMediaLeaves(){return this.getAllMediaLeaves().filter(e=>e.pinned)}getActiveMediaView(){return this.app.workspace.getActiveViewOfType(hf)??this.app.workspace.getActiveViewOfType(mf)??null}getAllMediaLeaves(){return[...this.getFileMediaLeaves(),...this.getUrlMediaLeaves()]}findMediaLeavesWithSameMedia(e){let r=[];return e.type==="file"?r=this.getFileMediaLeaves():e.type==="url:hosted"||e.type==="url:direct"?r=[...this.getUrlMediaLeaves()]:Be(e),r.filter(n=>da(n.state.media,e))}getMostRecentEditorLeaf(){let e=this.app.workspace.getLeavesOfType("markdown").filter(r=>{if(r.isDeferred||!r.isVisible())return!1;let n=r.view;return!!n.file&&n.getMode()==="source"});return e.sort(Xo),e[0]??null}getFileMediaLeaves(){return this.app.workspace.getLeavesOfType(Yo).map(e=>{let r=e.getViewState();if(typeof r.state?.file!="string")return null;let n=this.app.vault.getFileByPath(r.state.file);return n?{type:Yo,leaf:e,view:e.view instanceof hf?e.view:void 0,pinned:r.pinned,active:r.active,activeTime:e.activeTime,state:{media:this.mediaParser.parseFile(n)}}:null}).filter(e=>e!==null)}getUrlMediaLeaves(){return this.app.workspace.getLeavesOfType(bs).map(e=>{let r=e.getViewState();if(!r.state)return null;let n=pP(r.state);return n?{type:bs,leaf:e,view:e.view instanceof mf?e.view:void 0,pinned:r.pinned,active:r.active,activeTime:e.activeTime,state:n}:null}).filter(e=>e!==null)}};var $M=class{plugin;app;mediaLibraryIndex;settings;transcriptLoader;finder;trackStringifier;constructor(e){this.plugin=e.plugin,this.app=e.plugin.app,this.mediaLibraryIndex=e.mediaLib,this.settings=e.settings,this.transcriptLoader=e.transcriptLoader,this.trackStringifier=e.trackInfoEncoder,this.finder=e.workspaceFind}async openLinkedMediaForTrack(e,r={}){let n=(await this.transcriptLoader.getLinkedMedia(e)).at(0);if(!n)return null;let i=await this.finder.findLinkedMediaLeaf(e);return i?(await this.app.workspace.revealLeaf(i.leaf),i):await this.openMedia({info:n},r)}async openTranscript(e,r){let n=this.app;if(e.type==="internal.resolved")await n.workspace.openLinkText(e.src.path,"",r.newLeaf);else if(e.type==="url"||e.type==="file"){let i=this.trackStringifier.encodeUrlTrack(e),s=cy({src:i});await(r.newLeaf==="split"?n.workspace.getLeaf(r.newLeaf,r.direction):n.workspace.getLeaf(r.newLeaf)).setViewState({type:Mm,state:s,active:!0})}else Be(e)}async openMedia(e,r={}){if(!r.newLeaf){let a=this.finder.getPinnedMediaLeaves().sort(zl(l0,Xo)).filter(l=>l.view);if(a.length>0){let l=a.filter(u=>da(u.state.media,e.info));return await this.#e(e,(l[0]??a[0]).leaf,{target:r.target,supportsRemote:!1})}let o=this.finder.findMediaLeavesWithSameMedia(e.info).sort(zl(l0,Xo)).at(0);if(o)return o.view||await this.app.workspace.revealLeaf(o.leaf),e.hash&&o.leaf.setEphemeralState(Aj(e.hash)),o}let n=await this.settings.loaded,i=Ime(r.newLeaf,r.fromUser??!1,{click:n["link.click-behavior"],alt:n["link.altclick-behavior"]});return await this.#e(e,i==="split-horizontal"?this.app.workspace.getLeaf("split",r.direction??"horizontal"):this.app.workspace.getLeaf(i,r.direction),{target:r.target,supportsRemote:!1})}async#e(e,r,n){let i=e.hash?Aj(e.hash):{};if(e.info.type==="file")return await fL.call(r,e.info.file,{eState:i,active:!0}),{type:Yo,leaf:r,view:r.view,pinned:!1,activeTime:r.activeTime,active:!0,state:{media:e.info}};if(e.info.type==="url:hosted"){let a=(await this.settings.loaded)["link.hosted-prefer"]==="browser"||n.target==="browser",o;if(rZ(e.info))o={type:bs,state:cy({media:e.info,hash:e.hash})};else throw new ls("fallback");return await r.setViewState({...o,active:!0},i),{type:bs,leaf:r,view:r.view,pinned:!1,activeTime:r.activeTime,active:!0,state:{media:e.info}}}if(e.info.type==="url:direct"){let s={type:bs,state:cy({media:e.info,hash:e.hash})};return await r.setViewState({...s,active:!0},i),{type:bs,leaf:r,view:r.view,pinned:!1,activeTime:r.activeTime,active:!0,state:{media:e.info}}}Be(e.info)}};var Fr=require("obsidian");var Jwe=require("obsidian");async function e1e(t){if(!Jwe.Platform.isDesktopApp)throw new Error("Not supported in web");let e=await iQ().showOpenDialog({title:"Pick a media file",message:"Pick a media file to open",buttonLabel:"Pick",properties:["openFile"],filters:[{name:"Media files",extensions:Ja}],defaultPath:t});if(e.canceled)return null;let r=e.filePaths[0]??null;return r?Sm(r):null}var HJe=/^av(?<id>\d+)$/i,GJe=/^BV1(?<id>[1-9A-HJ-NP-Za-km-z]{9})$/,WJe=/^[\w-]{11}$/,KJe=/^(?:(?:[a-zA-Z\d]|[a-zA-Z\d][a-zA-Z\d-]*[a-zA-Z\d])\.)*(?:[A-Za-z\d]|[A-Za-z\d][A-Za-z\d-]*[A-Za-z\d])$/;function t1e(t){let e=null;return Fr.Platform.isDesktopApp?e=vs().isAbsolute(t)?Sm(t):an(t):e=an(t),!e||["http:","https:"].includes(e.protocol)&&!KJe.test(e.hostname)?null:e}var UM=class extends Fr.SuggestModal{app;workspace;fileHelper;mediaParser;constructor(e){super(e.app),this.app=e.app,this.workspace=e.workspaceOpen,this.fileHelper=e.fileService,this.mediaParser=e.mediaParser,this.setPlaceholder("Enter file path, URL or media id, or drop a media file here"),this.#e(this.inputEl,(r,[n])=>{r.preventDefault(),n&&(this.inputEl.value=n.url.href,this.inputEl.dispatchEvent(new Event("input")))}),this.setInstructions([{command:"\u2191\u2193",purpose:"to navigate"},{command:"\u21B5",purpose:"to open url"},{command:Fr.Platform.isMacOS?"\u2318 \u21B5":"ctrl \u21B5",purpose:"to open in new tab"},{command:Fr.Platform.isMacOS?"\u2318 \u2325 \u21B5":"ctrl alt \u21B5",purpose:"to open to the right"},{command:"esc",purpose:"to dismiss"}]),this.scope.register(null,"Enter",r=>(this.chooser.useSelectedItem(r),!1))}getSuggestions(e){let r=t1e(e),n=[];if(!r){let a=null;if(a=e.match(HJe),a&&n.push(new URL(`https://www.bilibili.com/video/av${a.groups.id}`)),a=e.match(GJe),a&&n.push(new URL(`https://www.bilibili.com/video/${e}`)),a=e.match(WJe),a&&n.push(new URL(`https://www.youtube.com/watch?v=${e}`)),!a){let o=t1e(`https://${e}`);o&&n.push(o)}}let i=n.map(a=>this.mediaParser.parseUrl(a)).filter(a=>a!==null),s=this.mediaParser.parseUrl(r?.href??"");return s?[s,...i]:i}onNoSuggestion(){super.onNoSuggestion(),Fr.Platform.isDesktopApp&&this.chooser.setSuggestions(["file-picker"])}renderSuggestion(e,r){e==="file-picker"?r.setText("Open local file"):r.setText(decodeURI(e.info.url.href))}async onChooseSuggestion(e,r){let n;if(e==="file-picker"){let i=await e1e();if(!i){new Fr.Notice("Failed to pick media file");return}let s=this.mediaParser.parseUrl(i);if(!s){new Fr.Notice(`Failed to resolve file: ${i}`);return}n=s}else n=e;if(n.info.type==="url:direct"&&Bt(n.info.url)){let i=this.fileHelper.safeResolveFileUri(n.info.url);if(!i.success){console.error("Failed to resolve file",n.info.url,i),new Fr.Notice(i.message);return}let s=ia(),a=n.info.url.pathname;try{if(!(await s.stat(n.info.url)).isFile()){new Fr.Notice(`Not a file: ${a}`);return}}catch(o){let l=o;l.code==="ENOENT"?new Fr.Notice(`File not found: ${a}`):l.code==="EACCES"?new Fr.Notice(`Permission denied: ${a}`):(console.error("Failed to access file",a,l),new Fr.Notice(`Failed to access file (${l.code}): ${a}`));return}}console.debug("media selected",n),Fr.Keymap.isModifier(r,"Mod")&&Fr.Keymap.isModifier(r,"Alt")?this.workspace.openMedia(n,{newLeaf:"split",direction:"vertical"}):Fr.Keymap.isModifier(r,"Mod")?this.workspace.openMedia(n,{newLeaf:"tab"}):this.workspace.openMedia(n,{newLeaf:!1})}#e(e,r){var l=[];try{let n=J(l,new DisposableStack);if(!Fr.Platform.isDesktopApp)return n;let i=window.electron;let{pathToFileURL:s}=Vi();if(!i)return n;let{webUtils:a}=i;let o=f=>{if(!f.dataTransfer||f.dataTransfer.files.length===0)return;let h=[...f.dataTransfer.files].filter(m=>{let v=pd(m);return Kl(v)}).map(m=>this.mediaParser.parseUrl(s(a.getPathForFile(m)))?.info).filter(m=>m!==void 0&&m.type==="url:direct");if(h.length===0){new Fr.Notice("None of the dropped files are supported media files");return}r(f,h)};e.addEventListener("drop",o);n.defer(()=>e.removeEventListener("drop",o));return n.move()}catch(c){var u=c,d=!0}finally{ee(l,u,d)}}};function YJe(t){return t?.flatMap(({accept:e})=>e?Object.entries(e).flatMap(([r,n])=>typeof n=="string"?[n||r]:n.length===0?[r]:n):[]).join(",")}function XJe(){return typeof window<"u"&&"showOpenFilePicker"in window}async function QJe({types:t,startIn:e="desktop",excludeAcceptAllOption:r=!1,multiple:n,id:i}){let s=await showOpenFilePicker({id:i,startIn:e,multiple:n,types:t,excludeAcceptAllOption:r});if(!s)throw new kt;return s.map(a=>({type:"file-handle",systemHandle:a}))}async function ZJe({accept:t}={}){let e=document.createElement("input");e.type="file",e.accept=t??"*";let r=eet(e);return await new Promise((i,s)=>{let a=()=>{let l=e.files?.[0];l&&(e.removeEventListener("cancel",a),i({type:"file",file:l}))},o=()=>{e.removeEventListener("change",a),s(new kt)};e.addEventListener("change",a,{once:!0}),e.addEventListener("cancel",o,{once:!0})}).finally(r)}async function r1e({forceHTMLInput:t,accept:e,...r}={}){if(XJe()&&!t){let[n]=await QJe({...r,types:e});return n}return ZJe({accept:YJe(e)})}function JJe(){return"oncancel"in HTMLInputElement.prototype}function eet(t){if(JJe())return;let e=()=>{if(document.hasFocus())window.addEventListener("focus",()=>{t.files?.length===0&&t.dispatchEvent(new Event("cancel"))},{once:!0});else{console.warn("polyfill for input cancel event only works on focused windows, fallback to timeout");let r=window.setTimeout(()=>{t.files?.length===0&&(console.warn("input cancel event timeout, dispatch cancel event"),t.dispatchEvent(new Event("cancel")))},3e4);t.addEventListener("change",()=>{t.files?.length!==0&&window.clearTimeout(r)},{once:!0})}};return t.addEventListener("click",e),()=>{t.removeEventListener("click",e)}}function n1e(t,e){let r=t instanceof Blob?t:new Blob([t]),n=URL.createObjectURL(r),i=document.createElement("a");i.href=n,i.download=e,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}var za=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var fs=typeof window>"u"||"Deno"in globalThis;function li(){}function a1e(t,e){return typeof t=="function"?t(e):t}function JS(t){return typeof t=="number"&&t>=0&&t!==1/0}function zM(t,e){return Math.max(t+(e||0)-Date.now(),0)}function gf(t,e){return typeof t=="function"?t(e):t}function Qs(t,e){return typeof t=="function"?t(e):t}function qM(t,e){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(n){if(e.queryHash!==eC(a,e.options))return!1}else if(!zv(e.queryKey,a))return!1}if(r!=="all"){let l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function HM(t,e){let{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(Dl(e.options.mutationKey)!==Dl(s))return!1}else if(!zv(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function eC(t,e){return(e?.queryKeyHashFn||Dl)(t)}function Dl(t){return JSON.stringify(t,(e,r)=>J$(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function zv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!zv(t[r],e[r])):!1}function eU(t,e){if(t===e)return t;let r=i1e(t)&&i1e(e);if(r||J$(t)&&J$(e)){let n=r?t:Object.keys(t),i=n.length,s=r?e:Object.keys(e),a=s.length,o=r?[]:{},l=0;for(let c=0;c<a;c++){let u=r?c:s[c];(!r&&n.includes(u)||r)&&t[u]===void 0&&e[u]===void 0?(o[u]=void 0,l++):(o[u]=eU(t[u],e[u]),o[u]===t[u]&&t[u]!==void 0&&l++)}return i===a&&l===i?t:o}return e}function qv(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0}function i1e(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function J$(t){if(!s1e(t))return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(!s1e(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function s1e(t){return Object.prototype.toString.call(t)==="[object Object]"}function o1e(t){return new Promise(e=>{setTimeout(e,t)})}function tC(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?eU(t,e):e}function l1e(t,e,r=0){let n=[...t,e];return r&&n.length>r?n.slice(1):n}function c1e(t,e,r=0){let n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Hv=Symbol();function GM(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Hv?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var tet=class extends za{#e;#t;#r;constructor(){super(),this.#r=t=>{if(!fs&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Gv=new tet;var ret=class extends za{#e=!0;#t;#r;constructor(){super(),this.#r=t=>{if(!fs&&window.addEventListener){let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(r=>{r(t)}))}isOnline(){return this.#e}},Wv=new ret;function rC(){let t,e,r=new Promise((i,s)=>{t=i,e=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},r.reject=i=>{n({status:"rejected",reason:i}),e(i)},r}function net(t){return Math.min(1e3*2**t,3e4)}function tU(t){return(t??"online")==="online"?Wv.isOnline():!0}var u1e=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function WM(t){return t instanceof u1e}function KM(t){let e=!1,r=0,n=!1,i,s=rC(),a=m=>{n||(f(new u1e(m)),t.abort?.())},o=()=>{e=!0},l=()=>{e=!1},c=()=>Gv.isFocused()&&(t.networkMode==="always"||Wv.isOnline())&&t.canRun(),u=()=>tU(t.networkMode)&&t.canRun(),d=m=>{n||(n=!0,t.onSuccess?.(m),i?.(),s.resolve(m))},f=m=>{n||(n=!0,t.onError?.(m),i?.(),s.reject(m))},p=()=>new Promise(m=>{i=v=>{(n||c())&&m(v)},t.onPause?.()}).then(()=>{i=void 0,n||t.onContinue?.()}),h=()=>{if(n)return;let m,v=r===0?t.initialPromise:void 0;try{m=v??t.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{if(n)return;let y=t.retry??(fs?0:3),x=t.retryDelay??net,w=typeof x=="function"?x(r,b):x,C=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,b);if(e||!C){f(b);return}r++,t.onFail?.(r,b),o1e(w).then(()=>c()?void 0:p()).then(()=>{e?f(b):h()})})};return{promise:s,cancel:a,continue:()=>(i?.(),s),cancelRetry:o,continueRetry:l,canStart:u,start:()=>(u()?h():p().then(h),s)}}function iet(){let t=[],e=0,r=o=>{o()},n=o=>{o()},i=o=>setTimeout(o,0),s=o=>{e?t.push(o):i(()=>{r(o)})},a=()=>{let o=t;t=[],o.length&&i(()=>{n(()=>{o.forEach(l=>{r(l)})})})};return{batch:o=>{let l;e++;try{l=o()}finally{e--,e||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var _t=iet();var YM=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),JS(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(fs?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}};var d1e=class extends YM{#e;#t;#r;#n;#i;#s;#a;constructor(t){super(),this.#a=!1,this.#s=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#n=t.client,this.#r=this.#n.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=set(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){this.options={...this.#s,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,e){let r=tC(this.state.data,t,this.options);return this.#o({data:r,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),r}setState(t,e){this.#o({type:"setState",state:t,setStateOptions:e})}cancel(t){let e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(li).catch(li):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>Qs(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!zM(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#a?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){let o=this.observers.find(l=>l.options.queryFn);o&&this.setOptions(o.options)}let r=new AbortController,n=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(this.#a=!0,r.signal)})},i=()=>{let o=GM(this.options,e),l={client:this.#n,queryKey:this.queryKey,meta:this.meta};return n(l),this.#a=!1,this.options.persister?this.options.persister(o,l,this):o(l)},s={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#n,state:this.state,fetchFn:i};n(s),this.options.behavior?.onFetch(s,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#o({type:"fetch",meta:s.fetchOptions?.meta});let a=o=>{WM(o)&&o.silent||this.#o({type:"error",error:o}),WM(o)||(this.#r.config.onError?.(o,this),this.#r.config.onSettled?.(this.state.data,o,this)),this.scheduleGc()};return this.#i=KM({initialPromise:e?.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:o=>{if(o===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(o)}catch(l){a(l);return}this.#r.config.onSuccess?.(o,this),this.#r.config.onSettled?.(o,this.state.error,this),this.scheduleGc()},onError:a,onFail:(o,l)=>{this.#o({type:"failed",failureCount:o,error:l})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}),this.#i.start()}#o(t){let e=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...rU(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=t.error;return WM(n)&&n.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...r,error:n,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=e(this.state),_t.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function rU(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tU(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function set(t){let e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var f1e=class extends za{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,r){let n=e.queryKey,i=e.queryHash??eC(n,e),s=this.get(i);return s||(s=new d1e({client:t,queryKey:n,queryHash:i,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(n)}),this.add(s)),s}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_t.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(r=>qM(e,r))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(r=>qM(t,r)):e}notify(t){_t.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){_t.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_t.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}};var p1e=class extends YM{#e;#t;#r;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||nU(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){this.#r=KM({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(n,i)=>{this.#n({type:"failed",failureCount:n,error:i})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let e=this.state.status==="pending",r=!this.#r.canStart();try{if(!e){this.#n({type:"pending",variables:t,isPaused:r}),await this.#t.config.onMutate?.(t,this);let i=await this.options.onMutate?.(t);i!==this.state.context&&this.#n({type:"pending",context:i,variables:t,isPaused:r})}let n=await this.#r.start();return await this.#t.config.onSuccess?.(n,t,this.state.context,this),await this.options.onSuccess?.(n,t,this.state.context),await this.#t.config.onSettled?.(n,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(n,null,t,this.state.context),this.#n({type:"success",data:n}),n}catch(n){try{throw await this.#t.config.onError?.(n,t,this.state.context,this),await this.options.onError?.(n,t,this.state.context),await this.#t.config.onSettled?.(void 0,n,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,n,t,this.state.context),n}finally{this.#n({type:"error",error:n})}}finally{this.#t.runNext(this)}}#n(t){let e=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),_t.batch(()=>{this.#e.forEach(r=>{r.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function nU(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var h1e=class extends za{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(t,e,r){let n=new p1e({mutationCache:this,mutationId:++this.#r,options:t.defaultMutationOptions(e),state:r});return this.add(n),n}add(t){this.#e.add(t);let e=XM(t);if(typeof e=="string"){let r=this.#t.get(e);r?r.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){let e=XM(t);if(typeof e=="string"){let r=this.#t.get(e);if(r)if(r.length>1){let n=r.indexOf(t);n!==-1&&r.splice(n,1)}else r[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=XM(t);if(typeof e=="string"){let n=this.#t.get(e)?.find(i=>i.state.status==="pending");return!n||n===t}else return!0}runNext(t){let e=XM(t);return typeof e=="string"?this.#t.get(e)?.find(n=>n!==t&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){_t.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){let e={exact:!0,...t};return this.getAll().find(r=>HM(e,r))}findAll(t={}){return this.getAll().filter(e=>HM(t,e))}notify(t){_t.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(e=>e.state.isPaused);return _t.batch(()=>Promise.all(t.map(e=>e.continue().catch(li))))}};function XM(t){return t.options.scope?.id}function iU(t){return{onFetch:(e,r)=>{let n=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],a=e.state.data?.pageParams||[],o={pages:[],pageParams:[]},l=0,c=async()=>{let u=!1,d=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(e.signal.aborted?u=!0:e.signal.addEventListener("abort",()=>{u=!0}),e.signal)})},f=GM(e.options,e.fetchOptions),p=async(h,m,v)=>{if(u)return Promise.reject();if(m==null&&h.pages.length)return Promise.resolve(h);let b={client:e.client,queryKey:e.queryKey,pageParam:m,direction:v?"backward":"forward",meta:e.options.meta};d(b);let y=await f(b),{maxPages:x}=e.options,w=v?c1e:l1e;return{pages:w(h.pages,y,x),pageParams:w(h.pageParams,m,x)}};if(i&&s.length){let h=i==="backward",m=h?aet:m1e,v={pages:s,pageParams:a},b=m(n,v);o=await p(v,b,h)}else{let h=t??s.length;do{let m=l===0?a[0]??n.initialPageParam:m1e(n,o);if(l>0&&m==null)break;o=await p(o,m),l++}while(l<h)}return o};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=c}}}function m1e(t,{pages:e,pageParams:r}){let n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function aet(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}var sU=class{#e;#t;#r;#n;#i;#s;#a;#o;constructor(t={}){this.#e=t.queryCache||new f1e,this.#t=t.mutationCache||new h1e,this.#r=t.defaultOptions||{},this.#n=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=Gv.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Wv.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),r=this.#e.build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(gf(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:r})=>{let n=r.data;return[e,n]})}setQueryData(t,e,r){let n=this.defaultQueryOptions({queryKey:t}),s=this.#e.get(n.queryHash)?.state.data,a=a1e(e,s);if(a!==void 0)return this.#e.build(this,n).setData(a,{...r,manual:!0})}setQueriesData(t,e,r){return _t.batch(()=>this.#e.findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){let e=this.#e;_t.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){let r=this.#e;return _t.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let r={revert:!0,...e},n=_t.batch(()=>this.#e.findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(li).catch(li)}invalidateQueries(t,e={}){return _t.batch(()=>(this.#e.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){let r={...e,cancelRefetch:e.cancelRefetch??!0},n=_t.batch(()=>this.#e.findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(li)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(li)}fetchQuery(t){let e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);let r=this.#e.build(this,e);return r.isStaleByTime(gf(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(li).catch(li)}fetchInfiniteQuery(t){return t.behavior=iU(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(li).catch(li)}ensureInfiniteQueryData(t){return t.behavior=iU(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Wv.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(t){this.#r=t}setQueryDefaults(t,e){this.#n.set(Dl(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#n.values()],r={};return e.forEach(n=>{zv(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){this.#i.set(Dl(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#i.values()],r={};return e.forEach(n=>{zv(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#r.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=eC(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Hv&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#r.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};var oU=class extends za{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#a=rC(),this.options.experimental_prefetchInRender||this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#r=void 0;#n=void 0;#i;#s;#a;#o;#l;#u;#c;#f;#d;#p;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),g1e(this.#t,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return aU(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return aU(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(t,e){let r=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qs(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#v(),this.#t.setOptions(this.options),r._defaulted&&!qv(this.options,r)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});let i=this.hasListeners();i&&y1e(this.#t,n,this.options,r)&&this.#m(),this.updateResult(e),i&&(this.#t!==n||Qs(this.options.enabled,this.#t)!==Qs(r.enabled,this.#t)||gf(this.options.staleTime,this.#t)!==gf(r.staleTime,this.#t))&&this.#y();let s=this.#w();i&&(this.#t!==n||Qs(this.options.enabled,this.#t)!==Qs(r.enabled,this.#t)||s!==this.#p)&&this.#h(s)}getOptimisticResult(t){let e=this.#e.getQueryCache().build(this.#e,t),r=this.createResult(e,t);return cet(this,r)&&(this.#n=r,this.#s=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#n}trackResult(t,e){let r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(n),e?.(n),t[n])})}),r}trackProp(t){this.#g.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#e.defaultQueryOptions(t),r=this.#e.getQueryCache().build(this.#e,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#m({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#m(t){this.#v();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(li)),e}#y(){this.#b();let t=gf(this.options.staleTime,this.#t);if(fs||this.#n.isStale||!JS(t))return;let r=zM(this.#n.dataUpdatedAt,t)+1;this.#f=setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#w(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#h(t){this.#S(),this.#p=t,!(fs||Qs(this.options.enabled,this.#t)===!1||!JS(this.#p)||this.#p===0)&&(this.#d=setInterval(()=>{(this.options.refetchIntervalInBackground||Gv.isFocused())&&this.#m()},this.#p))}#x(){this.#y(),this.#h(this.#w())}#b(){this.#f&&(clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d&&(clearInterval(this.#d),this.#d=void 0)}createResult(t,e){let r=this.#t,n=this.options,i=this.#n,s=this.#i,a=this.#s,l=t!==r?t.state:this.#r,{state:c}=t,u={...c},d=!1,f;if(e._optimisticResults){let S=this.hasListeners(),T=!S&&g1e(t,e),E=S&&y1e(t,r,e,n);(T||E)&&(u={...u,...rU(c.data,t.options)}),e._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:p,errorUpdatedAt:h,status:m}=u;if(e.select&&u.data!==void 0)if(i&&u.data===s?.data&&e.select===this.#l)f=this.#u;else try{this.#l=e.select,f=e.select(u.data),f=tC(i?.data,f,e),this.#u=f,this.#o=null}catch(S){this.#o=S}else f=u.data;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let S;if(i?.isPlaceholderData&&e.placeholderData===a?.placeholderData)S=i.data;else if(S=typeof e.placeholderData=="function"?e.placeholderData(this.#c?.state.data,this.#c):e.placeholderData,e.select&&S!==void 0)try{S=e.select(S),this.#o=null}catch(T){this.#o=T}S!==void 0&&(m="success",f=tC(i?.data,S,e),d=!0)}this.#o&&(p=this.#o,f=this.#u,h=Date.now(),m="error");let v=u.fetchStatus==="fetching",b=m==="pending",y=m==="error",x=b&&v,w=f!==void 0,O={status:m,fetchStatus:u.fetchStatus,isPending:b,isSuccess:m==="success",isError:y,isInitialLoading:x,isLoading:x,data:f,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!b,isLoadingError:y&&!w,isPaused:u.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&w,isStale:lU(t,e),refetch:this.refetch,promise:this.#a};if(this.options.experimental_prefetchInRender){let S=P=>{O.status==="error"?P.reject(O.error):O.data!==void 0&&P.resolve(O.data)},T=()=>{let P=this.#a=O.promise=rC();S(P)},E=this.#a;switch(E.status){case"pending":t.queryHash===r.queryHash&&S(E);break;case"fulfilled":(O.status==="error"||O.data!==E.value)&&T();break;case"rejected":(O.status!=="error"||O.error!==E.reason)&&T();break}}return O}updateResult(t){let e=this.#n,r=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#s=this.options,this.#i.data!==void 0&&(this.#c=this.#t),qv(r,e))return;this.#n=r;let n={},i=()=>{if(!e)return!0;let{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!this.#g.size)return!0;let o=new Set(a??this.#g);return this.options.throwOnError&&o.add("error"),Object.keys(this.#n).some(l=>{let c=l;return this.#n[c]!==e[c]&&o.has(c)})};t?.listeners!==!1&&i()&&(n.listeners=!0),this.#k({...n,...t})}#v(){let t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;let e=this.#t;this.#t=t,this.#r=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#k(t){_t.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function oet(t,e){return Qs(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function g1e(t,e){return oet(t,e)||t.state.data!==void 0&&aU(t,e,e.refetchOnMount)}function aU(t,e,r){if(Qs(e.enabled,t)!==!1){let n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&lU(t,e)}return!1}function y1e(t,e,r,n){return(t!==e||Qs(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&lU(t,r)}function lU(t,e){return Qs(e.enabled,t)!==!1&&t.isStaleByTime(gf(e.staleTime,t))}function cet(t,e){return!qv(t.getCurrentResult(),e)}var cU=class extends za{#e;#t=void 0;#r;#n;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#e.defaultMutationOptions(t),qv(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&Dl(e.mutationKey)!==Dl(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#s(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#i(),this.#s()}mutate(t,e){return this.#n=e,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#i(){let t=this.#r?.state??nU();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){_t.batch(()=>{if(this.#n&&this.hasListeners()){let e=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#n.onSuccess?.(t.data,e,r),this.#n.onSettled?.(t.data,null,e,r)):t?.type==="error"&&(this.#n.onError?.(t.error,e,r),this.#n.onSettled?.(void 0,t.error,e,r))}this.listeners.forEach(e=>{e(this.#t)})})}};var Kv=Z(Te(),1),v1e=Z(Ge(),1),uU=Kv.createContext(void 0),yf=t=>{let e=Kv.useContext(uU);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},dU=({client:t,children:e})=>(Kv.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,v1e.jsx)(uU.Provider,{value:t,children:e}));var QM=Z(Te(),1),b1e=QM.createContext(!1),x1e=()=>QM.useContext(b1e),w$t=b1e.Provider;var nC=Z(Te(),1),uet=Z(Ge(),1);function det(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var fet=nC.createContext(det()),w1e=()=>nC.useContext(fet);var k1e=Z(Te(),1);function ZM(t,e){return typeof t=="function"?t(...e):!!t}function iC(){}var S1e=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},C1e=t=>{k1e.useEffect(()=>{t.clearReset()},[t])},T1e=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(i&&t.data===void 0||ZM(r,[t.error,n]));var E1e=t=>{let e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...r)=>Math.max(e(...r),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},I1e=(t,e)=>t.isLoading&&t.isFetching&&!e,A1e=(t,e)=>t?.suspense&&e.isPending,fU=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});var vf=Z(Te(),1);function P1e(t,e,r){let n=yf(r),i=x1e(),s=w1e(),a=n.defaultQueryOptions(t);n.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=i?"isRestoring":"optimistic",E1e(a),S1e(a,s),C1e(s);let o=!n.getQueryCache().get(a.queryHash),[l]=vf.useState(()=>new e(n,a)),c=l.getOptimisticResult(a),u=!i&&t.subscribed!==!1;if(vf.useSyncExternalStore(vf.useCallback(d=>{let f=u?l.subscribe(_t.batchCalls(d)):iC;return l.updateResult(),f},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),vf.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),A1e(a,c))throw fU(a,l,s);if(T1e({result:c,errorResetBoundary:s,throwOnError:a.throwOnError,query:n.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw c.error;return n.getDefaultOptions().queries?._experimental_afterQuery?.(a,c),a.experimental_prefetchInRender&&!fs&&I1e(c,i)&&(o?fU(a,l,s):n.getQueryCache().get(a.queryHash)?.promise)?.catch(iC).finally(()=>{l.updateResult()}),a.notifyOnChangeProps?c:l.trackResult(c)}function pU(t,e){return P1e(t,oU,e)}var lu=Z(Te(),1);function JM(t,e){let r=yf(e),[n]=lu.useState(()=>new cU(r,t));lu.useEffect(()=>{n.setOptions(t)},[n,t]);let i=lu.useSyncExternalStore(lu.useCallback(a=>n.subscribe(_t.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=lu.useCallback((a,o)=>{n.mutate(a,o).catch(iC)},[n]);if(i.error&&ZM(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var ci=require("obsidian"),B1e=Z(zR(),1);var R1e=An({id:Ee(ke(),Rm(1,"ID is required")),pattern:Ee(ke(),Qa(),Rm(1,"Pattern/URL is required"),Pm(t=>{try{return new URLPattern(t),!0}catch{return!1}},"Invalid URL pattern")),username:Ee(ke(),Qa(),Rm(1,"Username is required")),password:Ee(ke(),Qa(),Rm(1,"Password is required"))}),L1e=Ee(ke(),u0(),Wl(R1e),Pm(t=>KT(t,e=>e.id).length===t.length,"Credentials must have unique IDs")),pet=FQ(R1e,["id"]),M1e=uv(pet);var e_=Z(Te(),1),hU=(0,e_.createContext)(null);function sC(){let t=(0,e_.use)(hU);if(!t)throw new Error("PasswordManager must be used within a PasswordManagerProvider");return t}function _1e(){let{manager:t}=sC();return pU({queryKey:["credentials"],queryFn:()=>t.getAll()})}function O1e(){let{manager:t,requestEditCredential:e}=sC(),r=yf();return JM({mutationFn:n=>e(n).then(()=>t.update(n)).catch(i=>{if(!kt.test(i))throw i}),onSuccess:()=>{r.invalidateQueries({queryKey:["credentials"]})}})}function D1e(){let{manager:t}=sC(),e=yf();return JM({mutationFn:r=>t.delete(r),onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}var t_=Z(Ge(),1);function N1e(){let{addCredential:t}=sC(),{data:e,isLoading:r}=_1e(),{mutate:n,isPending:i}=O1e(),{mutate:s,isPending:a}=D1e();return r||!e?(0,t_.jsx)(fce,{}):e.length===0?(0,t_.jsx)(dce,{onAdd:t}):e.map(o=>(0,t_.jsx)(cce,{username:o.username,password:o.password,pattern:o.pattern,onEdit:()=>{n(o)},onDelete:()=>{s(o.id)},disabled:i||a},o.id))}var r_=class{#e;constructor(e){this.#e=e.instance}getAll(){return this.#e.getCredentials()}create(e){return this.#e.setCredential({...e,id:Xr()})}update(e){return this.#e.setCredential(e)}delete(e){return this.#e.deleteCredential(e)}clear(){return this.#e.clearCredentials()}import(e){return this.#e.importCredentials(e)}};var F1e=Z(Ge(),1),aC=class extends si{app;#e;constructor(e,r){super(e.app),this.app=e.app,this.modalEl.addClass("mx-dialog",r?"mx-pwd-manager-edit":"mx-pwd-manager-create"),this.titleEl.setText(r?"Edit credential":"Add new credential"),this.#e=r}renderContent(){return(0,F1e.jsx)(lce,{resolver:M1e,defaultValues:this.#e,onSave:e=>this.resolveWith(e),onCancel:()=>this.rejectWith(new kt),onInvalid:e=>{console.log(e)},testPattern:(e,r)=>{try{if(!e)return{type:"invalid-pattern",reason:"Pattern is required"};try{return{type:new URLPattern(e).test(r)?"matched":"not-matched"}}catch(n){return{type:"invalid-pattern",reason:n instanceof Error?n.message:"Unknown error"}}}catch(n){return{type:"error",reason:n}}}})}};var Yv=Z(Ge(),1),n_=class extends ci.Modal{#e;#t;#r;constructor(e){if(super(e.app),this.modalEl.addClasses(["mx-dialog","mx-pwd-manager"]),!ci.Platform.isDesktopApp)throw new Error("Password Manager is only available on desktop app");this.#r=new r_(e.mainPs),this.#t=new sU,this.titleEl.setText("Password Manager")}onOpen(){this.contentEl.createDiv({cls:"pwd-manager-description"}).createSpan({text:"Manage login credentials for accessing content from password-protected sources like cloud storage (WebDAV, Nextcloud) and private file servers. These credentials are securely stored locally and used to stream media and files."});let r=this.contentEl.createDiv({cls:"pwd-manager-actions"}),n=this.contentEl.createDiv({cls:"pwd-manager-list"});new ci.ButtonComponent(r).setClass("pwd-manager-actions-add-new-btn").setIcon("plus").setCta().setTooltip("Add new credential").onClick(()=>{this.addCredential()}),new ci.ButtonComponent(r).setClass("pwd-manager-actions-import-btn").setIcon("import").setTooltip("Import credentials").onClick(()=>{this.importCredentials()}),new ci.ButtonComponent(r).setClass("pwd-manager-actions-export-btn").setIcon("folder-input").setTooltip("Export credentials").onClick(()=>{this.exportCredentials()}),new ci.ButtonComponent(r).setClass("pwd-manager-actions-clear-btn").setIcon("trash").setTooltip("Clear all credentials").setWarning().onClick(()=>{this.clearCredentials()});let i=B1e.default.createRoot(n);this.#e=()=>i.unmount(),i.render((0,Yv.jsx)(hU.Provider,{value:{manager:this.#r,requestEditCredential:s=>this.requestEditCredential(s),addCredential:()=>this.addCredential()},children:(0,Yv.jsx)(dU,{client:this.#t,children:(0,Yv.jsx)(Rf,{children:(0,Yv.jsx)(uce,{children:(0,Yv.jsx)(N1e,{})})})})}))}async importCredentials(){try{let e=await r1e({accept:[{description:"Password Export JSON",accept:{"application/json":[".json"]}}]}),r=e.type==="file-handle"?await e.systemHandle.getFile():e.file,n=Za(L1e,await r.text());if(!window.confirm(`Import ${n.length} credentials? the existing credentials will be overwritten.`))return;await this.#r.import(n),this.#n(),new ci.Notice(`Imported ${n.length} credentials`,2e3)}catch(e){if(kt.test(e))return;e instanceof Am?new ci.Notice("Failed to import password manager data, invalid data format",5e3):new ci.Notice(`Failed to import password manager data, ${e instanceof Error?e.message:String(e)}`,5e3),console.error("Failed to import password manager data",e)}}async exportCredentials(){if(!window.confirm("Export password manager data? Keep in mind that the credentials will be saved in plain text and is not secure and can be easily read by anyone."))return;let e=await this.#r.getAll();n1e(new Blob([JSON.stringify(e)],{type:"application/json"}),"password-manager.json")}async clearCredentials(){window.confirm("Are you sure you want to clear all credentials? This action cannot be undone.")&&(await this.#r.clear(),this.#n(),new ci.Notice("Cleared all credentials",2e3))}async addCredential(){try{let r=await new aC({app:this.app}).requestInput();await this.#r.create(r),this.#n(),new ci.Notice("Added credential",2e3)}catch(e){if(kt.test(e))return;new ci.Notice(`Failed to add credential, ${e instanceof Error?e.message:String(e)}`,5e3)}}async requestEditCredential(e){return{...await new aC({app:this.app},e).requestInput(),id:e.id}}#n(){this.#t.invalidateQueries({queryKey:["credentials"]})}onClose(){this.#e?.()}};var o_=require("obsidian");var i_=class{settings;constructor(e){this.settings=e.settings}create(e){let r=this.settings.value;if(!r)throw new Error("Settings not loaded");return{value:r[e],set:i=>{this.settings.set(e,i)},sub:i=>this.settings.subscribe(e,i)}}number(e){return this.create(e)}boolean(e){let r=this.create(e);return{value:r.value,set:r.set,sub:n=>r.sub((i,s)=>{n(i,s===su?null:s)})}}inputNumber(e){let r=this.create(e);return{value:r.value.toString(),set:n=>{let i=Number.parseFloat(n);Number.isNaN(i)||r.set(i)},sub:n=>r.sub((i,s)=>{n(i.toString(),s===su?null:s.toString())})}}optionalString(e){let r=this.create(e);return{value:r.value,set:r.set,sub:n=>r.sub((i,s)=>n(i??null,s===su?null:s))}}string(e){let r=this.create(e);return{value:r.value,set:r.set,sub:n=>r.sub((i,s)=>n(i,s===su?null:s))}}};var V1e=()=>window.localStorage.getItem("mx:browser-flag")==="1";var mU=require("obsidian");function j1e(t){var n=[];try{let e=J(n,new DisposableStack);let r=t.settings.optionalString("playback.screenshot.folder-path");new mU.Setting(t.containerEl).setName("Default location for new screenshots").setDesc('Where newly created screenshots will be saved. You can go to "Files and links" to change the default location of new attachments.').addDropdown(o=>o.addOptions({default:"Default location for new attachments",specific:"In the folder specified below"}).setValue(r.value===null?"default":"specific").onChange(l=>{l==="default"?r.set(null):r.set("/")}).then(l=>e.use(r.sub(c=>l.setValue(c===null?"default":"specific")))));new mU.Setting(t.containerEl).setName("Screenshot folder path").setDesc("Place newly created screenshots in this folder.").then(o=>{r.value===null&&(o.settingEl.style.display="none"),o.addText(l=>l.setValue(r.value||"/").onChange(c=>{c===""?(l.setValue("/"),r.set("/")):r.set(c)}).then(c=>e.use(r.sub(u=>{u==null?(c.setValue("/"),o.settingEl.style.display="none"):(c.setValue(u),o.settingEl.style.display="")}))))});return e.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}var Nl=require("obsidian");function $1e(t){var n=[];try{let e=J(n,new DisposableStack);let r=t.containerEl.createDiv("auth-section");new Nl.Setting(r).setName("Account").setHeading();Io()&&e.use(het(t,r));new Nl.Setting(r).setName("Login passwords").setDesc(createFragment(o=>{o.createSpan({text:"Manage login credentials for streaming media from password-protected sources like WebDAV servers, Nextcloud, private file servers, and other authenticated media sources."}),o.createEl("br"),Nl.Platform.isDesktopApp||o.createSpan({text:"This feature is only available on desktop.",cls:"mod-warning"})})).addButton(o=>{o.setTooltip("Open password manager").setIcon("arrow-up-right").setDisabled(!Nl.Platform.isDesktopApp).onClick(()=>{t.service.showPasswordManager()})});return e.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}function het(t,e){var o=[];try{let r=J(o,new DisposableStack);let n=null;let{data:{subscription:i}}=un.auth.onAuthStateChange((d,f)=>{a(f?.user||null),d==="SIGNED_OUT"&&new Nl.Notice("You have been signed out")});r.defer(()=>{i.unsubscribe()});s();return r.move();async function s(){try{let{data:d,error:f}=await un.auth.getUser();f?(console.error("Error checking auth state:",f),a(null)):a(d.user)}catch(d){console.error("Error checking auth state:",d),a(null)}}function a(d){if(n&&n.settingEl.remove(),d){let f=d.user_metadata.full_name||d.user_metadata.name,p=d.email;n=new Nl.Setting(e).setName("Your account").setDesc(f?`You're currently signed in as ${f} (${p}).`:`You're currently signed in via ${p}.`).addButton(h=>{h.setButtonText("Sign out").setWarning().onClick(async()=>{try{await un.auth.signOut()}catch(m){console.error("Error signing out:",m)}})})}else n=new Nl.Setting(e).setName("Your account").setDesc("Sign in to access online features like YouTube transcript fetching, AI transcript & summary, and more.").addButton(f=>{f.setButtonText("Sign in").setCta().onClick(async()=>{await Hd.open(t.service)})})}}catch(l){var c=l,u=!0}finally{ee(o,c,u)}}var oC=require("obsidian");function U1e(t){var r=[];try{let e=J(r,new DisposableStack);new oC.Setting(t.containerEl).setHeading().setName("Embed");new oC.Setting(t.containerEl).setName("Load strategy").setDesc(createFragment(a=>{a.appendText("Controls when media files start loading in your notes.");let o=a.createEl("dl");o.createEl("dt").setText("Eager"),o.createEl("dd").setText("Media starts loading immediately when you open the note."),o.createEl("dt").setText("On demand"),o.createEl("dd").setText(createFragment(l=>{l.appendText("Media starts loading immediately when you open the note."),l.createEl("br"),l.appendText("Recommended for notes with few videos/audio files as it keeps Obsidian fast.")}))})).then(a=>{let o=t.settings.string("note.embed.load-strategy");a.addDropdown(l=>l.addOptions({play:"On demand",eager:"Eager"}).setValue(o.value).onChange(o.set).then(()=>e.use(o.sub(c=>l.setValue(c)))))});new oC.Setting(t.containerEl).setName("Handle embedded hosted media in note").setDesc("Let media extended handle embedded links to YouTube, Vimeo, bilibili, etc").then(a=>{let o=t.settings.boolean("note.embed.handle-hosted");a.addToggle(l=>{l.setValue(o.value).onChange(o.set),e.use(o.sub(c=>l.setValue(c)))})});new oC.Setting(t.containerEl).setName("Handle embedded remote media files in note").setDesc("Let media extended handle embedded links to remote media files, like http://example.com/path/to/video.mp4").then(a=>{let o=t.settings.boolean("note.embed.handle-direct-url");a.addToggle(l=>{l.setValue(o.value).onChange(o.set),e.use(o.sub(c=>l.setValue(c)))})});return e.move()}catch(n){var i=n,s=!0}finally{ee(r,i,s)}}var lC=require("obsidian");function z1e(t,{enableBrowser:e}={}){var n=[];try{let r=J(n,new DisposableStack);new lC.Setting(t.containerEl).setHeading().setName("Link");new lC.Setting(t.containerEl).setName("Handle link to hosted media").setDesc("Let media extended handle link to YouTube, Vimeo, bilibili, etc").then(o=>{let l=t.settings.boolean("link.handle-hosted");o.addToggle(c=>{c.setValue(l.value).onChange(l.set),r.use(l.sub(u=>c.setValue(u)))})});new lC.Setting(t.containerEl).setName("Handle link to remote media file").setDesc("Let media extended handle link to remote media file, like http://example.com/path/to/video.mp4").then(o=>{let l=t.settings.boolean("link.handle-direct-url");o.addToggle(c=>{c.setValue(l.value).onChange(l.set),r.use(l.sub(u=>c.setValue(u)))})});e&&new lC.Setting(t.containerEl).setName("Open hosted media in...").setDesc(createFragment(o=>{o.appendText("For hosted media supported in both obsidian player and browser, including YouTube and Viemo, choose your preferred way to open them."),o.createEl("br"),o.appendText("Choose browser to open with browser companion extension to access more features.")})).then(o=>{let l=t.settings.string("link.hosted-prefer");o.addDropdown(c=>{c.addOptions({browser:"Browser",iframe:"Local player"}),c.setValue(l.value).onChange(l.set),r.use(l.sub(u=>c.setValue(u)))})});return r.move()}catch(i){var s=i,a=!0}finally{ee(n,s,a)}}var bf=require("obsidian");function H1e(t){var i=[];try{let e=J(i,new DisposableStack);new bf.Setting(t.containerEl).setName("Link behavior").setHeading().setDesc("Configure how links to media are opened");let r=q1e(t.settings,"link.click-behavior");let n=q1e(t.settings,"link.altclick-behavior");new bf.Setting(t.containerEl).setName("Click").setDesc("Behavior when clicking on a link").addDropdown(l=>l.addOptions(Hn(s_,c=>c.description)).setValue(r.value).onChange(c=>r.set(c)).then(()=>e.use(r.sub(c=>l.setValue(c)))));new bf.Setting(t.containerEl).setName("Alternative click").then(l=>{let c=u=>{if(u===null||u===!1){l.settingEl.style.display="none";return}l.settingEl.style.display="",l.setDesc(`Behavior when ${get(u)}`)};c(r.valueRaw),e.use(r.subRaw(u=>c(u))),l.addDropdown(u=>u.addOptions(Hn(s_,d=>d.description)).setValue(n.value).onChange(d=>n.set(d)).then(()=>e.use(n.sub(d=>u.setValue(d)))))});return e.move()}catch(s){var a=s,o=!0}finally{ee(i,a,o)}}function q1e(t,e){let{value:r,set:n,sub:i}=t.create(e);return{value:gU(r),valueRaw:r,set:s=>n(met(s)),sub:s=>i((a,o)=>s(gU(a),o===su?null:gU(o))),subRaw:s=>i((a,o)=>s(a,o===su?null:o))}}var s_={split:{value:"split",key:"split",description:"New pane on the right"},"split-horizontal":{value:"split-horizontal",key:"split-horizontal",description:"New pane on the bottom"},replace:{value:!1,key:"replace",description:"In current pane"},default:{value:null,key:"default",description:"Default obsidian behavior"},window:{value:"window",key:"window",description:"New window"},tab:{value:"tab",key:"tab",description:"New tab"}};function gU(t){let e=Object.values(s_).find(r=>r.value===t);if(!e)throw new Error(`Unknown pane behavior: ${t}`);return e.key}function met(t){let e=s_[t];if(!e)throw new Error(`Unknown pane behavior key: ${t}`);return e.value}function get(t){switch(t){case"split":case"split-horizontal":return bf.Platform.isMacOS?"click holding \u2318+\u2325":"click holding Ctrl+Alt";case"window":return bf.Platform.isMacOS?"click holding \u2318+\u2325+\u21E7":"click holding Ctrl+Alt+Shift";case"tab":return bf.Platform.isMacOS?"click holding \u2318 or middle-click":"click holding Ctrl or middle-click";default:Be(t)}}var yU=require("obsidian");function G1e(t){var r=[];try{let e=J(r,new DisposableStack);new yU.Setting(t.containerEl).setHeading().setName("Media Library");new yU.Setting(t.containerEl).setName("Media folder path").setDesc("Folder path for media library (relative to vault root)").then(a=>{let o=t.settings.string("media-lib.folder-path");a.addText(l=>{l.setValue(o.value).onChange(o.set),e.use(o.sub(c=>l.setValue(c)))})});return e.move()}catch(n){var i=n,s=!0}finally{ee(r,i,s)}}var $h=require("obsidian");function cC(t,e,r){return n=>{n.inputEl.type="number",n.inputEl.style.textAlign="center",n.inputEl.min=t.toString(),n.inputEl.max=e.toString(),n.inputEl.step=r.toString()}}function W1e(t){var c=[];try{let e=J(c,new DisposableStack);let{containerEl:r}=t;new $h.Setting(r).setHeading().setName("Note taking");let n=t.settings.create("note.template.insert-at");new $h.Setting(r).setDesc("Configure where timestamps and screenshots are inserted").setName("Insert location").addDropdown(p=>{let h={"before-cursor":"Latest content on top (Before cursor)","after-cursor":"Latest content at end (After cursor)"};p.addOptions(h).setValue(n.value).onChange(m=>n.set(m)).then(()=>e.use(n.sub(m=>p.setValue(m))))});let i=t.settings.string("note.template.timestamp");new $h.Setting(r).setName("Timestamp template").setDesc("The template used to insert timestamps. Supported placeholders: {{TIMESTAMP}}").addTextArea(p=>{p.setValue(i.value).onChange(i.set),p.inputEl.rows=5,p.inputEl.cols=40,e.use(i.sub(h=>p.setValue(h)))});let s=t.settings.number("note.template.timestamp-offset");let a=t.settings.inputNumber("note.template.timestamp-offset");new $h.Setting(r).setName("Timestamp offset").setDesc("Offset in seconds to add to the timestamp").addSlider(p=>p.setLimits(-10,10,.01).setValue(s.value).setDynamicTooltip().onChange(s.set).then(h=>{e.use(s.sub(m=>h.setValue(m)))})).addText(p=>p.setValue(a.value).onChange(a.set).then(cC(-10,10,.01)).then(h=>{e.use(a.sub(m=>h.setValue(m)))})).then(p=>p.controlEl.appendText("s"));let o=t.settings.string("note.template.screenshot-embed");new $h.Setting(r).setName("Screenshot linktext template").setDesc("The template used to create screenshot linktext. Supported placeholders: {{DURATION}}, {{TITLE}}. Remove `|50` suffix to embed image in full size.").addTextArea(p=>{p.setValue(o.value).onChange(o.set),p.inputEl.rows=5,p.inputEl.cols=40,e.use(o.sub(h=>p.setValue(h)))});let l=t.settings.string("note.template.screenshot");new $h.Setting(r).setName("Screenshot template").setDesc("The template used to insert screenshot. Supported placeholders: {{TIMESTAMP}}, {{SCREENSHOT}} (add `!` prefix to insert as image embed).").addTextArea(p=>{p.setValue(l.value).onChange(l.set),p.inputEl.rows=5,p.inputEl.cols=40,e.use(l.sub(h=>p.setValue(h)))});return e.move()}catch(u){var d=u,f=!0}finally{ee(c,d,f)}}var uC=require("obsidian");function K1e(t){var r=[];try{let e=J(r,new DisposableStack);new uC.Setting(t.containerEl).setHeading().setName("Playback");new uC.Setting(t.containerEl).setName("Default volume").setDesc("The default volume for media files").then(a=>{let o=t.settings.number("playback.default-volume"),l=t.settings.inputNumber("playback.default-volume");a.addSlider(c=>c.setLimits(0,100,1).setValue(o.value).onChange(o.set).then(u=>{e.use(o.sub(d=>u.setValue(d)))})).addText(c=>c.setValue(l.value).onChange(l.set).then(cC(0,100,1)).then(u=>{e.use(l.sub(d=>u.setValue(d)))}))});new uC.Setting(t.containerEl).setName("Preserve pitch").setDesc("Preserve audio pitch to compensate for playback rate changes. Won't work on video hosted in YouTube and Vimeo").then(a=>{let o=t.settings.boolean("playback.preserve-pitch");a.addToggle(l=>{l.setValue(o.value).onChange(o.set),e.use(o.sub(c=>l.setValue(c)))})});new uC.Setting(t.containerEl).setName("Fine-tune speed adjustment").setDesc("Set the increment/decrement value for fine-tuning playback speed using the fine-tune speed control commands.").then(a=>{let o=t.settings.number("playback.speed-step"),l=t.settings.inputNumber("playback.speed-step");a.addSlider(c=>c.setLimits(.01,2,.01).setValue(o.value).onChange(o.set).then(u=>{e.use(o.sub(d=>u.setValue(d)))})).addText(c=>c.then(cC(.01,2,.01)).setValue(l.value).onChange(l.set).then(u=>{e.use(l.sub(d=>u.setValue(d)))})),a.controlEl.appendText("x")});return e.move()}catch(n){var i=n,s=!0}finally{ee(r,i,s)}}var Y1e=require("obsidian");function X1e(t){var r=[];try{let e=J(r,new DisposableStack);new Y1e.Setting(t.containerEl).setName("Save screenshot as").setDesc(createFragment(a=>{a.appendText("Choose the format of the saved screenshot"),a.createEl("br"),a.appendText("WEBP has better compression ratio, but would fallback to JPEG in unsupported browsers like iOS or iPadOS")})).addDropdown(a=>{let o=t.settings.string("playback.screenshot.format");a.addOptions({"image/png":"PNG","image/jpeg":"JPEG","image/webp":"WEBP"}).setValue(o.value).onChange(l=>o.set(l)).then(l=>e.use(o.sub(c=>l.setValue(c))))});return e.move()}catch(n){var i=n,s=!0}finally{ee(r,i,s)}}var jo=require("obsidian");function Q1e(t){var r=[];try{let e=J(r,new DisposableStack);new jo.Setting(t.containerEl).setHeading().setName("Text tracks");new jo.Setting(t.containerEl).setName("Enable text tracks by default").setDesc("Show subtitles/captions whenever available.").then(a=>{let o=t.settings.boolean("playback.track.default-enabled");a.addToggle(l=>{l.setValue(o.value).onChange(o.set),e.use(o.sub(c=>l.setValue(c)))})});yet(e,t);vet(e,t);return e.move()}catch(n){var i=n,s=!0}finally{ee(r,i,s)}}var yet=(t,e)=>{let r=e.settings.create("playback.track.default-languages"),n=e.containerEl.createEl("form",{});n.onsubmit=s=>{s.preventDefault();let o=new FormData(n).get("default-languages");if(typeof o!="string"){new jo.Notice("Invalid value");return}if(o=o.trim(),!o){r.set([]),new jo.Notice("Languages cleared");return}let l=o.split(`
`).map(u=>u.trim()),c=l.reduce((u,d,f)=>(uf.test(d)||u.push(`Invalid language code at line ${f+1}: ${d}`),u),[]);if(c.length>0){new jo.Notice(c.join(`
`));return}r.set(l),new jo.Notice("Languages saved")};let i=new jo.Setting(n).setName("Default languages").setDesc(createFragment(s=>{s.appendText("A list of languages to show subtitles/captions for by default."),s.createEl("br"),s.appendText("Each language code should be on a new line.")})).addTextArea(s=>{s.setValue(r.value.join(`
`)),s.inputEl.name="default-languages",s.inputEl.rows=6,s.inputEl.cols=10}).addButton(s=>{s.setTooltip("Save").setIcon("lucide-save"),s.buttonEl.type="submit"});for(n.className=i.settingEl.className;i.settingEl.firstChild;)n.appendChild(i.settingEl.firstChild);i.settingEl.remove()},vet=(t,e)=>{let r=e.settings.optionalString("playback.track.folder-path");new jo.Setting(e.containerEl).setName("Default location for text tracks").setDesc('Where text tracks (subtitles/captions) will be searched for. You can go to "Files and links" to change the default location of new attachments.').addDropdown(n=>n.addOptions({default:"Default location for new attachments",specific:"In the folder specified below"}).setValue(r.value===null?"default":"specific").onChange(i=>{i==="default"?r.set(null):r.set("/")}).then(i=>t.use(r.sub(s=>i.setValue(s===null?"default":"specific"))))),new jo.Setting(e.containerEl).setName("Text track folder path").setDesc("Search for text tracks in this folder.").then(n=>{r.value===null&&(n.settingEl.style.display="none"),n.addText(i=>i.setValue(r.value||"/").onChange(s=>{s===""?(i.setValue("/"),r.set("/")):r.set(s)}).then(s=>t.use(r.sub(a=>{a==null?(s.setValue("/"),n.settingEl.style.display="none"):(s.setValue(a),n.settingEl.style.display="")}))))})};var a_=class extends o_.PluginSettingTab{plugin;settings;auth;#e=null;constructor(e){super(e.app,e.plugin),this.plugin=e.plugin,this.settings=e.settings,this.auth=e.auth}hide(){this.#e?.dispose(),this.containerEl.empty()}display(){this.containerEl.empty();let e=V1e();this.settings.loaded.then(()=>{var i=[];try{let r=J(i,new DisposableStack);let n={containerEl:this.containerEl,settings:new i_({settings:this.settings})};r.use($1e({...n,service:this.auth}));r.use(K1e(n));r.use(Q1e(n));r.use(U1e(n));r.use(z1e(n,{enableBrowser:e}));r.use(H1e(n));r.use(W1e(n));new o_.Setting(this.containerEl).setHeading().setName("Screenshot");r.use(j1e(n));r.use(X1e(n));r.use(G1e(n));this.#e=r.move()}catch(s){var a=s,o=!0}finally{ee(i,a,o)}})}};function J1e(t){let e=nD({injectionMode:Gf.PROXY,strict:!0});return e.register({plugin:Wf(t),app:Wf(t.app),settings:ot(XS),linkHandler:ot(_L),mediaLib:ot(UL),recorderNote:ot(pL),obsidianProtocol:ot(aM),auth:ot(mL),command:ot(KR),menu:ot(sL),mainPs:ot(mS),hashEditor:ot(AL),workspaceOpen:ot($M),workspaceFind:ot(jM),mediaNote:ot(KL),transcriptLoader:ot(bM),template:ot(hM),templateInsertion:ot(pM),fileService:ot(gL),imageCache:ot(LL),trackInfoParser:ot(mM),trackInfoResolver:ot(yM),trackInfoEncoder:ot(vM),metadataParser:ot($3),metadataUpdater:ot(H3),youTubeApi:ot(aS),textExtractionApi:ot(sS),transcriptSaver:ot(TM),attachement:ot(lL),screenshot:ot(cM),mediaUidMigrator:ot(G3),mediaAttr:ot(jL),mediaParser:ot(YL),newRelease:ot(YS),metadataExtractor:ot(j3),passwordManagerModal:ji(n_),mediaSwitcherModal:ji(UM),settingTab:ji(a_),store:zT(Kf,{lifetime:"SCOPED"})}),t.register(()=>e.dispose().catch(r=>{kt.test(r)||console.error("Failed to dispose container",r)})),e.resolve("settings"),e.resolve("linkHandler"),e.resolve("mediaLib"),e.resolve("recorderNote"),e.resolve("obsidianProtocol"),e.resolve("auth"),e.resolve("command"),e.resolve("menu"),e.resolve("newRelease"),e.resolve("hashEditor"),Z1e.Platform.isDesktopApp&&e.cradle.mainPs.initialize().catch(r=>{console.error("Failed to initialize main process service",r)}),e}var bet="open-media-switcher";function eke(t){t.plugin.addCommand({id:bet,name:"Open external media",icon:"play",callback:()=>t.mediaSwitcherModal.open()}),t.plugin.addRibbonIcon("square-play","Open external media",()=>t.mediaSwitcherModal.open())}var xet=/^(?<x>\d+)?x(?<y>\d+)$|^(?<xOnly>\d+)$/;function tke(t){let e=Number.parseInt(t,10);return Number.isNaN(e)?-1:e}function rke(t){let e=t?.match(xet)?.groups;if(!e)return null;let r=tke(e.xOnly??e.x??""),n=tke(e.y??"");return[r,n]}function l_(t){let e=t.lastIndexOf("|"),r=null,n=t;return e===-1?(r=rke(t),r&&(n="")):(r=rke(n.substring(e+1)),r&&(n=n.substring(0,e))),{title:n,size:r}}function Xv(t,e){t.classList.contains("dynamic-size")||t.classList.add("dynamic-size");let[r,n]=e??[-1,-1];Number.isNaN(r)||r<=0?t.style.removeProperty("--assigned-width"):t.style.setProperty("--assigned-width",`${r}px`),Number.isNaN(n)||n<=0?t.style.removeProperty("--assigned-height"):t.style.setProperty("--assigned-height",`${n}px`)}function c_(t,e){e?t.setAttr("alt",e):t.removeAttribute("alt")}var ake=require("@codemirror/state"),Zv=require("@codemirror/view"),Jv=require("obsidian");var ske=require("@codemirror/language"),wU=require("@codemirror/view");var nke=t=>!(!t.startsWith("./")&&!t.startsWith("../"))||t.indexOf(":")===-1;var bU=require("@codemirror/view"),xU=require("obsidian");var ike=require("obsidian");var Qv=class extends ike.MarkdownRenderChild{containerEl;onEditClick;service;helper;constructor(e,r,n){super(e),this.containerEl=e,this.onEditClick=n,e.addClasses(["mx","custom","mx-media-embed"]),this.service=new Ol(r),this.helper=this.service.helper,this.register(this.helper.registerAspectRatioUpdater(e)),this.register(this.helper.registerViewTypeUpdater(e)),this.register(()=>this.service[Symbol.dispose]())}async setSource(e){this.service.loadUrl(e)}#e=null;render(){this.#e=this.helper.render(this.containerEl,{isEmbed:!0,checkInEditor:()=>this.containerEl.matches(".cm-editor *"),onEditClick:this.onEditClick})}onload(){super.onload(),this.render()}onunload(){this.#e?.[Symbol.dispose](),super.onunload()}};var vU=class extends Qv{constructor(e,r,n){super(e,r,n),e.addClasses(["mx-external-media-embed"])}},u_=class t extends bU.WidgetType{constructor(r,n,i){super();this.message=r;this.start=n;this.end=i}toDOM(r){let n=document.createElement("div");return this.hookClickHandler(r,n),n.className="external-embed mx-external-media-embed mx-invalid-notice",n.createEl("p",{text:this.message}),n}eq(r){return r instanceof t&&r.message===this.message}updateDOM(r){return r.textContent!==this.message?(r.empty(),r.createEl("p",{text:this.message}),!0):!1}hookClickHandler(r,n){n.addEventListener("click",i=>{i.defaultPrevented||(this.selectElement(r,n),i.preventDefault())})}selectElement(r,n){let i=n.playerInfo,{start:s}=i??this,{end:a}=i??this;try{if(s<0||a<0){let o=r.posAtDOM(n);r.dispatch({selection:{head:o,anchor:o}}),r.focus()}else xU.Platform.isMobile&&(a=s),r.dispatch({selection:{head:s,anchor:a}}),r.focus()}catch{}}},dC=class extends bU.WidgetType{constructor(r,n,i,s,a){super();this.deps=r;this.media=n;this.title=i;this.start=s;this.end=a}setPos(r){let n=r.playerInfo;n&&(n.start=this.start,n.end=this.end)}selectElement(r,n){let i=n.playerInfo,{start:s}=i??this,{end:a}=i??this;try{if(s<0||a<0){let o=r.posAtDOM(n);r.dispatch({selection:{head:o,anchor:o}}),r.focus()}else xU.Platform.isMobile&&(a=s),r.dispatch({selection:{head:s,anchor:a}}),r.focus()}catch{}}resizeWidget(r,n){window.ResizeObserver&&new window.ResizeObserver(()=>r.requestMeasure()).observe(n,{box:"border-box"})}setInfo(r,n){r.playerInfo={title:this.title,start:this.start,end:this.end,child:n,url:this.media}}updateDOM(r){let n=r.playerInfo;if(!n)return!1;let{title:i}=n;return da(n.url.info,this.media.info)?this.title!==i&&(n.title=this.title,this.applyTitle(r),this.setPos(r)):n.child.setSource(this.media),!0}destroy(r){let n=r.playerInfo;n&&(r.playerInfo=void 0,n.child.unload())}eq(r){return da(this.media.info,r.media.info)&&this.title===r.title}setDOM(r,n){n.tabIndex=-1,this.applyTitle(n);let i=new vU(n,this.deps,()=>{this.selectElement(r,n)});i.setSource(this.media),i.load(),this.setInfo(n,i),this.resizeWidget(r,n)}applyTitle(r){let{size:n,title:i}=l_(this.title);Xv(r,n),c_(r,i)}toDOM(r){let n=createDiv();return n.style.display="none",n.setAttr("src",this.media.info.url.toString()),n.addClasses(["external-embed","cm-embed-block","mx-media-embed"]),n.style.removeProperty("display"),this.setDOM(r,n),n}};Object.defineProperty(dC.prototype,"estimatedHeight",{get:()=>100,enumerable:!1,configurable:!0});var wet=(t,e,r,n,i)=>{let{linkHandler:s,fileService:a,mediaParser:o}=t.deps.cradle,{settings:l}=t,c=e.doc,u=null;(0,ske.syntaxTree)(e).iterate({from:n,to:i,enter:({type:f,from:p,to:h})=>{let m=VV(f);if(m.size===0)return;if(m.has("image-marker")){u={imgMarkLoc:p};return}if(!u)return;if(m.has("image-alt-text")&&!m.has("formatting")){u.alt=c.sliceString(p,h);return}if(m.has("url")&&!m.has("formatting")){u.url=c.sliceString(p,h);return}if(!(m.has("formatting")&&u.url))return;let{imgMarkLoc:v,alt:b,url:y}=u;if(u=null,nke(y))return;let x=o.parseUrl(y);if(!x)return;let w=new dC(t.deps,x,b??"",v,h);if(s.shouldHandleEmbedLogic(x,l)){if(x.info.type==="url:direct"&&Bt(x.info.url)){let C=a.safeResolveFileUri(x.info.url);C.success||(w=new u_(C.code==="in-vault"?"For media file in vault, please use internal embed instead of file url embed":C.message,v,h))}d(w,v,h)}}});function d(f,p,h){let{from:v,text:b}=c.lineAt(p);b.substring(0,p-v).trim()===""&&b.substring(h-v).trim()===""?r.push(wU.Decoration.widget({widget:f,block:!0,side:-1}).range(v)):r.push(wU.Decoration.widget({widget:f,side:-1}).range(p))}},kU=wet;var ket=(t,e)=>d_(t,e[0])||d_(t,e[1]),d_=(t,e)=>t[0]<e&&t[1]>e,Cet=(t,e)=>{let r=d_(t,e[0])?t[0]:e[0],n=d_(t,e[1])?t[1]:e[1];return[r,n]};function SU(t){return t.sort((e,r)=>e[0]-r[0]).reduce((e,r)=>{let n=e.findIndex(i=>ket(i,r));return n!==-1?e[n]=Cet(e[n],r):e.push(r),e},[])}var Tet=t=>{let e=r=>{if(!r.field(Jv.editorLivePreviewField))return Zv.Decoration.none;let n=[];return kU(t,r,n),Zv.Decoration.set(n)};return ake.StateField.define({create:e,update:(r,n)=>{let i=r,s=n.startState.field(Jv.editorLivePreviewField),a=n.state.field(Jv.editorLivePreviewField);if(s!==a)return e(n.state);if(!a)return Zv.Decoration.none;if(!n.docChanged)return i;if(n.state.field(Jv.editorEditorField).composing)return i.map(n.changes);i=i.map(n.changes);let o=[];n.changes.iterChangedRanges((c,u,d,f)=>{o.push([n.state.doc.lineAt(d).number,n.state.doc.lineAt(f).number])});let l=[];for(let[c,u]of SU(o)){let{from:d}=n.state.doc.line(c),{to:f}=n.state.doc.line(u);i=i.update({filterFrom:d,filterTo:f,filter:()=>!1}),kU(t,n.state,l,d,f)}return i.update({add:l,sort:!0})},provide:r=>Zv.EditorView.decorations.from(r)})},oke=Tet;function CU(t){var o=[];try{let{plugin:e,settings:r}=t.cradle;let n=[];e.registerEditorExtension(n);let i=d=>{n.length=0,n.push(oke({deps:t,settings:d}))};r.loaded.then(i);let s=J(o,new DisposableStack);s.use(r.subscribe("link.handle-direct-url",(d,f,p)=>{i(p)}));s.use(r.subscribe("link.handle-hosted",(d,f,p)=>{i(p)}));let a=s.move();e.register(()=>a.dispose());Iet(e)}catch(l){var c=l,u=!0}finally{ee(o,c,u)}}var Eet=["cm-line","cm-content"],lke="mxError";function cke(t){if(!t.parentElement)return!1;let e=t.parentElement;return Eet.some(r=>e.classList.contains(r))}function uke(){cke(this)&&(this.dataset[lke]="",this.removeEventListener("load",dke))}function dke(){cke(this)&&(delete this.dataset[lke],this.removeEventListener("error",uke))}function Iet(t){t.register(pr(window,{createEl:e=>function(){let r=e.apply(this,arguments);return r instanceof HTMLImageElement&&(r.addEventListener("error",uke,{once:!0}),r.addEventListener("load",dke,{once:!0})),r}}))}var fke=require("obsidian");var f_=class extends fke.Component{containerEl;info;file;subpath;service;helper;constructor(e,r,n,i){super(),this.file=r,this.subpath=n,this.info=e,this.containerEl=e.containerEl;let{containerEl:s}=e;s.addClasses(["mx","mx-media-embed","custom"]),this.service=new Ol(i),this.helper=this.service.helper,this.register(this.#t()),this.register(this.helper.registerAspectRatioUpdater(s)),this.register(this.helper.registerViewTypeUpdater(s)),this.register(()=>this.service[Symbol.dispose]())}#e=null;#t(){let{containerEl:e}=this.info,r=i=>{let s=Number.parseFloat(i.getAttribute("width")||"-1"),a=Number.parseFloat(i.getAttribute("height")||"-1");Xv(i,[s,a])};r(e);let n=new MutationObserver(i=>{for(let s of i)r(s.target)});return n.observe(e,{attributes:!0,attributeFilter:["width","height"]}),()=>n.disconnect()}render(){this.#e=this.helper.render(this.containerEl,{isEmbed:!0})}onload(){super.onload(),this.render()}async loadFile(){this.service.loadFile(this.file,this.subpath)}onunload(){this.#e?.[Symbol.dispose](),super.onunload()}};function EU(t){Aet(t.cradle.plugin,(e,r,n)=>new f_(e,r,n,t)),Pet(t),CU(t)}function Aet(t,e){let{app:r}=t,n=a(Ja),i=s(Ja,e);t.register(()=>{i(),n()}),E6(r.workspace),t.register(()=>{E6(r.workspace)});function s(o,l){return r.embedRegistry.registerExtensions(o,l),()=>{r.embedRegistry.unregisterExtensions(o)}}function a(o){let l=o.map(c=>r.embedRegistry.embedByExtension[c]);return r.embedRegistry.unregisterExtensions(o),()=>{o.forEach((c,u)=>{let d=l[u];d&&r.embedRegistry.registerExtension(c,d)})}}}var TU=class extends Qv{info;constructor(e,r,n){super(r,n),this.info=e,r.addClasses(["mx-external-media-embed"])}onload(){this.setSource(this.info),super.onload()}};async function Pet(t){let{plugin:e,linkHandler:r,settings:n,mediaParser:i}=t.cradle;await n.loaded,e.registerMarkdownPostProcessor((s,a)=>{for(let l of s.querySelectorAll("img")){let c=Ret(l);c&&o(c,l)}function o(l,c){let u=i.parseUrl(l.url);if(!u||!n.value||!r.shouldHandleEmbedLogic(u,n.value))return;let d=createDiv({cls:["media-embed","external-embed","is-loaded"],attr:{src:u.info.url.href}});Xv(d,l.size),c_(d,l.title),c.replaceWith(d);let f=new TU(u,d,t);a.addChild(f)}},-10)}function Ret(t){let e=t.alt,r=t.src;return r?{url:r,...l_(e)}:null}function IU(t,e,r,n){let{app:{viewRegistry:i}}=t;t.registerView(e,r),t.register(s(n)),t.registerExtensions(n,e);function s(a){let o=a.map(l=>({ext:l,type:i.typeByExtension[l]}));return i.unregisterExtensions(a),()=>{Map.groupBy(o,l=>l.type).forEach((l,c)=>{c&&i.registerExtensions(l.map(u=>u.ext),c)})}}}function pke(t){let{plugin:e}=t.cradle;IU(e,Yo,r=>new hf(r,t),Ja),e.registerView(bs,r=>new mf(r,t)),EU(t)}var hke=require("obsidian");function mke({trackInfoParser:t,transcriptLoader:e,template:r,app:n}){return n.workspace.on("editor-paste",(i,s,a)=>{let o=i.clipboardData?.getData("text/html");if(!o||!o.includes('name="mx:track-src"'))return;let l=new DOMParser().parseFromString(o,"text/html"),c=l.querySelector('meta[name="mx:track-src"][content]');if(!c)return;let u=c.getAttribute("content");if(!u)return;let d=t.parseTextTrackInfo(u,{sourcePath:""});if(!d)return;i.preventDefault();let f=(0,hke.htmlToMarkdown)(l).trim().replace(/\n+/g," ");(async()=>{let[p]=await e.getLinkedMedia(d);if(!p)throw new Error("No linked media found for track");let h=l.querySelector('[data-part="cue"][data-start]'),m=h?.getAttribute("data-start"),b=h?.querySelector('[data-part="timestamp"][data-time]')?.getAttribute("data-time")||m;if(!b)throw new Error("No timestamp found for track");let y=Nn.parse(b),x=r.renderTimestampLink({currentTime:y.getTimestamp(),src:p},{sourcePath:a.file?.path??""});s.replaceSelection(`${x} ${f}`)})().catch(p=>{console.error("Error pasting track",p),s.replaceSelection(f)})})}function gke(t){let{plugin:e}=t.cradle;e.registerView(h0,r=>new wh(r,t)),e.registerView(Mm,r=>new kh(r,t)),e.registerExtensions(QT,h0),e.registerEvent(mke(t.cradle))}var p_=class extends yke.Plugin{container=null;loaded=!1;onload(){super.onload(),dm(this).then(()=>sleep(500)).then(()=>{this.loaded=!0}),vT();let e=J1e(this);this.container=e,XY(this),pke(e),gke(e),vxe(e),this.addSettingTab(e.cradle.settingTab),eke(e.cradle),JY(this.app,[{callback:()=>e.cradle.mediaSwitcherModal.open(),title:"Open external media"}]).then(r=>{r&&this.register(r)}),console.log("Hello from Media Extended")}async accessToken(){return(await un.auth.getSession()).data.session?.access_token}};
/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*!
* Ported and modified from: https://github.com/microsoft/TypeScript-Website/blob/v2/packages/documentation/copy/en/handbook-v1/Unions%20and%20Intersections.md#union-exhaustiveness-checking
* licensed as:
*
* The MIT License (MIT)
* Copyright (c) Microsoft Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*! Bundled license information:
react/cjs/react-jsx-runtime.production.js:
(**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react/cjs/react.production.js:
(**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-dom/cjs/react-dom.production.js:
(**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
scheduler/cjs/scheduler.production.js:
(**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-dom/cjs/react-dom-client.production.js:
(**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
@noble/hashes/utils.js:
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
@jsr/std__assert/unstable_never.js:
(*!
* Ported and modified from: https://github.com/microsoft/TypeScript-Website/blob/v2/packages/documentation/copy/en/handbook-v1/Unions%20and%20Intersections.md#union-exhaustiveness-checking
* licensed as:
*
* The MIT License (MIT)
* Copyright (c) Microsoft Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*)
lucide-react/dist/esm/shared/src/utils.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/defaultAttributes.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/Icon.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/createLucideIcon.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/arrow-down.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/arrow-up-right.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/arrow-up.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/audio-waveform.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/blocks.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/book.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/bug.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/camera.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/captions-off.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/captions.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/check.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/chevron-down.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/circle-alert.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/circle-check-big.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/circle-x.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/clock.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/copy.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/download.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/external-link.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/eye-off.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/eye.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/file-plus.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/file-text.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/folder-open.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/gauge.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/globe.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/hash.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/image.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/info.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/languages.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/link.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/loader-circle.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/lock.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/maximize.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/mic.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/minimize.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/music.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/pause.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/pen.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/picture-in-picture-2.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/picture-in-picture.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/pin.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/play.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/plus.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/redo.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/refresh-ccw.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/repeat.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/rocket.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/rotate-ccw.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/save.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/scissors.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/search.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/settings.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/sparkles.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/square-pen.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/square-scissors.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/star.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/test-tube.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/text.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/trash-2.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/undo-2.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/undo.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/upload.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/user.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/video.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/volume-1.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/volume-2.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/volume-x.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/x.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/icons/zap.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
lucide-react/dist/esm/lucide-react.js:
(**
* @license lucide-react v0.475.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*)
mediabunny/dist/modules/src/misc.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/tags.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/codec.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/codec-data.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/demuxer.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/custom-coder.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/packet.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/media-sink.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/input-track.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/isobmff/isobmff-misc.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/isobmff/isobmff-reader.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/isobmff/isobmff-demuxer.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/matroska/ebml.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/matroska/matroska-misc.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/matroska/matroska-demuxer.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/shared/mp3-misc.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/id3.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/mp3/mp3-reader.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/mp3/mp3-demuxer.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/ogg/ogg-misc.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/ogg/ogg-reader.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/ogg/ogg-demuxer.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/wave/wave-demuxer.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/adts/adts-reader.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/adts/adts-demuxer.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/flac/flac-misc.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/flac/flac-demuxer.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/input-format.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/source.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/input.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/reader.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
mediabunny/dist/modules/src/index.js:
(*!
* Copyright (c) 2025-present, Vanilagy and contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*)
*/
/* nosourcemap */