All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 3m42s
1166 lines
2.0 MiB
1166 lines
2.0 MiB
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
*/
|
|
|
|
"use strict";var xke=Object.create;var gC=Object.defineProperty;var wke=Object.getOwnPropertyDescriptor;var kke=Object.getOwnPropertyNames;var Ske=Object.getPrototypeOf,Cke=Object.prototype.hasOwnProperty;var AU=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),PU=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)gC(t,r,{get:e[r],enumerable:!0})},RU=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kke(e))!Cke.call(t,i)&&i!==r&&gC(t,i,{get:()=>e[i],enumerable:!(n=wke(e,i))||n.enumerable});return t};var Z=(t,e,r)=>(r=t!=null?xke(Ske(t)):{},RU(e||!t||!t.__esModule?gC(r,"default",{value:t,enumerable:!0}):r,t)),LU=t=>RU(gC({},"__esModule",{value:!0}),t);var J=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&PU("Object expected");var n,i;r&&(n=e[AU("asyncDispose")]),n===void 0&&(n=e[AU("dispose")],r&&(i=n)),typeof n!="function"&&PU("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((y_,MU)=>{"use strict";var nb=function(t){return t&&t.Math===Math&&t};MU.exports=nb(typeof globalThis=="object"&&globalThis)||nb(typeof window=="object"&&window)||nb(typeof self=="object"&&self)||nb(typeof global=="object"&&global)||nb(typeof y_=="object"&&y_)||function(){return this}()||Function("return this")()});var di=L((_et,_U)=>{"use strict";_U.exports=function(t){try{return!!t()}catch{return!0}}});var ms=L((Oet,OU)=>{"use strict";var Tke=di();OU.exports=!Tke(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var ib=L((Det,DU)=>{"use strict";var Eke=di();DU.exports=!Eke(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")})});var Ni=L((Net,NU)=>{"use strict";var Ike=ib(),yC=Function.prototype.call;NU.exports=Ike?yC.bind(yC):function(){return yC.apply(yC,arguments)}});var jU=L(VU=>{"use strict";var FU={}.propertyIsEnumerable,BU=Object.getOwnPropertyDescriptor,Ake=BU&&!FU.call({1:2},1);VU.f=Ake?function(e){var r=BU(this,e);return!!r&&r.enumerable}:FU});var sb=L((Bet,$U)=>{"use strict";$U.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}});var cn=L((Vet,qU)=>{"use strict";var UU=ib(),zU=Function.prototype,v_=zU.call,Pke=UU&&zU.bind.bind(v_,v_);qU.exports=UU?Pke:function(t){return function(){return v_.apply(t,arguments)}}});var ab=L((jet,GU)=>{"use strict";var HU=cn(),Rke=HU({}.toString),Lke=HU("".slice);GU.exports=function(t){return Lke(Rke(t),8,-1)}});var KU=L(($et,WU)=>{"use strict";var Mke=cn(),_ke=di(),Oke=ab(),b_=Object,Dke=Mke("".split);WU.exports=_ke(function(){return!b_("z").propertyIsEnumerable(0)})?function(t){return Oke(t)==="String"?Dke(t,""):b_(t)}:b_});var qh=L((Uet,YU)=>{"use strict";YU.exports=function(t){return t==null}});var Hh=L((zet,XU)=>{"use strict";var Nke=qh(),Fke=TypeError;XU.exports=function(t){if(Nke(t))throw new Fke("Can't call method on "+t);return t}});var ob=L((qet,QU)=>{"use strict";var Bke=KU(),Vke=Hh();QU.exports=function(t){return Bke(Vke(t))}});var Pr=L((Het,ZU)=>{"use strict";var x_=typeof document=="object"&&document.all;ZU.exports=typeof x_>"u"&&x_!==void 0?function(t){return typeof t=="function"||t===x_}:function(t){return typeof t=="function"}});var Ha=L((Get,JU)=>{"use strict";var jke=Pr();JU.exports=function(t){return typeof t=="object"?t!==null:jke(t)}});var Js=L((Wet,ez)=>{"use strict";var w_=ar(),$ke=Pr(),Uke=function(t){return $ke(t)?t:void 0};ez.exports=function(t,e){return arguments.length<2?Uke(w_[t]):w_[t]&&w_[t][e]}});var lb=L((Ket,tz)=>{"use strict";var zke=cn();tz.exports=zke({}.isPrototypeOf)});var Gh=L((Yet,iz)=>{"use strict";var qke=ar(),rz=qke.navigator,nz=rz&&rz.userAgent;iz.exports=nz?String(nz):""});var bC=L((Xet,uz)=>{"use strict";var cz=ar(),k_=Gh(),sz=cz.process,az=cz.Deno,oz=sz&&sz.versions||az&&az.version,lz=oz&&oz.v8,Ga,vC;lz&&(Ga=lz.split("."),vC=Ga[0]>0&&Ga[0]<4?1:+(Ga[0]+Ga[1]));!vC&&k_&&(Ga=k_.match(/Edge\/(\d+)/),(!Ga||Ga[1]>=74)&&(Ga=k_.match(/Chrome\/(\d+)/),Ga&&(vC=+Ga[1])));uz.exports=vC});var S_=L((Qet,fz)=>{"use strict";var dz=bC(),Hke=di(),Gke=ar(),Wke=Gke.String;fz.exports=!!Object.getOwnPropertySymbols&&!Hke(function(){var t=Symbol("symbol detection");return!Wke(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&dz&&dz<41})});var C_=L((Zet,pz)=>{"use strict";var Kke=S_();pz.exports=Kke&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var T_=L((Jet,hz)=>{"use strict";var Yke=Js(),Xke=Pr(),Qke=lb(),Zke=C_(),Jke=Object;hz.exports=Zke?function(t){return typeof t=="symbol"}:function(t){var e=Yke("Symbol");return Xke(e)&&Qke(e.prototype,Jke(t))}});var cb=L((ett,mz)=>{"use strict";var eSe=String;mz.exports=function(t){try{return eSe(t)}catch{return"Object"}}});var ea=L((ttt,gz)=>{"use strict";var tSe=Pr(),rSe=cb(),nSe=TypeError;gz.exports=function(t){if(tSe(t))return t;throw new nSe(rSe(t)+" is not a function")}});var Cf=L((rtt,yz)=>{"use strict";var iSe=ea(),sSe=qh();yz.exports=function(t,e){var r=t[e];return sSe(r)?void 0:iSe(r)}});var bz=L((ntt,vz)=>{"use strict";var E_=Ni(),I_=Pr(),A_=Ha(),aSe=TypeError;vz.exports=function(t,e){var r,n;if(e==="string"&&I_(r=t.toString)&&!A_(n=E_(r,t))||I_(r=t.valueOf)&&!A_(n=E_(r,t))||e!=="string"&&I_(r=t.toString)&&!A_(n=E_(r,t)))return n;throw new aSe("Can't convert object to primitive value")}});var Vl=L((itt,xz)=>{"use strict";xz.exports=!1});var xC=L((stt,kz)=>{"use strict";var wz=ar(),oSe=Object.defineProperty;kz.exports=function(t,e){try{oSe(wz,t,{value:e,configurable:!0,writable:!0})}catch{wz[t]=e}return e}});var ub=L((att,Tz)=>{"use strict";var lSe=Vl(),cSe=ar(),uSe=xC(),Sz="__core-js_shared__",Cz=Tz.exports=cSe[Sz]||uSe(Sz,{});(Cz.versions||(Cz.versions=[])).push({version:"3.41.0",mode:lSe?"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 P_=L((ott,Iz)=>{"use strict";var Ez=ub();Iz.exports=function(t,e){return Ez[t]||(Ez[t]=e||{})}});var R_=L((ltt,Az)=>{"use strict";var dSe=Hh(),fSe=Object;Az.exports=function(t){return fSe(dSe(t))}});var fi=L((ctt,Pz)=>{"use strict";var pSe=cn(),hSe=R_(),mSe=pSe({}.hasOwnProperty);Pz.exports=Object.hasOwn||function(e,r){return mSe(hSe(e),r)}});var L_=L((utt,Rz)=>{"use strict";var gSe=cn(),ySe=0,vSe=Math.random(),bSe=gSe(1 .toString);Rz.exports=function(t){return"Symbol("+(t===void 0?"":t)+")_"+bSe(++ySe+vSe,36)}});var Br=L((dtt,Mz)=>{"use strict";var xSe=ar(),wSe=P_(),Lz=fi(),kSe=L_(),SSe=S_(),CSe=C_(),Wh=xSe.Symbol,M_=wSe("wks"),TSe=CSe?Wh.for||Wh:Wh&&Wh.withoutSetter||kSe;Mz.exports=function(t){return Lz(M_,t)||(M_[t]=SSe&&Lz(Wh,t)?Wh[t]:TSe("Symbol."+t)),M_[t]}});var Nz=L((ftt,Dz)=>{"use strict";var ESe=Ni(),_z=Ha(),Oz=T_(),ISe=Cf(),ASe=bz(),PSe=Br(),RSe=TypeError,LSe=PSe("toPrimitive");Dz.exports=function(t,e){if(!_z(t)||Oz(t))return t;var r=ISe(t,LSe),n;if(r){if(e===void 0&&(e="default"),n=ESe(r,t,e),!_z(n)||Oz(n))return n;throw new RSe("Can't convert object to primitive value")}return e===void 0&&(e="number"),ASe(t,e)}});var __=L((ptt,Fz)=>{"use strict";var MSe=Nz(),_Se=T_();Fz.exports=function(t){var e=MSe(t,"string");return _Se(e)?e:e+""}});var wC=L((htt,Vz)=>{"use strict";var OSe=ar(),Bz=Ha(),O_=OSe.document,DSe=Bz(O_)&&Bz(O_.createElement);Vz.exports=function(t){return DSe?O_.createElement(t):{}}});var D_=L((mtt,jz)=>{"use strict";var NSe=ms(),FSe=di(),BSe=wC();jz.exports=!NSe&&!FSe(function(){return Object.defineProperty(BSe("div"),"a",{get:function(){return 7}}).a!==7})});var db=L(Uz=>{"use strict";var VSe=ms(),jSe=Ni(),$Se=jU(),USe=sb(),zSe=ob(),qSe=__(),HSe=fi(),GSe=D_(),$z=Object.getOwnPropertyDescriptor;Uz.f=VSe?$z:function(e,r){if(e=zSe(e),r=qSe(r),GSe)try{return $z(e,r)}catch{}if(HSe(e,r))return USe(!jSe($Se.f,e,r),e[r])}});var N_=L((ytt,zz)=>{"use strict";var WSe=ms(),KSe=di();zz.exports=WSe&&KSe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Wa=L((vtt,qz)=>{"use strict";var YSe=Ha(),XSe=String,QSe=TypeError;qz.exports=function(t){if(YSe(t))return t;throw new QSe(XSe(t)+" is not an object")}});var zo=L(Gz=>{"use strict";var ZSe=ms(),JSe=D_(),eCe=N_(),kC=Wa(),Hz=__(),tCe=TypeError,F_=Object.defineProperty,rCe=Object.getOwnPropertyDescriptor,B_="enumerable",V_="configurable",j_="writable";Gz.f=ZSe?eCe?function(e,r,n){if(kC(e),r=Hz(r),kC(n),typeof e=="function"&&r==="prototype"&&"value"in n&&j_ in n&&!n[j_]){var i=rCe(e,r);i&&i[j_]&&(e[r]=n.value,n={configurable:V_ in n?n[V_]:i[V_],enumerable:B_ in n?n[B_]:i[B_],writable:!1})}return F_(e,r,n)}:F_:function(e,r,n){if(kC(e),r=Hz(r),kC(n),JSe)try{return F_(e,r,n)}catch{}if("get"in n||"set"in n)throw new tCe("Accessors not supported");return"value"in n&&(e[r]=n.value),e}});var fb=L((xtt,Wz)=>{"use strict";var nCe=ms(),iCe=zo(),sCe=sb();Wz.exports=nCe?function(t,e,r){return iCe.f(t,e,sCe(1,r))}:function(t,e,r){return t[e]=r,t}});var Xz=L((wtt,Yz)=>{"use strict";var $_=ms(),aCe=fi(),Kz=Function.prototype,oCe=$_&&Object.getOwnPropertyDescriptor,U_=aCe(Kz,"name"),lCe=U_&&function(){}.name==="something",cCe=U_&&(!$_||$_&&oCe(Kz,"name").configurable);Yz.exports={EXISTS:U_,PROPER:lCe,CONFIGURABLE:cCe}});var SC=L((ktt,Qz)=>{"use strict";var uCe=cn(),dCe=Pr(),z_=ub(),fCe=uCe(Function.toString);dCe(z_.inspectSource)||(z_.inspectSource=function(t){return fCe(t)});Qz.exports=z_.inspectSource});var eq=L((Stt,Jz)=>{"use strict";var pCe=ar(),hCe=Pr(),Zz=pCe.WeakMap;Jz.exports=hCe(Zz)&&/native code/.test(String(Zz))});var CC=L((Ctt,rq)=>{"use strict";var mCe=P_(),gCe=L_(),tq=mCe("keys");rq.exports=function(t){return tq[t]||(tq[t]=gCe(t))}});var TC=L((Ttt,nq)=>{"use strict";nq.exports={}});var hb=L((Ett,aq)=>{"use strict";var yCe=eq(),sq=ar(),vCe=Ha(),bCe=fb(),q_=fi(),H_=ub(),xCe=CC(),wCe=TC(),iq="Object already initialized",G_=sq.TypeError,kCe=sq.WeakMap,EC,pb,IC,SCe=function(t){return IC(t)?pb(t):EC(t,{})},CCe=function(t){return function(e){var r;if(!vCe(e)||(r=pb(e)).type!==t)throw new G_("Incompatible receiver, "+t+" required");return r}};yCe||H_.state?(Ka=H_.state||(H_.state=new kCe),Ka.get=Ka.get,Ka.has=Ka.has,Ka.set=Ka.set,EC=function(t,e){if(Ka.has(t))throw new G_(iq);return e.facade=t,Ka.set(t,e),e},pb=function(t){return Ka.get(t)||{}},IC=function(t){return Ka.has(t)}):(Tf=xCe("state"),wCe[Tf]=!0,EC=function(t,e){if(q_(t,Tf))throw new G_(iq);return e.facade=t,bCe(t,Tf,e),e},pb=function(t){return q_(t,Tf)?t[Tf]:{}},IC=function(t){return q_(t,Tf)});var Ka,Tf;aq.exports={set:EC,get:pb,has:IC,enforce:SCe,getterFor:CCe}});var Y_=L((Itt,cq)=>{"use strict";var K_=cn(),TCe=di(),ECe=Pr(),AC=fi(),W_=ms(),ICe=Xz().CONFIGURABLE,ACe=SC(),lq=hb(),PCe=lq.enforce,RCe=lq.get,oq=String,PC=Object.defineProperty,LCe=K_("".slice),MCe=K_("".replace),_Ce=K_([].join),OCe=W_&&!TCe(function(){return PC(function(){},"length",{value:8}).length!==8}),DCe=String(String).split("String"),NCe=cq.exports=function(t,e,r){LCe(oq(e),0,7)==="Symbol("&&(e="["+MCe(oq(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!AC(t,"name")||ICe&&t.name!==e)&&(W_?PC(t,"name",{value:e,configurable:!0}):t.name=e),OCe&&r&&AC(r,"arity")&&t.length!==r.arity&&PC(t,"length",{value:r.arity});try{r&&AC(r,"constructor")&&r.constructor?W_&&PC(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=PCe(t);return AC(n,"source")||(n.source=_Ce(DCe,typeof e=="string"?e:"")),t};Function.prototype.toString=NCe(function(){return ECe(this)&&RCe(this).source||ACe(this)},"toString")});var Ya=L((Att,uq)=>{"use strict";var FCe=Pr(),BCe=zo(),VCe=Y_(),jCe=xC();uq.exports=function(t,e,r,n){n||(n={});var i=n.enumerable,s=n.name!==void 0?n.name:e;if(FCe(r)&&VCe(r,s,n),n.global)i?t[e]=r:jCe(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:BCe.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t}});var fq=L((Ptt,dq)=>{"use strict";var $Ce=Math.ceil,UCe=Math.floor;dq.exports=Math.trunc||function(e){var r=+e;return(r>0?UCe:$Ce)(r)}});var RC=L((Rtt,pq)=>{"use strict";var zCe=fq();pq.exports=function(t){var e=+t;return e!==e||e===0?0:zCe(e)}});var mq=L((Ltt,hq)=>{"use strict";var qCe=RC(),HCe=Math.max,GCe=Math.min;hq.exports=function(t,e){var r=qCe(t);return r<0?HCe(r+e,0):GCe(r,e)}});var X_=L((Mtt,gq)=>{"use strict";var WCe=RC(),KCe=Math.min;gq.exports=function(t){var e=WCe(t);return e>0?KCe(e,9007199254740991):0}});var Q_=L((_tt,yq)=>{"use strict";var YCe=X_();yq.exports=function(t){return YCe(t.length)}});var xq=L((Ott,bq)=>{"use strict";var XCe=ob(),QCe=mq(),ZCe=Q_(),vq=function(t){return function(e,r,n){var i=XCe(e),s=ZCe(i);if(s===0)return!t&&-1;var a=QCe(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}};bq.exports={includes:vq(!0),indexOf:vq(!1)}});var J_=L((Dtt,kq)=>{"use strict";var JCe=cn(),Z_=fi(),eTe=ob(),tTe=xq().indexOf,rTe=TC(),wq=JCe([].push);kq.exports=function(t,e){var r=eTe(t),n=0,i=[],s;for(s in r)!Z_(rTe,s)&&Z_(r,s)&&wq(i,s);for(;e.length>n;)Z_(r,s=e[n++])&&(~tTe(i,s)||wq(i,s));return i}});var LC=L((Ntt,Sq)=>{"use strict";Sq.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Tq=L(Cq=>{"use strict";var nTe=J_(),iTe=LC(),sTe=iTe.concat("length","prototype");Cq.f=Object.getOwnPropertyNames||function(e){return nTe(e,sTe)}});var Iq=L(Eq=>{"use strict";Eq.f=Object.getOwnPropertySymbols});var Pq=L((Vtt,Aq)=>{"use strict";var aTe=Js(),oTe=cn(),lTe=Tq(),cTe=Iq(),uTe=Wa(),dTe=oTe([].concat);Aq.exports=aTe("Reflect","ownKeys")||function(e){var r=lTe.f(uTe(e)),n=cTe.f;return n?dTe(r,n(e)):r}});var eO=L((jtt,Lq)=>{"use strict";var Rq=fi(),fTe=Pq(),pTe=db(),hTe=zo();Lq.exports=function(t,e,r){for(var n=fTe(e),i=hTe.f,s=pTe.f,a=0;a<n.length;a++){var o=n[a];!Rq(t,o)&&!(r&&Rq(r,o))&&i(t,o,s(e,o))}}});var tO=L(($tt,Mq)=>{"use strict";var mTe=di(),gTe=Pr(),yTe=/#|\.prototype\./,mb=function(t,e){var r=bTe[vTe(t)];return r===wTe?!0:r===xTe?!1:gTe(e)?mTe(e):!!e},vTe=mb.normalize=function(t){return String(t).replace(yTe,".").toLowerCase()},bTe=mb.data={},xTe=mb.NATIVE="N",wTe=mb.POLYFILL="P";Mq.exports=mb});var ta=L((Utt,_q)=>{"use strict";var MC=ar(),kTe=db().f,STe=fb(),CTe=Ya(),TTe=xC(),ETe=eO(),ITe=tO();_q.exports=function(t,e){var r=t.target,n=t.global,i=t.stat,s,a,o,l,c,u;if(n?a=MC:i?a=MC[r]||TTe(r,{}):a=MC[r]&&MC[r].prototype,a)for(o in e){if(c=e[o],t.dontCallGetSet?(u=kTe(a,o),l=u&&u.value):l=a[o],s=ITe(n?o:r+(i?".":"#")+o,t.forced),!s&&l!==void 0){if(typeof c==typeof l)continue;ETe(c,l)}(t.sham||l&&l.sham)&&STe(c,"sham",!0),CTe(a,o,c,t)}}});var Dq=L((ztt,Oq)=>{"use strict";var ATe=di();Oq.exports=!ATe(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})});var _C=L((qtt,Fq)=>{"use strict";var PTe=fi(),RTe=Pr(),LTe=R_(),MTe=CC(),_Te=Dq(),Nq=MTe("IE_PROTO"),rO=Object,OTe=rO.prototype;Fq.exports=_Te?rO.getPrototypeOf:function(t){var e=LTe(t);if(PTe(e,Nq))return e[Nq];var r=e.constructor;return RTe(r)&&e instanceof r?r.prototype:e instanceof rO?OTe:null}});var Vq=L((Htt,Bq)=>{"use strict";var DTe=cn(),NTe=ea();Bq.exports=function(t,e,r){try{return DTe(NTe(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}}});var $q=L((Gtt,jq)=>{"use strict";var FTe=Ha();jq.exports=function(t){return FTe(t)||t===null}});var zq=L((Wtt,Uq)=>{"use strict";var BTe=$q(),VTe=String,jTe=TypeError;Uq.exports=function(t){if(BTe(t))return t;throw new jTe("Can't set "+VTe(t)+" as a prototype")}});var nO=L((Ktt,qq)=>{"use strict";var $Te=Vq(),UTe=Ha(),zTe=Hh(),qTe=zq();qq.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=$Te(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(i,s){return zTe(i),qTe(s),UTe(i)&&(t?r(i,s):i.__proto__=s),i}}():void 0)});var Gq=L((Ytt,Hq)=>{"use strict";var HTe=J_(),GTe=LC();Hq.exports=Object.keys||function(e){return HTe(e,GTe)}});var Kq=L(Wq=>{"use strict";var WTe=ms(),KTe=N_(),YTe=zo(),XTe=Wa(),QTe=ob(),ZTe=Gq();Wq.f=WTe&&!KTe?Object.defineProperties:function(e,r){XTe(e);for(var n=QTe(r),i=ZTe(r),s=i.length,a=0,o;s>a;)YTe.f(e,o=i[a++],n[o]);return e}});var iO=L((Qtt,Yq)=>{"use strict";var JTe=Js();Yq.exports=JTe("document","documentElement")});var NC=L((Ztt,rH)=>{"use strict";var eEe=Wa(),tEe=Kq(),Xq=LC(),rEe=TC(),nEe=iO(),iEe=wC(),sEe=CC(),Qq=">",Zq="<",aO="prototype",oO="script",eH=sEe("IE_PROTO"),sO=function(){},tH=function(t){return Zq+oO+Qq+t+Zq+"/"+oO+Qq},Jq=function(t){t.write(tH("")),t.close();var e=t.parentWindow.Object;return t=null,e},aEe=function(){var t=iEe("iframe"),e="java"+oO+":",r;return t.style.display="none",nEe.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(tH("document.F=Object")),r.close(),r.F},OC,DC=function(){try{OC=new ActiveXObject("htmlfile")}catch{}DC=typeof document<"u"?document.domain&&OC?Jq(OC):aEe():Jq(OC);for(var t=Xq.length;t--;)delete DC[aO][Xq[t]];return DC()};rEe[eH]=!0;rH.exports=Object.create||function(e,r){var n;return e!==null?(sO[aO]=eEe(e),n=new sO,sO[aO]=null,n[eH]=e):n=DC(),r===void 0?n:tEe.f(n,r)}});var aH=L((Jtt,sH)=>{"use strict";var oEe=cn(),nH=Error,lEe=oEe("".replace),cEe=function(t){return String(new nH(t).stack)}("zxcasd"),iH=/\n\s*at [^:]*:[^\n]*/,uEe=iH.test(cEe);sH.exports=function(t,e){if(uEe&&typeof t=="string"&&!nH.prepareStackTrace)for(;e--;)t=lEe(t,iH,"");return t}});var lH=L((ert,oH)=>{"use strict";var dEe=di(),fEe=sb();oH.exports=!dEe(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",fEe(1,7)),t.stack!==7):!0})});var dH=L((trt,uH)=>{"use strict";var pEe=fb(),hEe=aH(),mEe=lH(),cH=Error.captureStackTrace;uH.exports=function(t,e,r,n){mEe&&(cH?cH(t,e):pEe(t,"stack",hEe(r,n)))}});var hH=L((rrt,pH)=>{"use strict";var gEe=Br(),yEe=gEe("toStringTag"),fH={};fH[yEe]="z";pH.exports=String(fH)==="[object z]"});var BC=L((nrt,mH)=>{"use strict";var vEe=hH(),bEe=Pr(),FC=ab(),xEe=Br(),wEe=xEe("toStringTag"),kEe=Object,SEe=FC(function(){return arguments}())==="Arguments",CEe=function(t,e){try{return t[e]}catch{}};mH.exports=vEe?FC:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=CEe(e=kEe(t),wEe))=="string"?r:SEe?FC(e):(n=FC(e))==="Object"&&bEe(e.callee)?"Arguments":n}});var VC=L((irt,gH)=>{"use strict";var TEe=BC(),EEe=String;gH.exports=function(t){if(TEe(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return EEe(t)}});var vH=L((srt,yH)=>{"use strict";var IEe=VC();yH.exports=function(t,e){return t===void 0?arguments.length<2?"":e:IEe(t)}});var wH=L(()=>{"use strict";var AEe=ta(),PEe=ar(),REe=lb(),bH=_C(),$C=nO(),LEe=eO(),xH=NC(),jC=fb(),lO=sb(),MEe=dH(),_Ee=vH(),OEe=Br(),DEe=di(),NEe=Vl(),Kh=PEe.SuppressedError,FEe=OEe("toStringTag"),UC=Error,BEe=!!Kh&&Kh.length!==3,VEe=!!Kh&&DEe(function(){return new Kh(1,2,3,{cause:4}).cause===4}),zC=BEe||VEe,Ef=function(e,r,n){var i=REe(gb,this),s;return $C?s=zC&&(!i||bH(this)===gb)?new Kh:$C(new UC,i?bH(this):gb):(s=i?this:xH(gb),jC(s,FEe,"Error")),n!==void 0&&jC(s,"message",_Ee(n)),MEe(s,Ef,s.stack,1),jC(s,"error",e),jC(s,"suppressed",r),s};$C?$C(Ef,UC):LEe(Ef,UC,{name:!0});var gb=Ef.prototype=zC?Kh.prototype:xH(UC.prototype,{constructor:lO(1,Ef),message:lO(1,""),name:lO(1,"SuppressedError")});zC&&!NEe&&(gb.constructor=Ef);AEe({global:!0,constructor:!0,arity:3,forced:zC},{SuppressedError:Ef})});var qC=L((lrt,kH)=>{"use strict";var jEe=lb(),$Ee=TypeError;kH.exports=function(t,e){if(jEe(e,t))return t;throw new $Ee("Incorrect invocation")}});var cO=L((crt,SH)=>{"use strict";var UEe=Ya();SH.exports=function(t,e,r){for(var n in e)UEe(t,n,e[n],r);return t}});var HC=L((urt,TH)=>{"use strict";var CH=Y_(),zEe=zo();TH.exports=function(t,e,r){return r.get&&CH(r.get,e,{getter:!0}),r.set&&CH(r.set,e,{setter:!0}),zEe.f(t,e,r)}});var IH=L((drt,EH)=>{"use strict";var qEe=ab(),HEe=cn();EH.exports=function(t){if(qEe(t)==="Function")return HEe(t)}});var yb=L((frt,PH)=>{"use strict";var AH=IH(),GEe=ea(),WEe=ib(),KEe=AH(AH.bind);PH.exports=function(t,e){return GEe(t),e===void 0?t:WEe?KEe(t,e):function(){return t.apply(e,arguments)}}});var dO=L((prt,OH)=>{"use strict";var YEe=Js(),XEe=Ni(),QEe=cn(),ZEe=yb(),JEe=Wa(),e2e=ea(),MH=qh(),uO=Cf(),_H=Br(),t2e=_H("asyncDispose"),RH=_H("dispose"),r2e=QEe([].push),n2e=function(t,e){if(e==="async-dispose"){var r=uO(t,t2e);return r!==void 0||(r=uO(t,RH),r===void 0)?r:function(){var n=this,i=YEe("Promise");return new i(function(s){XEe(r,n),s(void 0)})}}return uO(t,RH)},LH=function(t,e,r){return arguments.length<3&&!MH(t)&&(r=e2e(n2e(JEe(t),e))),r===void 0?function(){}:ZEe(r,t)};OH.exports=function(t,e,r,n){var i;if(arguments.length<4){if(MH(e)&&r==="sync-dispose")return;i=LH(e,r)}else i=LH(void 0,r,n);r2e(t.stack,i)}});var UH=L(()=>{"use strict";var i2e=ta(),WC=ms(),BH=Js(),DH=ea(),s2e=qC(),VH=Ya(),a2e=cO(),o2e=HC(),jH=Br(),$H=hb(),fO=dO(),NH=bC(),FH=BH("Promise"),l2e=BH("SuppressedError"),c2e=ReferenceError,u2e=jH("asyncDispose"),d2e=jH("toStringTag"),YC="AsyncDisposableStack",f2e=$H.set,KC=$H.getterFor(YC),pO="async-dispose",vb="disposed",p2e="pending",GC=function(t){var e=KC(t);if(e.state===vb)throw new c2e(YC+" already disposed");return e},hO=function(){f2e(s2e(this,Yh),{type:YC,state:p2e,stack:[]}),WC||(this.disposed=!1)},Yh=hO.prototype;a2e(Yh,{disposeAsync:function(){var e=this;return new FH(function(r,n){var i=KC(e);if(i.state===vb)return r(void 0);i.state=vb,WC||(e.disposed=!0);var s=i.stack,a=s.length,o=!1,l,c=function(d){o?l=new l2e(d,l):(o=!0,l=d),u()},u=function(){if(a){var d=s[--a];s[a]=null;try{FH.resolve(d()).then(u,c)}catch(f){c(f)}}else i.stack=null,o?n(l):r(void 0)};u()})},use:function(e){return fO(GC(this),e,pO),e},adopt:function(e,r){var n=GC(this);return DH(r),fO(n,void 0,pO,function(){return r(e)}),e},defer:function(e){var r=GC(this);DH(e),fO(r,void 0,pO,e)},move:function(){var e=GC(this),r=new hO;return KC(r).stack=e.stack,e.stack=[],e.state=vb,WC||(this.disposed=!0),r}});WC&&o2e(Yh,"disposed",{configurable:!0,get:function(){return KC(this).state===vb}});VH(Yh,u2e,Yh.disposeAsync,{name:"disposeAsync"});VH(Yh,d2e,YC,{nonWritable:!0});var h2e=NH&&NH<136;i2e({global:!0,constructor:!0,forced:h2e},{AsyncDisposableStack:hO})});var QH=L((grt,XH)=>{"use strict";var WH=ar(),KH=ub(),YH=Pr(),m2e=NC(),XC=_C(),g2e=Ya(),y2e=Br(),v2e=Vl(),zH="USE_FUNCTION_CONSTRUCTOR",qH=y2e("asyncIterator"),HH=WH.AsyncIterator,GH=KH.AsyncIteratorPrototype,qo,mO;if(GH)qo=GH;else if(YH(HH))qo=HH.prototype;else if(KH[zH]||WH[zH])try{mO=XC(XC(XC(Function("return async function*(){}()")()))),XC(mO)===Object.prototype&&(qo=mO)}catch{}qo?v2e&&(qo=m2e(qo)):qo={};YH(qo[qH])||g2e(qo,qH,function(){return this});XH.exports=qo});var tG=L(()=>{"use strict";var b2e=Ni(),x2e=Ya(),w2e=Js(),k2e=Cf(),S2e=fi(),C2e=Br(),ZH=QH(),JH=C2e("asyncDispose"),eG=w2e("Promise");S2e(ZH,JH)||x2e(ZH,JH,function(){var t=this;return new eG(function(e,r){var n=k2e(t,"return");n?eG.resolve(b2e(n,t)).then(function(){e(void 0)},r):e(void 0)})})});var aG=L(()=>{"use strict";var T2e=ta(),ZC=ms(),E2e=Js(),rG=ea(),I2e=qC(),nG=Ya(),A2e=cO(),P2e=HC(),iG=Br(),sG=hb(),gO=dO(),R2e=E2e("SuppressedError"),L2e=ReferenceError,M2e=iG("dispose"),_2e=iG("toStringTag"),eT="DisposableStack",O2e=sG.set,JC=sG.getterFor(eT),yO="sync-dispose",bb="disposed",D2e="pending",QC=function(t){var e=JC(t);if(e.state===bb)throw new L2e(eT+" already disposed");return e},vO=function(){O2e(I2e(this,Xh),{type:eT,state:D2e,stack:[]}),ZC||(this.disposed=!1)},Xh=vO.prototype;A2e(Xh,{dispose:function(){var e=JC(this);if(e.state!==bb){e.state=bb,ZC||(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 R2e(o,s):(i=!0,s=o)}}if(e.stack=null,i)throw s}},use:function(e){return gO(QC(this),e,yO),e},adopt:function(e,r){var n=QC(this);return rG(r),gO(n,void 0,yO,function(){r(e)}),e},defer:function(e){var r=QC(this);rG(e),gO(r,void 0,yO,e)},move:function(){var e=QC(this),r=new vO;return JC(r).stack=e.stack,e.stack=[],e.state=bb,ZC||(this.disposed=!0),r}});ZC&&P2e(Xh,"disposed",{configurable:!0,get:function(){return JC(this).state===bb}});nG(Xh,M2e,Xh.dispose,{name:"dispose"});nG(Xh,_2e,eT,{nonWritable:!0});T2e({global:!0,constructor:!0},{DisposableStack:vO})});var uG=L((wrt,cG)=>{"use strict";var N2e=di(),F2e=Pr(),B2e=Ha(),V2e=NC(),oG=_C(),j2e=Ya(),$2e=Br(),U2e=Vl(),wO=$2e("iterator"),lG=!1,jl,bO,xO;[].keys&&(xO=[].keys(),"next"in xO?(bO=oG(oG(xO)),bO!==Object.prototype&&(jl=bO)):lG=!0);var z2e=!B2e(jl)||N2e(function(){var t={};return jl[wO].call(t)!==t});z2e?jl={}:U2e&&(jl=V2e(jl));F2e(jl[wO])||j2e(jl,wO,function(){return this});cG.exports={IteratorPrototype:jl,BUGGY_SAFARI_ITERATORS:lG}});var pG=L(()=>{"use strict";var q2e=Ni(),H2e=Ya(),G2e=Cf(),W2e=fi(),K2e=Br(),dG=uG().IteratorPrototype,fG=K2e("dispose");W2e(dG,fG)||H2e(dG,fG,function(){var t=G2e(this,"return");t&&q2e(t,this)})});var tT=L((Crt,hG)=>{"use strict";var Y2e=ar();hG.exports=Y2e});var gG=L(mG=>{"use strict";var X2e=Br();mG.f=X2e});var kO=L((Ert,vG)=>{"use strict";var yG=tT(),Q2e=fi(),Z2e=gG(),J2e=zo().f;vG.exports=function(t){var e=yG.Symbol||(yG.Symbol={});Q2e(e,t)||J2e(e,t,{value:Z2e.f(t)})}});var bG=L(()=>{"use strict";var eIe=ar(),tIe=kO(),rIe=zo().f,nIe=db().f,SO=eIe.Symbol;tIe("asyncDispose");SO&&(xb=nIe(SO,"asyncDispose"),xb.enumerable&&xb.configurable&&xb.writable&&rIe(SO,"asyncDispose",{value:xb.value,enumerable:!1,configurable:!1,writable:!1}));var xb});var xG=L(()=>{"use strict";var iIe=ar(),sIe=kO(),aIe=zo().f,oIe=db().f,CO=iIe.Symbol;sIe("dispose");CO&&(wb=oIe(CO,"dispose"),wb.enumerable&&wb.configurable&&wb.writable&&aIe(CO,"dispose",{value:wb.value,enumerable:!1,configurable:!1,writable:!1}));var wb});var wG=L(()=>{"use strict";wH();UH();tG();aG();pG();bG();xG()});var TO=L((Ort,kG)=>{"use strict";var kb=ar(),lIe=Gh(),cIe=ab(),rT=function(t){return lIe.slice(0,t.length)===t};kG.exports=function(){return rT("Bun/")?"BUN":rT("Cloudflare-Workers")?"CLOUDFLARE":rT("Deno/")?"DENO":rT("Node.js/")?"NODE":kb.Bun&&typeof Bun.version=="string"?"BUN":kb.Deno&&typeof Deno.version=="object"?"DENO":cIe(kb.process)==="process"?"NODE":kb.window&&kb.document?"BROWSER":"REST"}()});var nT=L((Drt,SG)=>{"use strict";var uIe=TO();SG.exports=uIe==="NODE"});var EG=L((Nrt,TG)=>{"use strict";var dIe=zo().f,fIe=fi(),pIe=Br(),CG=pIe("toStringTag");TG.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!fIe(t,CG)&&dIe(t,CG,{configurable:!0,value:e})}});var PG=L((Frt,AG)=>{"use strict";var hIe=Js(),mIe=HC(),gIe=Br(),yIe=ms(),IG=gIe("species");AG.exports=function(t){var e=hIe(t);yIe&&e&&!e[IG]&&mIe(e,IG,{configurable:!0,get:function(){return this}})}});var DG=L((Brt,OG)=>{"use strict";var vIe=cn(),bIe=di(),RG=Pr(),xIe=BC(),wIe=Js(),kIe=SC(),LG=function(){},MG=wIe("Reflect","construct"),EO=/^\s*(?:class|function)\b/,SIe=vIe(EO.exec),CIe=!EO.test(LG),Sb=function(e){if(!RG(e))return!1;try{return MG(LG,[],e),!0}catch{return!1}},_G=function(e){if(!RG(e))return!1;switch(xIe(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return CIe||!!SIe(EO,kIe(e))}catch{return!0}};_G.sham=!0;OG.exports=!MG||bIe(function(){var t;return Sb(Sb.call)||!Sb(Object)||!Sb(function(){t=!0})||t})?_G:Sb});var FG=L((Vrt,NG)=>{"use strict";var TIe=DG(),EIe=cb(),IIe=TypeError;NG.exports=function(t){if(TIe(t))return t;throw new IIe(EIe(t)+" is not a constructor")}});var jG=L((jrt,VG)=>{"use strict";var BG=Wa(),AIe=FG(),PIe=qh(),RIe=Br(),LIe=RIe("species");VG.exports=function(t,e){var r=BG(t).constructor,n;return r===void 0||PIe(n=BG(r)[LIe])?e:AIe(n)}});var HG=L(($rt,qG)=>{"use strict";var MIe=ib(),zG=Function.prototype,$G=zG.apply,UG=zG.call;qG.exports=typeof Reflect=="object"&&Reflect.apply||(MIe?UG.bind($G):function(){return UG.apply($G,arguments)})});var WG=L((Urt,GG)=>{"use strict";var _Ie=cn();GG.exports=_Ie([].slice)});var YG=L((zrt,KG)=>{"use strict";var OIe=TypeError;KG.exports=function(t,e){if(t<e)throw new OIe("Not enough arguments");return t}});var IO=L((qrt,XG)=>{"use strict";var DIe=Gh();XG.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(DIe)});var NO=L((Hrt,sW)=>{"use strict";var gs=ar(),NIe=HG(),FIe=yb(),QG=Pr(),BIe=fi(),iW=di(),ZG=iO(),VIe=WG(),JG=wC(),jIe=YG(),$Ie=IO(),UIe=nT(),_O=gs.setImmediate,OO=gs.clearImmediate,zIe=gs.process,AO=gs.Dispatch,qIe=gs.Function,eW=gs.MessageChannel,HIe=gs.String,PO=0,Cb={},tW="onreadystatechange",Tb,If,RO,LO;iW(function(){Tb=gs.location});var DO=function(t){if(BIe(Cb,t)){var e=Cb[t];delete Cb[t],e()}},MO=function(t){return function(){DO(t)}},rW=function(t){DO(t.data)},nW=function(t){gs.postMessage(HIe(t),Tb.protocol+"//"+Tb.host)};(!_O||!OO)&&(_O=function(e){jIe(arguments.length,1);var r=QG(e)?e:qIe(e),n=VIe(arguments,1);return Cb[++PO]=function(){NIe(r,void 0,n)},If(PO),PO},OO=function(e){delete Cb[e]},UIe?If=function(t){zIe.nextTick(MO(t))}:AO&&AO.now?If=function(t){AO.now(MO(t))}:eW&&!$Ie?(RO=new eW,LO=RO.port2,RO.port1.onmessage=rW,If=FIe(LO.postMessage,LO)):gs.addEventListener&&QG(gs.postMessage)&&!gs.importScripts&&Tb&&Tb.protocol!=="file:"&&!iW(nW)?(If=nW,gs.addEventListener("message",rW,!1)):tW in JG("script")?If=function(t){ZG.appendChild(JG("script"))[tW]=function(){ZG.removeChild(this),DO(t)}}:If=function(t){setTimeout(MO(t),0)});sW.exports={set:_O,clear:OO}});var lW=L((Grt,oW)=>{"use strict";var aW=ar(),GIe=ms(),WIe=Object.getOwnPropertyDescriptor;oW.exports=function(t){if(!GIe)return aW[t];var e=WIe(aW,t);return e&&e.value}});var FO=L((Wrt,uW)=>{"use strict";var cW=function(){this.head=null,this.tail=null};cW.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}}};uW.exports=cW});var fW=L((Krt,dW)=>{"use strict";var KIe=Gh();dW.exports=/ipad|iphone|ipod/i.test(KIe)&&typeof Pebble<"u"});var hW=L((Yrt,pW)=>{"use strict";var YIe=Gh();pW.exports=/web0s(?!.*chrome)/i.test(YIe)});var wW=L((Xrt,xW)=>{"use strict";var Zh=ar(),XIe=lW(),mW=yb(),BO=NO().set,QIe=FO(),ZIe=IO(),JIe=fW(),eAe=hW(),VO=nT(),gW=Zh.MutationObserver||Zh.WebKitMutationObserver,yW=Zh.document,vW=Zh.process,iT=Zh.Promise,UO=XIe("queueMicrotask"),Qh,jO,$O,sT,bW;UO||(Eb=new QIe,Ib=function(){var t,e;for(VO&&(t=vW.domain)&&t.exit();e=Eb.get();)try{e()}catch(r){throw Eb.head&&Qh(),r}t&&t.enter()},!ZIe&&!VO&&!eAe&&gW&&yW?(jO=!0,$O=yW.createTextNode(""),new gW(Ib).observe($O,{characterData:!0}),Qh=function(){$O.data=jO=!jO}):!JIe&&iT&&iT.resolve?(sT=iT.resolve(void 0),sT.constructor=iT,bW=mW(sT.then,sT),Qh=function(){bW(Ib)}):VO?Qh=function(){vW.nextTick(Ib)}:(BO=mW(BO,Zh),Qh=function(){BO(Ib)}),UO=function(t){Eb.head||Qh(),Eb.add(t)});var Eb,Ib;xW.exports=UO});var SW=L((Qrt,kW)=>{"use strict";kW.exports=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}});var aT=L((Zrt,CW)=>{"use strict";CW.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}});var Jh=L((Jrt,TW)=>{"use strict";var tAe=ar();TW.exports=tAe.Promise});var em=L((ent,PW)=>{"use strict";var rAe=ar(),Ab=Jh(),nAe=Pr(),iAe=tO(),sAe=SC(),aAe=Br(),EW=TO(),oAe=Vl(),zO=bC(),IW=Ab&&Ab.prototype,lAe=aAe("species"),qO=!1,AW=nAe(rAe.PromiseRejectionEvent),cAe=iAe("Promise",function(){var t=sAe(Ab),e=t!==String(Ab);if(!e&&zO===66||oAe&&!(IW.catch&&IW.finally))return!0;if(!zO||zO<51||!/native code/.test(t)){var r=new Ab(function(s){s(1)}),n=function(s){s(function(){},function(){})},i=r.constructor={};if(i[lAe]=n,qO=r.then(function(){})instanceof n,!qO)return!0}return!e&&(EW==="BROWSER"||EW==="DENO")&&!AW});PW.exports={CONSTRUCTOR:cAe,REJECTION_EVENT:AW,SUBCLASSING:qO}});var Af=L((tnt,LW)=>{"use strict";var RW=ea(),uAe=TypeError,dAe=function(t){var e,r;this.promise=new t(function(n,i){if(e!==void 0||r!==void 0)throw new uAe("Bad Promise constructor");e=n,r=i}),this.resolve=RW(e),this.reject=RW(r)};LW.exports.f=function(t){return new dAe(t)}});var XW=L(()=>{"use strict";var fAe=ta(),pAe=Vl(),uT=nT(),mu=ar(),im=Ni(),MW=Ya(),_W=nO(),hAe=EG(),mAe=PG(),gAe=ea(),cT=Pr(),yAe=Ha(),vAe=qC(),bAe=jG(),BW=NO().set,YO=wW(),xAe=SW(),wAe=aT(),kAe=FO(),VW=hb(),dT=Jh(),XO=em(),jW=Af(),fT="Promise",$W=XO.CONSTRUCTOR,SAe=XO.REJECTION_EVENT,CAe=XO.SUBCLASSING,HO=VW.getterFor(fT),TAe=VW.set,tm=dT&&dT.prototype,Pf=dT,oT=tm,UW=mu.TypeError,GO=mu.document,QO=mu.process,WO=jW.f,EAe=WO,IAe=!!(GO&&GO.createEvent&&mu.dispatchEvent),zW="unhandledrejection",AAe="rejectionhandled",OW=0,qW=1,PAe=2,ZO=1,HW=2,lT,DW,RAe,NW,GW=function(t){var e;return yAe(t)&&cT(e=t.then)?e:!1},WW=function(t,e){var r=e.value,n=e.state===qW,i=n?t.ok:t.fail,s=t.resolve,a=t.reject,o=t.domain,l,c,u;try{i?(n||(e.rejection===HW&&MAe(e),e.rejection=ZO),i===!0?l=r:(o&&o.enter(),l=i(r),o&&(o.exit(),u=!0)),l===t.promise?a(new UW("Promise-chain cycle")):(c=GW(l))?im(c,l,s,a):s(l)):a(r)}catch(d){o&&!u&&o.exit(),a(d)}},KW=function(t,e){t.notified||(t.notified=!0,YO(function(){for(var r=t.reactions,n;n=r.get();)WW(n,t);t.notified=!1,e&&!t.rejection&&LAe(t)}))},YW=function(t,e,r){var n,i;IAe?(n=GO.createEvent("Event"),n.promise=e,n.reason=r,n.initEvent(t,!1,!0),mu.dispatchEvent(n)):n={promise:e,reason:r},!SAe&&(i=mu["on"+t])?i(n):t===zW&&xAe("Unhandled promise rejection",r)},LAe=function(t){im(BW,mu,function(){var e=t.facade,r=t.value,n=FW(t),i;if(n&&(i=wAe(function(){uT?QO.emit("unhandledRejection",r,e):YW(zW,e,r)}),t.rejection=uT||FW(t)?HW:ZO,i.error))throw i.value})},FW=function(t){return t.rejection!==ZO&&!t.parent},MAe=function(t){im(BW,mu,function(){var e=t.facade;uT?QO.emit("rejectionHandled",e):YW(AAe,e,t.value)})},rm=function(t,e,r){return function(n){t(e,n,r)}},nm=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=PAe,KW(t,!0))},KO=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new UW("Promise can't be resolved itself");var n=GW(e);n?YO(function(){var i={done:!1};try{im(n,e,rm(KO,i,t),rm(nm,i,t))}catch(s){nm(i,s,t)}}):(t.value=e,t.state=qW,KW(t,!1))}catch(i){nm({done:!1},i,t)}}};if($W&&(Pf=function(e){vAe(this,oT),gAe(e),im(lT,this);var r=HO(this);try{e(rm(KO,r),rm(nm,r))}catch(n){nm(r,n)}},oT=Pf.prototype,lT=function(e){TAe(this,{type:fT,done:!1,notified:!1,parent:!1,reactions:new kAe,rejection:!1,state:OW,value:null})},lT.prototype=MW(oT,"then",function(e,r){var n=HO(this),i=WO(bAe(this,Pf));return n.parent=!0,i.ok=cT(e)?e:!0,i.fail=cT(r)&&r,i.domain=uT?QO.domain:void 0,n.state===OW?n.reactions.add(i):YO(function(){WW(i,n)}),i.promise}),DW=function(){var t=new lT,e=HO(t);this.promise=t,this.resolve=rm(KO,e),this.reject=rm(nm,e)},jW.f=WO=function(t){return t===Pf||t===RAe?new DW(t):EAe(t)},!pAe&&cT(dT)&&tm!==Object.prototype)){NW=tm.then,CAe||MW(tm,"then",function(e,r){var n=this;return new Pf(function(i,s){im(NW,n,i,s)}).then(e,r)},{unsafe:!0});try{delete tm.constructor}catch{}_W&&_W(tm,oT)}fAe({global:!0,constructor:!0,wrap:!0,forced:$W},{Promise:Pf});hAe(Pf,fT,!1,!0);mAe(fT)});var JO=L((int,QW)=>{"use strict";QW.exports={}});var JW=L((snt,ZW)=>{"use strict";var _Ae=Br(),OAe=JO(),DAe=_Ae("iterator"),NAe=Array.prototype;ZW.exports=function(t){return t!==void 0&&(OAe.Array===t||NAe[DAe]===t)}});var e6=L((ant,tK)=>{"use strict";var FAe=BC(),eK=Cf(),BAe=qh(),VAe=JO(),jAe=Br(),$Ae=jAe("iterator");tK.exports=function(t){if(!BAe(t))return eK(t,$Ae)||eK(t,"@@iterator")||VAe[FAe(t)]}});var nK=L((ont,rK)=>{"use strict";var UAe=Ni(),zAe=ea(),qAe=Wa(),HAe=cb(),GAe=e6(),WAe=TypeError;rK.exports=function(t,e){var r=arguments.length<2?GAe(t):e;if(zAe(r))return qAe(UAe(r,t));throw new WAe(HAe(t)+" is not iterable")}});var aK=L((lnt,sK)=>{"use strict";var KAe=Ni(),iK=Wa(),YAe=Cf();sK.exports=function(t,e,r){var n,i;iK(t);try{if(n=YAe(t,"return"),!n){if(e==="throw")throw r;return r}n=KAe(n,t)}catch(s){i=!0,n=s}if(e==="throw")throw r;if(i)throw n;return iK(n),r}});var t6=L((cnt,uK)=>{"use strict";var XAe=yb(),QAe=Ni(),ZAe=Wa(),JAe=cb(),ePe=JW(),tPe=Q_(),oK=lb(),rPe=nK(),nPe=e6(),lK=aK(),iPe=TypeError,pT=function(t,e){this.stopped=t,this.result=e},cK=pT.prototype;uK.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=XAe(e,n),c,u,d,f,p,h,m,v=function(y){return c&&lK(c,"normal",y),new pT(!0,y)},b=function(y){return i?(ZAe(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=nPe(t),!u)throw new iPe(JAe(t)+" is not iterable");if(ePe(u)){for(d=0,f=tPe(t);f>d;d++)if(p=b(t[d]),p&&oK(cK,p))return p;return new pT(!1)}c=rPe(t,u)}for(h=s?t.next:c.next;!(m=QAe(h,c)).done;){try{p=b(m.value)}catch(y){lK(c,"throw",y)}if(typeof p=="object"&&p&&oK(cK,p))return p}return new pT(!1)}});var mK=L((unt,hK)=>{"use strict";var sPe=Br(),fK=sPe("iterator"),pK=!1;try{dK=0,r6={next:function(){return{done:!!dK++}},return:function(){pK=!0}},r6[fK]=function(){return this},Array.from(r6,function(){throw 2})}catch{}var dK,r6;hK.exports=function(t,e){try{if(!e&&!pK)return!1}catch{return!1}var r=!1;try{var n={};n[fK]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r}});var n6=L((dnt,gK)=>{"use strict";var aPe=Jh(),oPe=mK(),lPe=em().CONSTRUCTOR;gK.exports=lPe||!oPe(function(t){aPe.all(t).then(void 0,function(){})})});var yK=L(()=>{"use strict";var cPe=ta(),uPe=Ni(),dPe=ea(),fPe=Af(),pPe=aT(),hPe=t6(),mPe=n6();cPe({target:"Promise",stat:!0,forced:mPe},{all:function(e){var r=this,n=fPe.f(r),i=n.resolve,s=n.reject,a=pPe(function(){var o=dPe(r.resolve),l=[],c=0,u=1;hPe(e,function(d){var f=c++,p=!1;u++,uPe(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 bK=L(()=>{"use strict";var gPe=ta(),yPe=Vl(),vPe=em().CONSTRUCTOR,s6=Jh(),bPe=Js(),xPe=Pr(),wPe=Ya(),vK=s6&&s6.prototype;gPe({target:"Promise",proto:!0,forced:vPe,real:!0},{catch:function(t){return this.then(void 0,t)}});!yPe&&xPe(s6)&&(i6=bPe("Promise").prototype.catch,vK.catch!==i6&&wPe(vK,"catch",i6,{unsafe:!0}));var i6});var xK=L(()=>{"use strict";var kPe=ta(),SPe=Ni(),CPe=ea(),TPe=Af(),EPe=aT(),IPe=t6(),APe=n6();kPe({target:"Promise",stat:!0,forced:APe},{race:function(e){var r=this,n=TPe.f(r),i=n.reject,s=EPe(function(){var a=CPe(r.resolve);IPe(e,function(o){SPe(a,r,o).then(n.resolve,i)})});return s.error&&i(s.value),n.promise}})});var wK=L(()=>{"use strict";var PPe=ta(),RPe=Af(),LPe=em().CONSTRUCTOR;PPe({target:"Promise",stat:!0,forced:LPe},{reject:function(e){var r=RPe.f(this),n=r.reject;return n(e),r.promise}})});var SK=L((xnt,kK)=>{"use strict";var MPe=Wa(),_Pe=Ha(),OPe=Af();kK.exports=function(t,e){if(MPe(t),_Pe(e)&&e.constructor===t)return e;var r=OPe.f(t),n=r.resolve;return n(e),r.promise}});var EK=L(()=>{"use strict";var DPe=ta(),NPe=Js(),CK=Vl(),FPe=Jh(),TK=em().CONSTRUCTOR,BPe=SK(),VPe=NPe("Promise"),jPe=CK&&!TK;DPe({target:"Promise",stat:!0,forced:CK||TK},{resolve:function(e){return BPe(jPe&&this===VPe?FPe:this,e)}})});var IK=L(()=>{"use strict";XW();yK();bK();xK();wK();EK()});var AK=L(()=>{"use strict";var $Pe=ta(),UPe=Af();$Pe({target:"Promise",stat:!0},{withResolvers:function(){var e=UPe.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}})});var LK=L((Int,RK)=>{"use strict";IK();AK();var zPe=Ni(),qPe=Pr(),HPe=tT(),PK=HPe.Promise,GPe=PK.withResolvers;RK.exports=function(){return zPe(GPe,qPe(this)?this:PK)}});var _K=L((Ant,MK)=>{"use strict";var WPe=LK();MK.exports=WPe});var DK=L((Rnt,OK)=>{"use strict";var KPe=TypeError;OK.exports=function(t){if(typeof t=="string")return t;throw new KPe("Argument is not a string")}});var FK=L((Lnt,NK)=>{"use strict";var YPe=RC(),XPe=VC(),QPe=Hh(),ZPe=RangeError;NK.exports=function(e){var r=XPe(QPe(this)),n="",i=YPe(e);if(i<0||i===1/0)throw new ZPe("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(r+=r))i&1&&(n+=r);return n}});var UK=L((Mnt,$K)=>{"use strict";var jK=cn(),JPe=X_(),BK=VC(),eRe=FK(),tRe=Hh(),rRe=jK(eRe),nRe=jK("".slice),iRe=Math.ceil,VK=function(t){return function(e,r,n){var i=BK(tRe(e)),s=JPe(r),a=i.length,o=n===void 0?" ":BK(n),l,c;return s<=a||o===""?i:(l=s-a,c=rRe(o,iRe(l/o.length)),c.length>l&&(c=nRe(c,0,l)),t?i+c:c+i)}};$K.exports={start:VK(!1),end:VK(!0)}});var qK=L((_nt,zK)=>{"use strict";zK.exports=`
|
|
\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF`});var XK=L(()=>{"use strict";var sRe=ta(),Pb=cn(),aRe=DK(),oRe=fi(),HK=UK().start,lRe=qK(),cRe=Array,GK=RegExp.escape,WK=Pb("".charAt),l6=Pb("".charCodeAt),uRe=Pb(1.1.toString),dRe=Pb([].join),YK=/^[0-9a-z]/i,fRe=/^[$()*+./?[\\\]^{|}]/,pRe=RegExp("^[!\"#%&',\\-:;<=>@`~"+lRe+"]"),a6=Pb(YK.exec),KK={" ":"t","\n":"n","\v":"v","\f":"f","\r":"r"},o6=function(t){var e=uRe(l6(t,0),16);return e.length<3?"\\x"+HK(e,2,"0"):"\\u"+HK(e,4,"0")},hRe=!GK||GK("ab")!=="\\x61b";sRe({target:"RegExp",stat:!0,forced:hRe},{escape:function(e){aRe(e);for(var r=e.length,n=cRe(r),i=0;i<r;i++){var s=WK(e,i);if(i===0&&a6(YK,s))n[i]=o6(s);else if(oRe(KK,s))n[i]="\\"+KK[s];else if(a6(fRe,s))n[i]="\\"+s;else if(a6(pRe,s))n[i]=o6(s);else{var a=l6(s,0);(a&63488)!==55296?n[i]=s:a>=56320||i+1>=r||(l6(e,i+1)&64512)!==56320?n[i]=o6(s):(n[i]=s,n[++i]=WK(e,i))}}return dRe(n,"")}})});var ZK=L((Nnt,QK)=>{"use strict";XK();var mRe=tT();QK.exports=mRe.RegExp.escape});var eY=L((Fnt,JK)=>{"use strict";var gRe=ZK();JK.exports=gRe});var bY=L(hT=>{"use strict";var GRe=Symbol.for("react.transitional.element"),WRe=Symbol.for("react.fragment");function vY(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:GRe,type:t,key:n,ref:e!==void 0?e:null,props:r}}hT.Fragment=WRe;hT.jsx=vY;hT.jsxs=vY});var Ge=L((Znt,xY)=>{"use strict";xY.exports=bY()});var MY=L(Xe=>{"use strict";var h6=Symbol.for("react.transitional.element"),KRe=Symbol.for("react.portal"),YRe=Symbol.for("react.fragment"),XRe=Symbol.for("react.strict_mode"),QRe=Symbol.for("react.profiler"),ZRe=Symbol.for("react.consumer"),JRe=Symbol.for("react.context"),eLe=Symbol.for("react.forward_ref"),tLe=Symbol.for("react.suspense"),rLe=Symbol.for("react.memo"),EY=Symbol.for("react.lazy"),wY=Symbol.iterator;function nLe(t){return t===null||typeof t!="object"?null:(t=wY&&t[wY]||t["@@iterator"],typeof t=="function"?t:null)}var IY={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},AY=Object.assign,PY={};function om(t,e,r){this.props=t,this.context=e,this.refs=PY,this.updater=r||IY}om.prototype.isReactComponent={};om.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")};om.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function RY(){}RY.prototype=om.prototype;function m6(t,e,r){this.props=t,this.context=e,this.refs=PY,this.updater=r||IY}var g6=m6.prototype=new RY;g6.constructor=m6;AY(g6,om.prototype);g6.isPureReactComponent=!0;var kY=Array.isArray,or={H:null,A:null,T:null,S:null,V:null},LY=Object.prototype.hasOwnProperty;function y6(t,e,r,n,i,s){return r=s.ref,{$$typeof:h6,type:t,key:e,ref:r!==void 0?r:null,props:s}}function iLe(t,e){return y6(t.type,e,void 0,void 0,void 0,t.props)}function v6(t){return typeof t=="object"&&t!==null&&t.$$typeof===h6}function sLe(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var SY=/\/+/g;function p6(t,e){return typeof t=="object"&&t!==null&&t.key!=null?sLe(""+t.key):e.toString(36)}function CY(){}function aLe(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(CY,CY):(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 am(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 h6:case KRe:a=!0;break;case EY:return a=t._init,am(a(t._payload),e,r,n,i)}}if(a)return i=i(t),a=n===""?"."+p6(t,0):n,kY(i)?(r="",a!=null&&(r=a.replace(SY,"$&/")+"/"),am(i,e,r,"",function(c){return c})):i!=null&&(v6(i)&&(i=iLe(i,r+(i.key==null||t&&t.key===i.key?"":(""+i.key).replace(SY,"$&/")+"/")+a)),e.push(i)),1;a=0;var o=n===""?".":n+":";if(kY(t))for(var l=0;l<t.length;l++)n=t[l],s=o+p6(n,l),a+=am(n,e,r,s,i);else if(l=nLe(t),typeof l=="function")for(t=l.call(t),l=0;!(n=t.next()).done;)n=n.value,s=o+p6(n,l++),a+=am(n,e,r,s,i);else if(s==="object"){if(typeof t.then=="function")return am(aLe(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 mT(t,e,r){if(t==null)return t;var n=[],i=0;return am(t,n,"","",function(s){return e.call(r,s,i++)}),n}function oLe(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 TY=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 lLe(){}Xe.Children={map:mT,forEach:function(t,e,r){mT(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return mT(t,function(){e++}),e},toArray:function(t){return mT(t,function(e){return e})||[]},only:function(t){if(!v6(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Xe.Component=om;Xe.Fragment=YRe;Xe.Profiler=QRe;Xe.PureComponent=m6;Xe.StrictMode=XRe;Xe.Suspense=tLe;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=AY({},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)!LY.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 y6(t.type,i,void 0,void 0,s,n)};Xe.createContext=function(t){return t={$$typeof:JRe,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:ZRe,_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)LY.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 y6(t,s,void 0,void 0,null,i)};Xe.createRef=function(){return{current:null}};Xe.forwardRef=function(t){return{$$typeof:eLe,render:t}};Xe.isValidElement=v6;Xe.lazy=function(t){return{$$typeof:EY,_payload:{_status:-1,_result:t},_init:oLe}};Xe.memo=function(t,e){return{$$typeof:rLe,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(lLe,TY)}catch(s){TY(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,_Y)=>{"use strict";_Y.exports=MY()});var FY=L(hi=>{"use strict";var hLe=Te();function NY(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 vu(){}var pi={d:{f:vu,r:function(){throw Error(NY(522))},D:vu,C:vu,L:vu,m:vu,X:vu,S:vu,M:vu},p:0,findDOMNode:null},mLe=Symbol.for("react.portal");function gLe(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:mLe,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}var _b=hLe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function gT(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(NY(299));return gLe(t,e,null,r)};hi.flushSync=function(t){var e=_b.T,r=pi.p;try{if(_b.T=null,pi.p=2,t)return t()}finally{_b.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=gT(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=gT(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=gT(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=gT(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 _b.H.useFormState(t,e,r)};hi.useFormStatus=function(){return _b.H.useHostTransitionStatus()};hi.version="19.1.0"});var Rf=L((sit,VY)=>{"use strict";function BY(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(BY)}catch(t){console.error(t)}}BY(),VY.exports=FY()});var _f={};ln(_f,{Headers:()=>P6,Request:()=>TLe,Response:()=>ELe,default:()=>A6,fetch:()=>CLe});var SLe,pm,CLe,A6,P6,TLe,ELe,xu=yt(()=>{"use strict";SLe=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")},pm=SLe(),CLe=pm.fetch,A6=pm.fetch.bind(pm),P6=pm.Headers,TLe=pm.Request,ELe=pm.Response});var M6=L(L6=>{"use strict";Object.defineProperty(L6,"__esModule",{value:!0});var R6=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};L6.default=R6});var O6=L(Nb=>{"use strict";var eX=Nb&&Nb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nb,"__esModule",{value:!0});var ALe=eX((xu(),LU(_f))),PLe=eX(M6()),_6=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=ALe.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 PLe.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}};Nb.default=_6});var N6=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(O6()),D6=class extends LLe.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}};Fb.default=D6});var TT=L(Bb=>{"use strict";var MLe=Bb&&Bb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bb,"__esModule",{value:!0});var _Le=MLe(N6()),F6=class extends _Le.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}};Bb.default=F6});var V6=L(jb=>{"use strict";var OLe=jb&&jb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jb,"__esModule",{value:!0});var Vb=OLe(TT()),B6=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 Vb.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 Vb.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 Vb.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 Vb.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 Vb.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};jb.default=B6});var tX=L(ET=>{"use strict";Object.defineProperty(ET,"__esModule",{value:!0});ET.version=void 0;ET.version="0.0.0-automated"});var rX=L(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});IT.DEFAULT_HEADERS=void 0;var DLe=tX();IT.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${DLe.version}`}});var iX=L($b=>{"use strict";var nX=$b&&$b.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($b,"__esModule",{value:!0});var NLe=nX(V6()),FLe=nX(TT()),BLe=rX(),j6=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},BLe.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new NLe.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 FLe.default({method:a,url:o,headers:c,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};$b.default=j6});var dX=L(In=>{"use strict";var hm=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 sX=hm(iX());In.PostgrestClient=sX.default;var aX=hm(V6());In.PostgrestQueryBuilder=aX.default;var oX=hm(TT());In.PostgrestFilterBuilder=oX.default;var lX=hm(N6());In.PostgrestTransformBuilder=lX.default;var cX=hm(O6());In.PostgrestBuilder=cX.default;var uX=hm(M6());In.PostgrestError=uX.default;In.default={PostgrestClient:sX.default,PostgrestQueryBuilder:aX.default,PostgrestFilterBuilder:oX.default,PostgrestTransformBuilder:lX.default,PostgrestBuilder:cX.default,PostgrestError:uX.default}});var xX=L((Nst,bX)=>{"use strict";bX.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});function N_e(){lE=!0,queueMicrotask(lZ)}function lZ(){if(!Km.length){lE=!1;return}TD=!0;for(let t=0;t<Km.length;t++)Km[t].$st!==Qm&&F_e(Km[t]);Km=[],lE=!1,TD=!1}function F_e(t){let e=[t];for(;t=t[io];)t.$e&&t.$st!==Qm&&e.push(t);for(let r=e.length-1;r>=0;r--)_D(e[r])}function AD(t){let e=yi();return sx(e,t.length?t.bind(null,np.bind(e)):t,null)}function te(t){return sx(no,t,null)}function tl(t){return sx(null,t,null)}function Cs(){TD||lZ()}function ip(){return no}function pn(t,e){try{return sx(e,t,null)}catch(r){PD(e,r);return}}function ix(t,e=no){return e?.$cx[t]}function cZ(t,e,r=no){r&&(r.$cx={...r.$cx,[t]:e})}function Ne(t){if(!t||!no)return t||D_e;let e=no;return e.$d?Array.isArray(e.$d)?e.$d.push(t):e.$d=[e.$d,t]:e.$d=t,function(){e.$st!==dE&&(t.call(null),ax(e.$d)?e.$d=null:Array.isArray(e.$d)&&e.$d.splice(e.$d.indexOf(t),1))}}function np(t=!0){if(this.$st!==dE){if(this.$h)if(Array.isArray(this.$h))for(let e=this.$h.length-1;e>=0;e--)np.call(this.$h[e]);else np.call(this.$h);if(t){let e=this[io];e&&(Array.isArray(e.$h)?e.$h.splice(e.$h.indexOf(this),1):e.$h=null),B_e(this)}}}function B_e(t){t.$st=dE,t.$d&&uZ(t),t.$s&&ED(t,0),t[io]=null,t.$s=null,t.$o=null,t.$h=null,t.$cx=ID,t.$eh=null}function uZ(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){PD(t,e)}}function sx(t,e,r){let n=no,i=Ym;no=t,Ym=r;try{return e.call(t)}finally{no=n,Ym=i}}function PD(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 fE(){return this.$st===dE?this.$v:(Ym&&!this.$e&&(!pa&&Ym.$s&&Ym.$s[Ss]==this?Ss++:pa?pa.push(this):pa=[this]),this.$c&&_D(this),this.$v)}function RD(t){let e=ax(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++)fZ(this.$o[r],cE);return this.$v}function yi(){return new LD}function pE(t,e,r){return new dZ(t,e,r)}function V_e(t,e){return t!==e}function ax(t){return typeof t=="function"}function _D(t){if(t.$st===oZ)for(let e=0;e<t.$s.length&&(_D(t.$s[e]),t.$st!==cE);e++);t.$st===cE?OD(t):t.$st=Qm}function j_e(t){t.$h&&np.call(t,!1),t.$d&&uZ(t),t.$eh=t[io]?t[io].$eh:null}function OD(t){let e=pa,r=Ss;pa=null,Ss=0;try{j_e(t);let n=sx(t,t.$c,t);aZ(t),!t.$e&&t.$i?RD.call(t,n):(t.$v=n,t.$i=!0)}catch(n){aZ(t),PD(t,n)}finally{pa=e,Ss=r,t.$st=Qm}}function aZ(t){if(pa){if(t.$s&&ED(t,Ss),t.$s&&Ss>0){t.$s.length=Ss+pa.length;for(let r=0;r<pa.length;r++)t.$s[Ss+r]=pa[r]}else t.$s=pa;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&&(ED(t,Ss),t.$s.length=Ss)}function fZ(t,e){if(!(t.$st>=e)&&(t.$e&&t.$st===Qm&&(Km.push(t),lE||N_e()),t.$st=e,t.$o))for(let r=0;r<t.$o.length;r++)fZ(t.$o[r],oZ)}function ED(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 so(...t){}function ha(t){return t===null}function Jt(t){return typeof t>"u"}function DD(t){return ha(t)||Jt(t)}function ox(t){return t?.constructor===Object}function Rr(t){return typeof t=="number"&&!Number.isNaN(t)}function me(t){return typeof t=="string"}function hE(t){return typeof t=="boolean"}function hn(t){return typeof t=="function"}function Lr(t){return Array.isArray(t)}function hZ(t){return!!t?.[pZ]}function We(t,e,r,n){return t.addEventListener(e,r,n),Ne(()=>t.removeEventListener(e,r,n))}function mZ(...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 mE(t){return!!t?.type.startsWith("pointer")}function Zm(t){return!!t?.type.startsWith("touch")}function ND(t){return/^(click|mouse)/.test(t?.type??"")}function Jm(t){return!!t?.type.startsWith("key")}function FD(t){return Jm(t)&&t.key==="Enter"}function gE(t){return Jm(t)&&(t.key==="Enter"||t.key===" ")}function BD(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 io,lE,TD,no,Ym,pa,Ss,Km,ID,D_e,Qm,oZ,cE,dE,LD,sp,dZ,MD,$_e,pZ,Ie,uE,Xm,it,ap=yt(()=>{io=Symbol(0),lE=!1,TD=!1,no=null,Ym=null,pa=null,Ss=0,Km=[],ID={},D_e=()=>{},Qm=0,oZ=1,cE=2,dE=3;LD=function(){this[io]=null,this.$h=null,no&&no.append(this)},sp=LD.prototype;sp.$cx=ID;sp.$eh=null;sp.$c=null;sp.$d=null;sp.append=function(t){t[io]=this,this.$h?Array.isArray(this.$h)?this.$h.push(t):this.$h=[this.$h,t]:this.$h=t,t.$cx=t.$cx===ID?this.$cx:{...this.$cx,...t.$cx},this.$eh&&(t.$eh=t.$eh?[...t.$eh,...this.$eh]:this.$eh)};sp.dispose=function(){np.call(this)};dZ=function(e,r,n){LD.call(this),this.$st=r?cE:Qm,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)},MD=dZ.prototype;Object.setPrototypeOf(MD,sp);MD.$ch=V_e;MD.call=fE;$_e=Event,pZ=Symbol("DOM_EVENT"),Ie=class extends $_e{[pZ]=!0;detail;triggers=new uE;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)}},uE=class{chain=[];get source(){return this.chain[0]}get origin(){return this.chain[this.chain.length-1]}add(e){this.chain.push(e),hZ(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()}};Xm=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?mZ(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=pE(t,null,e),n=fE.bind(r);return n[io]=!0,n.set=RD.bind(r),n}function gZ(t){return ax(t)&&io in t}function tc(t,e){let r=pE(e?.initial,t,e),n=fE.bind(r);return n[io]=!0,n}function jD(t,e){let r=pE(null,function(){let i=t();return ax(i)&&Ne(i),null},void 0);return r.$e=!0,OD(r),np.bind(r,!0)}function $D(t){return gZ(t)&&"set"in t}function rl(t){return{id:Symbol(),provide:t}}function vi(t,e,r=ip()){let n=!Jt(e);cZ(t.id,n?e:t.provide?.(),r)}function mr(t){return ix(t.id)}function ao(t){return!Jt(ix(t.id))}function U_e(t){let e={};for(let r of Object.keys(t)){let n=t[r];e[r]=be(n,n)}return e}function UD(t,e){return AD(()=>{lx.$$=new yE(t,ip(),e);let r=new t;return lx.$$.component=r,lx.$$=null,r})}var U,vE,bE,cx,VD,yE,lx,Wn,xE=yt(()=>{ap();U=jD;vE=Symbol(0),bE=Symbol(0),cx=Symbol(0),VD={},yE=class{$ts__events;$ts__vars;[cx]=null;$el=be(null);el=null;scope=null;attachScope=null;connectScope=null;component=null;destroyed=!1;props=VD;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=U_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=VD,this.scope=null,this.state=VD,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))}};lx={$$: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(),lx.$$&&this.attach(lx)}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.$$[cx]?.(n),this.el.dispatchEvent(n)))}dispatchEvent(e){return this.dispatch(e)}listen(e,r,n){return this.el?We(this.el,e,r,n):so}}});function Du(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function zD(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function qD(t){return yZ(t).replace(/\s/g,"")}function yZ(t){return wE(t.replace(/-./g,e=>" "+e[1].toUpperCase()))}function wE(t){return t.charAt(0).toUpperCase()+t.slice(1)}var HD=yt(()=>{});function z_e(t,...e){return $t.createElement(SE.Provider,{value:t},...e)}function GD(){return $t.useContext(SE).current}function WD(t){let e=GD();return $t.useMemo(()=>ix(t.id,e),[e])}function wZ(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function st(...t){return e=>t.forEach(r=>wZ(r,e))}function q_e(t,e){let r=$t.forwardRef((n,i)=>{let s=$t.useContext(SE),a=$t.useRef(null),o=$t.useRef();if(!o.current){let v=G_e(),b=xZ(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=xZ(t,v,n,b);v.component=y,v.attached=!1,v.forwardRef=!1,a.current=y.scope}return v.el&&bZ(v,v.el),v.forwardRef||(wZ(i,v.component),v.forwardRef=!0),()=>kE(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&&(kE(y),v&&bZ(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,kE(v),v.component.$$.destroy(),v.component.$$[cx]=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=Du(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,z_e(a,$t.createElement(H_e,{effect:l}),hn(d)?d?.({...p,suppressHydrationWarning:!0,ref:c},u.component):d)});return r.displayName=t.name+"Bridge",r}function H_e({effect:t}){return $t.useEffect(t,[]),null}function G_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 bZ(t,e){if(!(t.el===e&&t.attached)){if(t.attached&&kE(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 kE(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 W_e(t){let e=vZ.get(t.type),r=Jt(t.detail)?[t]:[t.detail,t];e||vZ.set(t.type,e=`on${qD(t.type)}`),this.callbacks[e]?.(...r)}function xZ(t,e,r,n){let i=UD(t,{props:r,scope:n});return i.$$[cx]=W_e.bind(e),i.$$.setup(),i}function rc(t){return WD(t)}function Ut(t,e){let[,r]=$t.useState();return $t.useEffect(()=>jD(()=>{t(),r({})}),[e??t]),t()}function KD(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 q_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,SE,vZ,ux=yt(()=>{$t=Z(Te(),1);xE();HD();ap();SE=$t.createContext({current:null});SE.displayName="Scope";vZ=new Map});function mt(t,e,r){t[vE]||(t[vE]=new Set),t[vE].add(e)}function $r(t,e,r){t[bE]||(t[bE]=new Set),t[bE].add(e)}function eg(t){return mr(t)}var je,oo,lo=yt(()=>{xE();xE();ap();ap();je=class extends Wn{subscribe(e){return pn(()=>U(()=>e(this.state)),this.$$.scope)}destroy(){this.$$.destroy()}};oo=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?tc(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 dx(t){return t?"true":"false"}function YD(t){return Object.keys(t)}function nc(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}function kZ(t){return new Promise(e=>setTimeout(e,t))}function op(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 SZ(t,e){return new Promise(r=>{K_e(n=>{t?.(n),r()},e)})}var K_e,co=yt(()=>{ap();ap();HD();K_e=typeof window<"u"?"requestIdleCallback"in window?window.requestIdleCallback:t=>window.setTimeout(t,1):so});var RZ={};ln(RZ,{Icon$0:()=>Z_e,Icon$104:()=>IOe,Icon$105:()=>AOe,Icon$11:()=>tOe,Icon$13:()=>rOe,Icon$16:()=>nOe,Icon$19:()=>iOe,Icon$22:()=>sOe,Icon$24:()=>PZ,Icon$26:()=>oOe,Icon$27:()=>lOe,Icon$31:()=>cOe,Icon$33:()=>uOe,Icon$34:()=>dOe,Icon$35:()=>fOe,Icon$39:()=>pOe,Icon$40:()=>hOe,Icon$5:()=>J_e,Icon$53:()=>mOe,Icon$54:()=>gOe,Icon$56:()=>yOe,Icon$59:()=>vOe,Icon$60:()=>bOe,Icon$61:()=>xOe,Icon$62:()=>wOe,Icon$63:()=>kOe,Icon$74:()=>SOe,Icon$77:()=>COe,Icon$8:()=>eOe,Icon$81:()=>TOe,Icon$88:()=>EOe,chromecast:()=>aOe,fscreen:()=>ic,functionDebounce:()=>fx,functionThrottle:()=>sc,r:()=>XD});function Y_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 X_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,CZ,TZ,EZ,zi,ma,ic,sc,fx,IZ,AZ,CE,TE,Q_e,XD,Z_e,J_e,eOe,tOe,rOe,nOe,iOe,sOe,PZ,aOe,oOe,lOe,cOe,uOe,dOe,fOe,pOe,hOe,mOe,gOe,yOe,vOe,bOe,xOe,wOe,kOe,SOe,COe,TOe,EOe,IOe,AOe,QD=yt(()=>{"use client";Ts={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},CZ=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],TZ=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],EZ=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],zi=typeof window<"u"&&typeof window.document<"u"?window.document:{},ma="fullscreenEnabled"in zi&&Object.keys(Ts)||CZ[0]in zi&&CZ||TZ[0]in zi&&TZ||EZ[0]in zi&&EZ||[],ic={requestFullscreen:function(t){return t[ma[Ts.requestFullscreen]]()},requestFullscreenFunction:function(t){return t[ma[Ts.requestFullscreen]]},get exitFullscreen(){return zi[ma[Ts.exitFullscreen]].bind(zi)},get fullscreenPseudoClass(){return":"+ma[Ts.fullscreen]},addEventListener:function(t,e,r){return zi.addEventListener(ma[Ts[t]],e,r)},removeEventListener:function(t,e,r){return zi.removeEventListener(ma[Ts[t]],e,r)},get fullscreenEnabled(){return!!zi[ma[Ts.fullscreenEnabled]]},set fullscreenEnabled(t){},get fullscreenElement(){return zi[ma[Ts.fullscreenElement]]},set fullscreenElement(t){},get onfullscreenchange(){return zi[("on"+ma[Ts.fullscreenchange]).toLowerCase()]},set onfullscreenchange(t){return zi[("on"+ma[Ts.fullscreenchange]).toLowerCase()]=t},get onfullscreenerror(){return zi[("on"+ma[Ts.fullscreenerror]).toLowerCase()]},set onfullscreenerror(t){return zi[("on"+ma[Ts.fullscreenerror]).toLowerCase()]=t}},sc=Y_e;fx=X_e;IZ=t=>typeof t=="object"&&t!=null&&t.nodeType===1,AZ=(t,e)=>(!e||t!=="hidden")&&t!=="visible"&&t!=="clip",CE=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){let r=getComputedStyle(t,null);return AZ(r.overflowY,e)||AZ(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},TE=(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,Q_e=t=>{let e=t.parentElement;return e??(t.getRootNode().host||null)},XD=(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(!IZ(t))throw new TypeError("Invalid target");let f=document.scrollingElement||document.documentElement,p=[],h=t;for(;IZ(h)&&d(h);){if(h=Q_e(h),h===f){p.push(h);break}h!=null&&h===document.body&&CE(h)&&!CE(document.documentElement)||h!=null&&CE(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:ht,bottom:At,left:Ue}=V.getBoundingClientRect();if(a==="if-needed"&&C>=0&&T>=0&&S<=v&&O<=m&&(V===f&&!CE(V)||C>=Me&&S<=At&&T>=Ue&&O<=ht))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,kf="offsetWidth"in V?V.offsetWidth===0?0:de/V.offsetWidth:0,Bl="offsetHeight"in V?V.offsetHeight===0?0:K/V.offsetHeight:0;if(f===V)Ir=o==="start"?B:o==="end"?B-v:o==="nearest"?TE(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:TE(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"?TE(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-ht+lt+Zs:TE(Ue,ht,de,Kr,lt+Zs,M,M+w,w);let{scrollLeft:hu,scrollTop:zh}=V;Ir=Bl===0?0:Math.max(0,Math.min(zh+Ir/Bl,V.scrollHeight-K/Bl+ui)),Ar=kf===0?0:Math.max(0,Math.min(hu+Ar/kf,V.scrollWidth-de/kf+Zs)),B+=zh-Ir,M+=hu-Ar}z.push({el:V,top:Ir,left:Ar})}return z},Z_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"/>',J_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"/>',eOe='<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"/>',tOe='<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"/>',rOe='<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"/>',nOe='<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"/>',iOe='<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"/>',sOe='<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"/>',PZ='<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"/>',aOe=Object.freeze({__proto__:null,default:PZ}),oOe='<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"/>',lOe='<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"/>',cOe='<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"/>',uOe='<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"/>',dOe='<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"/>',fOe='<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"/>',pOe='<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"/>',hOe='<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"/>',mOe='<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"/>',gOe='<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"/>',yOe='<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"/>',vOe='<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"/>',bOe='<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"/>',xOe='<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"/>',wOe='<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"/>',kOe='<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"/>',SOe='<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"/>',COe='<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"/>',TOe='<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"/>',EOe='<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"/>',IOe='<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"/>',AOe='<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 ZD(t,e,r){return ac(t,tg(e,r))}function IE(t,e){return typeof t=="function"?t(e):t}function lp(t){return t.split("-")[0]}function AE(t){return t.split("-")[1]}function JD(t){return t==="x"?"y":"x"}function eN(t){return t==="y"?"height":"width"}function rg(t){return["top","bottom"].includes(lp(t))?"y":"x"}function tN(t){return JD(rg(t))}function LZ(t,e,r){r===void 0&&(r=!1);let n=AE(t),i=tN(t),s=eN(i),a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=px(a)),[a,px(a)]}function MZ(t){let e=px(t);return[EE(t),e,EE(e)]}function EE(t){return t.replace(/start|end/g,e=>ROe[e])}function LOe(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 _Z(t,e,r,n){let i=AE(t),s=LOe(lp(t),r==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(EE)))),s}function px(t){return t.replace(/left|right|bottom|top/g,e=>POe[e])}function MOe(t){return{top:0,right:0,bottom:0,left:0,...t}}function OZ(t){return typeof t!="number"?MOe(t):{top:t,right:t,bottom:t,left:t}}function cp(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 tg,ac,hx,mx,uo,POe,ROe,PE=yt(()=>{tg=Math.min,ac=Math.max,hx=Math.round,mx=Math.floor,uo=t=>({x:t,y:t}),POe={left:"right",right:"left",bottom:"top",top:"bottom"},ROe={start:"end",end:"start"}});function DZ(t,e,r){let{reference:n,floating:i}=t,s=rg(e),a=tN(e),o=eN(a),l=lp(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(AE(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 rN(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}=IE(e,t),h=OZ(p),v=o[f?d==="floating"?"reference":"floating":d],b=cp(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=cp(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 NZ,FZ,BZ,VZ=yt(()=>{PE();PE();NZ=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}=DZ(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}=DZ(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};FZ=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}=IE(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};let b=lp(i),y=rg(o),x=lp(o)===o,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!m?[px(o)]:MZ(o)),O=h!=="none";!f&&O&&C.push(..._Z(o,m,h,w));let S=[o,...C],T=await rN(e,v),E=[],P=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&E.push(T[b]),d){let M=LZ(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=rg(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{}}}},BZ=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}=IE(t,e),c={x:r,y:n},u=await rN(e,l),d=rg(lp(i)),f=JD(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=ZD(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=ZD(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 RE(){return typeof window<"u"}function up(t){return $Z(t)?(t.nodeName||"").toLowerCase():"#document"}function qi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function fo(t){var e;return(e=($Z(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function $Z(t){return RE()?t instanceof Node||t instanceof qi(t).Node:!1}function ga(t){return RE()?t instanceof Element||t instanceof qi(t).Element:!1}function po(t){return RE()?t instanceof HTMLElement||t instanceof qi(t).HTMLElement:!1}function jZ(t){return!RE()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof qi(t).ShadowRoot}function ig(t){let{overflow:e,overflowX:r,overflowY:n,display:i}=ya(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function UZ(t){return["table","td","th"].includes(up(t))}function gx(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function LE(t){let e=ME(),r=ga(t)?ya(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 zZ(t){let e=oc(t);for(;po(e)&&!dp(e);){if(LE(e))return e;if(gx(e))return null;e=oc(e)}return null}function ME(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function dp(t){return["html","body","#document"].includes(up(t))}function ya(t){return qi(t).getComputedStyle(t)}function yx(t){return ga(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function oc(t){if(up(t)==="html")return t;let e=t.assignedSlot||t.parentNode||jZ(t)&&t.host||fo(t);return jZ(e)?e.host:e}function qZ(t){let e=oc(t);return dp(e)?t.ownerDocument?t.ownerDocument.body:t.body:po(e)&&ig(e)?e:qZ(e)}function ng(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);let i=qZ(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),a=qi(i);if(s){let o=_E(a);return e.concat(a,a.visualViewport||[],ig(i)?i:[],o&&r?ng(o):[])}return e.concat(i,ng(i,[],r))}function _E(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}var HZ=yt(()=>{});function KZ(t){let e=ya(t),r=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=po(t),s=i?t.offsetWidth:r,a=i?t.offsetHeight:n,o=hx(r)!==s||hx(n)!==a;return o&&(r=s,n=a),{width:r,height:n,$:o}}function iN(t){return ga(t)?t:t.contextElement}function sg(t){let e=iN(t);if(!po(e))return uo(1);let r=e.getBoundingClientRect(),{width:n,height:i,$:s}=KZ(e),a=(s?hx(r.width):r.width)/n,o=(s?hx(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}function YZ(t){let e=qi(t);return!ME()||!e.visualViewport?_Oe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function OOe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==qi(t)?!1:e}function fp(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);let i=t.getBoundingClientRect(),s=iN(t),a=uo(1);e&&(n?ga(n)&&(a=sg(n)):a=sg(t));let o=OOe(s,r,n)?YZ(s):uo(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&&ga(n)?qi(n):n,h=f,m=_E(h);for(;m&&n&&p!==h;){let v=sg(m),b=m.getBoundingClientRect(),y=ya(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=_E(h)}}return cp({width:u,height:d,x:l,y:c})}function sN(t,e){let r=yx(t).scrollLeft;return e?e.left+r:fp(fo(t)).left+r}function XZ(t,e,r){r===void 0&&(r=!1);let n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(r?0:sN(t,n)),s=n.top+e.scrollTop;return{x:i,y:s}}function DOe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t,s=i==="fixed",a=fo(n),o=e?gx(e.floating):!1;if(n===a||o&&s)return r;let l={scrollLeft:0,scrollTop:0},c=uo(1),u=uo(0),d=po(n);if((d||!d&&!s)&&((up(n)!=="body"||ig(a))&&(l=yx(n)),po(n))){let p=fp(n);c=sg(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}let f=a&&!d&&!s?XZ(a,l,!0):uo(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 NOe(t){return Array.from(t.getClientRects())}function FOe(t){let e=fo(t),r=yx(t),n=t.ownerDocument.body,i=ac(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ac(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+sN(t),o=-r.scrollTop;return ya(n).direction==="rtl"&&(a+=ac(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}function BOe(t,e){let r=qi(t),n=fo(t),i=r.visualViewport,s=n.clientWidth,a=n.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;let c=ME();(!c||c&&e==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}function VOe(t,e){let r=fp(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=po(t)?sg(t):uo(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 GZ(t,e,r){let n;if(e==="viewport")n=BOe(t,r);else if(e==="document")n=FOe(fo(t));else if(ga(e))n=VOe(e,r);else{let i=YZ(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return cp(n)}function QZ(t,e){let r=oc(t);return r===e||!ga(r)||dp(r)?!1:ya(r).position==="fixed"||QZ(r,e)}function jOe(t,e){let r=e.get(t);if(r)return r;let n=ng(t,[],!1).filter(o=>ga(o)&&up(o)!=="body"),i=null,s=ya(t).position==="fixed",a=s?oc(t):t;for(;ga(a)&&!dp(a);){let o=ya(a),l=LE(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ig(a)&&!l&&QZ(t,a))?n=n.filter(u=>u!==a):i=o,a=oc(a)}return e.set(t,n),n}function $Oe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t,a=[...r==="clippingAncestors"?gx(e)?[]:jOe(e,this._c):[].concat(r),n],o=a[0],l=a.reduce((c,u)=>{let d=GZ(e,u,i);return c.top=ac(d.top,c.top),c.right=tg(d.right,c.right),c.bottom=tg(d.bottom,c.bottom),c.left=ac(d.left,c.left),c},GZ(e,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function UOe(t){let{width:e,height:r}=KZ(t);return{width:e,height:r}}function zOe(t,e,r){let n=po(e),i=fo(e),s=r==="fixed",a=fp(t,!0,s,e),o={scrollLeft:0,scrollTop:0},l=uo(0);if(n||!n&&!s)if((up(e)!=="body"||ig(i))&&(o=yx(e)),n){let f=fp(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=sN(i));let c=i&&!n&&!s?XZ(i,o):uo(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 nN(t){return ya(t).position==="static"}function WZ(t,e){if(!po(t)||ya(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return fo(t)===r&&(r=r.ownerDocument.body),r}function ZZ(t,e){let r=qi(t);if(gx(t))return r;if(!po(t)){let i=oc(t);for(;i&&!dp(i);){if(ga(i)&&!nN(i))return i;i=oc(i)}return r}let n=WZ(t,e);for(;n&&UZ(n)&&nN(n);)n=WZ(n,e);return n&&dp(n)&&nN(n)&&!LE(n)?r:n||zZ(t)||r}function HOe(t){return ya(t).direction==="rtl"}function JZ(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function WOe(t,e){let r=null,n,i=fo(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=mx(d),m=mx(i.clientWidth-(u+f)),v=mx(i.clientHeight-(d+p)),b=mx(u),x={rootMargin:-h+"px "+-m+"px "+-v+"px "+-b+"px",threshold:ac(0,tg(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&&!JZ(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 eJ(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=iN(t),u=i||s?[...c?ng(c):[],...ng(e)]:[];u.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),s&&b.addEventListener("resize",r)});let d=c&&o?WOe(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?fp(t):null;l&&v();function v(){let b=fp(t);m&&!JZ(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 _Oe,qOe,GOe,tJ,rJ,nJ,iJ=yt(()=>{VZ();PE();HZ();_Oe=uo(0);qOe=async function(t){let e=this.getOffsetParent||ZZ,r=this.getDimensions,n=await r(t.floating);return{reference:zOe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};GOe={convertOffsetParentRelativeRectToViewportRelativeRect:DOe,getDocumentElement:fo,getClippingRect:$Oe,getOffsetParent:ZZ,getElementRects:qOe,getClientRects:NOe,getDimensions:UOe,getScale:sg,isElement:ga,isRTL:HOe};tJ=BZ,rJ=FZ,nJ=(t,e,r)=>{let n=new Map,i={platform:GOe,...r},s={...i.platform,_c:n};return NZ(t,e,{...i,platform:s})}});var sJ={};ln(sJ,{SRTParser:()=>OE,default:()=>XOe});function XOe(){return new OE}var KOe,YOe,OE,aJ=yt(()=>{vx();KOe=/,/g,YOe="-->",OE=class extends og{parse(e,r){if(e==="")this.c&&(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null),this.e=ag.None;else if(this.e===ag.Cue)this.c.text+=(this.c.text?`
|
|
`:"")+e;else if(e.includes(YOe)){let n=this.q(e,r);n&&(this.c=new lc(n[0],n[1],n[2].join(" ")),this.c.id=this.n,this.e=ag.Cue)}this.n=e}q(e,r){return super.q(e.replace(KOe,"."),r)}}});var aN={};ln(aN,{ParseErrorBuilder:()=>QOe});var QOe,oN=yt(()=>{vx();QOe={r(){return new Hi({code:va.BadSignature,reason:"missing WEBVTT file header",line:1})},s(t,e){return new Hi({code:va.BadTimestamp,reason:`cue start timestamp \`${t}\` is invalid on line ${e}`,line:e})},t(t,e){return new Hi({code:va.BadTimestamp,reason:`cue end timestamp \`${t}\` is invalid on line ${e}`,line:e})},u(t,e,r){return new Hi({code:va.BadTimestamp,reason:`cue end timestamp \`${e}\` is greater than start \`${t}\` on line ${r}`,line:r})},y(t,e,r){return new Hi({code:va.BadSettingValue,reason:`invalid value for cue setting \`${t}\` on line ${r} (value: ${e})`,line:r})},x(t,e,r){return new Hi({code:va.UnknownSetting,reason:`unknown cue setting \`${t}\` on line ${r} (value: ${e})`,line:r})},w(t,e,r){return new Hi({code:va.BadSettingValue,reason:`invalid value for region setting \`${t}\` on line ${r} (value: ${e})`,line:r})},v(t,e,r){return new Hi({code:va.UnknownSetting,reason:`unknown region setting \`${t}\` on line ${r} (value: ${e})`,line:r})},T(t,e){return new Hi({code:va.BadFormat,reason:`format missing for \`${t}\` block on line ${e}`,line:e})}}});var fJ={};ln(fJ,{SSAParser:()=>FE,default:()=>ZOe});function cN(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 uN(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 ZOe(){return new FE}var DE,oJ,lJ,NE,cJ,uJ,dJ,lN,FE,pJ=yt(()=>{vx();DE=/^Format:[\s\t]*/,oJ=/^Style:[\s\t]*/,lJ=/^Dialogue:[\s\t]*/,NE=/[\s\t]*,[\s\t]*/,cJ=/\{[^}]+\}/g,uJ=/\\N/g,dJ=/^\[(.*)[\s\t]?Styles\]$/,lN=/^\[(.*)[\s\t]?Events\]$/,FE=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(()=>(oN(),aN))).ParseErrorBuilder)}parse(e,r){if(this.O)switch(this.O){case 1:if(e==="")this.O=0;else if(oJ.test(e))if(this.N){let n=e.replace(oJ,"").split(NE);this.S(n)}else this.g(this.f?.T("Style",r));else DE.test(e)?this.N=e.replace(DE,"").split(NE):lN.test(e)&&(this.N=null,this.O=2);break;case 2:if(e==="")this.Q();else if(lJ.test(e))if(this.Q(),this.N){let n=e.replace(lJ,"").split(NE),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(cJ,"").replace(uJ,`
|
|
`):DE.test(e)?this.N=e.replace(DE,"").split(NE):dJ.test(e)?(this.N=null,this.O=1):lN.test(e)&&(this.N=null)}else e===""||(dJ.test(e)?(this.N=null,this.O=1):lN.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=cN(m);v&&(n["--cue-color"]=v);break;case"BorderStyle":d=parseInt(m,10);break;case"BackColour":u=cN(m);break;case"OutlineColour":let b=cN(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&&uN(i*1.2,l*1.2,c),c?uN(i*(i/2),l*(i/2),p):uN(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 lc(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(cJ,"").replace(uJ,`
|
|
`),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=cc(e),s=cc(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 bJ(t,e){let r=new ReadableStream({start(n){let i=t.split(vJ);for(let s of i)n.enqueue(s);n.close()}});return $E(r,e)}async function $E(t,e){let r=e?.type??"vtt",n;if(typeof r=="string")switch(r){case"srt":n=(await Promise.resolve().then(()=>(aJ(),sJ))).default;break;case"ssa":case"ass":n=(await Promise.resolve().then(()=>(pJ(),fJ))).default;break;default:n=(await Promise.resolve().then(function(){return g6e})).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 xJ(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 hN(r.body,{type:i,encoding:s,...e})}async function hN(t,{encoding:e="utf-8",...r}={}){let n=t.pipeThrough(new fN(e));return $E(n,r)}function t6e(t){let e=parseInt(t,10);return Number.isNaN(e)?null:e}function xx(t){let e=parseInt(t.replace(e6e,""),10);return!Number.isNaN(e)&&e>=0&&e<=100?e:null}function mJ(t){if(!t.includes(hJ))return null;let[e,r]=t.split(hJ).map(xx);return e!==null&&r!==null?[e,r]:null}function r6e(t){let e=parseFloat(t);return Number.isNaN(e)?null:e}function cc(t){let e=t.match(h6e);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 m6e(){return new og}function gN(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&&y6e.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(v6e," "),s?.type==="v"?s.voice=dN(e):s?.type==="lang"&&(s.lang=dN(e)),e="",r=1):e+=u;break;case 5:u===">"&&(e="",s=i.pop(),r=1);break;case 6:if(u===">"){let d=cc(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(k6e.has(e)){let c=s;s=S6e(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_","");w6e.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:dN(e)};s?s.children.push(c):n.push(c),e=""}return r===1&&l(),n}function S6e(t){return{tagName:wJ[t],type:t,children:[]}}function dN(t){return t.replace(x6e,e=>b6e[e]||"'")}function bi(t,e,r){t.style.setProperty(`--${e}`,r+"")}function Nu(t,e,r=!0){t.setAttribute(`data-${e}`,r===!0?"":r+"")}function BE(t,e){t.setAttribute("data-part",e)}function C6e(t){return parseFloat(getComputedStyle(t).lineHeight)||0}function kJ(t){if(mN)throw Error("[media-captions] called `createVTTCueTemplate` on the server - use `renderVTTCueString`");let e=document.createElement("template");return e.innerHTML=UE(t),{cue:t,content:e.content}}function UE(t,e=0){return zE(gN(t),e)}function zE(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:""}>${zE(i.children)}</${i.tagName}>`}return n}function yN(t,e){if(!mN)for(let r of t.querySelectorAll('[data-part="timed"]')){let n=Number(r.getAttribute("data-time"));Number.isNaN(n)||(n>e?Nu(r,"future"):r.removeAttribute("data-future"),n<e?Nu(r,"past"):r.removeAttribute("data-past"))}}function T6e(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 vN(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 VE(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 E6e(t,e){return t.left<=e.right&&t.right>=e.left&&t.top<=e.bottom&&t.bottom>=e.top}function I6e(t,e){for(let r=0;r<e.length;r++)if(E6e(t,e[r]))return e[r];return null}function yJ(t,e){return e.top>=0&&e.bottom<=t.height&&e.left>=0&&e.right<=t.width}function A6e(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 P6e(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 bN(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 SJ(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 TJ(t,e,r,n){let i=bN(e,r);for(let s of CJ)bi(t,`${n}-${s}`,i[s]*100+"%")}function EJ(t,e,r,n){let i=1,s,a={...e};for(let o=0;o<n.length;o++){for(;A6e(t,e,n[o])||yJ(t,e)&&I6e(e,r);)VE(e,n[o],1);if(yJ(t,e))return e;let l=P6e(t,e);i>l&&(s={...e},i=l),e={...a}}return s||a}function R6e(t,e,r,n){let i=r.firstElementChild,s=_6e(e),a,o=[];if(r[Fu]||(r[Fu]=L6e(t,r)),a=SJ(t,{...r[Fu]}),r[wx])o=[r[wx]==="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=C6e(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()),VE(a,f,u)}else{let l=e.vertical==="",c=l?"+y":"+x",u=l?a.height:a.width;VE(a,c,(l?t.height:t.width)*s/100),VE(a,c,e.lineAlign==="center"?u/2:e.lineAlign==="end"?u:0),o=l?["-y","+y","-x","+x"]:["-x","+x","-y","+y"]}return a=EJ(t,a,n,o),TJ(r,t,a,"cue"),a}function L6e(t,e){let r=vN(e),n=M6e(e);if(e[wx]=!1,n.top&&(r.top=n.top,r.bottom=n.top+r.height,e[wx]="top"),n.bottom){let i=t.height-n.bottom;r.top=i-r.height,r.bottom=i,e[wx]="bottom"}return n.left&&(r.left=n.left),n.right&&(r.right=t.width-n.right),bN(t,r)}function M6e(t){let e={};for(let r of CJ)e[r]=parseFloat(t.style.getPropertyValue(`--cue-${r}`));return e}function _6e(t){return t.line==="auto"?t.snapToLines?-1:100:t.line}function O6e(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 D6e(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 F6e(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[Fu]||(r[Fu]=bN(t,vN(r)));let o={...r[Fu]};return o=SJ(t,o),o.width=r.clientWidth,o.height=s,o.right=o.left+o.width,o.bottom=o.top+s,o=EJ(t,o,n,N6e),TJ(r,t,o,"region"),o}var va,Hi,vJ,fN,pN,kx,mN,JOe,lc,Sx,hJ,e6e,n6e,gJ,i6e,lg,s6e,a6e,o6e,l6e,bx,c6e,u6e,d6e,f6e,p6e,h6e,ag,og,g6e,y6e,v6e,wJ,b6e,x6e,w6e,k6e,Fu,CJ,wx,N6e,jE,vx=yt(()=>{va={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}},vJ=/\r?\n|\r/gm,fN=class{writable;readable;constructor(e){let r=new pN(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()}})}},pN=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(vJ);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()}};kx=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)}},mN=typeof document>"u",JOe=mN?kx:window.VTTCue,lc=class extends JOe{region=null;vertical="";snapToLines=!0;line="auto";lineAlign="start";position="auto";positionAlign="auto";size=100;align="center";style},Sx=class{id="";width=100;lines=3;regionAnchorX=0;regionAnchorY=100;viewportAnchorX=0;viewportAnchorY=100;scroll=""},hJ=",",e6e="%";n6e="WEBVTT",gJ=",",i6e="%",lg=/[:=]/,s6e=/^[\s\t]*(region|vertical|line|position|size|align)[:=]/,a6e="NOTE",o6e="REGION",l6e=/^REGION:?[\s\t]+/,bx=/[\s\t]+/,c6e="-->",u6e=/[\s\t]*-->[\s\t]+/,d6e=/start|center|end|left|right/,f6e=/start|center|end/,p6e=/line-(?:left|right)|center|auto/,h6e=/^(?:(\d{1,2}):)?(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/,ag=(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))(ag||{}),og=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(()=>(oN(),aN))).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&&s6e.test(e)?this.o(e.split(bx),r):this.c.text+=(n?`
|
|
`:"")+e}break;case 3:this.p(e.split(bx),r);break}else if(e.startsWith(a6e))this.e=4;else if(e.startsWith(o6e))this.e=3,this.d=new Sx,this.p(e.replace(l6e,"").split(bx),r);else if(e.includes(c6e)){let n=this.q(e,r);n&&(this.c=new lc(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(lg.test(e)){let[n,i]=e.split(lg);n&&(this.i[n]=(i||"").replace(bx,""))}}else e.startsWith(n6e)?this.e=1:this.g(this.f?.r())}q(e,r){let[n,i=""]=e.split(u6e),[s,...a]=i.split(bx),o=cc(n),l=cc(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(lg.test(e[i])){n=!1;let[s,a]=e[i].split(lg);switch(s){case"id":this.d.id=a;break;case"width":let o=xx(a);o!==null?this.d.width=o:n=!0;break;case"lines":let l=t6e(a);l!==null?this.d.lines=l:n=!0;break;case"regionanchor":let c=mJ(a);c!==null?(this.d.regionAnchorX=c[0],this.d.regionAnchorY=c[1]):n=!0;break;case"viewportanchor":let u=mJ(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,lg.test(e[i])){let[s,a]=e[i].split(lg);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(gJ);if(l.includes(i6e)){let h=xx(l);h!==null?(this.c.line=h,this.c.snapToLines=!1):n=!0}else{let h=r6e(l);h!==null?this.c.line=h:n=!0}f6e.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(gJ),f=xx(u);f!==null?this.c.position=f:n=!0,d&&p6e.test(d)?this.c.positionAlign=d:d&&(n=!0);break;case"size":let p=xx(a);p!==null?(this.c.size=p,p<100&&(this.c.region=null)):n=!0;break;case"align":d6e.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)}}};g6e=Object.freeze({__proto__:null,VTTBlock:ag,VTTParser:og,default:m6e,parseVTTTimestamp:cc}),y6e=/[0-9]/,v6e=/[\s\t]+/,wJ={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span",timestamp:"span"},b6e={"&":"&","<":"<",">":">",""":'"',"'":"'"," ":"\xA0","‎":"\u200E","‏":"\u200F"},x6e=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,w6e=new Set(["white","lime","cyan","red","yellow","magenta","blue","black"]),k6e=new Set(Object.keys(wJ));Fu=Symbol(0);CJ=["top","left","right","bottom"];wx=Symbol(0);N6e=["-y","+y","-x","+x"];jE=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,Nu(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"),BE(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=T6e(()=>{this.D=!1,this.G();for(let e of this.j.values())e[Fu]=null;for(let e of this.l.values())e&&(e[Fu]=null);this.H(!0)},50);G(){this.z=vN(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(()=>Nu(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(F6e(this.z,r.region,c,s)):s.push(R6e(this.z,r,c,s)),a.add(l?r.region:r)}}yN(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 BE(r,"region"),Nu(r,"id",e.id),Nu(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=O6e(e),i=D6e(e,this.C);if(BE(r,"cue-display"),e.vertical!==""&&Nu(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 BE(s,"cue"),e.id&&Nu(s,"id",e.id),s.innerHTML=UE(e),r.append(s),r}F(e){return e.region&&e.size===100&&e.vertical===""&&e.line==="auto"}}});var Cx={};ln(Cx,{CaptionsRenderer:()=>jE,ParseError:()=>Hi,ParseErrorCode:()=>va,TextCue:()=>kx,VTTCue:()=>lc,VTTRegion:()=>Sx,createVTTCueTemplate:()=>kJ,parseByteStream:()=>hN,parseResponse:()=>xJ,parseText:()=>bJ,parseTextStream:()=>$E,parseVTTTimestamp:()=>cc,renderVTTCueString:()=>UE,renderVTTTokensString:()=>zE,tokenizeVTTCue:()=>gN,updateTimedVTTCueNodes:()=>yN});var Tx=yt(()=>{vx()});var IJ={};ln(IJ,{AudioProvider:()=>xN});var zyt,xN,AJ=yt(()=>{"use client";lo();ba();zyt=Z(Te(),1),xN=class extends Ex{$$PROVIDER_TYPE="AUDIO";get type(){return"audio"}airPlay;constructor(e,r){super(e,r),pn(()=>{this.airPlay=new Ix(this.media,r)},this.scope)}setup(){super.setup(),this.type==="audio"&&this.ctx.notify("provider-setup",this)}get audio(){return this.media}}});var PJ={};ln(PJ,{HLSProvider:()=>SN});async function V6e(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 j6e(t,e={}){if(me(t)){e.onLoadStart?.();try{if(await Px(t),!hn(window.Hls))throw Error("");let r=window.Hls;return e.onLoaded?.(r),r}catch(r){e.onLoadError?.(r)}}}var Wyt,B6e,wN,kN,$6e,SN,RJ=yt(()=>{"use client";lo();co();ba();Wyt=Z(Te(),1),B6e=t=>Du(t),wN=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(B6e(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,cg&&(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}},kN=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 j6e(this.#e,e);if(Jt(r)&&!me(this.#e)&&(r=await V6e(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=dg(e);this.#t.player.dispatch(new Ie("hls-lib-load-error",{detail:r})),this.#t.notify("error",{message:r.message,code:4,error:r})}};$6e="https://cdn.jsdelivr.net",SN=class extends ug{$$PROVIDER_TYPE="HLS";#e=null;#t=new wN(this.video,this.ctx);get ctor(){return this.#e}get instance(){return this.#t.instance}static supported=Ax();get type(){return"hls"}get canLiveSync(){return!0}#r=`${$6e}/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)&&xa(this.#r)}setup(){super.setup(),new kN(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 fg,CN=yt(()=>{"use client";ba();lo();co();fg=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",LJ(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 MJ={};ln(MJ,{getVimeoVideoInfo:()=>IN,resolveVimeoVideoId:()=>EN});function EN(t){let e=t.match(U6e);return{videoId:e?.[1],hash:e?.[2]}}async function IN(t,e,r){if(TN.has(t))return TN.get(t);if(qE.has(t))return qE.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 TN.set(t,c),c}).finally(()=>qE.delete(t));return qE.set(t,i),i}var U6e,TN,qE,AN=yt(()=>{"use client";U6e=/(?:https:\/\/)?(?:player\.)?vimeo(?:\.com)?\/(?:video\/)?(\d+)(?:(?:\?hash=|\?h=|\/)(.*))?/,TN=new Map,qE=new Map});var _J={};ln(_J,{VimeoProvider:()=>PN});var nvt,z6e,PN,OJ=yt(()=>{"use client";lo();co();ba();CN();AN();nvt=Z(Te(),1),z6e=["bufferend","bufferstart","durationchange","ended","enterpictureinpicture","error","fullscreenchange","leavepictureinpicture","loaded","playProgress","loadProgress","pause","play","playbackratechange","qualitychange","seeked","seeking","timeupdate","volumechange","waiting"],PN=class extends fg{$$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(){xa(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}=EN(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=nc(),n=new AbortController;return this.#f=r,IN(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 z6e)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=nc(),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 DJ={};ln(DJ,{findYouTubePoster:()=>H6e,resolveYouTubeVideoId:()=>LN});function LN(t){return t.match(q6e)?.[1]}async function H6e(t,e){if(RN.has(t))return RN.get(t);if(HE.has(t))return HE.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=G6e(t,s,a);if((await fetch(o,{mode:"no-cors",signal:e.signal})).status<400){RN.set(t,o),n(o);return}}}).catch(()=>"").finally(()=>HE.delete(t));return HE.set(t,r),r}function G6e(t,e,r){return`https://i.ytimg.com/${r?"vi_webp":"vi"}/${t}/${e}.${r?"webp":"jpg"}`}var q6e,RN,HE,MN=yt(()=>{"use client";q6e=/(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)(?:\/shorts)?\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/,RN=new Map,HE=new Map});var NJ={};ln(NJ,{YouTubeProvider:()=>_N});var cvt,pp,_N,FJ=yt(()=>{"use client";lo();co();ba();CN();MN();cvt=Z(Te(),1),pp={Ended:0,Playing:1,Paused:2,Buffering:3,Cued:5},_N=class extends fg{$$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(){xa(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=LN(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=nc(),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===pp.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===pp.Playing,a=e===pp.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 pp.Cued:this.#f(r);break;case pp.Playing:this.#e.notify("playing",void 0,r);break;case pp.Paused:this.#d(r);break;case pp.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(ox(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)&&hE(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 BJ={};ln(BJ,{GoogleCastProvider:()=>NN});var hvt,ON,DN,NN,VJ=yt(()=>{"use client";lo();co();ba();BN();hvt=Z(Te(),1),ON=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}},DN=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=Lx();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()}},NN=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 DN(e,r,this.#F.bind(this))}get type(){return"google-cast"}get currentSrc(){return this.#n}get player(){return this.#e}get cast(){return hp()}get session(){return Rx()}get media(){return Lx()}get hasActiveSession(){return GE(this.#n)}setup(){this.#d(),this.#p(),this.#r.setup(),this.#t.notify("provider-setup",this)}#d(){FN(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 YD(r))this.#e.controller.addEventListener(i,n);Ne(()=>{for(let i of YD(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),GE(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(WE(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 ON(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 $J={};ln($J,{getCastContext:()=>hp,getCastErrorMessage:()=>WE,getCastSession:()=>Rx,getCastSessionMedia:()=>Lx,hasActiveCastSession:()=>GE,listenCastContextEvent:()=>FN,loader:()=>Q6e});function W6e(){return"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"}function K6e(){return!!window.cast?.framework}function Y6e(){return!!window.chrome?.cast?.isAvailable}function jJ(){return hp().getCastState()===cast.framework.CastState.CONNECTED}function hp(){return window.cast.framework.CastContext.getInstance()}function Rx(){return hp().getCurrentSession()}function Lx(){return Rx()?.getSessionObj().media[0]}function GE(t){return Lx()?.media.contentId===t?.src}function X6e(){return{language:"en-US",autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,resumeSavedSession:!0,androidReceiverCompatible:!0}}function WE(t){return`Google Cast Error Code: ${t}`}function FN(t,e){return We(hp(),t,e)}var VN,Q6e,BN=yt(()=>{"use client";ba();lo();co();VN=class{name="google-cast";target;#e;get cast(){return hp()}mediaType(){return"video"}canPlay(e){return cg&&!Mx&&KE(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:Rx()?.getCastDevice().friendlyName}),jJ()&&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,jJ()?"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(()=>(VJ(),BJ))).GoogleCastProvider(this.#e,e)}async#t(e){if(K6e())return;let r=e.player.createEvent("google-cast-load-start");e.player.dispatch(r),await Px(W6e()),await customElements.whenDefined("google-cast-launcher");let n=e.player.createEvent("google-cast-loaded",{trigger:r});if(e.player.dispatch(n),!Y6e())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(),WE(r))}#n(e){this.cast?.setOptions({...X6e(),...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}},Q6e=Object.freeze({__proto__:null,GoogleCastLoader:VN})});function ZE(t){return!me(t)&&"width"in t&&"height"in t&&Rr(t.width)&&Rr(t.height)}function tF(){return iee()&&hn(screen.orientation.unlock)}function iee(){return!le&&!Jt(window.screen.orientation)&&!Jt(window.screen.orientation.lock)}function see(t,e){return le?!1:(t||(t=document.createElement("audio")),t.canPlayType(e).length>0)}function aee(t,e){return le?!1:(t||(t=document.createElement("video")),t.canPlayType(e).length>0)}function rF(t){return le?!1:(t||(t=document.createElement("video")),t.canPlayType("application/vnd.apple.mpegurl").length>0)}function nF(t){return le?!1:!!document.pictureInPictureEnabled&&!t?.disablePictureInPicture}function iF(t){return le?!1:hn(t?.webkitSupportsPresentationMode)&&hn(t?.webkitSetPresentationMode)}async function oee(){let t=document.createElement("video");return t.volume=.5,await kZ(0),t.volume===.5}function J6e(){return le?void 0:window?.ManagedMediaSource??window?.MediaSource??window?.WebKitMediaSource}function eDe(){return le?void 0:window?.SourceBuffer??window?.WebKitSourceBuffer}function Ax(){if(le)return!1;let t=J6e();if(Jt(t))return!1;let e=t&&hn(t.isTypeSupported)&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=eDe(),n=Jt(r)||!Jt(r.prototype)&&hn(r.prototype.appendBuffer)&&hn(r.prototype.remove);return!!e&&!!n}function lee(){return Ax()}function GN(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 Bu(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 cee(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 uee(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)),cee(t),e)}function sF({src:t,type:e}){return me(t)?dee.test(t)||fee.has(e)||t.startsWith("blob:")&&e==="audio/object":e==="audio/object"}function aF(t){return me(t.src)?pee.test(t.src)||hee.has(t.type)||t.src.startsWith("blob:")&&t.type==="video/object"||bp(t)&&(le||rF()):t.type==="video/object"}function bp({src:t,type:e}){return me(t)&&mee.test(t)||yee.has(e)}function N2({src:t,type:e}){return me(t)&&gee.test(t)||vee.has(e)}function KE(t){return me(t.src)&&(sF(t)||aF(t)||bp(t))}function bee(t){return!le&&typeof window.MediaStream<"u"&&t instanceof window.MediaStream}function LJ(t,e){let r=new URL(t);for(let n of Object.keys(e))r.searchParams.set(n,e[n]+"");return r.toString()}function xa(t,e="preconnect"){if(le)return!1;let r=document.querySelector(`link[href="${t}"]`);if(!ha(r))return!0;let n=document.createElement("link");return n.rel=e,n.href=t,n.crossOrigin="true",document.head.append(n),!0}function Px(t){if(_x[t])return _x[t].promise;let e=nc(),r=document.querySelector(`script[src="${t}"]`);if(!ha(r))return e.resolve(),e.promise;_x[t]=e;let n=document.createElement("script");return n.src=t,n.onload=()=>{e.resolve(),delete _x[t]},n.onerror=()=>{e.reject(),delete _x[t]},setTimeout(()=>document.head.append(n),0),e.promise}function Nx(t){return t==="use-credentials"?"include":me(t)?"same-origin":void 0}function WN(t,e){return e>=t.startTime&&e<t.endTime}function Sw(t,e,r){let n=null,i=ip();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 lDe.test(t.kind)}function xee(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 KN(t,e=!1){let r=e?wee:cDe;$u.reset(t,n=>r.has(n)),Cs()}function oF(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(Cw)}function Rn(t,e=2){return Number(t.toFixed(e))}function YN(t){return String(t).split(".")[1]?.length??0}function lF(t,e,r){return Math.max(t,Math.min(r,e))}function UJ(t,e){let r=e.composedPath()[0];return BD(r)&&t.contains(r)}function bDe(t){return XN.add(t),()=>XN.delete(t)}function vt(t,e,r){t.hasAttribute(e)||t.setAttribute(e,r)}function Uu(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 kee(t){let e=getComputedStyle(t);return e.display!=="none"&&parseInt(e.opacity)>0}function xDe(t){return!!t&&("checkVisibility"in t?t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):kee(t))}function See(t,e){return bDe(()=>e(xDe(t)))}function Cee(t,e,r){for(;e;){if(e===t)return!0;if(r?.(e))break;e=e.parentElement}return!1}function Vu(t,e){return new it(t).add("pointerup",r=>{r.button===0&&!r.defaultPrevented&&e(r)}).add("keydown",r=>{gE(r)&&e(r)})}function cF(t){return Zm(t)&&(t.touches.length>1||t.changedTouches.length>1)}function Tee(t){if(le)return t();let e=ip(),r=window.requestAnimationFrame(()=>{pn(t,e),r=-1});return()=>void window.cancelAnimationFrame(r)}function Eee(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 eJ(e,t,()=>{nJ(e,t,{placement:o,middleware:[...a.middleware??[],rJ({fallbackAxisSideDirection:"start",crossAxis:!1}),tJ()],...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 wDe(t){return getComputedStyle(t).animationName!=="none"}function n2(t){return t instanceof HTMLElement}function Iee(t,e){return[...t].sort(e?TDe:CDe)}function CDe(t,e){return t.height===e.height?(t.bitrate??0)-(e.bitrate??0):t.height-e.height}function TDe(t,e){return e.height===t.height?(e.bitrate??0)-(t.bitrate??0):e.height-t.height}function ho(t){return t?.$$PROVIDER_TYPE==="AUDIO"}function mo(t){return t?.$$PROVIDER_TYPE==="VIDEO"}function zu(t){return t?.$$PROVIDER_TYPE==="YOUTUBE"}function Aee(t){return!le&&t instanceof HTMLAudioElement}function Pee(t){return!le&&t instanceof HTMLVideoElement}function Ree(t){return Aee(t)||Pee(t)}function ADe(t){return t.replace(/Shift\+(\d)/g,(e,r)=>IDe[r-1])}function PDe(t){for(let e of Dx)if(t[e.toLowerCase()+"Key"])return!0;return!1}function jN(t){if(ic.fullscreenElement===t)return!0;try{return t.matches(ic.fullscreenPseudoClass)}catch{return!1}}function qJ(){if(!JN)throw Error("[vidstack] no fullscreen API")}function uF(){return QE??=new AudioContext}function RDe(){let t=uF(),e=t.createGain();return e.connect(t.destination),f2.push(e),e}function LDe(t,e){let r=uF(),n=r.createMediaElementSource(t);return e&&n.connect(e),p2.push(n),n}function MDe(t){let e=f2.indexOf(t);e!==-1&&(f2.splice(e,1),t.disconnect(),Mee())}function _De(t){let e=p2.indexOf(t);e!==-1&&(p2.splice(e,1),t.disconnect(),Mee())}function Mee(){QE&&f2.length===0&&p2.length===0&&QE.close().then(()=>{QE=null})}function HJ(t){return le||t?.type==="blur"||document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function DDe(t,e){return Array.from(t.children).find(r=>r.track===e)}function GJ(t){try{return new Intl.DisplayNames(navigator.languages,{type:"language"}).of(t)??null}catch{return null}}function dg(t){return t instanceof Error?t:Error(typeof t=="string"?t:JSON.stringify(t))}function uc(t,e){if(!t)throw Error("Assertion failed.")}async function BDe(t,e={}){if(!Jt(t)){if(e.onLoadStart?.(),jDe(t))return e.onLoaded?.(t),t;if(WJ(t)){let r=t.MediaPlayer;return e.onLoaded?.(r),r}try{let r=(await t())?.default;if(WJ(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 VDe(t,e={}){if(me(t)){e.onLoadStart?.();try{if(await Px(t),!hn(window.dashjs.MediaPlayer))throw Error("");let r=window.dashjs.MediaPlayer;return e.onLoaded?.(r),r}catch(r){e.onLoadError?.(r)}}}function jDe(t){return t&&t.prototype&&t.prototype!==Function}function WJ(t){return t&&"MediaPlayer"in t}function $N(t,e){let r=String(t),n=r.length;if(n<e){let s=e-n;return`${"0".repeat(s)}${t}`}return r}function _ee(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 pc(t,{padHrs:e=null,padMins:r=null,showHrs:n=!1,showMs:i=!1}={}){let{hours:s,minutes:a,seconds:o,fraction:l}=_ee(t),c=e?$N(s,2):s,u=r||ha(r)&&t>=3600?$N(a,2):a,d=$N(o,2),f=i&&l>0?`.${String(l).replace(/^0?\./,"")}`:"",p=`${u}:${d}${f}`;return s>0||n?`${c}:${p}`:p}function jx(t){let e=[],{hours:r,minutes:n,seconds:i}=_ee(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 HDe(t){return t?"true":"false"}function Ln(t){return()=>HDe(t())}function GDe(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function zN(t,e){if(!(t&&e))throw Error("[vidstack] media not ready")}function KJ(t,e){if(!e?.supported)throw Error("[vidstack] no fullscreen support")}function WDe(t){if(!(!GDe()||!t))throw Error("[vidstack] autoplay blocked")}function YE(t,e){Ae(t,"data-focus",e),Ae(t,"data-hocus",e)}function XJ(t,e){Ae(t,"data-hocus",e),Ae(t,"data-hover",e)}function YDe(t,e){return fetch(t,e).then(r=>r.text()).then(r=>/type="static"/.test(r)?"on-demand":"live")}function Oee(t,e){return fetch(t,e).then(r=>r.text()).then(r=>{let n=XDe(r);if(n)return Oee(/^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"&&QDe(r)>=10&&(/#EXT-X-DVR-ENABLED:\s*true/.test(r)||r.includes("#EXT-X-DISCONTINUITY"))?"live:dvr":i})}function XDe(t){let e=t.match(/#EXT-X-STREAM-INF:[^\n]+(\n[^\n]+)*/g);return e?e[0].split(`
|
|
`)[1].trim():null}function QDe(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 QJ(t){return(Lr(t)?t:[t]).map(e=>me(e)?{src:e,type:ZJ(e)}:{...e,type:ZJ(e.src,e.type)})}function ZJ(t,e){return me(e)&&e.length?e:me(t)&&x4.has(t)?x4.get(t):!e&&bp({src:t,type:""})?"application/x-mpegurl":!e&&N2({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 JJ(t,e){return t?.src===e?.src&&t?.type===e?.type}function eee(t,e,r){let n=e-t,i=r-t;return n>0?i/n:0}function tNe(t,e,r,n){return lF(t,Rn(r,YN(n)),e)}function rNe(t,e,r,n){let i=lF(0,r,1),s=e-t,a=s*i,o=a/n,l=n*Math.round(o);return t+l}function Dee(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 sNe(t,e){let r=XD(t,e);for(let{el:n,top:i,left:s}of r)n.scroll({top:i,left:s,behavior:e.behavior})}function aNe(t,e={}){sNe(t,{scrollMode:"if-needed",block:"center",inline:"center",...e})}function mNe(t){return er.isValidElement(t)&&t.type===hNe}function gNe(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 Bee(t){return t?.$$PROVIDER_TYPE==="REMOTION"}function Ew(t,e){let r=rc(qu);return Ut((e?.current?.$state||r||vNe)[t])}function Wi(t,e){let r=rc($u);return Ut((e?.current?.$state||r||Vee)[t])}function B2(t){let e=rc($u);return KD(t?.current?t.current.$state:e||Vee)}var er,le,Z6e,Mx,nee,cg,JE,Yt,dee,fee,pee,hee,mee,gee,yee,vee,_x,tDe,rDe,nDe,iDe,sDe,aDe,oDe,Re,Kn,lDe,$u,wee,cDe,Cw,gp,e2,uDe,dDe,fDe,pDe,hDe,mDe,gDe,yDe,vDe,Se,Bx,Ox,t2,r2,XN,QN,i2,s2,kDe,SDe,Qr,a2,fc,Lee,Dx,EDe,zJ,ZN,IDe,o2,l2,JN,c2,Vx,u2,pg,d2,QE,f2,p2,e4,ODe,t4,nl,r4,n4,Ex,i4,Ix,s4,a4,o4,l4,c4,ug,NDe,FDe,u4,d4,$De,f4,UDe,h2,m2,g2,UN,zDe,qDe,y2,p4,h4,v2,m4,g4,KDe,y4,v4,YJ,b4,b2,Es,x2,Dt,x4,w4,k4,w2,ZDe,S4,C4,T4,k2,mp,JDe,E4,I4,A4,Mn,S2,eNe,P4,R4,L4,M4,_4,O4,D4,N4,F4,qu,C2,dF,Fx,qN,B4,hg,Gi,yp,dc,XE,T2,E2,V4,I2,nNe,A2,iNe,j4,$4,U4,z4,q4,P2,R2,F2,il,oNe,lNe,H4,cNe,uNe,Tw,dNe,ju,$x,fNe,G4,HN,W4,K4,Ux,L2,Nee,M2,pNe,Y4,X4,Q4,Z4,J4,vp,_2,zx,qx,Hx,O2,Gx,Wx,Kx,Yx,Xx,Qx,Zx,Jx,ew,tw,rw,nw,mg,iw,sw,aw,ow,lw,cw,uw,dw,fw,pw,hw,mw,gw,yw,vw,bw,xw,ww,D2,gg,kw,Fee,eF,hNe,yNe,ke,tee,vNe,ree,Vee,ba=yt(()=>{"use client";er=Z(Te(),1);ux();lo();co();QD();iJ();le=typeof document>"u",Z6e=le?"":navigator?.userAgent.toLowerCase()||"",Mx=!le&&/iphone|ipad|ipod|ios|crios|fxios/i.test(Z6e),nee=!le&&/(iphone|ipod)/gi.test(navigator?.platform||""),cg=!le&&!!window.chrome,JE=!le&&(!!window.safari||Mx);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}};dee=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,fee=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac","audio/m4a","audio/m4b","audio/mp4a","audio/mp4"]),pee=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,hee=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),mee=/\.(m3u8)($|\?)/i,gee=/\.(mpd)($|\?)/i,yee=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),vee=new Set(["application/dash+xml"]);_x={};tDe=Symbol(0),rDe=Symbol(0),nDe=Symbol(0),iDe=Symbol(0),sDe=Symbol(0),aDe=Symbol(0),oDe=Symbol(0),Re={crossOrigin:tDe,readyState:rDe,updateActiveCues:nDe,canLoad:iDe,onModeChange:sDe,native:aDe,nativeHLS:oDe};Kn=class extends Xm{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})),WN(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];WN(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(()=>(Tx(),Cx)).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(()=>(Tx(),Cx)),i=this[Re.crossOrigin]?.(),s=this.#o(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:Nx(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}=xee(e,r,n);this.#i=i,this.#s=s}catch(i){this.#f(i)}}#p(e){this.dispatchEvent(new Ie("cue-change",{trigger:e}))}},lDe=/captions|subtitles/;$u=new oo({artist:"",artwork:null,audioTrack:null,audioTracks:[],autoPlay:!1,autoPlayError:null,audioGain:null,buffered:new Yt,canLoad:!1,canLoadPoster:!1,canFullscreen:!1,canOrientScreen:tF(),canPictureInPicture:!1,canPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,get iOSControls(){return nee&&this.mediaType==="video"&&(!this.playsInline||!ic.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=GN(this.buffered)??0;return Math.max(t,this.clipStartTime)},get bufferedEnd(){let t=Bu(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=GN(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?Bu(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}),wee=new Set(["autoPlayError","autoPlaying","buffered","canPlay","error","paused","played","playing","seekable","seeking","waiting"]),cDe=new Set([...wee,"ended","inferredPoster","inferredStreamType","inferredTitle","intrinsicDuration","inferredLiveDVRWindow","liveSyncPosition","realCurrentTime","savedState","started","userBehindLiveEdge"]);Cw=rl();gp=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){}},e2=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=sc(this.saveTime.bind(this),1e3);saveTime(){if(le||!this.mediaId)return;let e=(this.#e.time??0).toString();localStorage.setItem(this.mediaId,e)}},uDe=Symbol(0),dDe=Symbol(0),fDe=Symbol(0),pDe=Symbol(0),hDe=Symbol(0),mDe=Symbol(0),gDe=Symbol(0),yDe=Symbol(0),vDe=Symbol(0),Se={add:uDe,remove:dDe,reset:fDe,select:pDe,readonly:hDe,setReadonly:mDe,onReset:gDe,onRemove:yDe,onUserSelect:vDe},Bx=class extends Xm{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})))}},Ox=Symbol(0),t2=class extends Bx{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[Ox]=!1,Object.defineProperty(e,"selected",{get(){return this[Ox]},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?.[Ox])return;let i=this.selected;e&&(e[Ox]=r),(r?i!==e:i===e)&&(i&&(i[Ox]=!1),this.dispatchEvent(new Ie("change",{detail:{prev:i,current:this.selected},trigger:n})))}},r2=class extends t2{};XN=new Set;if(!le){let t=function(){for(let e of XN)try{e()}catch{}window.requestAnimationFrame(t)};t()}QN=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);n2(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)}}},i2=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 QN,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}},s2=class extends Bx{#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=fx(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}},kDe=Symbol(0),SDe=Symbol(0),Qr={setAuto:kDe,enableAuto:SDe},a2=class extends t2{#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})))}};fc=class extends Wn{},Lee={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:"<"},Dx=new Set(["Shift","Alt","Meta","Ctrl"]),EDe='button, [role="button"]',zJ='input, textarea, select, [contenteditable], [role^="menuitem"], [role="timer"]',ZN=class extends fc{#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(zJ))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||Dx.has(e.key))return;let r=document.activeElement;if(r?.matches(zJ)||gE(e)&&r?.matches(EDe))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&&!PDe(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){Ree(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=>ADe(l).replace(/Control/g,"Ctrl").split("+"))?.some(l=>{let c=new Set(l.filter(u=>Dx.has(u)));for(let u of Dx){let d=u.toLowerCase()+"Key";if(!c.has(u)&&e[d])return!1}return l.every(u=>Dx.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))}},IDe=["!","@","#","$","%","^","&","*","(",")"];o2=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)}}},l2=class extends fc{#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||cF(e)||(Jm(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}))}},JN=ic.fullscreenEnabled,c2=class extends Wn{#e=!1;#t=!1;get active(){return this.#t}get supported(){return JN}onConnect(){new it(ic).add("fullscreenchange",this.#n.bind(this)).add("fullscreenerror",this.#i.bind(this)),Ne(this.#r.bind(this))}async#r(){JN&&await this.exit()}#n(e){let r=jN(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||jN(this.el)?void 0:(qJ(),ic.requestFullscreen(this.el))}catch(e){throw this.#e=!1,e}}async exit(){if(!(!this.el||!jN(this.el)))return qJ(),ic.exitFullscreen()}};Vx=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=tF();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"}},u2=class{name="audio";target;canPlay(e){return sF(e)?le||!me(e.src)||e.type==="?"||see(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(()=>(AJ(),IJ))).AudioProvider(this.target,e)}},pg=class{name="video";target;canPlay(e){return aF(e)?le||!me(e.src)||e.type==="?"||aee(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 NDe})).VideoProvider(this.target,e)}},d2=class t extends pg{static supported=Ax();name="hls";canPlay(e){return t.supported&&bp(e)}async load(e){if(le)throw Error("[vidstack] can not load hls provider server-side");return new(await Promise.resolve().then(()=>(RJ(),PJ))).HLSProvider(this.target,e)}},QE=null,f2=[],p2=[];e4=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=RDe(),this.#n&&this.#n.connect(this.#r)),this.#n||(this.#n=LDe(this.#e,this.#r)),this.#r.gain.value=e,this.#t(e)}}removeGain(){this.#r&&(this.#n&&this.#n.connect(uF().destination),this.#s(),this.#t(null))}destroy(){this.#i(),this.#s()}#i(){if(this.#n)try{_De(this.#n)}catch{}finally{this.#n=null}}#s(){if(this.#r)try{MDe(this.#r)}catch{}finally{this.#r=null}}},ODe=["focus","blur","visibilitychange","pageshow","pagehide"],t4=class{#e=be(HJ());#t=be(le?"visible":document.visibilityState);#r;connect(){let e=new it(window),r=this.#n.bind(this);for(let n of ODe)e.add(n,r);JE&&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){JE&&window.clearTimeout(this.#r),(e.type!=="blur"||this.#e()==="active")&&(this.#e.set(HJ(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())})}},r4=class{#e;#t;#r=!1;#n=!1;#i=!1;#s=new nl(this.#d.bind(this));#a=new t4;#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;!(JE&&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),(Mx||JE&&bp(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()&&DD(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)&&YN(this.#l.duration)>YN(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)}},n4=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}}},Ex=class{constructor(e,r){this.media=e,this.ctx=r,this.audioGain=new e4(e,n=>{this.ctx.notify("audio-gain-change",n)})}scope=yi();currentSrc=null;audioGain;setup(){new r4(this,this.ctx),"audioTracks"in this.media&&new n4(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||"",bee(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}},i4=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}},Ix=class extends i4{type="airplay";get canPrompt(){return"WebKitPlaybackTargetAvailabilityEvent"in window}},s4=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||DDe(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)}}};a4=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 nF(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)}},o4=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 iF(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)})}},l4=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")}},c4=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")}},ug=class extends Ex{$$PROVIDER_TYPE="VIDEO";get type(){return"video"}airPlay;fullscreen;pictureInPicture;constructor(e,r){super(e,r),pn(()=>{if(this.airPlay=new Ix(e,r),iF(e)){let n=new o4(e,r);this.fullscreen=new l4(n),this.pictureInPicture=new c4(n)}else nF(e)&&(this.pictureInPicture=new a4(e,r))},this.scope)}setup(){super.setup(),rF(this.video)&&new s4(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}},NDe=Object.freeze({__proto__:null,VideoProvider:ug});FDe=t=>`dash-${Du(t)}`,u4=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(FDe(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&&GJ(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&&aee(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&&see(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&&GJ(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"),cg&&(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}};d4=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 VDe(this.#e,e);if(Jt(r)&&!me(this.#e)&&(r=await BDe(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=dg(e);this.#t.player.dispatch(new Ie("dash-lib-load-error",{detail:r})),this.#t.notify("error",{message:r.message,code:4,error:r})}};$De="https://cdn.jsdelivr.net",f4=class extends ug{$$PROVIDER_TYPE="DASH";#e=null;#t=new u4(this.video,this.ctx);get ctor(){return this.#e}get instance(){return this.#t.instance}static supported=lee();get type(){return"dash"}get canLiveSync(){return!0}#r=`${$De}/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)&&xa(this.#r)}setup(){super.setup(),new d4(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()}},UDe=Object.freeze({__proto__:null,DASHProvider:f4}),h2=class t extends pg{static supported=lee();name="dash";canPlay(e){return t.supported&&N2(e)}async load(e){if(le)throw Error("[vidstack] can not load dash provider server-side");return new(await Promise.resolve().then(function(){return UDe})).DASHProvider(this.target,e)}},m2=class{name="vimeo";target;preconnect(){let e=["https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"];for(let r of e)xa(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(()=>(OJ(),_J))).VimeoProvider(this.target,e)}async loadPoster(e,r,n){let{resolveVimeoVideoId:i,getVimeoVideoInfo:s}=await Promise.resolve().then(()=>(AN(),MJ));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}},g2=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)xa(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(()=>(FJ(),NJ))).YouTubeProvider(this.target,e)}async loadPoster(e,r,n){let{findYouTubePoster:i,resolveYouTubeVideoId:s}=await Promise.resolve().then(()=>(MN(),DJ)),a=me(e.src)&&s(e.src);return a?i(a,n):null}};UN=Symbol(0),zDe=["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"],qDe={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:Lee,storage:null},y2=class extends fc{#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")SZ(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())}}},p4=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{}}},h4=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()}},v2=class{#e=!1;#t=nc();#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=nc()}};m4=class extends fc{#e;#t;#r;controls;#n;#i;#s;#a=new v2;constructor(e,r,n){super(),this.#e=e,this.#t=r,this.#r=n,this.#s=n.$provider,this.controls=new l2,this.#n=new c2,this.#i=new Vx}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 zN(a,te(r)),WDe(s),await a.play()}catch(a){let o=this.createEvent("play-fail",{detail:dg(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 zN(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);zN(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(KJ(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(KJ(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=cg&&!Mx&&KE(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(xa("https://www.gstatic.com"),!this.#b){let i=await Promise.resolve().then(()=>(BN(),$J)).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:dg(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:dg(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=oF(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){}};g4=class{seeking=!1;looping=!1;replaying=!1;queue=new h4},KDe=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"]),y4=class extends fc{#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||(KDe.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}oee().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(!ZE(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(!ZE(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),KN(this.$state,r),this.#f();return}KN(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=Bu(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=Bu(i),o=i.length!==r().length,l=a!==Bu(r()),c=Bu(s),u=s.length!==n().length,d=c!==Bu(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=uee(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=sc(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.#_())}#_=fx(()=>{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))}},v4=class extends fc{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()})}},YJ=["play","pause","seekforward","seekbackward","seekto"],b4=class extends fc{onConnect(){U(this.#t.bind(this)),U(this.#r.bind(this));let e=this.#n.bind(this);for(let r of YJ)navigator.mediaSession.setActionHandler(r,e);Ne(this.#e.bind(this))}#e(){for(let e of YJ)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}}},b2=be(!1);le||(We(document,"pointerdown",()=>{b2.set(!1)}),We(document,"keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||b2.set(!0)}));Es=class extends Wn{#e=be(!1);onConnect(e){U(()=>{let r=new it(e);if(!b2()){this.#e.set(!1),YE(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),YE(e,n),r.add("focus",this.#t.bind(this)).add("blur",this.#r.bind(this))})}focused(){return this.#e()}#t(){this.#e.set(!0),YE(this.el,!0)}#r(){this.#e.set(!1),YE(this.el,!1)}#n(){XJ(this.el,!0)}#i(){XJ(this.el,!1)}};x2=class t extends je{static props=qDe;static state=$u;#e;#t;#r;canPlayQueue=new v2;remoteControl;get#n(){return this.#e.$provider()}get#i(){return this.$props}constructor(){super(),new v4;let e={player:this,qualities:new a2,audioTracks:new r2,storage:null,$provider:be(null),$providerSetup:be(!1),$props:this.$props,$state:this.$state};e.remote=this.remoteControl=new gp(void 0),e.remote.setPlayer(this),e.textTracks=new s2,e.textTracks[Re.crossOrigin]=this.$state.crossOrigin,e.textRenderers=new i2(e),e.ariaKeys={},this.#e=e,vi(Cw,e),this.orientation=new Vx,new Es,new ZN(e);let r=new g4;this.#t=new y4(r,e),this.#r=new m4(this.#t,r,e),e.delegate=new p4(this.#t.handle.bind(this.#t),e),e.notify=e.delegate.notify.bind(e.delegate),typeof navigator<"u"&&"mediaSession"in navigator&&new b4,new y2("load",this.startLoading.bind(this)),new y2("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){nee&&Ae(e,"data-iphone","");let r=window.matchMedia("(pointer: coarse)");this.#d(r),r.onchange=this.#d.bind(this);let n=new ResizeObserver(op(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=wE(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[UN]){this.setAttributes(t[UN]);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 zDe){let i="data-"+(r[n]??Du(n));e[i]=function(){return this.$state[n]()}}delete e.title,t[UN]=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=oF(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=lF(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 e2:e;if(r?.onChange){let{source:n}=this.$state,i=me(e)?e:this.el?.id,s=tc(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=x2.prototype;mt(Dt,"canPlayQueue");mt(Dt,"remoteControl");mt(Dt,"provider");mt(Dt,"controls");mt(Dt,"orientation");mt(Dt,"title");mt(Dt,"qualities");mt(Dt,"audioTracks");mt(Dt,"textTracks");mt(Dt,"textRenderers");mt(Dt,"duration");mt(Dt,"paused");mt(Dt,"muted");mt(Dt,"currentTime");mt(Dt,"volume");mt(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");x4=new Map,w4=class{#e=!1;#t;#r;#n;#i;constructor(e,r,n,i=[]){this.#r=e,this.#n=r,this.#i=n;let s=new h2,a=new d2,o=new pg,l=new u2,c=new g2,u=new m2,d=[c,u];this.#t=tc(()=>{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(QJ(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",[...QJ(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=Nx(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")||"??",x4.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(ZE(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 JJ(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(!JJ(e?.currentSrc,r)){if(this.#n.$state.canLoad()){let s=new AbortController;return bp(r)?(i||!Ax())&&Oee(r.src,{credentials:Nx(n),signal:s.signal}).then(a=>{this.#n.notify("stream-type-change",a)}).catch(so):N2(r)?YDe(r.src,{credentials:Nx(n),signal:s.signal}).then(a=>{this.#n.notify("stream-type-change",a)}).catch(so):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)&&xa(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()}}};k4=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}},w2=class extends je{static props={loaders:[]};static state=new oo({loader:null});#e;#t;#r=be([]);#n=be([]);#i=null;onSetup(){this.#e=Et(),this.#t=new w4(this.#r,this.#e,this.$state.loader,this.$props.loaders())}onAttach(e){e.setAttribute("data-media-provider","")}onConnect(e){this.#t.connect(),new k4(this.#n,this.#e);let r=new ResizeObserver(op(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()}},ZDe=w2.prototype;$r(ZDe,"load");S4=class extends je{static props={translations:null};static state=new oo({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=jx(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)}},C4=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()}},T4=class extends je{onAttach(e){e.style.pointerEvents||Gn(e,"pointer-events","auto")}},k2=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(wDe(r)){this.#i?.();let s=We(r,"animationend",n,{once:!0});this.#i=s}else n()}})}#s(){window.clearTimeout(this.#r),this.#r=-1}},mp=rl(),JDe=0,E4=class extends je{static props={showDelay:700};#e=`media-tooltip-${++JDe}`;#t=be(null);#r=be(null);#n=be(!1);constructor(){super(),new Es;let{showDelay:e}=this.$props;new k2({trigger:this.#t,content:this.#r,showDelay:e,listen(r,n,i){U(()=>{b2()&&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(mp,{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)}},I4=class extends je{constructor(){super(),new Es}onConnect(e){Ne(Tee(()=>{if(!this.connectScope)return;this.#e();let r=mr(mp);Ne(()=>{let n=this.#t();n&&r.detachTrigger(n)})}))}#e(){let e=this.#t(),r=mr(mp);e&&r.attachTrigger(e)}#t(){let e=this.el.firstElementChild;return e?.localName==="button"||e?.getAttribute("role")==="button"?e:this.el}},A4=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(mp);Ne(()=>r.detachContent(e)),Ne(Tee(()=>{this.connectScope&&U(this.#t.bind(this))}))}#e(e){mr(mp).attachContent(e)}#t(){let{showing:e}=mr(mp);if(!e())return;let{placement:r,offset:n,alignOffset:i}=this.$props;return Eee(this.el,this.#r(),r(),{offsetVarName:"media-tooltip",xOffset:i(),yOffset:n()})}#r(){return mr(mp).trigger()}},Mn=class extends Wn{static props={disabled:!1};#e;constructor(e){super(),this.#e=e,new Es,e.keyShortcut&&new o2(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=Vu(e,this.#n.bind(this));for(let n of["click","touchstart"])r.add(n,this.#i.bind(this),{passive:!0})}#t(){return dx(this.#e.isPresssed())}#r(e){$D(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())}},S2=class extends je{static props={disabled:!1,defaultPressed:!1};#e=be(!1);get pressed(){return this.#e()}constructor(){super(),new Mn({isPresssed:this.#e})}},eNe=S2.prototype;mt(eNe,"pressed");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{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"),Uu(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()}`}},R4=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"),Uu(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()}`}},L4=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"),Uu(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()}},M4=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"),Uu(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()}},_4=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"),Uu(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()}},O4=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"),Uu(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"}},D4=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"),Uu(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()}},N4=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"),Uu(e,this.#r.bind(this))}onConnect(e){Vu(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)}},F4=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){Vu(e,this.#t.bind(this))}#t(e){let{disabled:r}=this.$props,{liveEdge:n}=this.#e.$state;r()||n()||this.#e.remote.seekToLiveEdge(e)}},qu=new oo({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 eee(this.min,this.max,this.value)},get fillPercent(){return this.fillRate*100},get pointerRate(){return eee(this.min,this.max,this.pointerValue)},get pointerPercent(){return this.pointerRate*100}});C2=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}},dF=rl(),Fx=rl();qN={Left:-1,ArrowLeft:-1,Up:1,ArrowUp:1,Right:1,ArrowRight:1,Down:-1,ArrowDown:-1},B4=class extends Wn{#e;#t;#r;constructor(e,r){super(),this.#e=e,this.#t=r}onSetup(){ao(Fx)&&(this.#r=mr(Fx))}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(ha(this.#s)||cF(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(rNe(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(qN).includes(e.key))return;let{key:n}=e,i=this.#T(e);if(!ha(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(qN).includes(e.key)||!ha(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(qN[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=sc(e=>{this.#p(this.#g(e),e)},20,{leading:!0})},hg=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),ao(hg)||vi(hg,{default:"value"}),vi(dF,{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 B4(this.#t,this.#e).attach(this),new C2({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(See(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(tNe(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 dx(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=op((e,r)=>{this.el?.style.setProperty("--slider-fill",e+"%"),this.el?.style.setProperty("--slider-pointer",r+"%")})},yp=class extends je{static props={...Gi.props,min:0,max:100,value:0};static state=qu;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())}},dc=new Map,XE=new Map,T2=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)&&dc.has(r)){let n=dc.get(r);if(dc.delete(r),dc.set(r,n),dc.size>99){let i=dc.keys().next().value;dc.delete(i)}this.$images.set(dc.get(r))}else if(me(r)){let n=this.#r(),i=r+"::"+n;if(!XE.has(i)){let s=new Promise(async(a,o)=>{try{let l=await fetch(r,{credentials:Nx(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];uc(ox(f),!1),uc("url"in f&&me(f.url),!1),uc("startTime"in f&&Rr(f.startTime),!1)}a(u)}else a(this.#s(u));return}Promise.resolve().then(()=>(Tx(),Cx)).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=>(dc.set(i,a),a)).catch(a=>{this.#c(r,a)}).finally(()=>{me(i)&&XE.delete(i)});XE.set(i,s)}XE.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)=>(uc(n.url&&me(n.url)),uc("startTime"in n&&Rr(n.startTime)),{...n,url:me(n.url)?this.#l(n.url,r):n.url}))}#s(e){uc(me(e.url)),uc(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];uc("startTime"in s&&Rr(s.startTime)),uc("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){}},E2=class extends je{static props={src:null,time:0,crossOrigin:null};static state=new oo({src:"",img:null,thumbnails:[],activeThumbnail:null,crossOrigin:null,loading:!1,error:null,hidden:!1});media;#e;#t=[];onSetup(){this.media=Et(),this.#e=T2.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!ha(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=[]}},V4=class extends E2{#e;onAttach(e){this.#e=eg(yp.state)}getTime(){let{duration:e,clipStartTime:r}=this.media.$state;return r()+this.#e.pointerRate()*e()}},I2=class extends je{static props={src:null,crossOrigin:null};static state=new oo({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=eg(yp.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!ha(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())}},nNe=I2.prototype;mt(nNe,"video");A2=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=eg(yp.state),this.#e=mr(hg),this.#t=tc(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??pc)(p,{padHrs:i(),padMins:s(),showHrs:a(),showMs:o()}):(this.#e.value?.(p)??p.toFixed(2))+""}},iNe=A2.prototype;$r(iNe,"getValueText");j4=class extends je{static props={offset:0,noClamp:!1};#e;onSetup(){this.#e=mr(dF);let{active:e}=eg(yp.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=op(()=>{let{disabled:e,orientation:r}=this.#e;if(e())return;let n=this.el,{offset:i,noClamp:s}=this.$props;n&&Dee(n,{clamp:!s(),offset:i(),orientation:r()})})};$4=class extends je{static props={...Gi.props,keyStep:5,shiftKeyMultiplier:2};static state=qu;#e;onSetup(){this.#e=Et();let{audioGain:e}=this.#e.$state;vi(hg,{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=sc(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)}},U4=class extends je{static props={...Gi.props,step:25,keyStep:25,shiftKeyMultiplier:2,min:0,max:300};static state=qu;#e;onSetup(){this.#e=Et(),vi(hg,{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)}},z4=class extends je{static props={...Gi.props,step:.25,keyStep:.25,shiftKeyMultiplier:2,min:0,max:2};static state=qu;#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=sc(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)}},q4=class extends je{static props={...Gi.props,step:1,keyStep:1,shiftKeyMultiplier:1};static state=qu;#e;#t=tc(()=>{let{qualities:e}=this.#e.$state;return Iee(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=tc(()=>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=sc(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)}},P2=class extends je{static props={...Gi.props,step:.1,keyStep:5,shiftKeyMultiplier:2,pauseWhileDragging:!1,noSwipeGesture:!1,seekingRequestThrottle:100};static state=qu;#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(hg,{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)),Sw(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=sc(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(dF);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)?`${jx(e)} out of ${jx(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?"-":""}${pc(Math.abs(a),r)}`:"LIVE"}},R2=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=eg(P2.state)}onAttach(e){Sw(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=op(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=tc(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=fx(()=>{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}},F2=R2.prototype;mt(F2,"cues");mt(F2,"activeCue");mt(F2,"activePointerCue");$r(F2,"setRefs");il=rl();oNe=["a[href]","[tabindex]","input","select","button"].map(t=>`${t}:not([aria-hidden='true'])`).join(","),lNe=new Set(["Escape","Tab","ArrowUp","ArrowDown","Home","PageUp","End","PageDown","Enter"," "]),H4=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(()=>{aNe(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(FD(e)&&r instanceof Element){let n=r.getAttribute("role");return!/a|input|select|button/.test(r.localName)&&!n}return lNe.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(oNe),r=[],n=i=>i.getAttribute("role")==="menu";for(let i of e)n2(i)&&i.offsetParent!==null&&Cee(this.#t,i,n)&&r.push(i);return r}},cNe=Object.defineProperty,uNe=Object.getOwnPropertyDescriptor,Tw=(t,e,r,n)=>{for(var i=uNe(e,r),s=t.length-1,a;s>=0;s--)(a=t[s])&&(i=a(e,r,i)||i);return i&&cNe(e,r,i),i},dNe=0,ju=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 k2({trigger:this.#s,content:this.#a,showDelay:e,listen:(r,n,i)=>{Vu(r,a=>{this.#n()?i(a):n(a)});let s=this.#M();s&&Vu(s,a=>{a.stopPropagation(),i(a)})},onChange:this.#k.bind(this)})}onSetup(){this.#e=Et();let e=++dNe;this.#t=`media-menu-${e}`,this.#r=`media-menu-button-${e}`,this.#f=new H4({closeMenu:this.close.bind(this)}),ao(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=ao(Fx)?mr(Fx):null;vi(Fx,{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",dx(!e))}#S(e){this.#p.set(e)}#v=!1;#k(e,r){if(this.#v=Jm(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",dx(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&&UJ(r,e)||e.stopPropagation()}#L(e){let r=this.#a();this.#d||r&&UJ(r,e)||this.close(e)}#M(){let e=this.el?.querySelector('[data-part="close-target"]');return this.el&&e&&Cee(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=op(()=>{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(n2(s)&&s.style.display==="contents")i.push(...s.children);else if(s.nodeType===3)r+=parseFloat(getComputedStyle(s).fontSize);else if(n2(s)){if(!kee(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())}};Tw([mt],ju.prototype,"triggerElement");Tw([mt],ju.prototype,"contentElement");Tw([mt],ju.prototype,"isSubmenu");Tw([$r],ju.prototype,"open");Tw([$r],ju.prototype,"close");$x=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()),Vu(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)}},fNe=$x.prototype;mt(fNe,"expanded");G4=class extends $x{},HN=rl(),W4=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),ao(HN)){let r=mr(HN);r&&(vi(HN,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(Eee(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()}},K4=rl(),Ux=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(K4,{add:this.#n.bind(this),remove:this.#i.bind(this)})}onAttach(e){ao(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}},L2=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 Ux,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)}},Nee=L2.prototype;mt(Nee,"values");mt(Nee,"value");M2=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=ao(il);vt(e,"tabindex",r?"-1":"0"),vt(e,"role",r?"menuitemradio":"radio"),U(this.#i.bind(this))}onConnect(e){this.#n(),Vu(e,this.#s.bind(this)),Ne(this.#r.bind(this))}#r(){pn(()=>{mr(K4).remove(this.#t)},this.connectScope)}#n(){mr(K4).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})}},pNe=M2.prototype;mt(pNe,"checked");Y4=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()||mE(e)&&(e.button!==0||this.#e.activeMenu)||Zm(e)&&this.#e.activeMenu||cF(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(mE(e)||ND(e)||Zm(e)){let r=Zm(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[zD(i)](r),this.dispatch("trigger",{detail:e,trigger:r})}},X4=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]})}},Q4=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(()=>(Tx(),Cx)).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 X4(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}},Z4=class extends je{static props={src:null,alt:null,crossOrigin:null};static state=new oo({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!ha(e())}#r(){let{canLoadPoster:e,poster:r}=this.#e.$state;!e()&&r()&&xa(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)}},J4=class extends je{static props={type:"current",showHours:!1,padHours:null,padMinutes:null,remainder:!1,toggle:!1,hidden:!1};static state=new oo({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 C2({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(See(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&&Vu(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=pc(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)}},vp=class extends x2{},_2=class extends w2{},zx=class extends S4{},qx=class extends C4{},Hx=class extends T4{},O2=class extends S2{},Gx=class extends M4{},Wx=class extends _4{},Kx=class extends F4{},Yx=class extends O4{},Xx=class extends D4{},Qx=class extends L4{},Zx=class extends P4{},Jx=class extends R4{},ew=class extends N4{},tw=class extends E4{},rw=class extends I4{},nw=class extends A4{},mg=class extends yp{},iw=class extends P2{},sw=class extends $4{},aw=class extends U4{},ow=class extends z4{},lw=class extends q4{},cw=class extends V4{},uw=class extends A2{},dw=class extends I2{},fw=class extends j4{},pw=class extends R2{},hw=class extends ju{},mw=class extends $x{},gw=class extends W4{},yw=class extends G4{},vw=class extends L2{},bw=class extends M2{},xw=class extends Q4{},ww=class extends Y4{},D2=class extends Z4{},gg=class extends E2{},kw=class extends J4{},Fee=er.forwardRef((t,e)=>{let{children:r,...n}=t,i=er.Children.toArray(r),s=i.find(mNe);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(eF,{...n,ref:e},er.isValidElement(a)?er.cloneElement(a,void 0,o):null)}return er.createElement(eF,{...n,ref:e},r)});Fee.displayName="Slot";eF=er.forwardRef((t,e)=>{let{children:r,...n}=t;return er.isValidElement(r)?er.cloneElement(r,{...gNe(n,r.props),ref:e?st(e,r.ref):r.ref}):er.Children.count(r)>1?er.Children.only(null):null});eF.displayName="SlotClone";hNe=({children:t})=>er.createElement(er.Fragment,null,t);yNe=["button","div","span","img","video","audio"],ke=yNe.reduce((t,e)=>{let r=er.forwardRef((n,i)=>{let{asChild:s,...a}=n;return er.createElement(s?Fee:e,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});tee=mg.state.record,vNe=Object.keys(tee).reduce((t,e)=>({...t,[e](){return tee[e]}}),{});ree=vp.state.record,Vee=Object.keys(ree).reduce((t,e)=>({...t,[e](){return ree[e]}}),{})});var Ise={};ln(Ise,{SRTParser:()=>rA,default:()=>P7e});function P7e(){return new rA}var I7e,A7e,rA,Ase=yt(()=>{b1();I7e=/,/g,A7e="-->",rA=class extends Ng{parse(e,r){if(e==="")this.a&&(this.j.push(this.a),this.f.onCue?.(this.a),this.a=null),this.c=Dg.None;else if(this.c===Dg.Cue)this.a.text+=(this.a.text?`
|
|
`:"")+e;else if(e.includes(A7e)){let n=this.o(e,r);n&&(this.a=new Ju(n[0],n[1],n[2].join(" ")),this.a.id=this.l,this.c=Dg.Cue)}this.l=e}o(e,r){return super.o(e.replace(I7e,"."),r)}}});var r8={};ln(r8,{ParseErrorBuilder:()=>R7e});var R7e,n8=yt(()=>{b1();R7e={p(){return new Ns({code:yo.BadSignature,reason:"missing WEBVTT file header",line:1})},q(t,e){return new Ns({code:yo.BadTimestamp,reason:`cue start timestamp \`${t}\` is invalid on line ${e}`,line:e})},r(t,e){return new Ns({code:yo.BadTimestamp,reason:`cue end timestamp \`${t}\` is invalid on line ${e}`,line:e})},s(t,e,r){return new Ns({code:yo.BadTimestamp,reason:`cue end timestamp \`${e}\` is greater than start \`${t}\` on line ${r}`,line:r})},w(t,e,r){return new Ns({code:yo.BadSettingValue,reason:`invalid value for cue setting \`${t}\` on line ${r} (value: ${e})`,line:r})},v(t,e,r){return new Ns({code:yo.UnknownSetting,reason:`unknown cue setting \`${t}\` on line ${r} (value: ${e})`,line:r})},u(t,e,r){return new Ns({code:yo.BadSettingValue,reason:`invalid value for region setting \`${t}\` on line ${r} (value: ${e})`,line:r})},t(t,e,r){return new Ns({code:yo.UnknownSetting,reason:`unknown region setting \`${t}\` on line ${r} (value: ${e})`,line:r})},T(t,e){return new Ns({code:yo.BadFormat,reason:`format missing for \`${t}\` block on line ${e}`,line:e})}}});var Ose={};ln(Ose,{SSAParser:()=>sA,default:()=>L7e});function s8(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 a8(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 L7e(){return new sA}var nA,Pse,Rse,iA,Lse,Mse,_se,i8,sA,Dse=yt(()=>{b1();nA=/^Format:[\s\t]*/,Pse=/^Style:[\s\t]*/,Rse=/^Dialogue:[\s\t]*/,iA=/[\s\t]*,[\s\t]*/,Lse=/\{[^}]+\}/g,Mse=/\\N/g,_se=/^\[(.*)[\s\t]?Styles\]$/,i8=/^\[(.*)[\s\t]?Events\]$/,sA=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(()=>(n8(),r8))).ParseErrorBuilder)}parse(e,r){if(this.O)switch(this.O){case 1:if(e==="")this.O=0;else if(Pse.test(e))if(this.N){let n=e.replace(Pse,"").split(iA);this.S(n)}else this.e(this.d?.T("Style",r));else nA.test(e)?this.N=e.replace(nA,"").split(iA):i8.test(e)&&(this.N=null,this.O=2);break;case 2:if(e==="")this.Q();else if(Rse.test(e))if(this.Q(),this.N){let n=e.replace(Rse,"").split(iA),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(Lse,"").replace(Mse,`
|
|
`):nA.test(e)?this.N=e.replace(nA,"").split(iA):_se.test(e)?(this.N=null,this.O=1):i8.test(e)&&(this.N=null)}else e===""||(_se.test(e)?(this.N=null,this.O=1):i8.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=s8(m);v&&(n["--cue-color"]=v);break;case"BorderStyle":d=parseInt(m,10);break;case"BackColour":u=s8(m);break;case"OutlineColour":let b=s8(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&&a8(i*1.2,l*1.2,c),c?a8(i*(i/2),l*(i/2),p):a8(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 Ju(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(Lse,"").replace(Mse,`
|
|
`),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=ed(e),s=ed(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 l8(t,e){let r=new ReadableStream({start(n){let i=t.split(M7e);for(let s of i)n.enqueue(s);n.close()}});return Vse(r,e)}async function Vse(t,e){let r=e?.type??"vtt",n;if(typeof r=="string")switch(r){case"srt":n=(await Promise.resolve().then(()=>(Ase(),Ise))).default;break;case"ssa":case"ass":n=(await Promise.resolve().then(()=>(Dse(),Ose))).default;break;default:n=(await Promise.resolve().then(function(){return X7e})).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 D7e(t){let e=parseInt(t,10);return Number.isNaN(e)?null:e}function w1(t){let e=parseInt(t.replace(O7e,""),10);return!Number.isNaN(e)&&e>=0&&e<=100?e:null}function Fse(t){if(!t.includes(Nse))return null;let[e,r]=t.split(Nse).map(w1);return e!==null&&r!==null?[e,r]:null}function N7e(t){let e=parseFloat(t);return Number.isNaN(e)?null:e}function ed(t){let e=t.match(K7e);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 Y7e(){return new Ng}function c8(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&&Q7e.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(Z7e," "),s?.type==="v"?s.voice=o8(e):s?.type==="lang"&&(s.lang=o8(e)),e="",r=1):e+=u;break;case 5:u===">"&&(e="",s=i.pop(),r=1);break;case 6:if(u===">"){let d=ed(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(rBe.has(e)){let c=s;s=nBe(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_","");tBe.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:o8(e)};s?s.children.push(c):n.push(c),e=""}return r===1&&l(),n}function nBe(t){return{tagName:jse[t],type:t,children:[]}}function o8(t){return t.replace(eBe,e=>J7e[e]||"'")}var yo,Ns,M7e,_7e,Ju,aA,Nse,O7e,F7e,Bse,B7e,Fg,V7e,j7e,$7e,U7e,x1,z7e,q7e,H7e,G7e,W7e,K7e,Dg,Ng,X7e,Q7e,Z7e,jse,J7e,eBe,tBe,rBe,kkt,Skt,b1=yt(()=>{yo={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}},M7e=/\r?\n|\r/gm;_7e=window.VTTCue,Ju=class extends _7e{region=null;vertical="";snapToLines=!0;line="auto";lineAlign="start";position="auto";positionAlign="auto";size=100;align="center";style},aA=class{id="";width=100;lines=3;regionAnchorX=0;regionAnchorY=100;viewportAnchorX=0;viewportAnchorY=100;scroll=""},Nse=",",O7e="%";F7e="WEBVTT",Bse=",",B7e="%",Fg=/[:=]/,V7e=/^[\s\t]*(region|vertical|line|position|size|align)[:=]/,j7e="NOTE",$7e="REGION",U7e=/^REGION:?[\s\t]+/,x1=/[\s\t]+/,z7e="-->",q7e=/[\s\t]*-->[\s\t]+/,H7e=/start|center|end|left|right/,G7e=/start|center|end/,W7e=/line-(?:left|right)|center|auto/,K7e=/^(?:(\d{1,2}):)?(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/,Dg=(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))(Dg||{}),Ng=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(()=>(n8(),r8))).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&&V7e.test(e)?this.m(e.split(x1),r):this.a.text+=(n?`
|
|
`:"")+e}break;case 3:this.n(e.split(x1),r);break}else if(e.startsWith(j7e))this.c=4;else if(e.startsWith($7e))this.c=3,this.b=new aA,this.n(e.replace(U7e,"").split(x1),r);else if(e.includes(z7e)){let n=this.o(e,r);n&&(this.a=new Ju(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(Fg.test(e)){let[n,i]=e.split(Fg);n&&(this.g[n]=(i||"").replace(x1,""))}}else e.startsWith(F7e)?this.c=1:this.e(this.d?.p())}o(e,r){let[n,i=""]=e.split(q7e),[s,...a]=i.split(x1),o=ed(n),l=ed(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(Fg.test(e[i])){n=!1;let[s,a]=e[i].split(Fg);switch(s){case"id":this.b.id=a;break;case"width":let o=w1(a);o!==null?this.b.width=o:n=!0;break;case"lines":let l=D7e(a);l!==null?this.b.lines=l:n=!0;break;case"regionanchor":let c=Fse(a);c!==null?(this.b.regionAnchorX=c[0],this.b.regionAnchorY=c[1]):n=!0;break;case"viewportanchor":let u=Fse(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,Fg.test(e[i])){let[s,a]=e[i].split(Fg);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(Bse);if(l.includes(B7e)){let h=w1(l);h!==null?(this.a.line=h,this.a.snapToLines=!1):n=!0}else{let h=N7e(l);h!==null?this.a.line=h:n=!0}G7e.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(Bse),f=w1(u);f!==null?this.a.position=f:n=!0,d&&W7e.test(d)?this.a.positionAlign=d:d&&(n=!0);break;case"size":let p=w1(a);p!==null?(this.a.size=p,p<100&&(this.a.region=null)):n=!0;break;case"align":H7e.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)}}};X7e=Object.freeze({__proto__:null,VTTBlock:Dg,VTTParser:Ng,default:Y7e,parseVTTTimestamp:ed}),Q7e=/[0-9]/,Z7e=/[\s\t]+/,jse={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span",timestamp:"span"},J7e={"&":"&","<":"<",">":">",""":'"',"'":"'"," ":"\xA0","‎":"\u200E","‏":"\u200F"},eBe=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,tBe=new Set(["white","lime","cyan","red","yellow","magenta","blue","black"]),rBe=new Set(Object.keys(jse));kkt=Symbol(0),Skt=Symbol(0)});var _ue=L(cr=>{"use strict";function Y9(t,e){var r=t.length;t.push(e);e:for(;0<r;){var n=r-1>>>1,i=t[n];if(0<xP(i,e))t[n]=e,t[r]=i,r=n;else break e}}function xl(t){return t.length===0?null:t[0]}function kP(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>xP(o,r))l<i&&0>xP(c,o)?(t[n]=c,t[l]=r,n=l):(t[n]=o,t[a]=r,n=a);else if(l<i&&0>xP(c,r))t[n]=c,t[l]=r,n=l;else break e}}return e}function xP(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"?(Cue=performance,cr.unstable_now=function(){return Cue.now()}):(G9=Date,Tue=G9.now(),cr.unstable_now=function(){return G9.now()-Tue});var Cue,G9,Tue,Lc=[],vd=[],rHe=1,Pa=null,ri=3,X9=!1,X1=!1,Q1=!1,Q9=!1,Aue=typeof setTimeout=="function"?setTimeout:null,Pue=typeof clearTimeout=="function"?clearTimeout:null,Eue=typeof setImmediate<"u"?setImmediate:null;function wP(t){for(var e=xl(vd);e!==null;){if(e.callback===null)kP(vd);else if(e.startTime<=t)kP(vd),e.sortIndex=e.expirationTime,Y9(Lc,e);else break;e=xl(vd)}}function Z9(t){if(Q1=!1,wP(t),!X1)if(xl(Lc)!==null)X1=!0,fy||(fy=!0,dy());else{var e=xl(vd);e!==null&&J9(Z9,e.startTime-t)}}var fy=!1,Z1=-1,Rue=5,Lue=-1;function Mue(){return Q9?!0:!(cr.unstable_now()-Lue<Rue)}function W9(){if(Q9=!1,fy){var t=cr.unstable_now();Lue=t;var e=!0;try{e:{X1=!1,Q1&&(Q1=!1,Pue(Z1),Z1=-1),X9=!0;var r=ri;try{t:{for(wP(t),Pa=xl(Lc);Pa!==null&&!(Pa.expirationTime>t&&Mue());){var n=Pa.callback;if(typeof n=="function"){Pa.callback=null,ri=Pa.priorityLevel;var i=n(Pa.expirationTime<=t);if(t=cr.unstable_now(),typeof i=="function"){Pa.callback=i,wP(t),e=!0;break t}Pa===xl(Lc)&&kP(Lc),wP(t)}else kP(Lc);Pa=xl(Lc)}if(Pa!==null)e=!0;else{var s=xl(vd);s!==null&&J9(Z9,s.startTime-t),e=!1}}break e}finally{Pa=null,ri=r,X9=!1}e=void 0}}finally{e?dy():fy=!1}}}var dy;typeof Eue=="function"?dy=function(){Eue(W9)}:typeof MessageChannel<"u"?(K9=new MessageChannel,Iue=K9.port2,K9.port1.onmessage=W9,dy=function(){Iue.postMessage(null)}):dy=function(){Aue(W9,0)};var K9,Iue;function J9(t,e){Z1=Aue(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"):Rue=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(){Q9=!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:rHe++,callback:e,priorityLevel:t,startTime:r,expirationTime:i,sortIndex:-1},r>n?(t.sortIndex=r,Y9(vd,t),xl(Lc)===null&&t===xl(vd)&&(Q1?(Pue(Z1),Z1=-1):Q1=!0,J9(Z9,r-n))):(t.sortIndex=i,Y9(Lc,t),X1||X9||(X1=!0,fy||(fy=!0,dy()))),t};cr.unstable_shouldYield=Mue;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 Due=L((AEt,Oue)=>{"use strict";Oue.exports=_ue()});var Fhe=L(qR=>{"use strict";var sn=Due(),nfe=Te(),nHe=Rf();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 ife(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Vk(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 sfe(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 Nue(t){if(Vk(t)!==t)throw Error(X(188))}function iHe(t){var e=t.alternate;if(!e){if(e=Vk(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 Nue(i),t;if(s===n)return Nue(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 afe(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=afe(t),e!==null)return e;t=t.sibling}return null}var rr=Object.assign,sHe=Symbol.for("react.element"),SP=Symbol.for("react.transitional.element"),ok=Symbol.for("react.portal"),by=Symbol.for("react.fragment"),ofe=Symbol.for("react.strict_mode"),L7=Symbol.for("react.profiler"),aHe=Symbol.for("react.provider"),lfe=Symbol.for("react.consumer"),Nc=Symbol.for("react.context"),EB=Symbol.for("react.forward_ref"),M7=Symbol.for("react.suspense"),_7=Symbol.for("react.suspense_list"),IB=Symbol.for("react.memo"),wd=Symbol.for("react.lazy");Symbol.for("react.scope");var O7=Symbol.for("react.activity");Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var oHe=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var Fue=Symbol.iterator;function J1(t){return t===null||typeof t!="object"?null:(t=Fue&&t[Fue]||t["@@iterator"],typeof t=="function"?t:null)}var lHe=Symbol.for("react.client.reference");function D7(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===lHe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case by:return"Fragment";case L7:return"Profiler";case ofe:return"StrictMode";case M7:return"Suspense";case _7:return"SuspenseList";case O7:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case ok:return"Portal";case Nc:return(t.displayName||"Context")+".Provider";case lfe:return(t._context.displayName||"Context")+".Consumer";case EB:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case IB:return e=t.displayName||null,e!==null?e:D7(t.type)||"Memo";case wd:e=t._payload,t=t._init;try{return D7(t(e))}catch{}}return null}var lk=Array.isArray,De=nfe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xt=nHe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lh={pending:!1,data:null,method:null,action:null},N7=[],xy=-1;function Il(t){return{current:t}}function wn(t){0>xy||(t.current=N7[xy],N7[xy]=null,xy--)}function dr(t,e){xy++,N7[xy]=t.current,t.current=e}var Cl=Il(null),Tk=Il(null),Ld=Il(null),JP=Il(null);function eR(t,e){switch(dr(Ld,e),dr(Tk,t),dr(Cl,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?zde(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=zde(e),t=The(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}wn(Cl),dr(Cl,t)}function Vy(){wn(Cl),wn(Tk),wn(Ld)}function F7(t){t.memoizedState!==null&&dr(JP,t);var e=Cl.current,r=The(e,t.type);e!==r&&(dr(Tk,t),dr(Cl,r))}function tR(t){Tk.current===t&&(wn(Cl),wn(Tk)),JP.current===t&&(wn(JP),Dk._currentValue=lh)}var B7=Object.prototype.hasOwnProperty,AB=sn.unstable_scheduleCallback,e7=sn.unstable_cancelCallback,cHe=sn.unstable_shouldYield,uHe=sn.unstable_requestPaint,Tl=sn.unstable_now,dHe=sn.unstable_getCurrentPriorityLevel,cfe=sn.unstable_ImmediatePriority,ufe=sn.unstable_UserBlockingPriority,rR=sn.unstable_NormalPriority,fHe=sn.unstable_LowPriority,dfe=sn.unstable_IdlePriority,pHe=sn.log,hHe=sn.unstable_setDisableYieldValue,jk=null,Hs=null;function Id(t){if(typeof pHe=="function"&&hHe(t),Hs&&typeof Hs.setStrictMode=="function")try{Hs.setStrictMode(jk,t)}catch{}}var Gs=Math.clz32?Math.clz32:yHe,mHe=Math.log,gHe=Math.LN2;function yHe(t){return t>>>=0,t===0?32:31-(mHe(t)/gHe|0)|0}var CP=256,TP=4194304;function sh(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 PR(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=sh(n):(a&=o,a!==0?i=sh(a):r||(r=o&~t,r!==0&&(i=sh(r))))):(o=n&~s,o!==0?i=sh(o):a!==0?i=sh(a):r||(r=n&~t,r!==0&&(i=sh(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 $k(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function vHe(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 ffe(){var t=CP;return CP<<=1,(CP&4194048)===0&&(CP=256),t}function pfe(){var t=TP;return TP<<=1,(TP&62914560)===0&&(TP=4194304),t}function t7(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function Uk(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function bHe(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&&hfe(t,n,0),s!==0&&i===0&&t.tag!==0&&(t.suspendedLanes|=s&~(a&~e))}function hfe(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 mfe(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 PB(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 RB(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function gfe(){var t=xt.p;return t!==0?t:(t=window.event,t===void 0?32:Dhe(t.type))}function xHe(t,e){var r=xt.p;try{return xt.p=t,e()}finally{xt.p=r}}var Ud=Math.random().toString(36).slice(2),ni="__reactFiber$"+Ud,is="__reactProps$"+Ud,Xy="__reactContainer$"+Ud,V7="__reactEvents$"+Ud,wHe="__reactListeners$"+Ud,kHe="__reactHandles$"+Ud,Bue="__reactResources$"+Ud,zk="__reactMarker$"+Ud;function LB(t){delete t[ni],delete t[is],delete t[V7],delete t[wHe],delete t[kHe]}function wy(t){var e=t[ni];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Xy]||r[ni]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=Gde(t);t!==null;){if(r=t[ni])return r;t=Gde(t)}return e}t=r,r=t.parentNode}return null}function Qy(t){if(t=t[ni]||t[Xy]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function ck(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(X(33))}function Ly(t){var e=t[Bue];return e||(e=t[Bue]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function bn(t){t[zk]=!0}var yfe=new Set,vfe={};function bh(t,e){jy(t,e),jy(t+"Capture",e)}function jy(t,e){for(vfe[t]=e,t=0;t<e.length;t++)yfe.add(e[t])}var SHe=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]*$"),Vue={},jue={};function CHe(t){return B7.call(jue,t)?!0:B7.call(Vue,t)?!1:SHe.test(t)?jue[t]=!0:(Vue[t]=!0,!1)}function jP(t,e,r){if(CHe(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 EP(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 Mc(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 r7,$ue;function gy(t){if(r7===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);r7=e&&e[1]||"",$ue=-1<r.stack.indexOf(`
|
|
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
`+r7+t+$ue}var n7=!1;function i7(t,e){if(!t||n7)return"";n7=!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{n7=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?gy(r):""}function THe(t){switch(t.tag){case 26:case 27:case 5:return gy(t.type);case 16:return gy("Lazy");case 13:return gy("Suspense");case 19:return gy("SuspenseList");case 0:case 15:return i7(t.type,!1);case 11:return i7(t.type.render,!1);case 1:return i7(t.type,!0);case 31:return gy("Activity");default:return""}}function Uue(t){try{var e="";do e+=THe(t),t=t.return;while(t);return e}catch(r){return`
|
|
Error generating stack: `+r.message+`
|
|
`+r.stack}}function La(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function bfe(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function EHe(t){var e=bfe(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 nR(t){t._valueTracker||(t._valueTracker=EHe(t))}function xfe(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=bfe(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function iR(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 IHe=/[\n"\\]/g;function Oa(t){return t.replace(IHe,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function j7(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=""+La(e)):t.value!==""+La(e)&&(t.value=""+La(e)):a!=="submit"&&a!=="reset"||t.removeAttribute("value"),e!=null?$7(t,a,La(e)):r!=null?$7(t,a,La(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=""+La(o):t.removeAttribute("name")}function wfe(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?""+La(r):"",e=e!=null?""+La(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 $7(t,e,r){e==="number"&&iR(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function My(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=""+La(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 kfe(t,e,r){if(e!=null&&(e=""+La(e),e!==t.value&&(t.value=e),r==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=r!=null?""+La(r):""}function Sfe(t,e,r,n){if(e==null){if(n!=null){if(r!=null)throw Error(X(92));if(lk(n)){if(1<n.length)throw Error(X(93));n=n[0]}r=n}r==null&&(r=""),e=r}r=La(e),t.defaultValue=r,n=t.textContent,n===r&&n!==""&&n!==null&&(t.value=n)}function $y(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var AHe=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 zue(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||AHe.has(e)?e==="float"?t.cssFloat=r:t[e]=(""+r).trim():t[e]=r+"px"}function Cfe(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&&zue(t,i,n)}else for(var s in e)e.hasOwnProperty(s)&&zue(t,s,e[s])}function MB(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 PHe=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"]]),RHe=/^[\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 $P(t){return RHe.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var U7=null;function _B(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ky=null,_y=null;function que(t){var e=Qy(t);if(e&&(t=e.stateNode)){var r=t[is]||null;e:switch(t=e.stateNode,e.type){case"input":if(j7(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="'+Oa(""+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));j7(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&&xfe(n)}break e;case"textarea":kfe(t,r.value,r.defaultValue);break e;case"select":e=r.value,e!=null&&My(t,!!r.multiple,e,!1)}}}var s7=!1;function Tfe(t,e,r){if(s7)return t(e,r);s7=!0;try{var n=t(e);return n}finally{if(s7=!1,(ky!==null||_y!==null)&&(VR(),ky&&(e=ky,t=_y,_y=ky=null,que(e),t)))for(e=0;e<t.length;e++)que(t[e])}}function Ek(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 zc=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),z7=!1;if(zc)try{py={},Object.defineProperty(py,"passive",{get:function(){z7=!0}}),window.addEventListener("test",py,py),window.removeEventListener("test",py,py)}catch{z7=!1}var py,Ad=null,OB=null,UP=null;function Efe(){if(UP)return UP;var t,e=OB,r=e.length,n,i="value"in Ad?Ad.value:Ad.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 UP=i.slice(t,1<n?1-n:void 0)}function zP(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 IP(){return!0}function Hue(){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)?IP:Hue,this.isPropagationStopped=Hue,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=IP)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=IP)},persist:function(){},isPersistent:IP}),e}var xh={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},RR=ss(xh),qk=rr({},xh,{view:0,detail:0}),LHe=ss(qk),a7,o7,ek,LR=rr({},qk,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:DB,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!==ek&&(ek&&t.type==="mousemove"?(a7=t.screenX-ek.screenX,o7=t.screenY-ek.screenY):o7=a7=0,ek=t),a7)},movementY:function(t){return"movementY"in t?t.movementY:o7}}),Gue=ss(LR),MHe=rr({},LR,{dataTransfer:0}),_He=ss(MHe),OHe=rr({},qk,{relatedTarget:0}),l7=ss(OHe),DHe=rr({},xh,{animationName:0,elapsedTime:0,pseudoElement:0}),NHe=ss(DHe),FHe=rr({},xh,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),BHe=ss(FHe),VHe=rr({},xh,{data:0}),Wue=ss(VHe),jHe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$He={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"},UHe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zHe(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=UHe[t])?!!e[t]:!1}function DB(){return zHe}var qHe=rr({},qk,{key:function(t){if(t.key){var e=jHe[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=zP(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?$He[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:DB,charCode:function(t){return t.type==="keypress"?zP(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zP(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),HHe=ss(qHe),GHe=rr({},LR,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kue=ss(GHe),WHe=rr({},qk,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:DB}),KHe=ss(WHe),YHe=rr({},xh,{propertyName:0,elapsedTime:0,pseudoElement:0}),XHe=ss(YHe),QHe=rr({},LR,{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}),ZHe=ss(QHe),JHe=rr({},xh,{newState:0,oldState:0}),eGe=ss(JHe),tGe=[9,13,27,32],NB=zc&&"CompositionEvent"in window,dk=null;zc&&"documentMode"in document&&(dk=document.documentMode);var rGe=zc&&"TextEvent"in window&&!dk,Ife=zc&&(!NB||dk&&8<dk&&11>=dk),Yue=" ",Xue=!1;function Afe(t,e){switch(t){case"keyup":return tGe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pfe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Sy=!1;function nGe(t,e){switch(t){case"compositionend":return Pfe(e);case"keypress":return e.which!==32?null:(Xue=!0,Yue);case"textInput":return t=e.data,t===Yue&&Xue?null:t;default:return null}}function iGe(t,e){if(Sy)return t==="compositionend"||!NB&&Afe(t,e)?(t=Efe(),UP=OB=Ad=null,Sy=!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 Ife&&e.locale!=="ko"?null:e.data;default:return null}}var sGe={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 Que(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!sGe[t.type]:e==="textarea"}function Rfe(t,e,r,n){ky?_y?_y.push(n):_y=[n]:ky=n,e=kR(e,"onChange"),0<e.length&&(r=new RR("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var fk=null,Ik=null;function aGe(t){khe(t,0)}function MR(t){var e=ck(t);if(xfe(e))return t}function Zue(t,e){if(t==="change")return e}var Lfe=!1;zc&&(zc?(PP="oninput"in document,PP||(c7=document.createElement("div"),c7.setAttribute("oninput","return;"),PP=typeof c7.oninput=="function"),AP=PP):AP=!1,Lfe=AP&&(!document.documentMode||9<document.documentMode));var AP,PP,c7;function Jue(){fk&&(fk.detachEvent("onpropertychange",Mfe),Ik=fk=null)}function Mfe(t){if(t.propertyName==="value"&&MR(Ik)){var e=[];Rfe(e,Ik,t,_B(t)),Tfe(aGe,e)}}function oGe(t,e,r){t==="focusin"?(Jue(),fk=e,Ik=r,fk.attachEvent("onpropertychange",Mfe)):t==="focusout"&&Jue()}function lGe(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return MR(Ik)}function cGe(t,e){if(t==="click")return MR(e)}function uGe(t,e){if(t==="input"||t==="change")return MR(e)}function dGe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ys=typeof Object.is=="function"?Object.is:dGe;function Ak(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(!B7.call(e,i)||!Ys(t[i],e[i]))return!1}return!0}function ede(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function tde(t,e){var r=ede(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=ede(r)}}function _fe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?_fe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ofe(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=iR(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=iR(t.document)}return e}function FB(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 fGe=zc&&"documentMode"in document&&11>=document.documentMode,Cy=null,q7=null,pk=null,H7=!1;function rde(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;H7||Cy==null||Cy!==iR(n)||(n=Cy,"selectionStart"in n&&FB(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}),pk&&Ak(pk,n)||(pk=n,n=kR(q7,"onSelect"),0<n.length&&(e=new RR("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=Cy)))}function ih(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Ty={animationend:ih("Animation","AnimationEnd"),animationiteration:ih("Animation","AnimationIteration"),animationstart:ih("Animation","AnimationStart"),transitionrun:ih("Transition","TransitionRun"),transitionstart:ih("Transition","TransitionStart"),transitioncancel:ih("Transition","TransitionCancel"),transitionend:ih("Transition","TransitionEnd")},u7={},Dfe={};zc&&(Dfe=document.createElement("div").style,"AnimationEvent"in window||(delete Ty.animationend.animation,delete Ty.animationiteration.animation,delete Ty.animationstart.animation),"TransitionEvent"in window||delete Ty.transitionend.transition);function wh(t){if(u7[t])return u7[t];if(!Ty[t])return t;var e=Ty[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in Dfe)return u7[t]=e[r];return t}var Nfe=wh("animationend"),Ffe=wh("animationiteration"),Bfe=wh("animationstart"),pGe=wh("transitionrun"),hGe=wh("transitionstart"),mGe=wh("transitioncancel"),Vfe=wh("transitionend"),jfe=new Map,G7="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(" ");G7.push("scrollEnd");function Io(t,e){jfe.set(t,e),bh(e,[t])}var nde=new WeakMap;function Da(t,e){if(typeof t=="object"&&t!==null){var r=nde.get(t);return r!==void 0?r:(e={value:t,source:e,stack:Uue(e)},nde.set(t,e),e)}return{value:t,source:e,stack:Uue(e)}}var Ra=[],Ey=0,BB=0;function _R(){for(var t=Ey,e=BB=Ey=0;e<t;){var r=Ra[e];Ra[e++]=null;var n=Ra[e];Ra[e++]=null;var i=Ra[e];Ra[e++]=null;var s=Ra[e];if(Ra[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&&$fe(r,i,s)}}function OR(t,e,r,n){Ra[Ey++]=t,Ra[Ey++]=e,Ra[Ey++]=r,Ra[Ey++]=n,BB|=n,t.lanes|=n,t=t.alternate,t!==null&&(t.lanes|=n)}function VB(t,e,r,n){return OR(t,e,r,n),sR(t)}function Zy(t,e){return OR(t,null,null,e),sR(t)}function $fe(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 sR(t){if(50<Sk)throw Sk=0,pB=null,Error(X(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Iy={};function gGe(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 gGe(t,e,r,n)}function jB(t){return t=t.prototype,!(!t||!t.isReactComponent)}function $c(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 Ufe(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 qP(t,e,r,n,i,s){var a=0;if(n=t,typeof t=="function")jB(t)&&(a=1);else if(typeof t=="string")a=gWe(t,r,Cl.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O7:return t=qs(31,r,e,i),t.elementType=O7,t.lanes=s,t;case by:return ch(r.children,i,s,e);case ofe:a=8,i|=24;break;case L7:return t=qs(12,r,e,i|2),t.elementType=L7,t.lanes=s,t;case M7:return t=qs(13,r,e,i),t.elementType=M7,t.lanes=s,t;case _7:return t=qs(19,r,e,i),t.elementType=_7,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case aHe:case Nc:a=10;break e;case lfe:a=9;break e;case EB:a=11;break e;case IB:a=14;break e;case wd: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 ch(t,e,r,n){return t=qs(7,t,n,e),t.lanes=r,t}function d7(t,e,r){return t=qs(6,t,null,e),t.lanes=r,t}function f7(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 Ay=[],Py=0,aR=null,oR=0,Ma=[],_a=0,uh=null,Fc=1,Bc="";function ah(t,e){Ay[Py++]=oR,Ay[Py++]=aR,aR=t,oR=e}function zfe(t,e,r){Ma[_a++]=Fc,Ma[_a++]=Bc,Ma[_a++]=uh,uh=t;var n=Fc;t=Bc;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,Fc=1<<32-Gs(e)+i|r<<i|n,Bc=s+t}else Fc=1<<s|r<<i|n,Bc=t}function $B(t){t.return!==null&&(ah(t,1),zfe(t,1,0))}function UB(t){for(;t===aR;)aR=Ay[--Py],Ay[Py]=null,oR=Ay[--Py],Ay[Py]=null;for(;t===uh;)uh=Ma[--_a],Ma[_a]=null,Bc=Ma[--_a],Ma[_a]=null,Fc=Ma[--_a],Ma[_a]=null}var Ai=null,Tr=null,bt=!1,dh=null,kl=!1,W7=Error(X(519));function mh(t){var e=Error(X(418,""));throw Pk(Da(e,t)),W7}function ide(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<Mk.length;r++)rt(Mk[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),wfe(e,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),nR(e);break;case"select":rt("invalid",e);break;case"textarea":rt("invalid",e),Sfe(e,n.value,n.defaultValue,n.children),nR(e)}r=n.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||e.textContent===""+r||n.suppressHydrationWarning===!0||Che(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=UR),e=!0):e=!1,e||mh(t)}function sde(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 tk(t){if(t!==Ai)return!1;if(!bt)return sde(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")||bB(t.type,t.memoizedProps)),r=!r),r&&Tr&&mh(t),sde(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=Eo(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++;t=t.nextSibling}Tr=null}}else e===27?(e=Tr,zd(t.type)?(t=kB,kB=null,Tr=t):Tr=e):Tr=Ai?Eo(t.stateNode.nextSibling):null;return!0}function Hk(){Tr=Ai=null,bt=!1}function ade(){var t=dh;return t!==null&&(ns===null?ns=t:ns.push.apply(ns,t),dh=null),t}function Pk(t){dh===null?dh=[t]:dh.push(t)}var K7=Il(null),kh=null,Vc=null;function Sd(t,e,r){dr(K7,e._currentValue),e._currentValue=r}function Uc(t){t._currentValue=K7.current,wn(K7)}function Y7(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 X7(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),Y7(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),Y7(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 Gk(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===JP.current){if(a=i.alternate,a===null)throw Error(X(387));a.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(t!==null?t.push(Dk):t=[Dk])}i=i.return}t!==null&&X7(e,t,r,n),e.flags|=262144}function lR(t){for(t=t.firstContext;t!==null;){if(!Ys(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function gh(t){kh=t,Vc=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function ii(t){return qfe(kh,t)}function RP(t,e){return kh===null&&gh(t),qfe(t,e)}function qfe(t,e){var r=e._currentValue;if(e={context:e,memoizedValue:r,next:null},Vc===null){if(t===null)throw Error(X(308));Vc=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Vc=Vc.next=e;return r}var yGe=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()})}},vGe=sn.unstable_scheduleCallback,bGe=sn.unstable_NormalPriority,rn={$$typeof:Nc,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zB(){return{controller:new yGe,data:new Map,refCount:0}}function Wk(t){t.refCount--,t.refCount===0&&vGe(bGe,function(){t.controller.abort()})}var hk=null,Q7=0,Uy=0,Oy=null;function xGe(t,e){if(hk===null){var r=hk=[];Q7=0,Uy=fV(),Oy={status:"pending",value:void 0,then:function(n){r.push(n)}}}return Q7++,e.then(ode,ode),e}function ode(){if(--Q7===0&&hk!==null){Oy!==null&&(Oy.status="fulfilled");var t=hk;hk=null,Uy=0,Oy=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function wGe(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 lde=De.S;De.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&xGe(t,e),lde!==null&&lde(t,e)};var fh=Il(null);function qB(){var t=fh.current;return t!==null?t:Qt.pooledCache}function HP(t,e){e===null?dr(fh,fh.current):dr(fh,e.pool)}function Hfe(){var t=qB();return t===null?null:{parent:rn._currentValue,pool:t}}var Kk=Error(X(460)),Gfe=Error(X(474)),DR=Error(X(542)),Z7={then:function(){}};function cde(t){return t=t.status,t==="fulfilled"||t==="rejected"}function LP(){}function Wfe(t,e,r){switch(r=t[r],r===void 0?t.push(e):r!==e&&(e.then(LP,LP),e=r),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,dde(t),t;default:if(typeof e.status=="string")e.then(LP,LP);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,dde(t),t}throw mk=e,Kk}}var mk=null;function ude(){if(mk===null)throw Error(X(459));var t=mk;return mk=null,t}function dde(t){if(t===Kk||t===DR)throw Error(X(483))}var kd=!1;function HB(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function J7(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 Md(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function _d(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=sR(t),$fe(t,null,r),e}return OR(t,n,e,r),sR(t)}function gk(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,mfe(t,r)}}function p7(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 eB=!1;function yk(){if(eB){var t=Oy;if(t!==null)throw t}}function vk(t,e,r,n){eB=!1;var i=t.updateQueue;kd=!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===Uy&&(eB=!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:kd=!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),$d|=a,t.lanes=a,t.memoizedState=d}}function Kfe(t,e){if(typeof t!="function")throw Error(X(191,t));t.call(e)}function Yfe(t,e){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;t<r.length;t++)Kfe(r[t],e)}var zy=Il(null),cR=Il(0);function fde(t,e){t=Gc,dr(cR,t),dr(zy,e),Gc=t|e.baseLanes}function tB(){dr(cR,Gc),dr(zy,zy.current)}function GB(){Gc=cR.current,wn(zy),wn(cR)}var Vd=0,et=null,Ft=null,Hr=null,uR=!1,Dy=!1,yh=!1,dR=0,Rk=0,Ny=null,kGe=0;function _r(){throw Error(X(321))}function WB(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 KB(t,e,r,n,i,s){return Vd=s,et=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,De.H=t===null||t.memoizedState===null?Epe:Ipe,yh=!1,s=r(n,i),yh=!1,Dy&&(s=Qfe(e,r,n,i)),Xfe(t),s}function Xfe(t){De.H=fR;var e=Ft!==null&&Ft.next!==null;if(Vd=0,Hr=Ft=et=null,uR=!1,Rk=0,Ny=null,e)throw Error(X(300));t===null||xn||(t=t.dependencies,t!==null&&lR(t)&&(xn=!0))}function Qfe(t,e,r,n){et=t;var i=0;do{if(Dy&&(Ny=null),Rk=0,Dy=!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=PGe,s=e(r,n)}while(Dy);return s}function SGe(){var t=De.H,e=t.useState()[0];return e=typeof e.then=="function"?Yk(e):e,t=t.useState()[0],(Ft!==null?Ft.memoizedState:null)!==t&&(et.flags|=1024),e}function YB(){var t=dR!==0;return dR=0,t}function XB(t,e,r){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r}function QB(t){if(uR){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}uR=!1}Vd=0,Hr=Ft=et=null,Dy=!1,Rk=dR=0,Ny=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 ZB(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yk(t){var e=Rk;return Rk+=1,Ny===null&&(Ny=[]),t=Wfe(Ny,t,e),e=et,(Hr===null?e.memoizedState:Hr.next)===null&&(e=e.alternate,De.H=e===null||e.memoizedState===null?Epe:Ipe),t}function NR(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Yk(t);if(t.$$typeof===Nc)return ii(t)}throw Error(X(438,String(t)))}function JB(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=ZB(),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]=oHe;return e.index++,r}function qc(t,e){return typeof e=="function"?e(t):e}function GP(t){var e=Gr();return eV(e,Ft,t)}function eV(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:(Vd&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===Uy&&(u=!0);else if((Vd&f)===f){c=c.next,f===Uy&&(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,$d|=f;d=c.action,yh&&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,$d|=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=Oy,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 h7(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 Zfe(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=tpe.bind(null,n,i,t);if(Xk(2048,8,o,[t]),i.getSnapshot!==e||a||Hr!==null&&Hr.memoizedState.tag&1){if(n.flags|=2048,qy(9,FR(),epe.bind(null,n,i,r,e),null),Qt===null)throw Error(X(349));s||(Vd&124)!==0||Jfe(n,e,r)}return r}function Jfe(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=et.updateQueue,e===null?(e=ZB(),et.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function epe(t,e,r,n){e.value=r,e.getSnapshot=n,rpe(e)&&npe(t)}function tpe(t,e,r){return r(function(){rpe(e)&&npe(t)})}function rpe(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Ys(t,r)}catch{return!0}}function npe(t){var e=Zy(t,2);e!==null&&Ks(e,t,2)}function rB(t){var e=ts();if(typeof t=="function"){var r=t;if(t=r(),yh){Id(!0);try{r()}finally{Id(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qc,lastRenderedState:t},e}function ipe(t,e,r,n){return t.baseState=r,eV(t,Ft,typeof n=="function"?n:qc)}function CGe(t,e,r,n,i){if(BR(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,spe(e,s)):(s.next=r.next,e.pending=r.next=s)}}function spe(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),pde(t,e,o)}catch(c){nB(t,e,c)}finally{De.T=s}}else try{s=r(i,n),pde(t,e,s)}catch(c){nB(t,e,c)}}function pde(t,e,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(n){hde(t,e,n)},function(n){return nB(t,e,n)}):hde(t,e,r)}function hde(t,e,r){e.status="fulfilled",e.value=r,ape(e),t.state=r,e=t.pending,e!==null&&(r=e.next,r===e?t.pending=null:(r=r.next,e.next=r,spe(t,r)))}function nB(t,e,r){var n=t.pending;if(t.pending=null,n!==null){n=n.next;do e.status="rejected",e.reason=r,ape(e),e=e.next;while(e!==n)}t.action=null}function ape(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function ope(t,e){return e}function mde(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=Eo(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){Tr=Eo(i.nextSibling),n=i.data==="F!";break e}}mh(n)}n=!1}n&&(e=r[0])}}return r=ts(),r.memoizedState=r.baseState=e,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ope,lastRenderedState:e},r.queue=n,r=Spe.bind(null,et,n),n.dispatch=r,n=rB(!1),s=iV.bind(null,et,!1,n.queue),n=ts(),i={state:e,dispatch:null,action:t,pending:null},n.queue=i,r=CGe.bind(null,et,i,s,r),i.dispatch=r,n.memoizedState=t,[e,r,!1]}function gde(t){var e=Gr();return lpe(e,Ft,t)}function lpe(t,e,r){if(e=eV(t,e,ope)[0],t=GP(qc)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var n=Yk(e)}catch(a){throw a===Kk?DR:a}else n=e;e=Gr();var i=e.queue,s=i.dispatch;return r!==e.memoizedState&&(et.flags|=2048,qy(9,FR(),TGe.bind(null,i,r),null)),[n,s,t]}function TGe(t,e){t.action=e}function yde(t){var e=Gr(),r=Ft;if(r!==null)return lpe(e,r,t);Gr(),e=e.memoizedState,r=Gr();var n=r.queue.dispatch;return r.memoizedState=t,[e,n,!1]}function qy(t,e,r,n){return t={tag:t,create:r,deps:n,inst:e,next:null},e=et.updateQueue,e===null&&(e=ZB(),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 FR(){return{destroy:void 0,resource:void 0}}function cpe(){return Gr().memoizedState}function WP(t,e,r,n){var i=ts();n=n===void 0?null:n,et.flags|=t,i.memoizedState=qy(1|e,FR(),r,n)}function Xk(t,e,r,n){var i=Gr();n=n===void 0?null:n;var s=i.memoizedState.inst;Ft!==null&&n!==null&&WB(n,Ft.memoizedState.deps)?i.memoizedState=qy(e,s,r,n):(et.flags|=t,i.memoizedState=qy(1|e,s,r,n))}function vde(t,e){WP(8390656,8,t,e)}function upe(t,e){Xk(2048,8,t,e)}function dpe(t,e){return Xk(4,2,t,e)}function fpe(t,e){return Xk(4,4,t,e)}function ppe(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 hpe(t,e,r){r=r!=null?r.concat([t]):null,Xk(4,4,ppe.bind(null,e,t),r)}function tV(){}function mpe(t,e){var r=Gr();e=e===void 0?null:e;var n=r.memoizedState;return e!==null&&WB(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function gpe(t,e){var r=Gr();e=e===void 0?null:e;var n=r.memoizedState;if(e!==null&&WB(e,n[1]))return n[0];if(n=t(),yh){Id(!0);try{t()}finally{Id(!1)}}return r.memoizedState=[n,e],n}function rV(t,e,r){return r===void 0||(Vd&1073741824)!==0?t.memoizedState=e:(t.memoizedState=r,t=ahe(),et.lanes|=t,$d|=t,r)}function ype(t,e,r,n){return Ys(r,e)?r:zy.current!==null?(t=rV(t,r,n),Ys(t,e)||(xn=!0),t):(Vd&42)===0?(xn=!0,t.memoizedState=r):(t=ahe(),et.lanes|=t,$d|=t,e)}function vpe(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,iV(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=wGe(l,n);bk(t,e,u,Ws(t))}else bk(t,e,n,Ws(t))}catch(d){bk(t,e,{then:function(){},status:"rejected",reason:d},Ws())}finally{xt.p=s,De.T=a}}function EGe(){}function iB(t,e,r,n){if(t.tag!==5)throw Error(X(476));var i=bpe(t).queue;vpe(t,i,e,lh,r===null?EGe:function(){return xpe(t),r(n)})}function bpe(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:lh,baseState:lh,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qc,lastRenderedState:lh},next:null};var r={};return e.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qc,lastRenderedState:r},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function xpe(t){var e=bpe(t).next.queue;bk(t,e,{},Ws())}function nV(){return ii(Dk)}function wpe(){return Gr().memoizedState}function kpe(){return Gr().memoizedState}function IGe(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var r=Ws();t=Md(r);var n=_d(e,t,r);n!==null&&(Ks(n,e,r),gk(n,e,r)),e={cache:zB()},t.payload=e;return}e=e.return}}function AGe(t,e,r){var n=Ws();r={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},BR(t)?Cpe(e,r):(r=VB(t,e,r,n),r!==null&&(Ks(r,t,n),Tpe(r,e,n)))}function Spe(t,e,r){var n=Ws();bk(t,e,r,n)}function bk(t,e,r,n){var i={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(BR(t))Cpe(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 OR(t,e,i,0),Qt===null&&_R(),!1}catch{}finally{}if(r=VB(t,e,i,n),r!==null)return Ks(r,t,n),Tpe(r,e,n),!0}return!1}function iV(t,e,r,n){if(n={lane:2,revertLane:fV(),action:n,hasEagerState:!1,eagerState:null,next:null},BR(t)){if(e)throw Error(X(479))}else e=VB(t,r,n,2),e!==null&&Ks(e,t,2)}function BR(t){var e=t.alternate;return t===et||e!==null&&e===et}function Cpe(t,e){Dy=uR=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function Tpe(t,e,r){if((r&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,mfe(t,r)}}var fR={readContext:ii,use:NR,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},Epe={readContext:ii,use:NR,useCallback:function(t,e){return ts().memoizedState=[t,e===void 0?null:e],t},useContext:ii,useEffect:vde,useImperativeHandle:function(t,e,r){r=r!=null?r.concat([t]):null,WP(4194308,4,ppe.bind(null,e,t),r)},useLayoutEffect:function(t,e){return WP(4194308,4,t,e)},useInsertionEffect:function(t,e){WP(4,2,t,e)},useMemo:function(t,e){var r=ts();e=e===void 0?null:e;var n=t();if(yh){Id(!0);try{t()}finally{Id(!1)}}return r.memoizedState=[n,e],n},useReducer:function(t,e,r){var n=ts();if(r!==void 0){var i=r(e);if(yh){Id(!0);try{r(e)}finally{Id(!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=AGe.bind(null,et,t),[n.memoizedState,t]},useRef:function(t){var e=ts();return t={current:t},e.memoizedState=t},useState:function(t){t=rB(t);var e=t.queue,r=Spe.bind(null,et,e);return e.dispatch=r,[t.memoizedState,r]},useDebugValue:tV,useDeferredValue:function(t,e){var r=ts();return rV(r,t,e)},useTransition:function(){var t=rB(!1);return t=vpe.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||Jfe(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,vde(tpe.bind(null,n,s,t),[t]),n.flags|=2048,qy(9,FR(),epe.bind(null,n,s,r,e),null),r},useId:function(){var t=ts(),e=Qt.identifierPrefix;if(bt){var r=Bc,n=Fc;r=(n&~(1<<32-Gs(n)-1)).toString(32)+r,e="\xAB"+e+"R"+r,r=dR++,0<r&&(e+="H"+r.toString(32)),e+="\xBB"}else r=kGe++,e="\xAB"+e+"r"+r.toString(32)+"\xBB";return t.memoizedState=e},useHostTransitionStatus:nV,useFormState:mde,useActionState:mde,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=iV.bind(null,et,!0,r),r.dispatch=e,[t,e]},useMemoCache:JB,useCacheRefresh:function(){return ts().memoizedState=IGe.bind(null,et)}},Ipe={readContext:ii,use:NR,useCallback:mpe,useContext:ii,useEffect:upe,useImperativeHandle:hpe,useInsertionEffect:dpe,useLayoutEffect:fpe,useMemo:gpe,useReducer:GP,useRef:cpe,useState:function(){return GP(qc)},useDebugValue:tV,useDeferredValue:function(t,e){var r=Gr();return ype(r,Ft.memoizedState,t,e)},useTransition:function(){var t=GP(qc)[0],e=Gr().memoizedState;return[typeof t=="boolean"?t:Yk(t),e]},useSyncExternalStore:Zfe,useId:wpe,useHostTransitionStatus:nV,useFormState:gde,useActionState:gde,useOptimistic:function(t,e){var r=Gr();return ipe(r,Ft,t,e)},useMemoCache:JB,useCacheRefresh:kpe},PGe={readContext:ii,use:NR,useCallback:mpe,useContext:ii,useEffect:upe,useImperativeHandle:hpe,useInsertionEffect:dpe,useLayoutEffect:fpe,useMemo:gpe,useReducer:h7,useRef:cpe,useState:function(){return h7(qc)},useDebugValue:tV,useDeferredValue:function(t,e){var r=Gr();return Ft===null?rV(r,t,e):ype(r,Ft.memoizedState,t,e)},useTransition:function(){var t=h7(qc)[0],e=Gr().memoizedState;return[typeof t=="boolean"?t:Yk(t),e]},useSyncExternalStore:Zfe,useId:wpe,useHostTransitionStatus:nV,useFormState:yde,useActionState:yde,useOptimistic:function(t,e){var r=Gr();return Ft!==null?ipe(r,Ft,t,e):(r.baseState=t,[t,r.queue.dispatch])},useMemoCache:JB,useCacheRefresh:kpe},Fy=null,Lk=0;function MP(t){var e=Lk;return Lk+=1,Fy===null&&(Fy=[]),Wfe(Fy,t,e)}function rk(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function _P(t,e){throw e.$$typeof===sHe?Error(X(525)):(t=Object.prototype.toString.call(e),Error(X(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function bde(t){var e=t._init;return e(t._payload)}function Ape(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=$c(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=d7(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===by?u(b,y,x.props.children,w,x.key):y!==null&&(y.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===wd&&bde(C)===y.type)?(y=i(y,x.props),rk(y,x),y.return=b,y):(y=qP(x.type,x.key,x.props,null,b.mode,w),rk(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=f7(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=ch(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=d7(""+y,b.mode,x),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case SP:return x=qP(y.type,y.key,y.props,null,b.mode,x),rk(x,y),x.return=b,x;case ok:return y=f7(y,b.mode,x),y.return=b,y;case wd:var w=y._init;return y=w(y._payload),d(b,y,x)}if(lk(y)||J1(y))return y=ch(y,b.mode,x,null),y.return=b,y;if(typeof y.then=="function")return d(b,MP(y),x);if(y.$$typeof===Nc)return d(b,RP(b,y),x);_P(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 SP:return x.key===C?l(b,y,x,w):null;case ok:return x.key===C?c(b,y,x,w):null;case wd:return C=x._init,x=C(x._payload),f(b,y,x,w)}if(lk(x)||J1(x))return C!==null?null:u(b,y,x,w,null);if(typeof x.then=="function")return f(b,y,MP(x),w);if(x.$$typeof===Nc)return f(b,y,RP(b,x),w);_P(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 SP:return b=b.get(w.key===null?x:w.key)||null,l(y,b,w,C);case ok:return b=b.get(w.key===null?x:w.key)||null,c(y,b,w,C);case wd:var O=w._init;return w=O(w._payload),p(b,y,x,w,C)}if(lk(w)||J1(w))return b=b.get(x)||null,u(y,b,w,C,null);if(typeof w.then=="function")return p(b,y,x,MP(w),C);if(w.$$typeof===Nc)return p(b,y,x,RP(y,w),C);_P(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&&ah(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&&ah(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&&ah(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&&ah(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&&ah(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&&ah(b,T),C}function v(b,y,x,w){if(typeof x=="object"&&x!==null&&x.type===by&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case SP:e:{for(var C=x.key;y!==null;){if(y.key===C){if(C=x.type,C===by){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===wd&&bde(C)===y.type){r(b,y.sibling),w=i(y,x.props),rk(w,x),w.return=b,b=w;break e}r(b,y);break}else e(b,y);y=y.sibling}x.type===by?(w=ch(x.props.children,b.mode,w,x.key),w.return=b,b=w):(w=qP(x.type,x.key,x.props,null,b.mode,w),rk(w,x),w.return=b,b=w)}return a(b);case ok: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=f7(x,b.mode,w),w.return=b,b=w}return a(b);case wd:return C=x._init,x=C(x._payload),v(b,y,x,w)}if(lk(x))return h(b,y,x,w);if(J1(x)){if(C=J1(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,MP(x),w);if(x.$$typeof===Nc)return v(b,y,RP(b,x),w);_P(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=d7(x,b.mode,w),w.return=b,b=w),a(b)):r(b,y)}return function(b,y,x,w){try{Lk=0;var C=v(b,y,x,w);return Fy=null,C}catch(S){if(S===Kk||S===DR)throw S;var O=qs(29,S,null,b.mode);return O.lanes=w,O.return=b,O}finally{}}}var Hy=Ape(!0),Ppe=Ape(!1),Fa=Il(null),El=null;function Cd(t){var e=t.alternate;dr(nn,nn.current&1),dr(Fa,t),El===null&&(e===null||zy.current!==null||e.memoizedState!==null)&&(El=t)}function Rpe(t){if(t.tag===22){if(dr(nn,nn.current),dr(Fa,t),El===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(El=t)}}else Td(t)}function Td(){dr(nn,nn.current),dr(Fa,Fa.current)}function jc(t){wn(Fa),El===t&&(El=null),wn(nn)}var nn=Il(0);function pR(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==="$?"||wB(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 m7(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 sB={enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Ws(),i=Md(n);i.payload=e,r!=null&&(i.callback=r),e=_d(t,i,n),e!==null&&(Ks(e,t,n),gk(e,t,n))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Ws(),i=Md(n);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=_d(t,i,n),e!==null&&(Ks(e,t,n),gk(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Ws(),n=Md(r);n.tag=2,e!=null&&(n.callback=e),e=_d(t,n,r),e!==null&&(Ks(e,t,r),gk(e,t,r))}};function xde(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?!Ak(r,n)||!Ak(i,s):!0}function wde(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&&sB.enqueueReplaceState(e,e.state,null)}function vh(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 hR=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 Lpe(t){hR(t)}function Mpe(t){console.error(t)}function _pe(t){hR(t)}function mR(t,e){try{var r=t.onUncaughtError;r(e.value,{componentStack:e.stack})}catch(n){setTimeout(function(){throw n})}}function kde(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 aB(t,e,r){return r=Md(r),r.tag=3,r.payload={element:null},r.callback=function(){mR(t,e)},r}function Ope(t){return t=Md(t),t.tag=3,t}function Dpe(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(){kde(e,r,n)}}var a=r.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(t.callback=function(){kde(e,r,n),typeof i!="function"&&(Od===null?Od=new Set([this]):Od.add(this));var o=n.stack;this.componentDidCatch(n.value,{componentStack:o!==null?o:""})})}function RGe(t,e,r,n,i){if(r.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(e=r.alternate,e!==null&&Gk(e,r,i,!0),r=Fa.current,r!==null){switch(r.tag){case 13:return El===null?hB():r.alternate===null&&Er===0&&(Er=3),r.flags&=-257,r.flags|=65536,r.lanes=i,n===Z7?r.flags|=16384:(e=r.updateQueue,e===null?r.updateQueue=new Set([n]):e.add(n),E7(t,n,i)),!1;case 22:return r.flags|=65536,n===Z7?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)),E7(t,n,i)),!1}throw Error(X(435,r.tag))}return E7(t,n,i),hB(),!1}if(bt)return e=Fa.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=i,n!==W7&&(t=Error(X(422),{cause:n}),Pk(Da(t,r)))):(n!==W7&&(e=Error(X(423),{cause:n}),Pk(Da(e,r))),t=t.current.alternate,t.flags|=65536,i&=-i,t.lanes|=i,n=Da(n,r),i=aB(t.stateNode,n,i),p7(t,i),Er!==4&&(Er=2)),!1;var s=Error(X(520),{cause:n});if(s=Da(s,r),kk===null?kk=[s]:kk.push(s),Er!==4&&(Er=2),e===null)return!0;n=Da(n,r),r=e;do{switch(r.tag){case 3:return r.flags|=65536,t=i&-i,r.lanes|=t,t=aB(r.stateNode,n,t),p7(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"&&(Od===null||!Od.has(s))))return r.flags|=65536,i&=-i,r.lanes|=i,i=Ope(i),Dpe(i,t,r,n),p7(r,i),!1}r=r.return}while(r!==null);return!1}var Npe=Error(X(461)),xn=!1;function Vn(t,e,r,n){e.child=t===null?Ppe(e,null,r,n):Hy(e,t.child,r,n)}function Sde(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 gh(e),n=KB(t,e,r,a,s,i),o=YB(),t!==null&&!xn?(XB(t,e,i),Hc(t,e,i)):(bt&&o&&$B(e),e.flags|=1,Vn(t,e,n,i),e.child)}function Cde(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!jB(s)&&s.defaultProps===void 0&&r.compare===null?(e.tag=15,e.type=s,Fpe(t,e,s,n,i)):(t=qP(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!sV(t,i)){var a=s.memoizedProps;if(r=r.compare,r=r!==null?r:Ak,r(a,n)&&t.ref===e.ref)return Hc(t,e,i)}return e.flags|=1,t=$c(s,n),t.ref=e.ref,t.return=e,e.child=t}function Fpe(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(Ak(s,n)&&t.ref===e.ref)if(xn=!1,e.pendingProps=n=s,sV(t,i))(t.flags&131072)!==0&&(xn=!0);else return e.lanes=t.lanes,Hc(t,e,i)}return oB(t,e,r,n,i)}function Bpe(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 Tde(t,e,n,r)}if((r&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&HP(e,s!==null?s.cachePool:null),s!==null?fde(e,s):tB(),Rpe(e);else return e.lanes=e.childLanes=536870912,Tde(t,e,s!==null?s.baseLanes|r:r,r)}else s!==null?(HP(e,s.cachePool),fde(e,s),Td(e),e.memoizedState=null):(t!==null&&HP(e,null),tB(),Td(e));return Vn(t,e,i,r),e.child}function Tde(t,e,r,n){var i=qB();return i=i===null?null:{parent:rn._currentValue,pool:i},e.memoizedState={baseLanes:r,cachePool:i},t!==null&&HP(e,null),tB(),Rpe(e),t!==null&&Gk(t,e,n,!0),null}function KP(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 oB(t,e,r,n,i){return gh(e),r=KB(t,e,r,n,void 0,i),n=YB(),t!==null&&!xn?(XB(t,e,i),Hc(t,e,i)):(bt&&n&&$B(e),e.flags|=1,Vn(t,e,r,i),e.child)}function Ede(t,e,r,n,i,s){return gh(e),e.updateQueue=null,r=Qfe(e,n,r,i),Xfe(t),n=YB(),t!==null&&!xn?(XB(t,e,s),Hc(t,e,s)):(bt&&n&&$B(e),e.flags|=1,Vn(t,e,r,s),e.child)}function Ide(t,e,r,n,i){if(gh(e),e.stateNode===null){var s=Iy,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=sB,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=n,s.state=e.memoizedState,s.refs={},HB(e),a=r.contextType,s.context=typeof a=="object"&&a!==null?ii(a):Iy,s.state=e.memoizedState,a=r.getDerivedStateFromProps,typeof a=="function"&&(m7(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&&sB.enqueueReplaceState(s,s.state,null),vk(e,n,s,i),yk(),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=vh(r,o);s.props=l;var c=s.context,u=r.contextType;a=Iy,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)&&wde(e,s,n,a),kd=!1;var f=e.memoizedState;s.state=f,vk(e,n,s,i),yk(),c=e.memoizedState,o||f!==c||kd?(typeof d=="function"&&(m7(e,r,d,n),c=e.memoizedState),(l=kd||xde(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,J7(t,e),a=e.memoizedProps,u=vh(r,a),s.props=u,d=e.pendingProps,f=s.context,c=r.contextType,l=Iy,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)&&wde(e,s,n,l),kd=!1,f=e.memoizedState,s.state=f,vk(e,n,s,i),yk();var p=e.memoizedState;a!==d||f!==p||kd||t!==null&&t.dependencies!==null&&lR(t.dependencies)?(typeof o=="function"&&(m7(e,r,o,n),p=e.memoizedState),(u=kd||xde(e,r,u,n,f,p,l)||t!==null&&t.dependencies!==null&&lR(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,KP(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=Hy(e,t.child,null,i),e.child=Hy(e,null,r,i)):Vn(t,e,r,i),e.memoizedState=s.state,t=e.child):t=Hc(t,e,i),t}function Ade(t,e,r,n){return Hk(),e.flags|=256,Vn(t,e,r,n),e.child}var g7={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function y7(t){return{baseLanes:t,cachePool:Hfe()}}function v7(t,e,r){return t=t!==null?t.childLanes&~r:0,e&&(t|=Na),t}function Vpe(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?Cd(e):Td(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=Eo(l.nextSibling),l===null){o=null;break e}}o=l}o!==null?(e.memoizedState={dehydrated:o,treeContext:uh!==null?{id:Fc,overflow:Bc}: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||mh(e)}if(o=e.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return wB(o)?e.lanes=32:e.lanes=536870912,null;jc(e)}return o=n.children,n=n.fallback,i?(Td(e),i=e.mode,o=gR({mode:"hidden",children:o},i),n=ch(n,i,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,i=e.child,i.memoizedState=y7(r),i.childLanes=v7(t,a,r),e.memoizedState=g7,n):(Cd(e),lB(e,o))}if(l=t.memoizedState,l!==null&&(o=l.dehydrated,o!==null)){if(s)e.flags&256?(Cd(e),e.flags&=-257,e=b7(t,e,r)):e.memoizedState!==null?(Td(e),e.child=t.child,e.flags|=128,e=null):(Td(e),i=n.fallback,o=e.mode,n=gR({mode:"visible",children:n.children},o),i=ch(i,o,r,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,Hy(e,t.child,null,r),n=e.child,n.memoizedState=y7(r),n.childLanes=v7(t,a,r),e.memoizedState=g7,e=i);else if(Cd(e),wB(o)){if(a=o.nextSibling&&o.nextSibling.dataset,a)var c=a.dgst;a=c,n=Error(X(419)),n.stack="",n.digest=a,Pk({value:n,source:null,stack:null}),e=b7(t,e,r)}else if(xn||Gk(t,e,r,!1),a=(r&t.childLanes)!==0,xn||a){if(a=Qt,a!==null&&(n=r&-r,n=(n&42)!==0?1:PB(n),n=(n&(a.suspendedLanes|r))!==0?0:n,n!==0&&n!==l.retryLane))throw l.retryLane=n,Zy(t,n),Ks(a,t,n),Npe;o.data==="$?"||hB(),e=b7(t,e,r)}else o.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,Tr=Eo(o.nextSibling),Ai=e,bt=!0,dh=null,kl=!1,t!==null&&(Ma[_a++]=Fc,Ma[_a++]=Bc,Ma[_a++]=uh,Fc=t.id,Bc=t.overflow,uh=e),e=lB(e,n.children),e.flags|=4096);return e}return i?(Td(e),i=n.fallback,o=e.mode,l=t.child,c=l.sibling,n=$c(l,{mode:"hidden",children:n.children}),n.subtreeFlags=l.subtreeFlags&65011712,c!==null?i=$c(c,i):(i=ch(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=y7(r):(l=o.cachePool,l!==null?(c=rn._currentValue,l=l.parent!==c?{parent:c,pool:c}:l):l=Hfe(),o={baseLanes:o.baseLanes|r,cachePool:l}),i.memoizedState=o,i.childLanes=v7(t,a,r),e.memoizedState=g7,n):(Cd(e),r=t.child,t=r.sibling,r=$c(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 lB(t,e){return e=gR({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function gR(t,e){return t=qs(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function b7(t,e,r){return Hy(e,t.child,null,r),t=lB(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Pde(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Y7(t.return,e,r)}function x7(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 jpe(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&&Pde(t,r,e);else if(t.tag===19)Pde(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&&pR(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),x7(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&&pR(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}x7(e,!0,r,null,s);break;case"together":x7(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Hc(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),$d|=e.lanes,(r&e.childLanes)===0)if(t!==null){if(Gk(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=$c(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=$c(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function sV(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&lR(t)))}function LGe(t,e,r){switch(e.tag){case 3:eR(e,e.stateNode.containerInfo),Sd(e,rn,t.memoizedState.cache),Hk();break;case 27:case 5:F7(e);break;case 4:eR(e,e.stateNode.containerInfo);break;case 10:Sd(e,e.type,e.memoizedProps.value);break;case 13:var n=e.memoizedState;if(n!==null)return n.dehydrated!==null?(Cd(e),e.flags|=128,null):(r&e.child.childLanes)!==0?Vpe(t,e,r):(Cd(e),t=Hc(t,e,r),t!==null?t.sibling:null);Cd(e);break;case 19:var i=(t.flags&128)!==0;if(n=(r&e.childLanes)!==0,n||(Gk(t,e,r,!1),n=(r&e.childLanes)!==0),i){if(n)return jpe(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,Bpe(t,e,r);case 24:Sd(e,rn,t.memoizedState.cache)}return Hc(t,e,r)}function $pe(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps)xn=!0;else{if(!sV(t,r)&&(e.flags&128)===0)return xn=!1,LGe(t,e,r);xn=(t.flags&131072)!==0}else xn=!1,bt&&(e.flags&1048576)!==0&&zfe(e,oR,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")jB(n)?(t=vh(n,t),e.tag=1,e=Ide(null,e,n,t,r)):(e.tag=0,e=oB(null,e,n,t,r));else{if(n!=null){if(i=n.$$typeof,i===EB){e.tag=11,e=Sde(null,e,n,t,r);break e}else if(i===IB){e.tag=14,e=Cde(null,e,n,t,r);break e}}throw e=D7(n)||n,Error(X(306,e,""))}}return e;case 0:return oB(t,e,e.type,e.pendingProps,r);case 1:return n=e.type,i=vh(n,e.pendingProps),Ide(t,e,n,i,r);case 3:e:{if(eR(e,e.stateNode.containerInfo),t===null)throw Error(X(387));n=e.pendingProps;var s=e.memoizedState;i=s.element,J7(t,e),vk(e,n,null,r);var a=e.memoizedState;if(n=a.cache,Sd(e,rn,n),n!==s.cache&&X7(e,[rn],r,!0),yk(),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=Ade(t,e,n,r);break e}else if(n!==i){i=Da(Error(X(424)),e),Pk(i),e=Ade(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=Eo(t.firstChild),Ai=e,bt=!0,dh=null,kl=!0,r=Ppe(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Hk(),n===i){e=Hc(t,e,r);break e}Vn(t,e,n,r)}e=e.child}return e;case 26:return KP(t,e),t===null?(r=Kde(e.type,null,e.pendingProps,null))?e.memoizedState=r:bt||(r=e.type,t=e.pendingProps,n=SR(Ld.current).createElement(r),n[ni]=e,n[is]=t,$n(n,r,t),bn(n),e.stateNode=n):e.memoizedState=Kde(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return F7(e),t===null&&bt&&(n=e.stateNode=Ihe(e.type,e.pendingProps,Ld.current),Ai=e,kl=!0,i=Tr,zd(e.type)?(kB=i,Tr=Eo(n.firstChild)):Tr=i),Vn(t,e,e.pendingProps.children,r),KP(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&bt&&((i=n=Tr)&&(n=nWe(n,e.type,e.pendingProps,kl),n!==null?(e.stateNode=n,Ai=e,Tr=Eo(n.firstChild),kl=!1,i=!0):i=!1),i||mh(e)),F7(e),i=e.type,s=e.pendingProps,a=t!==null?t.memoizedProps:null,n=s.children,bB(i,s)?n=null:a!==null&&bB(i,a)&&(e.flags|=32),e.memoizedState!==null&&(i=KB(t,e,SGe,null,null,r),Dk._currentValue=i),KP(t,e),Vn(t,e,n,r),e.child;case 6:return t===null&&bt&&((t=r=Tr)&&(r=iWe(r,e.pendingProps,kl),r!==null?(e.stateNode=r,Ai=e,Tr=null,t=!0):t=!1),t||mh(e)),null;case 13:return Vpe(t,e,r);case 4:return eR(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Hy(e,null,n,r):Vn(t,e,n,r),e.child;case 11:return Sde(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,Sd(e,e.type,n.value),Vn(t,e,n.children,r),e.child;case 9:return i=e.type._context,n=e.pendingProps.children,gh(e),i=ii(i),n=n(i),e.flags|=1,Vn(t,e,n,r),e.child;case 14:return Cde(t,e,e.type,e.pendingProps,r);case 15:return Fpe(t,e,e.type,e.pendingProps,r);case 19:return jpe(t,e,r);case 31:return n=e.pendingProps,r=e.mode,n={mode:n.mode,children:n.children},t===null?(r=gR(n,r),r.ref=e.ref,e.child=r,r.return=e,e=r):(r=$c(t.child,n),r.ref=e.ref,e.child=r,r.return=e,e=r),e;case 22:return Bpe(t,e,r);case 24:return gh(e),n=ii(rn),t===null?(i=qB(),i===null&&(i=Qt,s=zB(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=r),i=s),e.memoizedState={parent:n,cache:i},HB(e),Sd(e,rn,i)):((t.lanes&r)!==0&&(J7(t,e),vk(e,null,null,r),yk()),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),Sd(e,rn,n)):(n=s.cache,Sd(e,rn,n),n!==i.cache&&X7(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 _c(t){t.flags|=4}function Rde(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Rhe(e)){if(e=Fa.current,e!==null&&((at&4194048)===at?El!==null:(at&62914560)!==at&&(at&536870912)===0||e!==El))throw mk=Z7,Gfe;t.flags|=8192}}function OP(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?pfe():536870912,t.lanes|=e,Gy|=e)}function nk(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 MGe(t,e,r){var n=e.pendingProps;switch(UB(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),Uc(rn),Vy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(tk(e)?_c(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,ade())),yr(e),null;case 26:return r=e.memoizedState,t===null?(_c(e),r!==null?(yr(e),Rde(e,r)):(yr(e),e.flags&=-16777217)):r?r!==t.memoizedState?(_c(e),yr(e),Rde(e,r)):(yr(e),e.flags&=-16777217):(t.memoizedProps!==n&&_c(e),yr(e),e.flags&=-16777217),null;case 27:tR(e),r=Ld.current;var i=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==n&&_c(e);else{if(!n){if(e.stateNode===null)throw Error(X(166));return yr(e),null}t=Cl.current,tk(e)?ide(e,t):(t=Ihe(i,n,r),e.stateNode=t,_c(e))}return yr(e),null;case 5:if(tR(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&_c(e);else{if(!n){if(e.stateNode===null)throw Error(X(166));return yr(e),null}if(t=Cl.current,tk(e))ide(e,t);else{switch(i=SR(Ld.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&&_c(e)}}return yr(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&_c(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(X(166));if(t=Ld.current,tk(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||Che(t.nodeValue,r)),t||mh(e)}else t=SR(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=tk(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 Hk(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;yr(e),i=!1}else i=ade(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return e.flags&256?(jc(e),e):(jc(e),null)}if(jc(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),OP(e,e.updateQueue),yr(e),null;case 4:return Vy(),t===null&&pV(e.stateNode.containerInfo),yr(e),null;case 10:return Uc(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)nk(i,!1);else{if(Er!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=pR(t),s!==null){for(e.flags|=128,nk(i,!1),t=s.updateQueue,e.updateQueue=t,OP(e,t),e.subtreeFlags=0,t=r,r=e.child;r!==null;)Ufe(r,t),r=r.sibling;return dr(nn,nn.current&1|2),e.child}t=t.sibling}i.tail!==null&&Tl()>vR&&(e.flags|=128,n=!0,nk(i,!1),e.lanes=4194304)}else{if(!n)if(t=pR(s),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,OP(e,t),nk(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!bt)return yr(e),null}else 2*Tl()-i.renderingStartTime>vR&&r!==536870912&&(e.flags|=128,n=!0,nk(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 jc(e),GB(),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&&OP(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(fh),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Uc(rn),yr(e),null;case 25:return null;case 30:return null}throw Error(X(156,e.tag))}function _Ge(t,e){switch(UB(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Uc(rn),Vy(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return tR(e),null;case 13:if(jc(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(X(340));Hk()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wn(nn),null;case 4:return Vy(),null;case 10:return Uc(e.type),null;case 22:case 23:return jc(e),GB(),t!==null&&wn(fh),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Uc(rn),null;case 25:return null;default:return null}}function Upe(t,e){switch(UB(e),e.tag){case 3:Uc(rn),Vy();break;case 26:case 27:case 5:tR(e);break;case 4:Vy();break;case 13:jc(e);break;case 19:wn(nn);break;case 10:Uc(e.type);break;case 22:case 23:jc(e),GB(),t!==null&&wn(fh);break;case 24:Uc(rn)}}function Qk(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 jd(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 zpe(t){var e=t.updateQueue;if(e!==null){var r=t.stateNode;try{Yfe(e,r)}catch(n){zt(t,t.return,n)}}}function qpe(t,e,r){r.props=vh(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(n){zt(t,e,n)}}function xk(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 Hpe(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 w7(t,e,r){try{var n=t.stateNode;ZGe(n,t.type,r,e),n[is]=e}catch(i){zt(t,t.return,i)}}function Gpe(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&zd(t.type)||t.tag===4}function k7(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gpe(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&&zd(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 cB(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=UR));else if(n!==4&&(n===27&&zd(t.type)&&(r=t.stateNode,e=null),t=t.child,t!==null))for(cB(t,e,r),t=t.sibling;t!==null;)cB(t,e,r),t=t.sibling}function yR(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&&zd(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(yR(t,e,r),t=t.sibling;t!==null;)yR(t,e,r),t=t.sibling}function Wpe(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 Dc=!1,Or=!1,S7=!1,Lde=typeof WeakSet=="function"?WeakSet:Set,vn=null;function OGe(t,e){if(t=t.containerInfo,yB=IR,t=Ofe(t),FB(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(vB={focusedElem:t,selectionRange:r},IR=!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=vh(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)xB(t);else if(r===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xB(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 Kpe(t,e,r){var n=r.flags;switch(r.tag){case 0:case 11:case 15:bd(t,r),n&4&&Qk(5,r);break;case 1:if(bd(t,r),n&4)if(t=r.stateNode,e===null)try{t.componentDidMount()}catch(a){zt(r,r.return,a)}else{var i=vh(r.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(i,e,t.__reactInternalSnapshotBeforeUpdate)}catch(a){zt(r,r.return,a)}}n&64&&zpe(r),n&512&&xk(r,r.return);break;case 3:if(bd(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{Yfe(t,e)}catch(a){zt(r,r.return,a)}}break;case 27:e===null&&n&4&&Wpe(r);case 26:case 5:bd(t,r),e===null&&n&4&&Hpe(r),n&512&&xk(r,r.return);break;case 12:bd(t,r);break;case 13:bd(t,r),n&4&&Qpe(t,r),n&64&&(t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(r=zGe.bind(null,r),sWe(t,r))));break;case 22:if(n=r.memoizedState!==null||Dc,!n){e=e!==null&&e.memoizedState!==null||Or,i=Dc;var s=Or;Dc=n,(Or=e)&&!s?xd(t,r,(r.subtreeFlags&8772)!==0):bd(t,r),Dc=i,Or=s}break;case 30:break;default:bd(t,r)}}function Ype(t){var e=t.alternate;e!==null&&(t.alternate=null,Ype(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&LB(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 Oc(t,e,r){for(r=r.child;r!==null;)Xpe(t,e,r),r=r.sibling}function Xpe(t,e,r){if(Hs&&typeof Hs.onCommitFiberUnmount=="function")try{Hs.onCommitFiberUnmount(jk,r)}catch{}switch(r.tag){case 26:Or||Sl(r,e),Oc(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;zd(r.type)&&(ur=r.stateNode,rs=!1),Oc(t,e,r),Ck(r.stateNode),ur=n,rs=i;break;case 5:Or||Sl(r,e);case 6:if(n=ur,i=rs,ur=null,Oc(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,Hde(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,r.stateNode),Bk(t)):Hde(ur,r.stateNode));break;case 4:n=ur,i=rs,ur=r.stateNode.containerInfo,rs=!0,Oc(t,e,r),ur=n,rs=i;break;case 0:case 11:case 14:case 15:Or||jd(2,r,e),Or||jd(4,r,e),Oc(t,e,r);break;case 1:Or||(Sl(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"&&qpe(r,e,n)),Oc(t,e,r);break;case 21:Oc(t,e,r);break;case 22:Or=(n=Or)||r.memoizedState!==null,Oc(t,e,r),Or=n;break;default:Oc(t,e,r)}}function Qpe(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Bk(t)}catch(r){zt(e,e.return,r)}}function DGe(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Lde),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Lde),e;default:throw Error(X(435,t.tag))}}function C7(t,e){var r=DGe(t);e.forEach(function(n){var i=qGe.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(zd(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));Xpe(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;)Zpe(e,t),e=e.sibling}var To=null;function Zpe(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&&(jd(3,t,t.return),Qk(3,t),jd(5,t,t.return));break;case 1:$s(e,t),Us(t),n&512&&(Or||r===null||Sl(r,r.return)),n&64&&Dc&&(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=To;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[zk]||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=Xde("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=Xde("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 Qde(i,t.type,t.stateNode);else t.stateNode=Yde(i,n,t.memoizedProps);else s!==n?(s===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):s.count--,n===null?Qde(i,t.type,t.stateNode):Yde(i,n,t.memoizedProps)):n===null&&t.stateNode!==null&&w7(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&&w7(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{$y(i,"")}catch(p){zt(t,t.return,p)}}n&4&&t.stateNode!=null&&(i=t.memoizedProps,w7(t,i,r!==null?r.memoizedProps:i)),n&1024&&(S7=!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(QP=null,i=To,To=CR(e.containerInfo),$s(e,t),To=i,Us(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Bk(e.containerInfo)}catch(p){zt(t,t.return,p)}S7&&(S7=!1,Jpe(t));break;case 4:n=To,To=CR(t.stateNode.containerInfo),$s(e,t),Us(t),To=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)&&(uV=Tl()),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,C7(t,n)));break;case 22:i=t.memoizedState!==null;var l=r!==null&&r.memoizedState!==null,c=Dc,u=Or;if(Dc=c||i,Or=u||l,$s(e,t),Or=u,Dc=c,Us(t),n&8192)e:for(e=t.stateNode,e._visibility=i?e._visibility&-2:e._visibility|1,i&&(r===null||l||Dc||Or||oh(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,C7(t,r))));break;case 19:$s(e,t),Us(t),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,C7(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(Gpe(n)){r=n;break}n=n.return}if(r==null)throw Error(X(160));switch(r.tag){case 27:var i=r.stateNode,s=k7(t);yR(t,s,i);break;case 5:var a=r.stateNode;r.flags&32&&($y(a,""),r.flags&=-33);var o=k7(t);yR(t,o,a);break;case 3:case 4:var l=r.stateNode.containerInfo,c=k7(t);cB(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 Jpe(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;Jpe(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function bd(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Kpe(t,e.alternate,e),e=e.sibling}function oh(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:jd(4,e,e.return),oh(e);break;case 1:Sl(e,e.return);var r=e.stateNode;typeof r.componentWillUnmount=="function"&&qpe(e,e.return,r),oh(e);break;case 27:Ck(e.stateNode);case 26:case 5:Sl(e,e.return),oh(e);break;case 22:e.memoizedState===null&&oh(e);break;case 30:oh(e);break;default:oh(e)}t=t.sibling}}function xd(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:xd(i,s,r),Qk(4,s);break;case 1:if(xd(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++)Kfe(l[i],o)}catch(c){zt(n,n.return,c)}}r&&a&64&&zpe(s),xk(s,s.return);break;case 27:Wpe(s);case 26:case 5:xd(i,s,r),r&&n===null&&a&4&&Hpe(s),xk(s,s.return);break;case 12:xd(i,s,r);break;case 13:xd(i,s,r),r&&a&4&&Qpe(i,s);break;case 22:s.memoizedState===null&&xd(i,s,r),xk(s,s.return);break;case 30:break;default:xd(i,s,r)}e=e.sibling}}function aV(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&&Wk(r))}function oV(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Wk(t))}function wl(t,e,r,n){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ehe(t,e,r,n),e=e.sibling}function ehe(t,e,r,n){var i=e.flags;switch(e.tag){case 0:case 11:case 15:wl(t,e,r,n),i&2048&&Qk(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&&Wk(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):wk(t,e):s._visibility&2?wl(t,e,r,n):(s._visibility|=2,yy(t,e,r,n,(e.subtreeFlags&10256)!==0)),i&2048&&aV(a,e);break;case 24:wl(t,e,r,n),i&2048&&oV(e.alternate,e);break;default:wl(t,e,r,n)}}function yy(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:yy(s,a,o,l,i),Qk(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?yy(s,a,o,l,i):wk(s,a):(u._visibility|=2,yy(s,a,o,l,i)),i&&c&2048&&aV(a.alternate,a);break;case 24:yy(s,a,o,l,i),i&&c&2048&&oV(a.alternate,a);break;default:yy(s,a,o,l,i)}e=e.sibling}}function wk(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:wk(r,n),i&2048&&aV(n.alternate,n);break;case 24:wk(r,n),i&2048&&oV(n.alternate,n);break;default:wk(r,n)}e=e.sibling}}var uk=8192;function hy(t){if(t.subtreeFlags&uk)for(t=t.child;t!==null;)the(t),t=t.sibling}function the(t){switch(t.tag){case 26:hy(t),t.flags&uk&&t.memoizedState!==null&&vWe(To,t.memoizedState,t.memoizedProps);break;case 5:hy(t);break;case 3:case 4:var e=To;To=CR(t.stateNode.containerInfo),hy(t),To=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=uk,uk=16777216,hy(t),uk=e):hy(t));break;default:hy(t)}}function rhe(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 ik(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,ihe(n,t)}rhe(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)nhe(t),t=t.sibling}function nhe(t){switch(t.tag){case 0:case 11:case 15:ik(t),t.flags&2048&&jd(9,t,t.return);break;case 3:ik(t);break;case 12:ik(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,YP(t)):ik(t);break;default:ik(t)}}function YP(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,ihe(n,t)}rhe(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:jd(8,e,e.return),YP(e);break;case 22:r=e.stateNode,r._visibility&2&&(r._visibility&=-3,YP(e));break;default:YP(e)}t=t.sibling}}function ihe(t,e){for(;vn!==null;){var r=vn;switch(r.tag){case 0:case 11:case 15:jd(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:Wk(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(Ype(n),n===r){vn=null;break e}if(i!==null){i.return=s,vn=i;break e}vn=s}}}var NGe={getCacheForType:function(t){var e=ii(rn),r=e.data.get(t);return r===void 0&&(r=t(),e.data.set(t,r)),r}},FGe=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Qt=null,nt=null,at=0,Rt=0,zs=null,Pd=!1,Jy=!1,lV=!1,Gc=0,Er=0,$d=0,ph=0,cV=0,Na=0,Gy=0,kk=null,ns=null,uB=!1,uV=0,vR=1/0,bR=null,Od=null,jn=0,Dd=null,Wy=null,By=0,dB=0,fB=null,she=null,Sk=0,pB=null;function Ws(){if((Lt&2)!==0&&at!==0)return at&-at;if(De.T!==null){var t=Uy;return t!==0?t:fV()}return gfe()}function ahe(){Na===0&&(Na=(at&536870912)===0||bt?ffe():536870912);var t=Fa.current;return t!==null&&(t.flags|=32),Na}function Ks(t,e,r){(t===Qt&&(Rt===2||Rt===9)||t.cancelPendingCommit!==null)&&(Ky(t,0),Rd(t,at,Na,!1)),Uk(t,r),((Lt&2)===0||t!==Qt)&&(t===Qt&&((Lt&2)===0&&(ph|=r),Er===4&&Rd(t,at,Na,!1)),Al(t))}function ohe(t,e,r){if((Lt&6)!==0)throw Error(X(327));var n=!r&&(e&124)===0&&(e&t.expiredLanes)===0||$k(t,e),i=n?jGe(t,e):T7(t,e,!0),s=n;do{if(i===0){Jy&&!n&&Rd(t,e,0,!1);break}else{if(r=t.current.alternate,s&&!BGe(r)){i=T7(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=kk;var l=o.current.memoizedState.isDehydrated;if(l&&(Ky(o,a).flags|=256),a=T7(o,a,!1),a!==2){if(lV&&!l){o.errorRecoveryDisabledLanes|=s,ph|=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){Ky(t,0),Rd(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:Rd(n,e,Na,!Pd);break e;case 2:ns=null;break;case 3:case 5:break;default:throw Error(X(329))}if((e&62914560)===e&&(i=uV+300-Tl(),10<i)){if(Rd(n,e,Na,!Pd),PR(n,0,!0)!==0)break e;n.timeoutHandle=Ehe(Mde.bind(null,n,r,ns,bR,uB,e,Na,ph,Gy,Pd,s,2,-0,0),i);break e}Mde(n,r,ns,bR,uB,e,Na,ph,Gy,Pd,s,0,-0,0)}}break}while(!0);Al(t)}function Mde(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)&&(Ok={stylesheets:null,count:0,unsuspend:yWe},the(e),d=bWe(),d!==null)){t.cancelPendingCommit=d(Ode.bind(null,t,e,s,r,n,i,a,o,l,u,1,f,p)),Rd(t,s,a,!c);return}Ode(t,e,s,r,n,i,a,o,l)}function BGe(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 Rd(t,e,r,n){e&=~cV,e&=~ph,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&&hfe(t,r,e)}function VR(){return(Lt&6)===0?(Zk(0,!1),!1):!0}function dV(){if(nt!==null){if(Rt===0)var t=nt.return;else t=nt,Vc=kh=null,QB(t),Fy=null,Lk=0,t=nt;for(;t!==null;)Upe(t.alternate,t),t=t.return;nt=null}}function Ky(t,e){var r=t.timeoutHandle;r!==-1&&(t.timeoutHandle=-1,eWe(r)),r=t.cancelPendingCommit,r!==null&&(t.cancelPendingCommit=null,r()),dV(),Qt=t,nt=r=$c(t.current,null),at=e,Rt=0,zs=null,Pd=!1,Jy=$k(t,e),lV=!1,Gy=Na=cV=ph=$d=Er=0,ns=kk=null,uB=!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 Gc=e,_R(),r}function lhe(t,e){et=null,De.H=fR,e===Kk||e===DR?(e=ude(),Rt=3):e===Gfe?(e=ude(),Rt=4):Rt=e===Npe?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,zs=e,nt===null&&(Er=1,mR(t,Da(e,t.current)))}function che(){var t=De.H;return De.H=fR,t===null?fR:t}function uhe(){var t=De.A;return De.A=NGe,t}function hB(){Er=4,Pd||(at&4194048)!==at&&Fa.current!==null||(Jy=!0),($d&134217727)===0&&(ph&134217727)===0||Qt===null||Rd(Qt,at,Na,!1)}function T7(t,e,r){var n=Lt;Lt|=2;var i=che(),s=uhe();(Qt!==t||at!==e)&&(bR=null,Ky(t,e)),e=!1;var a=Er;e:do try{if(Rt!==0&&nt!==null){var o=nt,l=zs;switch(Rt){case 8:dV(),a=6;break e;case 3:case 2:case 9:case 6:Fa.current===null&&(e=!0);var c=Rt;if(Rt=0,zs=null,Ry(t,o,l,c),r&&Jy){a=0;break e}break;default:c=Rt,Rt=0,zs=null,Ry(t,o,l,c)}}VGe(),a=Er;break}catch(u){lhe(t,u)}while(!0);return e&&t.shellSuspendCounter++,Vc=kh=null,Lt=n,De.H=i,De.A=s,nt===null&&(Qt=null,at=0,_R()),a}function VGe(){for(;nt!==null;)dhe(nt)}function jGe(t,e){var r=Lt;Lt|=2;var n=che(),i=uhe();Qt!==t||at!==e?(bR=null,vR=Tl()+500,Ky(t,e)):Jy=$k(t,e);e:do try{if(Rt!==0&&nt!==null){e=nt;var s=zs;t:switch(Rt){case 1:Rt=0,zs=null,Ry(t,e,s,1);break;case 2:case 9:if(cde(s)){Rt=0,zs=null,_de(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:cde(s)?(Rt=0,zs=null,_de(e)):(Rt=0,zs=null,Ry(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||Rhe(a)){Rt=0,zs=null;var l=o.sibling;if(l!==null)nt=l;else{var c=o.return;c!==null?(nt=c,jR(c)):nt=null}break t}}Rt=0,zs=null,Ry(t,e,s,5);break;case 6:Rt=0,zs=null,Ry(t,e,s,6);break;case 8:dV(),Er=6;break e;default:throw Error(X(462))}}$Ge();break}catch(u){lhe(t,u)}while(!0);return Vc=kh=null,De.H=n,De.A=i,Lt=r,nt!==null?0:(Qt=null,at=0,_R(),Er)}function $Ge(){for(;nt!==null&&!cHe();)dhe(nt)}function dhe(t){var e=$pe(t.alternate,t,Gc);t.memoizedProps=t.pendingProps,e===null?jR(t):nt=e}function _de(t){var e=t,r=e.alternate;switch(e.tag){case 15:case 0:e=Ede(r,e,e.pendingProps,e.type,void 0,at);break;case 11:e=Ede(r,e,e.pendingProps,e.type.render,e.ref,at);break;case 5:QB(e);default:Upe(r,e),e=nt=Ufe(e,Gc),e=$pe(r,e,Gc)}t.memoizedProps=t.pendingProps,e===null?jR(t):nt=e}function Ry(t,e,r,n){Vc=kh=null,QB(e),Fy=null,Lk=0;var i=e.return;try{if(RGe(t,i,e,r,at)){Er=1,mR(t,Da(r,t.current)),nt=null;return}}catch(s){if(i!==null)throw nt=i,s;Er=1,mR(t,Da(r,t.current)),nt=null;return}e.flags&32768?(bt||n===1?t=!0:Jy||(at&536870912)!==0?t=!1:(Pd=t=!0,(n===2||n===9||n===3||n===6)&&(n=Fa.current,n!==null&&n.tag===13&&(n.flags|=16384))),fhe(e,t)):jR(e)}function jR(t){var e=t;do{if((e.flags&32768)!==0){fhe(e,Pd);return}t=e.return;var r=MGe(e.alternate,e,Gc);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 fhe(t,e){do{var r=_Ge(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 Ode(t,e,r,n,i,s,a,o,l){t.cancelPendingCommit=null;do $R();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|=BB,bHe(t,r,s,a,o,l),t===Qt&&(nt=Qt=null,at=0),Wy=e,Dd=t,By=r,dB=s,fB=i,she=n,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,HGe(rR,function(){return yhe(!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{OGe(t,e,r)}finally{Lt=a,xt.p=i,De.T=n}}jn=1,phe(),hhe(),mhe()}}function phe(){if(jn===1){jn=0;var t=Dd,e=Wy,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{Zpe(e,t);var s=vB,a=Ofe(t.containerInfo),o=s.focusedElem,l=s.selectionRange;if(a!==o&&o&&o.ownerDocument&&_fe(o.ownerDocument.documentElement,o)){if(l!==null&&FB(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=tde(o,m),y=tde(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}}IR=!!yB,vB=yB=null}finally{Lt=i,xt.p=n,De.T=r}}t.current=e,jn=2}}function hhe(){if(jn===2){jn=0;var t=Dd,e=Wy,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{Kpe(t,e.alternate,e)}finally{Lt=i,xt.p=n,De.T=r}}jn=3}}function mhe(){if(jn===4||jn===3){jn=0,uHe();var t=Dd,e=Wy,r=By,n=she;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?jn=5:(jn=0,Wy=Dd=null,ghe(t,t.pendingLanes));var i=t.pendingLanes;if(i===0&&(Od=null),RB(r),e=e.stateNode,Hs&&typeof Hs.onCommitFiberRoot=="function")try{Hs.onCommitFiberRoot(jk,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}}(By&3)!==0&&$R(),Al(t),i=t.pendingLanes,(r&4194090)!==0&&(i&42)!==0?t===pB?Sk++:(Sk=0,pB=t):Sk=0,Zk(0,!1)}}function ghe(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Wk(e)))}function $R(t){return phe(),hhe(),mhe(),yhe(t)}function yhe(){if(jn!==5)return!1;var t=Dd,e=dB;dB=0;var r=RB(By),n=De.T,i=xt.p;try{xt.p=32>r?32:r,De.T=null,r=fB,fB=null;var s=Dd,a=By;if(jn=0,Wy=Dd=null,By=0,(Lt&6)!==0)throw Error(X(331));var o=Lt;if(Lt|=4,nhe(s.current),ehe(s,s.current,a,r),Lt=o,Zk(0,!1),Hs&&typeof Hs.onPostCommitFiberRoot=="function")try{Hs.onPostCommitFiberRoot(jk,s)}catch{}return!0}finally{xt.p=i,De.T=n,ghe(t,e)}}function Dde(t,e,r){e=Da(r,e),e=aB(t.stateNode,e,2),t=_d(t,e,2),t!==null&&(Uk(t,2),Al(t))}function zt(t,e,r){if(t.tag===3)Dde(t,t,r);else for(;e!==null;){if(e.tag===3){Dde(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Od===null||!Od.has(n))){t=Da(r,t),r=Ope(2),n=_d(e,r,2),n!==null&&(Dpe(r,n,e,t),Uk(n,2),Al(n));break}}e=e.return}}function E7(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new FGe;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)||(lV=!0,i.add(r),t=UGe.bind(null,t,e,r),e.then(t,t))}function UGe(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()-uV?(Lt&2)===0&&Ky(t,0):cV|=r,Gy===at&&(Gy=0)),Al(t)}function vhe(t,e){e===0&&(e=pfe()),t=Zy(t,e),t!==null&&(Uk(t,e),Al(t))}function zGe(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),vhe(t,r)}function qGe(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),vhe(t,r)}function HGe(t,e){return AB(t,e)}var xR=null,vy=null,mB=!1,wR=!1,I7=!1,hh=0;function Al(t){t!==vy&&t.next===null&&(vy===null?xR=vy=t:vy=vy.next=t),wR=!0,mB||(mB=!0,WGe())}function Zk(t,e){if(!I7&&wR){I7=!0;do for(var r=!1,n=xR;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,Nde(n,s))}else s=at,s=PR(n,n===Qt?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(s&3)===0||$k(n,s)||(r=!0,Nde(n,s));n=n.next}while(r);I7=!1}}function GGe(){bhe()}function bhe(){wR=mB=!1;var t=0;hh!==0&&(JGe()&&(t=hh),hh=0);for(var e=Tl(),r=null,n=xR;n!==null;){var i=n.next,s=xhe(n,e);s===0?(n.next=null,r===null?xR=i:r.next=i,i===null&&(vy=r)):(r=n,(t!==0||(s&3)!==0)&&(wR=!0)),n=i}Zk(t,!1)}function xhe(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]=vHe(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}if(e=Qt,r=at,r=PR(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&&e7(n),t.callbackNode=null,t.callbackPriority=0;if((r&3)===0||$k(t,r)){if(e=r&-r,e===t.callbackPriority)return e;switch(n!==null&&e7(n),RB(r)){case 2:case 8:r=ufe;break;case 32:r=rR;break;case 268435456:r=dfe;break;default:r=rR}return n=whe.bind(null,t),r=AB(r,n),t.callbackPriority=e,t.callbackNode=r,e}return n!==null&&n!==null&&e7(n),t.callbackPriority=2,t.callbackNode=null,2}function whe(t,e){if(jn!==0&&jn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var r=t.callbackNode;if($R(!0)&&t.callbackNode!==r)return null;var n=at;return n=PR(t,t===Qt?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n===0?null:(ohe(t,n,e),xhe(t,Tl()),t.callbackNode!=null&&t.callbackNode===r?whe.bind(null,t):null)}function Nde(t,e){if($R())return null;ohe(t,e,!0)}function WGe(){tWe(function(){(Lt&6)!==0?AB(cfe,GGe):bhe()})}function fV(){return hh===0&&(hh=ffe()),hh}function Fde(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:$P(""+t)}function Bde(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 KGe(t,e,r,n,i){if(e==="submit"&&r&&r.stateNode===i){var s=Fde((i[is]||null).action),a=n.submitter;a&&(e=(e=a[is]||null)?Fde(e.formAction):a.getAttribute("formAction"),e!==null&&(s=e,a=null));var o=new RR("action","action",null,n,i);t.push({event:o,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(hh!==0){var l=a?Bde(i,a):new FormData(i);iB(r,{pending:!0,data:l,method:i.method,action:s},null,l)}}else typeof s=="function"&&(o.preventDefault(),l=a?Bde(i,a):new FormData(i),iB(r,{pending:!0,data:l,method:i.method,action:s},s,l))},currentTarget:i}]})}}for(DP=0;DP<G7.length;DP++)NP=G7[DP],Vde=NP.toLowerCase(),jde=NP[0].toUpperCase()+NP.slice(1),Io(Vde,"on"+jde);var NP,Vde,jde,DP;Io(Nfe,"onAnimationEnd");Io(Ffe,"onAnimationIteration");Io(Bfe,"onAnimationStart");Io("dblclick","onDoubleClick");Io("focusin","onFocus");Io("focusout","onBlur");Io(pGe,"onTransitionRun");Io(hGe,"onTransitionStart");Io(mGe,"onTransitionCancel");Io(Vfe,"onTransitionEnd");jy("onMouseEnter",["mouseout","mouseover"]);jy("onMouseLeave",["mouseout","mouseover"]);jy("onPointerEnter",["pointerout","pointerover"]);jy("onPointerLeave",["pointerout","pointerover"]);bh("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));bh("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));bh("onBeforeInput",["compositionend","keypress","textInput","paste"]);bh("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));bh("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));bh("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mk="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(" "),YGe=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mk));function khe(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){hR(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){hR(u)}i.currentTarget=null,s=l}}}}function rt(t,e){var r=e[V7];r===void 0&&(r=e[V7]=new Set);var n=t+"__bubble";r.has(n)||(She(e,t,2,!1),r.add(n))}function A7(t,e,r){var n=0;e&&(n|=4),She(r,t,n,e)}var FP="_reactListening"+Math.random().toString(36).slice(2);function pV(t){if(!t[FP]){t[FP]=!0,yfe.forEach(function(r){r!=="selectionchange"&&(YGe.has(r)||A7(r,!1,t),A7(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[FP]||(e[FP]=!0,A7("selectionchange",!1,e))}}function She(t,e,r,n){switch(Dhe(e)){case 2:var i=kWe;break;case 8:i=SWe;break;default:i=yV}r=i.bind(null,e,r,t),i=void 0,!z7||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 P7(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=wy(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}Tfe(function(){var c=s,u=_B(r),d=[];e:{var f=jfe.get(t);if(f!==void 0){var p=RR,h=t;switch(t){case"keypress":if(zP(r)===0)break e;case"keydown":case"keyup":p=HHe;break;case"focusin":h="focus",p=l7;break;case"focusout":h="blur",p=l7;break;case"beforeblur":case"afterblur":p=l7;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=Gue;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=_He;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=KHe;break;case Nfe:case Ffe:case Bfe:p=NHe;break;case Vfe:p=XHe;break;case"scroll":case"scrollend":p=LHe;break;case"wheel":p=ZHe;break;case"copy":case"cut":case"paste":p=BHe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Kue;break;case"toggle":case"beforetoggle":p=eGe}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=Ek(y,b),w!=null&&m.push(_k(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!==U7&&(h=r.relatedTarget||r.fromElement)&&(wy(h)||h[Xy]))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?wy(h):null,h!==null&&(v=Vk(h),m=h.tag,h!==v||m!==5&&m!==27&&m!==6)&&(h=null)):(p=null,h=c),p!==h)){if(m=Gue,w="onMouseLeave",b="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(m=Kue,w="onPointerLeave",b="onPointerEnter",y="pointer"),v=p==null?f:ck(p),x=h==null?f:ck(h),f=new m(w,y+"leave",p,r,u),f.target=v,f.relatedTarget=x,w=null,wy(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=my(x))y++;for(x=0,w=b;w;w=my(w))x++;for(;0<y-x;)m=my(m),y--;for(;0<x-y;)b=my(b),x--;for(;y--;){if(m===b||b!==null&&m===b.alternate)break t;m=my(m),b=my(b)}m=null}else m=null;p!==null&&$de(d,f,p,m,!1),h!==null&&v!==null&&$de(d,v,h,m,!0)}}e:{if(f=c?ck(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var C=Zue;else if(Que(f))if(Lfe)C=uGe;else{C=lGe;var O=oGe}else p=f.nodeName,!p||p.toLowerCase()!=="input"||f.type!=="checkbox"&&f.type!=="radio"?c&&MB(c.elementType)&&(C=Zue):C=cGe;if(C&&(C=C(t,c))){Rfe(d,C,r,u);break e}O&&O(t,f,c),t==="focusout"&&c&&f.type==="number"&&c.memoizedProps.value!=null&&$7(f,"number",f.value)}switch(O=c?ck(c):window,t){case"focusin":(Que(O)||O.contentEditable==="true")&&(Cy=O,q7=c,pk=null);break;case"focusout":pk=q7=Cy=null;break;case"mousedown":H7=!0;break;case"contextmenu":case"mouseup":case"dragend":H7=!1,rde(d,r,u);break;case"selectionchange":if(fGe)break;case"keydown":case"keyup":rde(d,r,u)}var S;if(NB)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 Sy?Afe(t,r)&&(T="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(Ife&&r.locale!=="ko"&&(Sy||T!=="onCompositionStart"?T==="onCompositionEnd"&&Sy&&(S=Efe()):(Ad=u,OB="value"in Ad?Ad.value:Ad.textContent,Sy=!0)),O=kR(c,T),0<O.length&&(T=new Wue(T,t,null,r,u),d.push({event:T,listeners:O}),S?T.data=S:(S=Pfe(r),S!==null&&(T.data=S)))),(S=rGe?nGe(t,r):iGe(t,r))&&(T=kR(c,"onBeforeInput"),0<T.length&&(O=new Wue("onBeforeInput","beforeinput",null,r,u),d.push({event:O,listeners:T}),O.data=S)),KGe(d,t,c,r,u)}khe(d,e)})}function _k(t,e,r){return{instance:t,listener:e,currentTarget:r}}function kR(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=Ek(t,r),i!=null&&n.unshift(_k(t,i,s)),i=Ek(t,e),i!=null&&n.push(_k(t,i,s))),t.tag===3)return n;t=t.return}return[]}function my(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function $de(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=Ek(r,s),c!=null&&a.unshift(_k(r,c,l))):i||(c=Ek(r,s),c!=null&&a.push(_k(r,c,l)))),r=r.return}a.length!==0&&t.push({event:e,listeners:a})}var XGe=/\r\n?/g,QGe=/\u0000|\uFFFD/g;function Ude(t){return(typeof t=="string"?t:""+t).replace(XGe,`
|
|
`).replace(QGe,"")}function Che(t,e){return e=Ude(e),Ude(t)===e}function UR(){}function Nt(t,e,r,n,i,s){switch(r){case"children":typeof n=="string"?e==="body"||e==="textarea"&&n===""||$y(t,n):(typeof n=="number"||typeof n=="bigint")&&e!=="body"&&$y(t,""+n);break;case"className":EP(t,"class",n);break;case"tabIndex":EP(t,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":EP(t,r,n);break;case"style":Cfe(t,n,s);break;case"data":if(e!=="object"){EP(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=$P(""+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=$P(""+n),t.setAttribute(r,n);break;case"onClick":n!=null&&(t.onclick=UR);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=$P(""+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),jP(t,"popover",n);break;case"xlinkActuate":Mc(t,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Mc(t,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Mc(t,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Mc(t,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Mc(t,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Mc(t,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Mc(t,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Mc(t,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Mc(t,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":jP(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=PHe.get(r)||r,jP(t,r,n))}}function gB(t,e,r,n,i,s){switch(r){case"style":Cfe(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"?$y(t,n):(typeof n=="number"||typeof n=="bigint")&&$y(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=UR);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vfe.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,""):jP(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)}}wfe(t,s,o,l,c,a,i,!1),nR(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?My(t,!!n,e,!1):r!=null&&My(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)}Sfe(t,n,i,s),nR(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<Mk.length;n++)rt(Mk[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(MB(e)){for(u in r)r.hasOwnProperty(u)&&(n=r[u],n!==void 0&&gB(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 ZGe(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)}}j7(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?My(t,!!r,f,!1):!!n!=!!r&&(e!=null?My(t,!!r,e,!0):My(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)}kfe(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(MB(e)){for(var v in r)f=r[v],r.hasOwnProperty(v)&&f!==void 0&&!n.hasOwnProperty(v)&&gB(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||gB(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 yB=null,vB=null;function SR(t){return t.nodeType===9?t:t.ownerDocument}function zde(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 The(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 bB(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 R7=null;function JGe(){var t=window.event;return t&&t.type==="popstate"?t===R7?!1:(R7=t,!0):(R7=null,!1)}var Ehe=typeof setTimeout=="function"?setTimeout:void 0,eWe=typeof clearTimeout=="function"?clearTimeout:void 0,qde=typeof Promise=="function"?Promise:void 0,tWe=typeof queueMicrotask=="function"?queueMicrotask:typeof qde<"u"?function(t){return qde.resolve(null).then(t).catch(rWe)}:Ehe;function rWe(t){setTimeout(function(){throw t})}function zd(t){return t==="head"}function Hde(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&&Ck(a.documentElement),r&2&&Ck(a.body),r&4)for(r=a.head,Ck(r),a=r.firstChild;a;){var o=a.nextSibling,l=a.nodeName;a[zk]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&a.rel.toLowerCase()==="stylesheet"||r.removeChild(a),a=o}}if(i===0){t.removeChild(s),Bk(e);return}i--}else r==="$"||r==="$?"||r==="$!"?i++:n=r.charCodeAt(0)-48;else n=0;r=s}while(r);Bk(e)}function xB(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":xB(r),LB(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}t.removeChild(r)}}function nWe(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[zk])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=Eo(t.nextSibling),t===null)break}return null}function iWe(t,e,r){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Eo(t.nextSibling),t===null))return null;return t}function wB(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function sWe(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 Eo(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 kB=null;function Gde(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 Ihe(t,e,r){switch(e=SR(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 Ck(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);LB(t)}var Ba=new Map,Wde=new Set;function CR(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Wc=xt.d;xt.d={f:aWe,r:oWe,D:lWe,C:cWe,L:uWe,m:dWe,X:pWe,S:fWe,M:hWe};function aWe(){var t=Wc.f(),e=VR();return t||e}function oWe(t){var e=Qy(t);e!==null&&e.tag===5&&e.type==="form"?xpe(e):Wc.r(t)}var ev=typeof document>"u"?null:document;function Ahe(t,e,r){var n=ev;if(n&&typeof e=="string"&&e){var i=Oa(e);i='link[rel="'+t+'"][href="'+i+'"]',typeof r=="string"&&(i+='[crossorigin="'+r+'"]'),Wde.has(i)||(Wde.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 lWe(t){Wc.D(t),Ahe("dns-prefetch",t,null)}function cWe(t,e){Wc.C(t,e),Ahe("preconnect",t,e)}function uWe(t,e,r){Wc.L(t,e,r);var n=ev;if(n&&t&&e){var i='link[rel="preload"][as="'+Oa(e)+'"]';e==="image"&&r&&r.imageSrcSet?(i+='[imagesrcset="'+Oa(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(i+='[imagesizes="'+Oa(r.imageSizes)+'"]')):i+='[href="'+Oa(t)+'"]';var s=i;switch(e){case"style":s=Yy(t);break;case"script":s=tv(t)}Ba.has(s)||(t=rr({rel:"preload",href:e==="image"&&r&&r.imageSrcSet?void 0:t,as:e},r),Ba.set(s,t),n.querySelector(i)!==null||e==="style"&&n.querySelector(Jk(s))||e==="script"&&n.querySelector(eS(s))||(e=n.createElement("link"),$n(e,"link",t),bn(e),n.head.appendChild(e)))}}function dWe(t,e){Wc.m(t,e);var r=ev;if(r&&t){var n=e&&typeof e.as=="string"?e.as:"script",i='link[rel="modulepreload"][as="'+Oa(n)+'"][href="'+Oa(t)+'"]',s=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=tv(t)}if(!Ba.has(s)&&(t=rr({rel:"modulepreload",href:t},e),Ba.set(s,t),r.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(eS(s)))return}n=r.createElement("link"),$n(n,"link",t),bn(n),r.head.appendChild(n)}}}function fWe(t,e,r){Wc.S(t,e,r);var n=ev;if(n&&t){var i=Ly(n).hoistableStyles,s=Yy(t);e=e||"default";var a=i.get(s);if(!a){var o={loading:0,preload:null};if(a=n.querySelector(Jk(s)))o.loading=5;else{t=rr({rel:"stylesheet",href:t,"data-precedence":e},r),(r=Ba.get(s))&&hV(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,XP(a,e,n)}a={type:"stylesheet",instance:a,count:1,state:o},i.set(s,a)}}}function pWe(t,e){Wc.X(t,e);var r=ev;if(r&&t){var n=Ly(r).hoistableScripts,i=tv(t),s=n.get(i);s||(s=r.querySelector(eS(i)),s||(t=rr({src:t,async:!0},e),(e=Ba.get(i))&&mV(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 hWe(t,e){Wc.M(t,e);var r=ev;if(r&&t){var n=Ly(r).hoistableScripts,i=tv(t),s=n.get(i);s||(s=r.querySelector(eS(i)),s||(t=rr({src:t,async:!0,type:"module"},e),(e=Ba.get(i))&&mV(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 Kde(t,e,r,n){var i=(i=Ld.current)?CR(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=Yy(r.href),r=Ly(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=Yy(r.href);var s=Ly(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(Jk(t)))&&!s._p&&(a.instance=s,a.state.loading=5),Ba.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},Ba.set(t,r),s||mWe(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=tv(r),r=Ly(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 Yy(t){return'href="'+Oa(t)+'"'}function Jk(t){return'link[rel="stylesheet"]['+t+"]"}function Phe(t){return rr({},t,{"data-precedence":t.precedence,precedence:null})}function mWe(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 tv(t){return'[src="'+Oa(t)+'"]'}function eS(t){return"script[async]"+t}function Yde(t,e,r){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+Oa(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),XP(n,r.precedence,t),e.instance=n;case"stylesheet":i=Yy(r.href);var s=t.querySelector(Jk(i));if(s)return e.state.loading|=4,e.instance=s,bn(s),s;n=Phe(r),(i=Ba.get(i))&&hV(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,XP(s,r.precedence,t),e.instance=s;case"script":return s=tv(r.src),(i=t.querySelector(eS(s)))?(e.instance=i,bn(i),i):(n=r,(i=Ba.get(s))&&(n=rr({},r),mV(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,XP(n,r.precedence,t));return e.instance}function XP(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 hV(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function mV(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var QP=null;function Xde(t,e,r){if(QP===null){var n=new Map,i=QP=new Map;i.set(r,n)}else i=QP,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[zk]||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 Qde(t,e,r){t=t.ownerDocument||t,t.head.insertBefore(r,e==="title"?t.querySelector("head > title"):null)}function gWe(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 Rhe(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var Ok=null;function yWe(){}function vWe(t,e,r){if(Ok===null)throw Error(X(475));var n=Ok;if(e.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var i=Yy(r.href),s=t.querySelector(Jk(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(n.count++,n=TR.bind(n),t.then(n,n)),e.state.loading|=4,e.instance=s,bn(s);return}s=t.ownerDocument||t,r=Phe(r),(i=Ba.get(i))&&hV(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=TR.bind(n),t.addEventListener("load",e),t.addEventListener("error",e))}}function bWe(){if(Ok===null)throw Error(X(475));var t=Ok;return t.stylesheets&&t.count===0&&SB(t,t.stylesheets),0<t.count?function(e){var r=setTimeout(function(){if(t.stylesheets&&SB(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 TR(){if(this.count--,this.count===0){if(this.stylesheets)SB(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ER=null;function SB(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ER=new Map,e.forEach(xWe,t),ER=null,TR.call(t))}function xWe(t,e){if(!(e.state.loading&4)){var r=ER.get(t);if(r)var n=r.get(null);else{r=new Map,ER.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=TR.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 Dk={$$typeof:Nc,Provider:null,Consumer:null,_currentValue:lh,_currentValue2:lh,_threadCount:0};function wWe(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=t7(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=t7(0),this.hiddenUpdates=t7(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 Lhe(t,e,r,n,i,s,a,o,l,c,u,d){return t=new wWe(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=zB(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:n,isDehydrated:r,cache:e},HB(s),t}function Mhe(t){return t?(t=Iy,t):Iy}function _he(t,e,r,n,i,s){i=Mhe(i),n.context===null?n.context=i:n.pendingContext=i,n=Md(e),n.payload={element:r},s=s===void 0?null:s,s!==null&&(n.callback=s),r=_d(t,n,e),r!==null&&(Ks(r,t,e),gk(r,t,e))}function Zde(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function gV(t,e){Zde(t,e),(t=t.alternate)&&Zde(t,e)}function Ohe(t){if(t.tag===13){var e=Zy(t,67108864);e!==null&&Ks(e,t,67108864),gV(t,67108864)}}var IR=!0;function kWe(t,e,r,n){var i=De.T;De.T=null;var s=xt.p;try{xt.p=2,yV(t,e,r,n)}finally{xt.p=s,De.T=i}}function SWe(t,e,r,n){var i=De.T;De.T=null;var s=xt.p;try{xt.p=8,yV(t,e,r,n)}finally{xt.p=s,De.T=i}}function yV(t,e,r,n){if(IR){var i=CB(n);if(i===null)P7(t,e,n,AR,r),Jde(t,n);else if(TWe(i,t,e,r,n))n.stopPropagation();else if(Jde(t,n),e&4&&-1<CWe.indexOf(t)){for(;i!==null;){var s=Qy(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var a=sh(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&&(vR=Tl()+500,Zk(0,!1))}}break;case 13:o=Zy(s,2),o!==null&&Ks(o,s,2),VR(),gV(s,2)}if(s=CB(n),s===null&&P7(t,e,n,AR,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else P7(t,e,n,null,r)}}function CB(t){return t=_B(t),vV(t)}var AR=null;function vV(t){if(AR=null,t=wy(t),t!==null){var e=Vk(t);if(e===null)t=null;else{var r=e.tag;if(r===13){if(t=sfe(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 AR=t,null}function Dhe(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(dHe()){case cfe:return 2;case ufe:return 8;case rR:case fHe:return 32;case dfe:return 268435456;default:return 32}default:return 32}}var TB=!1,Nd=null,Fd=null,Bd=null,Nk=new Map,Fk=new Map,Ed=[],CWe="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 Jde(t,e){switch(t){case"focusin":case"focusout":Nd=null;break;case"dragenter":case"dragleave":Fd=null;break;case"mouseover":case"mouseout":Bd=null;break;case"pointerover":case"pointerout":Nk.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fk.delete(e.pointerId)}}function sk(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=Qy(e),e!==null&&Ohe(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function TWe(t,e,r,n,i){switch(e){case"focusin":return Nd=sk(Nd,t,e,r,n,i),!0;case"dragenter":return Fd=sk(Fd,t,e,r,n,i),!0;case"mouseover":return Bd=sk(Bd,t,e,r,n,i),!0;case"pointerover":var s=i.pointerId;return Nk.set(s,sk(Nk.get(s)||null,t,e,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Fk.set(s,sk(Fk.get(s)||null,t,e,r,n,i)),!0}return!1}function Nhe(t){var e=wy(t.target);if(e!==null){var r=Vk(e);if(r!==null){if(e=r.tag,e===13){if(e=sfe(r),e!==null){t.blockedOn=e,xHe(t.priority,function(){if(r.tag===13){var n=Ws();n=PB(n);var i=Zy(r,n);i!==null&&Ks(i,r,n),gV(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 ZP(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=CB(t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);U7=n,r.target.dispatchEvent(n),U7=null}else return e=Qy(r),e!==null&&Ohe(e),t.blockedOn=r,!1;e.shift()}return!0}function efe(t,e,r){ZP(t)&&r.delete(e)}function EWe(){TB=!1,Nd!==null&&ZP(Nd)&&(Nd=null),Fd!==null&&ZP(Fd)&&(Fd=null),Bd!==null&&ZP(Bd)&&(Bd=null),Nk.forEach(efe),Fk.forEach(efe)}function BP(t,e){t.blockedOn===e&&(t.blockedOn=null,TB||(TB=!0,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,EWe)))}var VP=null;function tfe(t){VP!==t&&(VP=t,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,function(){VP===t&&(VP=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(vV(n||r)===null)continue;break}var s=Qy(r);s!==null&&(t.splice(e,3),e-=3,iB(s,{pending:!0,data:i,method:r.method,action:n},n,i))}}))}function Bk(t){function e(l){return BP(l,t)}Nd!==null&&BP(Nd,t),Fd!==null&&BP(Fd,t),Bd!==null&&BP(Bd,t),Nk.forEach(e),Fk.forEach(e);for(var r=0;r<Ed.length;r++){var n=Ed[r];n.blockedOn===t&&(n.blockedOn=null)}for(;0<Ed.length&&(r=Ed[0],r.blockedOn===null);)Nhe(r),r.blockedOn===null&&Ed.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||tfe(r);else if(a){var o=null;if(s&&s.hasAttribute("formAction")){if(i=s,a=s[is]||null)o=a.formAction;else if(vV(i)!==null)continue}else o=a.action;typeof o=="function"?r[n+1]=o:(r.splice(n,3),n-=3),tfe(r)}}}function bV(t){this._internalRoot=t}zR.prototype.render=bV.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(X(409));var r=e.current,n=Ws();_he(r,n,t,e,null,null)};zR.prototype.unmount=bV.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;_he(t.current,2,null,t,null,null),VR(),e[Xy]=null}};function zR(t){this._internalRoot=t}zR.prototype.unstable_scheduleHydration=function(t){if(t){var e=gfe();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Ed.length&&e!==0&&e<Ed[r].priority;r++);Ed.splice(r,0,t),r===0&&Nhe(t)}};var rfe=nfe.version;if(rfe!=="19.1.0")throw Error(X(527,rfe,"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=iHe(e),t=t!==null?afe(t):null,t=t===null?null:t.stateNode,t};var IWe={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:De,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ak=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ak.isDisabled&&ak.supportsFiber))try{jk=ak.inject(IWe),Hs=ak}catch{}var ak;qR.createRoot=function(t,e){if(!ife(t))throw Error(X(299));var r=!1,n="",i=Lpe,s=Mpe,a=_pe,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=Lhe(t,1,!1,null,null,r,n,i,s,a,o,null),t[Xy]=e.current,pV(t),new bV(e)};qR.hydrateRoot=function(t,e,r){if(!ife(t))throw Error(X(299));var n=!1,i="",s=Lpe,a=Mpe,o=_pe,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=Lhe(t,1,!0,e,r??null,n,i,s,a,o,l,c),e.context=Mhe(null),r=e.current,n=Ws(),n=PB(n),i=Md(n),i.callback=null,_d(r,i,n),r=n,e.current.lanes=r,Uk(e,r),Al(e),t[Xy]=e.current,pV(t),new zR(e)};qR.version="19.1.0"});var HR=L((REt,Vhe)=>{"use strict";function Bhe(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bhe)}catch(t){console.error(t)}}Bhe(),Vhe.exports=Fhe()});var yj=L(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.anumber=gj;Rh.abytes=hye;Rh.ahash=UKe;Rh.aexists=zKe;Rh.aoutput=qKe;function gj(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 hye(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");gj(t.outputLen),gj(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){hye(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Nye=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=bj;$e.split=mye;$e.add=Pye;var GL=BigInt(2**32-1),vj=BigInt(32);function bj(t,e=!1){return e?{h:Number(t&GL),l:Number(t>>vj&GL)}:{h:Number(t>>vj&GL)|0,l:Number(t&GL)|0}}function mye(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}=bj(t[i],e);[r[i],n[i]]=[s,a]}return[r,n]}var gye=(t,e)=>BigInt(t>>>0)<<vj|BigInt(e>>>0);$e.toBig=gye;var yye=(t,e,r)=>t>>>r;$e.shrSH=yye;var vye=(t,e,r)=>t<<32-r|e>>>r;$e.shrSL=vye;var bye=(t,e,r)=>t>>>r|e<<32-r;$e.rotrSH=bye;var xye=(t,e,r)=>t<<32-r|e>>>r;$e.rotrSL=xye;var wye=(t,e,r)=>t<<64-r|e>>>r-32;$e.rotrBH=wye;var kye=(t,e,r)=>t>>>r-32|e<<64-r;$e.rotrBL=kye;var Sye=(t,e)=>e;$e.rotr32H=Sye;var Cye=(t,e)=>t;$e.rotr32L=Cye;var Tye=(t,e,r)=>t<<r|e>>>32-r;$e.rotlSH=Tye;var Eye=(t,e,r)=>e<<r|t>>>32-r;$e.rotlSL=Eye;var Iye=(t,e,r)=>e<<r-32|t>>>64-r;$e.rotlBH=Iye;var Aye=(t,e,r)=>t<<r-32|e>>>64-r;$e.rotlBL=Aye;function Pye(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var Rye=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);$e.add3L=Rye;var Lye=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;$e.add3H=Lye;var Mye=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);$e.add4L=Mye;var _ye=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;$e.add4H=_ye;var Oye=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);$e.add5L=Oye;var Dye=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;$e.add5H=Dye;var HKe={fromBig:bj,split:mye,toBig:gye,shrSH:yye,shrSL:vye,rotrSH:bye,rotrSL:xye,rotrBH:wye,rotrBL:kye,rotr32H:Sye,rotr32L:Cye,rotlSH:Tye,rotlSL:Eye,rotlBH:Iye,rotlBL:Aye,add:Pye,add3L:Rye,add3H:Lye,add4L:Mye,add4H:_ye,add5H:Dye,add5L:Oye};$e.default=HKe});var Fye=L(WL=>{"use strict";Object.defineProperty(WL,"__esModule",{value:!0});WL.crypto=void 0;WL.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var jye=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=kj;wt.byteSwap32=ZKe;wt.bytesToHex=eYe;wt.hexToBytes=tYe;wt.asyncLoop=nYe;wt.utf8ToBytes=Vye;wt.toBytes=KL;wt.concatBytes=iYe;wt.checkOpts=sYe;wt.wrapConstructor=aYe;wt.wrapConstructorWithOpts=oYe;wt.wrapXOFConstructorWithOpts=lYe;wt.randomBytes=cYe;var hv=Fye(),wj=yj();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 kj(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}wt.byteSwapIfBE=wt.isLE?t=>t:t=>kj(t);function ZKe(t){for(let e=0;e<t.length;e++)t[e]=kj(t[e])}var JKe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function eYe(t){(0,wj.abytes)(t);let e="";for(let r=0;r<t.length;r++)e+=JKe[t[r]];return e}var Qc={_0:48,_9:57,A:65,F:70,a:97,f:102};function Bye(t){if(t>=Qc._0&&t<=Qc._9)return t-Qc._0;if(t>=Qc.A&&t<=Qc.F)return t-(Qc.A-10);if(t>=Qc.a&&t<=Qc.f)return t-(Qc.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=Bye(t.charCodeAt(s)),o=Bye(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 Vye(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function KL(t){return typeof t=="string"&&(t=Vye(t)),(0,wj.abytes)(t),t}function iYe(...t){let e=0;for(let n=0;n<t.length;n++){let i=t[n];(0,wj.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 xj=class{clone(){return this._cloneInto()}};wt.Hash=xj;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(KL(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(KL(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(KL(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function cYe(t=32){if(hv.crypto&&typeof hv.crypto.getRandomValues=="function")return hv.crypto.getRandomValues(new Uint8Array(t));if(hv.crypto&&typeof hv.crypto.randomBytes=="function")return hv.crypto.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}});var Kye=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=Gye;var mv=yj(),vS=Nye(),Zc=jye(),zye=[],qye=[],Hye=[],uYe=BigInt(0),yS=BigInt(1),dYe=BigInt(2),fYe=BigInt(7),pYe=BigInt(256),hYe=BigInt(113);for(let t=0,e=yS,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],zye.push(2*(5*n+r)),qye.push((t+1)*(t+2)/2%64);let i=uYe;for(let s=0;s<7;s++)e=(e<<yS^(e>>fYe)*hYe)%pYe,e&dYe&&(i^=yS<<(yS<<BigInt(s))-yS);Hye.push(i)}var[mYe,gYe]=(0,vS.split)(Hye,!0),$ye=(t,e,r)=>r>32?(0,vS.rotlBH)(t,e,r):(0,vS.rotlSH)(t,e,r),Uye=(t,e,r)=>r>32?(0,vS.rotlBL)(t,e,r):(0,vS.rotlSL)(t,e,r);function Gye(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=$ye(c,u,1)^r[o],f=Uye(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=qye[a],l=$ye(i,s,o),c=Uye(i,s,o),u=zye[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 bS=class t extends Zc.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,mv.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,Zc.u32)(this.state)}keccak(){Zc.isLE||(0,Zc.byteSwap32)(this.state32),Gye(this.state32,this.rounds),Zc.isLE||(0,Zc.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,mv.aexists)(this);let{blockLen:r,state:n}=this;e=(0,Zc.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,mv.aexists)(this,!1),(0,mv.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,mv.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,mv.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=bS;var ef=(t,e,r)=>(0,Zc.wrapConstructor)(()=>new bS(e,t,r));nr.sha3_224=ef(6,144,224/8);nr.sha3_256=ef(6,136,256/8);nr.sha3_384=ef(6,104,384/8);nr.sha3_512=ef(6,72,512/8);nr.keccak_224=ef(1,144,224/8);nr.keccak_256=ef(1,136,256/8);nr.keccak_384=ef(1,104,384/8);nr.keccak_512=ef(1,72,512/8);var Wye=(t,e,r)=>(0,Zc.wrapXOFConstructorWithOpts)((n={})=>new bS(e,t,n.dkLen===void 0?r:n.dkLen,!0));nr.shake128=Wye(31,168,128/8);nr.shake256=Wye(31,136,256/8)});var rve=L((IMt,tf)=>{var{sha3_512:yYe}=Kye(),Xye=24,xS=32,Sj=(t=4,e=Math.random)=>{let r="";for(;r.length<t;)r=r+Math.floor(e()*36).toString(36);return r};function Qye(t){let e=8n,r=0n;for(let n of t.values()){let i=BigInt(n);r=(r<<e)+i}return r}var Zye=(t="")=>Qye(yYe(t)).toString(36).slice(1),Yye=Array.from({length:26},(t,e)=>String.fromCharCode(e+97)),vYe=t=>Yye[Math.floor(t()*Yye.length)],Jye=({globalObj:t=typeof global<"u"?global:typeof window<"u"?window:{},random:e=Math.random}={})=>{let r=Object.keys(t).toString(),n=r.length?r+Sj(xS,e):Sj(xS,e);return Zye(n).substring(0,xS)},eve=t=>()=>t++,bYe=476782367,tve=({random:t=Math.random,counter:e=eve(Math.floor(t()*bYe)),length:r=Xye,fingerprint:n=Jye({random:t})}={})=>function(){let s=vYe(t),a=Date.now().toString(36),o=e().toString(36),l=Sj(r,t),c=`${a+l+o+n}`;return`${s+Zye(c).substring(1,r)}`},xYe=tve(),wYe=(t,{minLength:e=2,maxLength:r=xS}={})=>{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};tf.exports.getConstants=()=>({defaultLength:Xye,bigLength:xS});tf.exports.init=tve;tf.exports.createId=xYe;tf.exports.bufToBigInt=Qye;tf.exports.createCounter=eve;tf.exports.createFingerprint=Jye;tf.exports.isCuid=wYe});var Cj=L((AMt,wS)=>{var{createId:kYe,init:SYe,getConstants:CYe,isCuid:TYe}=rve();wS.exports.createId=kYe;wS.exports.init=SYe;wS.exports.getConstants=CYe;wS.exports.isCuid=TYe});var $S=L((bNt,Ibe)=>{var hXe="2.0.0",mXe=Number.MAX_SAFE_INTEGER||9007199254740991,gXe=16,yXe=250,vXe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ibe.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 US=L((xNt,Abe)=>{var bXe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Abe.exports=bXe});var Ov=L((_l,Pbe)=>{var{MAX_SAFE_COMPONENT_LENGTH:h$,MAX_SAFE_BUILD_LENGTH:xXe,MAX_LENGTH:wXe}=$S(),kXe=US();_l=Pbe.exports={};var SXe=_l.re=[],CXe=_l.safeRe=[],ce=_l.src=[],TXe=_l.safeSrc=[],ue=_l.t={},EXe=0,m$="[a-zA-Z0-9-]",IXe=[["\\s",1],["\\d",wXe],[m$,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-]${m$}*`);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",`${m$}+`);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,${h$}})(?:\\.(\\d{1,${h$}}))?(?:\\.(\\d{1,${h$}}))?`);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 K3=L((wNt,Rbe)=>{var PXe=Object.freeze({loose:!0}),RXe=Object.freeze({}),LXe=t=>t?typeof t!="object"?PXe:t:RXe;Rbe.exports=LXe});var g$=L((kNt,_be)=>{var Lbe=/^[0-9]+$/,Mbe=(t,e)=>{let r=Lbe.test(t),n=Lbe.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)=>Mbe(e,t);_be.exports={compareIdentifiers:Mbe,rcompareIdentifiers:MXe}});var oi=L((SNt,Fbe)=>{var Y3=US(),{MAX_LENGTH:Obe,MAX_SAFE_INTEGER:X3}=$S(),{safeRe:Dbe,safeSrc:Nbe,t:Q3}=Ov(),_Xe=K3(),{compareIdentifiers:Dv}=g$(),y$=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>Obe)throw new TypeError(`version is longer than ${Obe} characters`);Y3("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Dbe[Q3.LOOSE]:Dbe[Q3.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>X3||this.major<0)throw new TypeError("Invalid major version");if(this.minor>X3||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>X3||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<X3)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(Y3("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)),Dv(this.major,e.major)||Dv(this.minor,e.minor)||Dv(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(Y3("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 Dv(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(Y3("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 Dv(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?Nbe[Q3.PRERELEASELOOSE]:Nbe[Q3.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]),Dv(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}};Fbe.exports=y$});var $h=L((CNt,Vbe)=>{var Bbe=oi(),OXe=(t,e,r=!1)=>{if(t instanceof Bbe)return t;try{return new Bbe(t,e)}catch(n){if(!r)return null;throw n}};Vbe.exports=OXe});var $be=L((TNt,jbe)=>{var DXe=$h(),NXe=(t,e)=>{let r=DXe(t,e);return r?r.version:null};jbe.exports=NXe});var zbe=L((ENt,Ube)=>{var FXe=$h(),BXe=(t,e)=>{let r=FXe(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};Ube.exports=BXe});var Gbe=L((INt,Hbe)=>{var qbe=oi(),VXe=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new qbe(t instanceof qbe?t.version:t,r).inc(e,n,i).version}catch{return null}};Hbe.exports=VXe});var Ybe=L((ANt,Kbe)=>{var Wbe=$h(),jXe=(t,e)=>{let r=Wbe(t,null,!0),n=Wbe(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"};Kbe.exports=jXe});var Qbe=L((PNt,Xbe)=>{var $Xe=oi(),UXe=(t,e)=>new $Xe(t,e).major;Xbe.exports=UXe});var Jbe=L((RNt,Zbe)=>{var zXe=oi(),qXe=(t,e)=>new zXe(t,e).minor;Zbe.exports=qXe});var t0e=L((LNt,e0e)=>{var HXe=oi(),GXe=(t,e)=>new HXe(t,e).patch;e0e.exports=GXe});var n0e=L((MNt,r0e)=>{var WXe=$h(),KXe=(t,e)=>{let r=WXe(t,e);return r&&r.prerelease.length?r.prerelease:null};r0e.exports=KXe});var Ua=L((_Nt,s0e)=>{var i0e=oi(),YXe=(t,e,r)=>new i0e(t,r).compare(new i0e(e,r));s0e.exports=YXe});var o0e=L((ONt,a0e)=>{var XXe=Ua(),QXe=(t,e,r)=>XXe(e,t,r);a0e.exports=QXe});var c0e=L((DNt,l0e)=>{var ZXe=Ua(),JXe=(t,e)=>ZXe(t,e,!0);l0e.exports=JXe});var Z3=L((NNt,d0e)=>{var u0e=oi(),eQe=(t,e,r)=>{let n=new u0e(t,r),i=new u0e(e,r);return n.compare(i)||n.compareBuild(i)};d0e.exports=eQe});var p0e=L((FNt,f0e)=>{var tQe=Z3(),rQe=(t,e)=>t.sort((r,n)=>tQe(r,n,e));f0e.exports=rQe});var m0e=L((BNt,h0e)=>{var nQe=Z3(),iQe=(t,e)=>t.sort((r,n)=>nQe(n,r,e));h0e.exports=iQe});var zS=L((VNt,g0e)=>{var sQe=Ua(),aQe=(t,e,r)=>sQe(t,e,r)>0;g0e.exports=aQe});var J3=L((jNt,y0e)=>{var oQe=Ua(),lQe=(t,e,r)=>oQe(t,e,r)<0;y0e.exports=lQe});var v$=L(($Nt,v0e)=>{var cQe=Ua(),uQe=(t,e,r)=>cQe(t,e,r)===0;v0e.exports=uQe});var b$=L((UNt,b0e)=>{var dQe=Ua(),fQe=(t,e,r)=>dQe(t,e,r)!==0;b0e.exports=fQe});var eM=L((zNt,x0e)=>{var pQe=Ua(),hQe=(t,e,r)=>pQe(t,e,r)>=0;x0e.exports=hQe});var tM=L((qNt,w0e)=>{var mQe=Ua(),gQe=(t,e,r)=>mQe(t,e,r)<=0;w0e.exports=gQe});var x$=L((HNt,k0e)=>{var yQe=v$(),vQe=b$(),bQe=zS(),xQe=eM(),wQe=J3(),kQe=tM(),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}`)}};k0e.exports=SQe});var C0e=L((GNt,S0e)=>{var CQe=oi(),TQe=$h(),{safeRe:rM,t:nM}=Ov(),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?rM[nM.COERCEFULL]:rM[nM.COERCE]);else{let l=e.includePrerelease?rM[nM.COERCERTLFULL]:rM[nM.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)};S0e.exports=EQe});var E0e=L((WNt,T0e)=>{var w$=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}};T0e.exports=w$});var za=L((KNt,R0e)=>{var IQe=/\s+/g,k$=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 S$)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=>!A0e(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=I0e.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 S$(d,this.options));for(let d of c){if(A0e(d))return[d];l.set(d.value,d)}l.size>1&&l.has("")&&l.delete("");let u=[...l.values()];return I0e.set(n,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>P0e(n,r)&&e.set.some(i=>P0e(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}};R0e.exports=k$;var AQe=E0e(),I0e=new AQe,PQe=K3(),S$=qS(),sr=US(),RQe=oi(),{safeRe:ds,t:Mi,comparatorTrimReplace:LQe,tildeTrimReplace:MQe,caretTrimReplace:_Qe}=Ov(),{FLAG_INCLUDE_PRERELEASE:OQe,FLAG_LOOSE:DQe}=$S(),A0e=t=>t.value==="<0.0.0-0",NQe=t=>t.value==="",P0e=(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!==S$.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 qS=L((YNt,N0e)=>{var HS=Symbol("SemVer ANY"),E$=class t{static get ANY(){return HS}constructor(e,r){if(r=L0e(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),T$("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===HS?this.value="":this.value=this.operator+this.semver.version,T$("comp",this)}parse(e){let r=this.options.loose?M0e[_0e.COMPARATORLOOSE]:M0e[_0e.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 O0e(n[2],this.options.loose):this.semver=HS}toString(){return this.value}test(e){if(T$("Comparator.test",e,this.options.loose),this.semver===HS||e===HS)return!0;if(typeof e=="string")try{e=new O0e(e,this.options)}catch{return!1}return C$(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 D0e(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new D0e(this.value,r).test(e.semver):(r=L0e(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("=")||C$(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||C$(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};N0e.exports=E$;var L0e=K3(),{safeRe:M0e,t:_0e}=Ov(),C$=x$(),T$=US(),O0e=oi(),D0e=za()});var GS=L((XNt,F0e)=>{var KQe=za(),YQe=(t,e,r)=>{try{e=new KQe(e,r)}catch{return!1}return e.test(t)};F0e.exports=YQe});var V0e=L((QNt,B0e)=>{var XQe=za(),QQe=(t,e)=>new XQe(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));B0e.exports=QQe});var $0e=L((ZNt,j0e)=>{var ZQe=oi(),JQe=za(),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};j0e.exports=eZe});var z0e=L((JNt,U0e)=>{var tZe=oi(),rZe=za(),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};U0e.exports=nZe});var G0e=L((e4t,H0e)=>{var I$=oi(),iZe=za(),q0e=zS(),sZe=(t,e)=>{t=new iZe(t,e);let r=new I$("0.0.0");if(t.test(r)||(r=new I$("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 I$(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||q0e(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||q0e(r,s))&&(r=s)}return r&&t.test(r)?r:null};H0e.exports=sZe});var K0e=L((t4t,W0e)=>{var aZe=za(),oZe=(t,e)=>{try{return new aZe(t,e).range||"*"}catch{return null}};W0e.exports=oZe});var iM=L((r4t,Z0e)=>{var lZe=oi(),Q0e=qS(),{ANY:cZe}=Q0e,uZe=za(),dZe=GS(),Y0e=zS(),X0e=J3(),fZe=tM(),pZe=eM(),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=Y0e,s=fZe,a=X0e,o=">",l=">=";break;case"<":i=X0e,s=pZe,a=Y0e,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 Q0e(">=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};Z0e.exports=hZe});var exe=L((n4t,J0e)=>{var mZe=iM(),gZe=(t,e,r)=>mZe(t,e,">",r);J0e.exports=gZe});var rxe=L((i4t,txe)=>{var yZe=iM(),vZe=(t,e,r)=>yZe(t,e,"<",r);txe.exports=vZe});var sxe=L((s4t,ixe)=>{var nxe=za(),bZe=(t,e,r)=>(t=new nxe(t,r),e=new nxe(e,r),t.intersects(e,r));ixe.exports=bZe});var oxe=L((a4t,axe)=>{var xZe=GS(),wZe=Ua();axe.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 pxe=L((o4t,fxe)=>{var lxe=za(),P$=qS(),{ANY:A$}=P$,WS=GS(),R$=Ua(),kZe=(t,e,r={})=>{if(t===e)return!0;t=new lxe(t,r),e=new lxe(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 P$(">=0.0.0-0")],cxe=[new P$(">=0.0.0")],CZe=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===A$){if(e.length===1&&e[0].semver===A$)return!0;r.includePrerelease?t=SZe:t=cxe}if(e.length===1&&e[0].semver===A$){if(r.includePrerelease)return!0;e=cxe}let n=new Set,i,s;for(let p of t)p.operator===">"||p.operator===">="?i=uxe(i,p,r):p.operator==="<"||p.operator==="<="?s=dxe(s,p,r):n.add(p.semver);if(n.size>1)return null;let a;if(i&&s){if(a=R$(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&&!WS(p,String(i),r)||s&&!WS(p,String(s),r))return null;for(let h of e)if(!WS(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=uxe(i,p,r),o===p&&o!==i)return!1}else if(i.operator===">="&&!WS(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=dxe(s,p,r),l===p&&l!==s)return!1}else if(s.operator==="<="&&!WS(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)},uxe=(t,e,r)=>{if(!t)return e;let n=R$(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},dxe=(t,e,r)=>{if(!t)return e;let n=R$(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};fxe.exports=kZe});var yxe=L((l4t,gxe)=>{var L$=Ov(),hxe=$S(),TZe=oi(),mxe=g$(),EZe=$h(),IZe=$be(),AZe=zbe(),PZe=Gbe(),RZe=Ybe(),LZe=Qbe(),MZe=Jbe(),_Ze=t0e(),OZe=n0e(),DZe=Ua(),NZe=o0e(),FZe=c0e(),BZe=Z3(),VZe=p0e(),jZe=m0e(),$Ze=zS(),UZe=J3(),zZe=v$(),qZe=b$(),HZe=eM(),GZe=tM(),WZe=x$(),KZe=C0e(),YZe=qS(),XZe=za(),QZe=GS(),ZZe=V0e(),JZe=$0e(),eJe=z0e(),tJe=G0e(),rJe=K0e(),nJe=iM(),iJe=exe(),sJe=rxe(),aJe=sxe(),oJe=oxe(),lJe=pxe();gxe.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:L$.re,src:L$.src,tokens:L$.t,SEMVER_SPEC_VERSION:hxe.SEMVER_SPEC_VERSION,RELEASE_TYPES:hxe.RELEASE_TYPES,compareIdentifiers:mxe.compareIdentifiers,rcompareIdentifiers:mxe.rcompareIdentifiers}});var Let={};ln(Let,{default:()=>h_});module.exports=LU(Let);var _rt=Z(wG(),1);var Pnt=Z(_K(),1);var Bnt=Z(eY(),1);var Mb=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"}},yRe=/[$_\p{ID_Start}]/u,vRe=/[$_\u200C\u200D\p{ID_Continue}]/u,u6=".*";function bRe(t,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(t)}function nY(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&&yRe.test(l)||o!==n+1&&vRe.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(!bRe(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 iY(t,e={}){let r=nY(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 Mb(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 Mb(3,"","",h(x),"",T));return}let E;C?C==="*"?E=u6:E=C:E=n;let P=2;E===n?(P=1,E=""):E===u6&&(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 Mb(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 tY(t){return t&&t.ignoreCase?"ui":"u"}function xRe(t,e,r){return sY(iY(t,r),e,r)}function sm(t){switch(t){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function sY(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)})${sm(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=u6),!o.prefix.length&&!o.suffix.length){o.modifier===3||o.modifier===1?n+=`(${c})${sm(o.modifier)}`:n+=`((?:${c})${sm(o.modifier)})`;continue}if(o.modifier===3||o.modifier===1){n+=`(?:${ra(o.prefix)}(${c})${ra(o.suffix)})`,n+=sm(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,tY(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,tY(r))}var yu={delimiter:"",prefixes:"",sensitive:!0,strict:!0},wRe={delimiter:".",prefixes:"",sensitive:!0,strict:!0},kRe={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function SRe(t,e){return t.length?t[0]==="/"?!0:!e||t.length<2?!1:(t[0]=="\\"||t[0]=="{")&&t[1]=="/":!1}function aY(t,e){return t.startsWith(e)?t.substring(e.length,t.length):t}function CRe(t,e){return t.endsWith(e)?t.substr(0,t.length-e.length):t}function oY(t){return!t||t.length<2?!1:t[0]==="["||(t[0]==="\\"||t[0]==="{")&&t[1]==="["}var lY=["ftp","file","http","https","ws","wss"];function cY(t){if(!t)return!0;for(let e of lY)if(t.test(e))return!0;return!1}function TRe(t,e){if(t=aY(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 ERe(t,e){if(t=aY(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 IRe(t,e){return e||t===""?t:oY(t)?fY(t):dY(t)}function ARe(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.password=t,r.password}function PRe(t,e){if(e||t==="")return t;let r=new URL("https://example.com");return r.username=t,r.username}function RRe(t,e,r){if(r||t==="")return t;if(e&&!lY.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 LRe(t,e,r){return uY(e)===t&&(t=""),r||t===""?t:pY(t)}function MRe(t,e){return t=CRe(t,":"),e||t===""?t:d6(t)}function uY(t){switch(t){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function d6(t){if(t==="")return t;if(/^[-+.A-Za-z0-9]*$/.test(t))return t.toLowerCase();throw new TypeError(`Invalid protocol '${t}'.`)}function _Re(t){if(t==="")return t;let e=new URL("https://example.com");return e.username=t,e.username}function ORe(t){if(t==="")return t;let e=new URL("https://example.com");return e.password=t,e.password}function dY(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 fY(t){if(t==="")return t;if(/[^0-9a-fA-F[\]:]/g.test(t))throw new TypeError(`Invalid IPv6 hostname '${t}'`);return t.toLowerCase()}function pY(t){if(t===""||/^[0-9]*$/.test(t)&&parseInt(t)<=65535)return t;throw new TypeError(`Invalid port '${t}'.`)}function DRe(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 NRe(t){return t===""?t:new URL(`data:${t}`).pathname}function FRe(t){if(t==="")return t;let e=new URL("https://example.com");return e.search=t,e.search.substring(1,e.search.length)}function BRe(t){if(t==="")return t;let e=new URL("https://example.com");return e.hash=t,e.hash.substring(1,e.hash.length)}var VRe=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=nY(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,yu),t.encodePart=d6;let e=xRe(this.#A(),void 0,t);this.#u=cY(e)}},c6=["protocol","username","password","hostname","port","pathname","search","hash"],gu="*";function rY(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 $l(t,e){return e?Lb(t):t}function Rb(t,e,r){let n;if(typeof e.baseURL=="string")try{n=new URL(e.baseURL),e.protocol===void 0&&(t.protocol=$l(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=$l(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=$l(n.password,r)),e.protocol===void 0&&e.hostname===void 0&&(t.hostname=$l(n.hostname,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(t.port=$l(n.port,r)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(t.pathname=$l(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=$l(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=$l(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(t.protocol=MRe(e.protocol,r)),typeof e.username=="string"&&(t.username=PRe(e.username,r)),typeof e.password=="string"&&(t.password=ARe(e.password,r)),typeof e.hostname=="string"&&(t.hostname=IRe(e.hostname,r)),typeof e.port=="string"&&(t.port=LRe(e.port,t.protocol,r)),typeof e.pathname=="string"){if(t.pathname=e.pathname,n&&!SRe(t.pathname,r)){let i=n.pathname.lastIndexOf("/");i>=0&&(t.pathname=$l(n.pathname.substring(0,i+1),r)+t.pathname)}t.pathname=RRe(t.pathname,t.protocol,r)}return typeof e.search=="string"&&(t.search=ERe(e.search,r)),typeof e.hash=="string"&&(t.hash=TRe(e.hash,r)),t}function Lb(t){return t.replace(/([+*?:{}()\\])/g,"\\$1")}function jRe(t){return t.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function $Re(t,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let r=".*",n=`[^${jRe(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+=Lb(o.value);continue}s+=`{${Lb(o.value)}}${sm(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+=Lb(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+=Lb(o.suffix),c&&(s+="}"),o.modifier!==3&&(s+=sm(o.modifier))}return s}var hY=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 VRe(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:gu,protocol:gu,username:gu,password:gu,hostname:gu,port:gu,search:gu,hash:gu};this.#e=Rb(s,t,!0),uY(this.#e.protocol)===this.#e.port&&(this.#e.port="");let a;for(a of c6){if(!(a in this.#e))continue;let o={},l=this.#e[a];switch(this.#r[a]=[],a){case"protocol":Object.assign(o,yu),o.encodePart=d6;break;case"username":Object.assign(o,yu),o.encodePart=_Re;break;case"password":Object.assign(o,yu),o.encodePart=ORe;break;case"hostname":Object.assign(o,wRe),oY(l)?o.encodePart=fY:o.encodePart=dY;break;case"port":Object.assign(o,yu),o.encodePart=pY;break;case"pathname":cY(this.#t.protocol)?(Object.assign(o,kRe,i),o.encodePart=DRe):(Object.assign(o,yu,i),o.encodePart=NRe);break;case"search":Object.assign(o,yu,i),o.encodePart=FRe;break;case"hash":Object.assign(o,yu,i),o.encodePart=BRe;break}try{this.#i[a]=iY(l,o),this.#t[a]=sY(this.#i[a],this.#r[a],o),this.#n[a]=$Re(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=Rb(r,t,!1):r=Rb(r,rY(t,e),!1)}catch{return!1}let n;for(n of c6)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=Rb(r,t,!1):r=Rb(r,rY(t,e),!1)}catch{return null}let n={};e?n.inputs=[t,e]:n.inputs=[t];let i;for(i of c6){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 Mb(3,"","","","",3),s=new Mb(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=hY);var f6=require("obsidian"),URe={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(URe))e&&(0,f6.addIcon)(t,e);(0,f6.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 bke=require("obsidian");var mY=`.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 gY=`/*! 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 yY=`: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 vT=Z(Ge(),1);var Yr=Z(Te(),1);var cLe=Z(Te(),1);function OY(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function DY(...t){return e=>{let r=!1,n=t.map(i=>{let s=OY(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():OY(t[i],null)}}}}var lm=Z(Ge(),1),x6=Yr.forwardRef((t,e)=>{let{children:r,...n}=t,i=Yr.Children.toArray(r),s=i.find(dLe);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,lm.jsx)(b6,{...n,ref:e,children:Yr.isValidElement(a)?Yr.cloneElement(a,void 0,o):null})}return(0,lm.jsx)(b6,{...n,ref:e,children:r})});x6.displayName="Slot";var b6=Yr.forwardRef((t,e)=>{let{children:r,...n}=t;if(Yr.isValidElement(r)){let i=pLe(r),s=fLe(n,r.props);return r.type!==Yr.Fragment&&(s.ref=e?DY(e,i):i),Yr.cloneElement(r,s)}return Yr.Children.count(r)>1?Yr.Children.only(null):null});b6.displayName="SlotClone";var uLe=({children:t})=>(0,lm.jsx)(lm.Fragment,{children:t});function dLe(t){return Yr.isValidElement(t)&&t.type===uLe}function fLe(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 pLe(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 Lf=Z(Te(),1),$Y=Z(Rf(),1);var cm=Z(Te(),1);function yT(t){let e=(0,cm.useRef)(void 0),r=(0,cm.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,cm.useMemo)(()=>t.every(n=>n==null)?null:n=>{e.current&&(e.current(),e.current=void 0),n!=null&&(e.current=r(n))},t)}var jY=Z(Te(),1),w6=(0,jY.createContext)(null);function yLe({root:t,children:e=null}){return(0,$Y.createPortal)(e,t)}function k6({mode:t="open",delegatesFocus:e=!1,styleSheets:r=[],children:n,ref:i,asChild:s,...a}){let o=(0,Lf.useRef)(null),l=yT([o,i]),[c,u]=(0,Lf.useState)(null),d=`node_${t}${e}`,f=s?x6:"div";return(0,Lf.useLayoutEffect)(()=>{if(!o.current||o.current.shadowRoot)return;let p=null;p=o.current.attachShadow({mode:t,delegatesFocus:e}),u(p)},[t,e]),(0,Lf.useLayoutEffect)(()=>{c&&(c.adoptedStyleSheets=r)},[c,r]),(0,vT.jsx)(f,{ref:l,...a,children:(0,vT.jsx)(w6.Provider,{value:c,children:c&&(0,vT.jsx)(yLe,{root:c,children:n})})},d)}var UY=Z(Te(),1),zY=Z(Ge(),1),S6=new WeakMap;async function bT(t=window){let e=t.document;if(S6.has(e))return S6.get(e);let r=Promise.all([C6(gY,t),C6(yY,t),C6(mY,t)]);return S6.set(e,r),await r}async function C6(t,e){let{CSSStyleSheet:r}=e,n=new r;return await n.replace(t),n}function Mf(t){let[e,r]=(0,UY.useState)([]);return(0,zY.jsx)(k6,{ref:n=>{n&&(n.onWindowMigrated(i=>{bT(i).then(r)}),bT(n.win).then(r))},styleSheets:e,...t})}function Vr(t,e){return t instanceof Promise?vLe(t,e):bLe(t,e)}function vLe(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*bLe(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 HY;HY=Symbol.asyncIterator;var qY=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()}}[HY](){return this.iterate()}};function T6(t,e,r,n,i){let s=Math.min(t,e*n**r);return(1-i*Math.random())*s}var xT=class extends Error{constructor(e,r){super(`Retrying exceeded the maxAttempts (${r}).`),this.name="RetryError",this.cause=e}};var E6=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 um(t,e,r,n,i){e.addEventListener(r,n,i),t.defer(()=>e.removeEventListener(r,n,i))}function dm(t,e,r,n,i){let s=e.register(r,n,i);t.defer(()=>e.unregister(s))}var bu=class extends AbortController{[Symbol.dispose](){this.abort(new kt)}};async function GY(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 E6.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 WY(t){return t.constructor.prototype}function I6(t){return Promise.all(t.getLeavesOfType("markdown").map(async e=>{let r=e.getViewState();await e.setViewState({type:"empty"}),await e.setViewState(r)}))}var KY=Promise.withResolvers();async function YY(t){let e=new AbortController;t.register(()=>e.abort());let r=await GY("markdown",{app:t.app,signal:e.signal}),n=xLe(r.editMode,"triggerClickableToken");if(!n)throw new Error("Failed to find markdown view prototype");KY.resolve({edit:n})}async function XY(){return(await KY.promise).edit}function xLe(t,e){let r=t;for(;r;){if(Object.hasOwn(r,e))return r;r=Object.getPrototypeOf(r)}return null}async function fm(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=>wLe(t,n,e[n]));return r.length===1?r[0]:function(){r.forEach(n=>n())}}function wLe(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 QY=require("obsidian");async function kLe(t){let e=new QY.WorkspaceLeaf(t);return await e.setViewState({type:"empty"}),e.view.constructor}async function ZY(t,e){let r=await kLe(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 JY=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>(xu(),_f)).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};var Ob=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}},wT=class extends Ob{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}},kT=class extends Ob{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}},ST=class extends Ob{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}},CT;(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"})(CT||(CT={}));var ILe=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())})},Db=class{constructor(e,{headers:r={},customFetch:n,region:i=CT.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=JY(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return ILe(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 wT(h)}),d=u.headers.get("x-relay-error");if(d&&d==="true")throw new kT(u);if(!u.ok)throw new ST(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 fX=Z(dX(),1),{PostgrestClient:pX,PostgrestQueryBuilder:yst,PostgrestFilterBuilder:vst,PostgrestTransformBuilder:bst,PostgrestBuilder:xst,PostgrestError:VLe}=fX.default;var hX="2.11.2";var mX={"X-Client-Info":`realtime-js/${hX}`},gX="1.0.0",PT=1e4,yX=1e3,Of;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Of||(Of={}));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 AT;(function(t){t.websocket="websocket"})(AT||(AT={}));var wu;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(wu||(wu={}));var Ub=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 Df=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 U6=(t,e,r={})=>{var n;let i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return Object.keys(e).reduce((s,a)=>(s[a]=jLe(a,t,e,i),s),{})},jLe=(t,e,r,n)=>{let i=e.find(o=>o.name===t),s=i?.type,a=r[t];return s&&!n.includes(s)?vX(s,a):$6(a)},vX=(t,e)=>{if(t.charAt(0)==="_"){let r=t.slice(1,t.length);return qLe(e,r)}switch(t){case Wt.bool:return $Le(e);case Wt.float4:case Wt.float8:case Wt.int2:case Wt.int4:case Wt.int8:case Wt.numeric:case Wt.oid:return ULe(e);case Wt.json:case Wt.jsonb:return zLe(e);case Wt.timestamp:return HLe(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 $6(e);default:return $6(e)}},$6=t=>t,$Le=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},ULe=t=>{if(typeof t=="string"){let e=parseFloat(t);if(!Number.isNaN(e))return e}return t},zLe=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},qLe=(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=>vX(e,o))}return t},HLe=t=>typeof t=="string"?t.replace(" ","T"):t,RT=t=>{let e=t;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};var Nf=class{constructor(e,r,n={},i=PT){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 z6;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(z6||(z6={}));var mm=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 q6;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(q6||(q6={}));var H6;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(H6||(H6={}));var Ho;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Ho||(Ho={}));var gm=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 Nf(this,ys.join,this.params,this.timeout),this.rejoinTimer=new Df(()=>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 mm(this),this.broadcastEndpointURL=RT(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?.(Ho.CHANNEL_ERROR,u)),this._onClose(()=>e?.(Ho.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?.(Ho.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?.(Ho.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=h,e&&e(Ho.SUBSCRIBED);return}}).receive("error",u=>{e?.(Ho.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(u).join(", ")||"error")))}).receive("timeout",()=>{e?.(Ho.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 Nf(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 Nf(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=U6(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=U6(e.columns,e.old_record)),r}};var WLe=()=>{},KLe=typeof WebSocket<"u",YLe=`
|
|
addEventListener("message", (e) => {
|
|
if (e.data.event === "start") {
|
|
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
}
|
|
});`,ym=class{constructor(e,r){var n;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=mX,this.params={},this.timeout=PT,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=WLe,this.conn=null,this.sendBuffer=[],this.serializer=new Ub,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(()=>(xu(),_f)).then(({default:l})=>l(...o)):a=fetch,(...o)=>a(...o)},this.endPoint=`${e}/${AT.websocket}`,this.httpEndpoint=RT(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 Df(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(KLe){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new G6(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),Promise.resolve().then(()=>Z(xX())).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:gX}))}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 Of.connecting:return wu.Connecting;case Of.open:return wu.Open;case Of.closing:return wu.Closing;default:return wu.Closed}}isConnected(){return this.connectionState()===wu.Open}channel(e,r={config:{}}){let n=new gm(`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(yX,"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([YLe],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}},G6=class{constructor(e,r,n){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=Of.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=n.close}};var vm=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 LT=class extends vm{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}},Ff=class extends vm{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};var XLe=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())})},_T=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>(xu(),_f)).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},wX=()=>XLe(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(xu(),_f))).Response:Response}),MT=t=>{if(Array.isArray(t))return t.map(r=>MT(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]=MT(n)}),e};var Bf=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())})},W6=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),QLe=(t,e,r)=>Bf(void 0,void 0,void 0,function*(){let n=yield wX();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new LT(W6(i),t.status||500))}).catch(i=>{e(new Ff(W6(i),i))}):e(new Ff(W6(t),t))}),ZLe=(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 zb(t,e,r,n,i,s){return Bf(this,void 0,void 0,function*(){return new Promise((a,o)=>{t(r,ZLe(e,n,i,s)).then(l=>{if(!l.ok)throw l;return n?.noResolveJson?l:l.json()}).then(l=>a(l)).catch(l=>QLe(l,o,n))})})}function bm(t,e,r,n){return Bf(this,void 0,void 0,function*(){return zb(t,"GET",e,r,n)})}function Go(t,e,r,n,i){return Bf(this,void 0,void 0,function*(){return zb(t,"POST",e,n,i,r)})}function kX(t,e,r,n,i){return Bf(this,void 0,void 0,function*(){return zb(t,"PUT",e,n,i,r)})}function SX(t,e,r,n){return Bf(this,void 0,void 0,function*(){return zb(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function OT(t,e,r,n,i){return Bf(this,void 0,void 0,function*(){return zb(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())})},JLe={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},CX={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},qb=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=_T(i)}uploadOrUpdate(e,r,n,i){return Bi(this,void 0,void 0,function*(){try{let s,a=Object.assign(Object.assign({},CX),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:CX.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 Go(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 vm("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 Go(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 Go(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 Go(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 Go(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 bm(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 bm(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:MT(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 SX(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(jr(n)&&n instanceof Ff){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 OT(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({},JLe),r),{prefix:e||""});return{data:yield Go(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 TX="2.7.1";var EX={"X-Client-Info":`storage-js/${TX}`};var xm=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())})},Hb=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},EX),r),this.fetch=_T(n)}listBuckets(){return xm(this,void 0,void 0,function*(){try{return{data:yield bm(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 xm(this,void 0,void 0,function*(){try{return{data:yield bm(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 xm(this,void 0,void 0,function*(){try{return{data:yield Go(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 xm(this,void 0,void 0,function*(){try{return{data:yield kX(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 xm(this,void 0,void 0,function*(){try{return{data:yield Go(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 xm(this,void 0,void 0,function*(){try{return{data:yield OT(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(jr(r))return{data:null,error:r};throw r}})}};var Gb=class extends Hb{constructor(e,r={},n){super(e,r,n)}from(e){return new qb(this.url,this.headers,e,this.fetch)}};var IX="2.49.1";var Wb="";typeof Deno<"u"?Wb="deno":typeof document<"u"?Wb="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Wb="react-native":Wb="node";var e3e={"X-Client-Info":`supabase-js-${Wb}/${IX}`},AX={headers:e3e},PX={schema:"public"},RX={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},LX={};xu();var t3e=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())})},r3e=t=>{let e;return t?e=t:typeof fetch>"u"?e=A6:e=fetch,(...r)=>e(...r)},n3e=()=>typeof Headers>"u"?P6:Headers,MX=(t,e,r)=>{let n=r3e(r),i=n3e();return(s,a)=>t3e(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 i3e=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 _X(t){return t.replace(/\/$/,"")}function OX(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:()=>i3e(this,void 0,void 0,function*(){return""})};return t.accessToken?u.accessToken=t.accessToken:delete u.accessToken,u}var DT="2.68.0";var Vf=30*1e3,NT=3,FT=NT*Vf,DX="http://localhost:9999",NX="supabase.auth.token";var FX={"X-Client-Info":`gotrue-js/${DT}`};var Kb="X-Supabase-Api-Version",K6={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function BX(t){return Math.round(Date.now()/1e3)+t}function VX(){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 Xa=()=>typeof window<"u"&&typeof document<"u",jf={tested:!1,writable:!1},ku=()=>{if(!Xa())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(jf.tested)return jf.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),jf.tested=!0,jf.writable=!0}catch{jf.tested=!0,jf.writable=!1}return jf.writable};function jX(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 BT=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>(xu(),_f)).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},$X=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Y6=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},Xb=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Qb=async(t,e)=>{await t.removeItem(e)};function s3e(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 Yb=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};Yb.promiseConstructor=Promise;function X6(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(s3e(n))}async function UX(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function zX(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 a3e(t){return("0"+t.toString(16)).substr(-2)}function o3e(){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,a3e).join("")}async function l3e(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 c3e(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function u3e(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 l3e(t);return c3e(r)}async function $f(t,e,r=!1){let n=o3e(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await Y6(t,`${e}-code-verifier`,i);let s=await u3e(n);return[s,n===s?"plain":"s256"]}var d3e=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function qX(t){let e=t.headers.get(Kb);if(!e||!e.match(d3e))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}var Zb=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 VT=class extends Zb{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};function HX(t){return He(t)&&t.name==="AuthApiError"}var wm=class extends Zb{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}},Ul=class extends Zb{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}},na=class extends Ul{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function GX(t){return He(t)&&t.name==="AuthSessionMissingError"}var km=class extends Ul{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Uf=class extends Ul{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}},zf=class extends Ul{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 WX(t){return He(t)&&t.name==="AuthImplicitGrantRedirectError"}var Jb=class extends Ul{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}}},Sm=class extends Ul{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};function jT(t){return He(t)&&t.name==="AuthRetryableFetchError"}var e0=class extends Ul{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};var f3e=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},qf=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),p3e=[502,503,504];async function KX(t){var e;if(!$X(t))throw new Sm(qf(t),0);if(p3e.includes(t.status))throw new Sm(qf(t),t.status);let r;try{r=await t.json()}catch(s){throw new wm(qf(s),s)}let n,i=qX(t);if(i&&i.getTime()>=K6["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 e0(qf(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 e0(qf(r),t.status,r.weak_password.reasons);throw new VT(qf(r),t.status||500,n)}var h3e=(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[Kb]||(s[Kb]=K6["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 m3e(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 m3e(t,e,r,n,i,s){let a=h3e(e,n,i,s),o;try{o=await t(r,Object.assign({},a))}catch(l){throw console.error(l),new Sm(qf(l),0)}if(o.ok||await KX(o),n?.noResolveJson)return o;try{return await o.json()}catch(l){await KX(l)}}function zl(t){var e;let r=null;g3e(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=BX(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function Q6(t){let e=zl(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 Wo(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function YX(t){return{data:t,error:null}}function XX(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:s}=t,a=f3e(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 QX(t){return t}function g3e(t){return t.access_token&&t.refresh_token&&t.expires_in}var y3e=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},Hf=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=BT(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:Wo})}catch(n){if(He(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=y3e(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:XX,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:Wo})}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:QX});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:Wo})}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:Wo})}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:Wo})}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 ZX={getItem:t=>ku()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{ku()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{ku()&&globalThis.localStorage.removeItem(t)}};function Z6(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}function JX(){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 Gf={debug:!!(globalThis&&ku()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},t0=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}},$T=class extends t0{};async function J6(t,e,r){Gf.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Gf.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){Gf.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Gf.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Gf.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new $T(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Gf.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()}}))}JX();var v3e={url:DX,storageKey:NX,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:FX,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function eQ(t,e,r){return await r()}var Wf=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&&Xa()&&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({},v3e),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 Hf({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=BT(i.fetch),this.lock=i.lock||eQ,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:Xa()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=J6:this.lock=eQ,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:ku()?this.storage=ZX:(this.memoryStorage={},this.storage=Z6(this.memoryStorage)):(this.memoryStorage={},this.storage=Z6(this.memoryStorage)),Xa()&&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} (${DT}) ${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=jX(window.location.href),n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),Xa()&&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),WX(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 wm("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:zl}),{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 $f(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:zl})}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:zl})}else throw new Uf("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:Q6})}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:Q6})}else throw new Uf("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 km}:(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 Xb(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:zl});if(await Qb(this.storage,`${this.storageKey}-code-verifier`),a)throw a;return!s||!s.session||!s.user?{data:{user:null,session:null,redirectType:null},error:new km}:(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:zl}),{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 km}:(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 $f(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 Uf("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:zl});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 $f(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:YX})}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 Uf("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 Xb(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()<FT:!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:Wo}):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:Wo})})}catch(r){if(He(r))return GX(r)&&(await this._removeSession(),await Qb(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 $f(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:Wo});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 X6(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=X6(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(!Xa())throw new zf("No browser detected.");if(e.error||e.error_description||e.error_code)throw new zf(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 Jb("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new zf("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 Jb("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 zf("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<=Vf&&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 Xb(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&&!(HX(o)&&(o.status===404||o.status===401||o.status===403)))return{error:o}}return e!=="others"&&(await this._removeSession(),await Qb(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=VX(),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 $f(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 Xa()&&!(!((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 zX(async i=>(i>0&&await UX(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:zl})),(i,s)=>{let a=200*Math.pow(2,i);return s&&jT(s)&&Date.now()+a-n<Vf})}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),Xa()&&!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 Xb(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()<FT;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${FT}s`),i){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),jT(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 Yb;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 jT(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 Y6(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await Qb(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Xa()&&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(),Vf);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)/Vf);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Vf}ms, refresh threshold is ${NT} ticks`),i<=NT&&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 t0)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Xa()||!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 $f(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}}))}};Wf.nextInstanceID=0;var b3e=Wf,eD=b3e;var UT=class extends eD{constructor(e){super(e)}};var x3e=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())})},r0=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=_X(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:PX,realtime:LX,auth:Object.assign(Object.assign({},RX),{storageKey:l}),global:AX},u=OX(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=MX(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 pX(`${o}/rest/v1`,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),u.accessToken||this._listenForAuthEvents()}get functions(){return new Db(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new Gb(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 x3e(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 UT({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 ym(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 tQ=(t,e,r)=>new r0(t,e,r);var sQ=require("obsidian");function ia(){return require("node:fs/promises")}function vs(){return require("node:path")}function Vi(){return require("node:url")}function sa(){return require("@electron/remote")}function rQ(){return sa().safeStorage}function nQ(){return sa().dialog}function zT(){return require("node:crypto")}function iQ(){return require("electron")}function Cm(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=tQ("https://usittnhnfwrdkspwnahn.supabase.co","sb_publishable_LGay-xxhOCQXin7Yf7CLFA_Ivo2nJbb",{auth:{detectSessionInUrl:!1,flowType:"pkce",persistSession:!0,autoRefreshToken:!1,storageKey:"mx-auth-session",storage:(()=>{if(!sQ.Platform.isDesktopApp)return localStorage;let t=rQ();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 aQ=`
|
|
`,tD=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})}},s0=class extends tD{},Em=class t extends s0{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}},Tm=class extends s0{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+=aQ+aQ,o+=`Resolution path: ${a}`,super(o)}},rD=class extends s0{constructor(e,r){let i=`Could not register '${e.toString()}'.`;r&&(i+=` ${r}`),super(i)}},Kf={PROXY:"PROXY",CLASSIC:"CLASSIC"},qn={SINGLETON:"SINGLETON",TRANSIENT:"TRANSIENT",SCOPED:"SCOPED"};function w3e(t,e){return t===qn.SINGLETON&&e!==qn.SINGLETON||t===qn.SCOPED&&e===qn.TRANSIENT}function uQ(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(oQ(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(T3e(v))return u(),n;r++}}}function u(){let v=t.charAt(r),b=++r;for(;E3e(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(oQ(y)){r++;continue}if(k3e(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 oQ(t){switch(t){case"\r":case`
|
|
`:case" ":return!0}return!1}function k3e(t){switch(t){case"'":case'"':case"`":return!0}return!1}var S3e=/^[_$a-zA-Z\xA0-\uFFFF]$/,C3e=/^[?._$a-zA-Z0-9\xA0-\uFFFF]$/;function T3e(t){return S3e.test(t)}function E3e(t){return C3e.test(t)}function I3e(t,e){let r=t;return typeof r=="string"||typeof r=="symbol"?{[t]:e}:r}function A3e(t){return t[t.length-1]}function P3e(t){if(typeof t!="function")return!1;let e=uQ(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 dQ(t){return typeof t=="function"}function R3e(t){return Array.from(new Set(t))}function L3e(t){let{next:e,done:r}=uQ(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 fQ=Symbol("Awilix Resolver Config");function Yf(t){return{resolve:()=>t,isLeakSafe:!0}}function qT(t,e){if(!dQ(t))throw new Em("asFunction","fn","function",t);let r={lifetime:qn.TRANSIENT};e=pQ(r,e,t[fQ]);let i={resolve:mQ(t),...e};return nD(i0(i))}function ji(t,e){if(!dQ(t))throw new Em("asClass","Type","class",t);let r={lifetime:qn.TRANSIENT};e=pQ(r,e,t[fQ]);let i=mQ(function(...a){return Reflect.construct(t,a)},t);return nD(i0({...e,resolve:i}))}function i0(t){function e(i){return i0({...this,lifetime:i})}function r(i){return i0({...this,injectionMode:i})}function n(i){return i0({...this,injector:i})}return hQ(t,{setLifetime:e,inject:n,transient:n0(e,qn.TRANSIENT),scoped:n0(e,qn.SCOPED),singleton:n0(e,qn.SINGLETON),setInjectionMode:r,proxy:n0(r,Kf.PROXY),classic:n0(r,Kf.CLASSIC)})}function nD(t){function e(r){return nD({...this,dispose:r})}return hQ(t,{disposer:e})}function n0(t,e){return function(){return t.call(this,e)}}function pQ(t,...e){return Object.assign({},t,...e)}function hQ(t,e){return{...t,...e}}function M3e(t,e){return function(n,i){return n in e?e[n]:t.resolve(n,i)}}function _3e(t,e){let r=e(t),n=R3e([...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 mQ(t,e){e||(e=t);let r=gQ(e);return function(i){if((this.injectionMode||i.options.injectionMode||Kf.PROXY)!==Kf.CLASSIC){let a=this.injector?_3e(i,this.injector):i.cradle;return t(a)}if(r.length>0){let a=this.injector?M3e(i,this.injector(i)):i.resolve,o=r.map(l=>a(l.name,{allowUnregistered:l.optional}));return t(...o)}return t()}}function gQ(t){let e=L3e(t.toString());if(!e){let r=Object.getPrototypeOf(t);return typeof r=="function"&&r!==Function.prototype?gQ(r):[]}return e}var lQ=Symbol("familyTree"),cQ=Symbol("rollUpRegistrations"),O3e="AwilixContainerCradle";function iD(t={}){return yQ(t)}function yQ(t,e,r){t={injectionMode:Kf.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,[cQ]:u,get registrations(){return u()}},o=e?[a].concat(e[lQ]):[a];a[lQ]=o;let l=A3e(o);return a;function c(){return`[AwilixContainer (${e?"scoped, ":""}registrations: ${Object.keys(a.registrations).length})]`}function u(){return{...e&&e[cQ](),...i}}function*d(){let w=u();for(let C in w)yield C}function f(){return yQ(t,a,n)}function p(w,C){let O=I3e(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 rD(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 Tm(w,n,"Cyclic dependencies detected.");if(w==="toJSON")return h;if(w==="constructor")return iD;if(!O){switch(w){case"inspect":case"toString":return h;case Symbol.toStringTag:return O3e;case"then":return;case Symbol.iterator:return d}if(C.allowUnregistered)return;throw new Tm(w,n)}let S=O.lifetime||qn.TRANSIENT;if(t.strict&&!O.isLeakSafe){let P=n.findIndex(({lifetime:R})=>w3e(R,S));if(P>-1)throw new Tm(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 Tm(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 Em.assert(w,O,S,"a registration, function or class",w),Em.assert(typeof w=="function",O,S,"a function or class",w),(P3e(w)?ji(w,C):qT(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={},vQ=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,bQ=t=>"init"in t,sD=t=>!!t.write,xQ=t=>"v"in t||"e"in t,HT=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},GT=new WeakMap,wQ=t=>{var e;return WT(t)&&!!((e=GT.get(t))!=null&&e[0])},D3e=t=>{let e=GT.get(t);e?.[0]&&(e[0]=!1,e[1].forEach(r=>r()))},SQ=(t,e)=>{let r=GT.get(t);if(!r){r=[!0,new Set],GT.set(t,r);let n=()=>{r[0]=!1};t.then(n,n)}r[1].add(e)},WT=t=>typeof t?.then=="function",CQ=(t,e,r)=>{r.p.has(t)||(r.p.add(t),e.then(()=>{r.p.delete(t)},()=>{r.p.delete(t)}))},aD=(t,e,r)=>{let n=r(t),i="v"in n,s=n.v;if(WT(e))for(let a of n.d.keys())CQ(t,e,r(a));n.v=e,delete n.e,(!i||!Object.is(s,n.v))&&(++n.n,WT(s)&&D3e(s))},kQ=(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},N3e=()=>{let t=new Set,e=()=>{t.forEach(r=>r())};return e.add=r=>(t.add(r),()=>{t.delete(r)}),e},oD=()=>{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},F3e=t=>(t.c||(t.c=oD()),t.m||(t.m=oD()),t.u||(t.u=oD()),t.f||(t.f=N3e()),t),B3e=Symbol();var V3e=(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 kQ(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(xQ(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(vQ(S,V)){let Me=f(V);if(!xQ(Me))if(bQ(V))aD(V,V.init,f);else throw new Error("no atom init");return HT(Me)}let de=m(V);try{return HT(de)}finally{E.d.set(V,de.n),wQ(E.v)&&CQ(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"&&!sD(S)&&console.warn("setSelf function cannot be used with read-only atom"),!M&&sD(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 aD(S,V,f),WT(V)&&(SQ(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 kQ(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=>HT(m(I)),R=(I,...B)=>{var M;let z=f(I);try{if(vQ(S,I)){if(!bQ(I))throw new Error("atom not writable");let G=z.n,V=B[0];aD(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&&!wQ(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),sD(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=>HT(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,B3e,{value:C}),O},lD=V3e;var TQ=F3e;var cD=SQ;var Im={},j3e=0;function re(t,e){let r=`atom${++j3e}`,n={toString(){return(Im.env?Im.env.MODE:void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof t=="function"?n.read=t:(n.init=t,n.read=$3e,n.write=U3e),e&&(n.write=e),n}function $3e(t){return t(this)}function U3e(t,e,r){return e(this,typeof r=="function"?r(t(this)):r)}var z3e=()=>{let t=0,e=TQ({}),r=new WeakMap,n=new WeakMap,i=lD(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 Xf(){return(Im.env?Im.env.MODE:void 0)!=="production"?z3e():lD()}var a0;function KT(){return a0||(a0=Xf(),(Im.env?Im.env.MODE:void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=a0),globalThis.__JOTAI_DEFAULT_STORE__!==a0&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),a0}var dn=Z(Te(),1);var IQ={},AQ=(0,dn.createContext)(void 0);function Su(t){let e=(0,dn.useContext)(AQ);return t?.store||e||KT()}function PQ({children:t,store:e}){let r=(0,dn.useRef)(void 0);return!e&&!r.current&&(r.current=Xf()),(0,dn.createElement)(AQ.Provider,{value:e||r.current},t)}var dD=t=>typeof t?.then=="function",RQ=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},q3e=dn.default.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(RQ(t),t)}),uD=new WeakMap,EQ=(t,e)=>{let r=uD.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();dD(c)?(uD.set(c,r),s=c,c.then(a(c),o(c)),cD(c,l)):n(c)}catch(c){i(c)}};t.then(a(t),o(t)),cD(t,l)}),uD.set(t,r)),r};function St(t,e){let r=Su(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);dD(u)&&RQ(EQ(u,()=>r.get(t))),setTimeout(a,l);return}a()});return a(),c},[r,t,l]),(0,dn.useDebugValue)(o),dD(o)){let c=EQ(o,()=>r.get(t));return q3e(c)}return o}function Am(t,e){let r=Su(e);return(0,dn.useCallback)((...i)=>{if((IQ.env?IQ.env.MODE:void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return r.set(t,...i)},[r,t])}function aa(t,e){return[St(t,e),Am(t,e)]}var J1e=require("obsidian");function fD(t,e){let r={},n=Object.entries(t);for(let i of n){let[s,a]=e(i);r[s]=a}return r}function LQ(t){let e=new Set(t);return Array.from(e)}function YT(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 XT(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 o0(t,e){let r=new Set(e);return Object.fromEntries(Object.entries(t).filter(([n,i])=>!r.has(n)))}function Qf(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}var Gd=require("obsidian");var Yo="mx-file",bs="mx-url";function l0(t){return typeof t.view<"u"}function Xo(t,e){return e.activeTime-t.activeTime}function c0(t,e){return t.view===void 0?1:e.view===void 0?-1:0}function ql(...t){return(e,r)=>{for(let n of t){let i=n(e,r);if(i!==0)return i}return 0}}var WR=require("obsidian");var pD;function QT(t){return{lang:t?.lang??pD?.lang,message:t?.message,abortEarly:t?.abortEarly??pD?.abortEarly,abortPipeEarly:t?.abortPipeEarly??pD?.abortPipeEarly}}var H3e;function G3e(t){return H3e?.get(t)}var W3e;function K3e(t){return W3e?.get(t)}var Y3e;function X3e(t,e){return Y3e?.get(t)?.get(e)}function Hl(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??Hl(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??X3e(t.reference,l.lang)??(c?K3e(l.lang):null)??n.message??G3e(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},QT())}}}function _Q(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}function OQ(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 Pm=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};var Q3e=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Z3e=/^\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 J3e=/^\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 Gl(t){return{kind:"transformation",type:"brand",reference:Gl,async:!1,name:t,"~run"(e){return e}}}function Rm(t,e){return{kind:"validation",type:"check",reference:Rm,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 Wl(t,e){return{kind:"validation",type:"gt_value",reference:Wl,async:!1,expects:`>${t instanceof Date?t.toJSON():Hl(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():Hl(r.value)}),r}}}function u0(t){return{kind:"validation",type:"integer",reference:u0,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 hD(t){return{kind:"validation",type:"iso_date",reference:hD,async:!1,expects:null,requirement:Q3e,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&Zt(this,"date",e,r),e}}}function mD(t){return{kind:"validation",type:"iso_date_time",reference:mD,async:!1,expects:null,requirement:Z3e,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&Zt(this,"date-time",e,r),e}}}function gD(t){return{kind:"validation",type:"iso_timestamp",reference:gD,async:!1,expects:null,requirement:J3e,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():Hl(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():Hl(r.value)}),r}}}function Lm(t,e){return{kind:"validation",type:"min_length",reference:Lm,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 Qa(t,e){return{kind:"validation",type:"min_value",reference:Qa,async:!1,expects:`>=${t instanceof Date?t.toJSON():Hl(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():Hl(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 d0(t,e){return{kind:"transformation",type:"parse_json",reference:d0,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 yD(t){return{kind:"transformation",type:"raw_transform",reference:yD,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 f0(t,e){return{kind:"validation",type:"regex",reference:f0,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 oa(t){return{kind:"transformation",type:"transform",reference:oa,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function Za(){return{kind:"transformation",type:"trim",reference:Za,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function DQ(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:DQ(this,i,n)}:i}}}function vD(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 Kl(t,e){return{kind:"schema",type:"array",reference:Kl,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:Hl(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 bD(t,e){return{kind:"schema",type:"non_nullable",reference:bD,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 p0(t){return{kind:"schema",type:"null",reference:p0,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 la(t,e){return{kind:"schema",type:"nullable",reference:la,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=vD(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]:vD(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]=DQ(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=vD(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:_Q(t.map(Hl),"|"),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 we(t){return{kind:"schema",type:"string",reference:we,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 MQ(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:_Q(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:MQ(s)}),r.typed=!0}else{if(a?.length===1)return a[0];Zt(this,"type",r,n,{issues:MQ(a)})}return r}}}function NQ(t,e){let r={...t.entries};for(let n of e)delete r[n];return{...t,entries:r,get"~standard"(){return mi(this)}}}function Ja(t,e,r){let n=t["~run"]({value:e},QT(r));if(n.issues)throw new Pm(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},QT(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}async function FQ(t,e,r){let n=await t["~run"]({value:e},QT(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var Cu={video:["mp4","webm","ogv","mov","mkv"],audio:["mp3","wav","m4a","3gp","flac","ogg","oga","opus"],track:["vtt","srt","ssa","ass"]},eo=[...Cu.video,...Cu.audio],ZT=[...Cu.track],Mm={video:Pt(Cu.video),audio:Pt(Cu.audio),track:Pt(Cu.track),media:Pt(eo)},BQ=Mm.track;function Yl(t){return ws(Mm.media,t.extension)}function h0(t){return ws(Mm.video,t.extension)}function xD(t){return ws(Mm.audio,t.extension)}function JT(t){return ws(Mm.track,t.extension)}function wD(t){let{pathname:e}=t,r=e.split(".").pop();return ws(Mm.media,r)}function VQ(){return[...Cu.video,...Cu.audio]}var m0="mx-vault-track",_m="mx-url-track";var wV=require("obsidian");var Ot=class extends Error{constructor(e,r){super(e,r),this.name="AssertionError"}};function jQ(t){return t instanceof Set||t instanceof Map}function eMe(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 tMe(t){let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||e===Array.prototype}function UQ(t){return[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)]}function $Q(t){let e=new Set;for(;t!==Object.prototype&&t!==Array.prototype&&t!=null;){for(let r of UQ(t))e.add(r);t=Object.getPrototypeOf(t)}return e}var Tu=globalThis.Temporal??new Proxy({},{get:()=>{}}),rMe=new Set([Intl.Locale,RegExp,Tu.Duration,Tu.Instant,Tu.PlainDate,Tu.PlainDateTime,Tu.PlainTime,Tu.PlainYearMonth,Tu.PlainMonthDay,Tu.ZonedDateTime,URL,URLSearchParams].filter(t=>t!=null).map(t=>t.prototype));function kD(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||typeof t=="symbol"||t==null}var nMe=Object.getPrototypeOf(Uint8Array);function iMe(t,e){if(t.length!==e.length)return!1;for(let r=0;r<e.length;r++)if(!zQ(t[r],e[r]))return!1;return!0}function zQ(t,e){return t===e||Object.is(t,e)}function Xl(t,e){let r=new Map;return function n(i,s){if(zQ(i,s))return!0;if(kD(i)||kD(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(!eMe(i,s))return!1;if(i instanceof nMe)return iMe(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),jQ(i)&&jQ(s)){if(i.size!==s.size)return!1;let o=[...i.keys()];if(o.every(kD)){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(tMe(i))a=UQ({...i,...s});else{if(rMe.has(Object.getPrototypeOf(i)))return String(i)===String(s);a=$Q(i).union($Q(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 to(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:qQ}=globalThis,Wct=typeof qQ?.noColor=="boolean"?qQ.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 GQ(t,e=""){if(!t)throw new Ot(e)}var ca={},KQ=Symbol((ca.env?ca.env.MODE:void 0)!=="production"?"RESET":"");var SD=(t,e,r)=>(e.has(r)?e:e.set(r,t())).get(r),cMe=new WeakMap,uMe=(t,e,r,n)=>{let i=SD(()=>new WeakMap,cMe,e),s=SD(()=>new WeakMap,i,r);return SD(t,s,n)};function g0(t,e,r=Object.is){return uMe(()=>{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 dMe=t=>typeof t?.then=="function";function fMe(t=()=>{try{return window.localStorage}catch(r){(ca.env?ca.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 dMe(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=fMe();var WQ=(t,e,r)=>(e.has(r)?e:e.set(r,t())).get(r),pMe=new WeakMap,hMe=(t,e,r)=>{let n=WQ(()=>new WeakMap,pMe,e);return WQ(t,n,r)},mMe=t=>t instanceof Promise,gMe=()=>{};function YQ(t,e=gMe){return hMe(()=>{let r=new WeakMap,n=new WeakMap,i=re(0);(ca.env?ca.env.MODE:void 0)!=="production"&&(i.debugPrivate=!0);let s=re((a,{setSelf:o})=>{a(i);let l=a(s),c=a(t);if(!mMe(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,(ca.env?ca.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 XQ(t,e){let r=re(0);return(ca.env?ca.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((ca.env?ca.env.MODE:void 0)!=="production")throw new Error("refresh must be called without arguments")}})}var ZQ=Z(Te(),1);var QQ=new WeakMap;function JQ(t,e){let r=Su(e),n=yMe(r);for(let[i,s]of t)(!n.has(i)||e?.dangerouslyForceHydrate)&&(n.add(i),r.set(i,s))}var yMe=t=>{let e=QQ.get(t);return e||(e=new WeakSet,QQ.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 eE=new WeakMap;function ua(t,e=KT()){eE.has(e)||eE.set(e,new Map);let r=eE.get(e),n=r.get(t);if(!n){let i=$i(t),s=e.sub(i,()=>{});n=()=>{s&&(r.delete(t),r.size===0&&eE.delete(e),s=void s())},r.set(t,n)}return n}function Be(t,e){throw new Ot(e??`Expect ${to(t)} to be of type never`)}var eZ="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Xr=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=eZ[r[t]&63];return e};var CD=new WeakMap;function tE(t){return CD.has(t)||CD.set(t,Xr()),CD.get(t)}function da(t){return t?t.type==="url:hosted"&&t.vid.host==="youtube":!1}function Zf(t){return!!t&&(t.type==="url:direct"||t.type==="url:hosted")}function vMe(t){return t.host==="youtube"||t.host==="vimeo"}function tZ(t){return t.type==="url:hosted"&&vMe(t.vid)}function Ql(t){if(t.type==="file")return`file:${tE(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 fa(t,e){if(!t||!e)return!1;let r=Ql(t),n=Ql(e);return r===n}var Tt=re({}),Jo=re(null),Kt=g0(Jo,t=>t?.info,fa),jt=g0(Jo,t=>t?.hash??null,(t,e)=>Xl(t,e)),Jf=re(null),iE=re(null,(t,e)=>{e(Jf,{tempFragment:null}),e(Jo,r=>r&&{...r,hash:{...r.hash,tempFragment:null}})}),sE=re(t=>t(Eu)===!1),y0=fn(re(!0),(t,e)=>{if(!t(Jo))return;e(y0,!1);let r=window.setTimeout(()=>{e(y0,!0)},500);return()=>window.clearTimeout(r)}),rZ=re(null,(t,e,r)=>{t(y0)||e(Jo,i=>i&&{...i,hash:r}),e(Jf,r)}),Eu=re(!1),rE=class extends Event{constructor(r){super("ephemeral-hash-event");this.hash=r}},nE=class extends Event{sources;constructor(e){super("initial-hash-event"),this.sources=e}};var N=Z(Te(),1),$=Z(Te(),1);var oE=Z(Te(),1);var nZ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),aE=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();var v0=Z(Te(),1);var iZ={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 sZ=(0,v0.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:a,...o},l)=>(0,v0.createElement)("svg",{ref:l,...iZ,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:aE("lucide",i),...o},[...a.map(([c,u])=>(0,v0.createElement)(c,u)),...Array.isArray(s)?s:[s]]));var W=(t,e)=>{let r=(0,oE.forwardRef)(({className:n,...i},s)=>(0,oE.createElement)(sZ,{ref:s,iconNode:e,className:aE(`lucide-${nZ(t)}`,n),...i}));return r.displayName=`${t}`,r};var bMe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],b0=W("ArrowDown",bMe);var xMe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],x0=W("ArrowUpRight",xMe);var wMe=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],w0=W("ArrowUp",wMe);var kMe=[["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"}]],k0=W("AudioWaveform",kMe);var SMe=[["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"}]],S0=W("Blocks",SMe);var CMe=[["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"}]],C0=W("Book",CMe);var TMe=[["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"}]],T0=W("Bug",TMe);var EMe=[["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"}]],Om=W("Camera",EMe);var IMe=[["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"}]],E0=W("CaptionsOff",IMe);var AMe=[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]],Zl=W("Captions",AMe);var PMe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ep=W("Check",PMe);var RMe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],I0=W("ChevronDown",RMe);var LMe=[["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"}]],Jl=W("CircleAlert",LMe);var MMe=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ec=W("CircleCheckBig",MMe);var _Me=[["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"}]],Iu=W("CircleX",_Me);var OMe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Dm=W("Clock",OMe);var DMe=[["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"}]],Nm=W("Copy",DMe);var NMe=[["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"}]],A0=W("Download",NMe);var FMe=[["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"}]],Au=W("ExternalLink",FMe);var BMe=[["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"}]],P0=W("EyeOff",BMe);var VMe=[["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"}]],Fm=W("Eye",VMe);var jMe=[["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"}]],R0=W("FilePlus",jMe);var $Me=[["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"}]],tp=W("FileText",$Me);var UMe=[["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"}]],L0=W("FolderOpen",UMe);var zMe=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],M0=W("Gauge",zMe);var qMe=[["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"}]],_0=W("Globe",qMe);var HMe=[["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"}]],O0=W("Hash",HMe);var GMe=[["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"}]],D0=W("Image",GMe);var WMe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Bm=W("Info",WMe);var KMe=[["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"}]],Vm=W("Languages",KMe);var YMe=[["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"}]],rp=W("Link",YMe);var XMe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ro=W("LoaderCircle",XMe);var QMe=[["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"}]],N0=W("Lock",QMe);var ZMe=[["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"}]],F0=W("Maximize",ZMe);var JMe=[["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"}]],B0=W("Mic",JMe);var e_e=[["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"}]],V0=W("Minimize",e_e);var t_e=[["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"}]],jm=W("Music",t_e);var r_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"}]],j0=W("Pause",r_e);var n_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"}]],Pu=W("Pen",n_e);var i_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"}]],$0=W("PictureInPicture2",i_e);var s_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"}]],$m=W("PictureInPicture",s_e);var a_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"}]],Ru=W("Pin",a_e);var o_e=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Lu=W("Play",o_e);var l_e=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Um=W("Plus",l_e);var c_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"}]],U0=W("Redo",c_e);var u_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"}]],z0=W("RefreshCcw",u_e);var d_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"}]],q0=W("Repeat",d_e);var f_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"}]],H0=W("Rocket",f_e);var p_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"}]],Mu=W("RotateCcw",p_e);var h_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"}]],zm=W("Save",h_e);var m_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"}]],qm=W("Scissors",m_e);var g_e=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],G0=W("Search",g_e);var y_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"}]],W0=W("Settings",y_e);var v_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"}]],_u=W("Sparkles",v_e);var b_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",b_e);var x_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"}]],Ou=W("SquareScissors",x_e);var w_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"}]],K0=W("Star",w_e);var k_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"}]],Y0=W("TestTube",k_e);var S_e=[["path",{d:"M17 6.1H3",key:"wptmhv"}],["path",{d:"M21 12.1H3",key:"1j38uz"}],["path",{d:"M15.1 18H3",key:"1nb16a"}]],X0=W("Text",S_e);var C_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"}]],Q0=W("Trash2",C_e);var T_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"}]],Z0=W("Undo2",T_e);var E_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"}]],J0=W("Undo",E_e);var I_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"}]],ex=W("Upload",I_e);var A_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"}]],Hm=W("User",A_e);var P_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"}]],tx=W("Video",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"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]],rx=W("Volume1",R_e);var L_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"}]],Gm=W("Volume2",L_e);var M_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"}]],Wm=W("VolumeX",M_e);var __e=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],el=W("X",__e);var O_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"}]],nx=W("Zap",O_e);ba();ba();var Le=Z(Te(),1);ux();var Pe=Z(Te(),1);ux();ba();var Y=Z(Te(),1);ux();ba();lo();co();var jee=Z(Rf(),1);function yg(){return WD(Cw)}var bNe=ze(Zx,{domEventsRegex:/^onMedia/}),$ee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(bNe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));$ee.displayName="AirPlayButton";var xNe=ze(Qx,{domEventsRegex:/^onMedia/}),V2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(xNe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));V2.displayName="PlayButton";var wNe=ze(Gx,{domEventsRegex:/^onMedia/}),j2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(wNe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));j2.displayName="CaptionButton";var kNe=ze(Wx,{domEventsRegex:/^onMedia/}),$2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(kNe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));$2.displayName="FullscreenButton";var SNe=ze(Yx,{domEventsRegex:/^onMedia/}),U2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(SNe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));U2.displayName="MuteButton";var CNe=ze(Xx,{domEventsRegex:/^onMedia/}),z2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(CNe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));z2.displayName="PIPButton";var TNe=ze(ew,{domEventsRegex:/^onMedia/}),q2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(TNe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));q2.displayName="SeekButton";var ENe=ze(Kx,{domEventsRegex:/^onMedia/}),Uee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(ENe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));Uee.displayName="LiveButton";var xp=["onDragStart","onDragEnd","onDragValueChange","onValueChange","onPointerValueChange"],INe=ze(uw),ANe=ze(mg,{events:xp}),zee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(ANe,{...e,ref:r},n=>Y.createElement(ke.div,{...n},t)));zee.displayName="Slider";var Iw=Y.forwardRef((t,e)=>Y.createElement(ke.div,{...t,ref:e}));Iw.displayName="SliderThumb";var Aw=Y.forwardRef((t,e)=>Y.createElement(ke.div,{...t,ref:e}));Aw.displayName="SliderTrack";var Pw=Y.forwardRef((t,e)=>Y.createElement(ke.div,{...t,ref:e}));Pw.displayName="SliderTrackFill";var PNe=ze(fw),Rw=Y.forwardRef(({children:t,...e},r)=>Y.createElement(PNe,{...e},n=>Y.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));Rw.displayName="SliderPreview";var Lw=Y.forwardRef(({children:t,...e},r)=>Y.createElement(INe,{...e},(n,i)=>{let s=Ut(()=>i.getValueText(),i);return Y.createElement(ke.div,{...n,ref:r},s,t)}));Lw.displayName="SliderValue";var Mw=Y.forwardRef(({children:t,...e},r)=>{let n=Ew("min"),i=Ew("max"),s=Ew("step"),a=(i-n)/s;return Y.createElement(ke.div,{...e,ref:r},Array.from({length:Math.floor(a)+1}).map((o,l)=>t(l)))});Mw.displayName="SliderSteps";var _w=Object.freeze({__proto__:null,Preview:Rw,Root:zee,Steps:Mw,Thumb:Iw,Track:Aw,TrackFill:Pw,Value:Lw}),RNe=ze(sw,{events:xp,domEventsRegex:/^onMedia/}),qee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(RNe,{...e,ref:r},n=>Y.createElement(ke.div,{...n},t)));qee.displayName="VolumeSlider";var fF=Object.freeze({__proto__:null,Preview:Rw,Root:qee,Steps:Mw,Thumb:Iw,Track:Aw,TrackFill:Pw,Value:Lw});function LNe(t=0,e=0,r=""){return le?{startTime:t,endTime:e,text:r,addEventListener:so,removeEventListener:so,dispatchEvent:so}:new window.VTTCue(t,e,r)}var MNe=ze(gg),_Ne=Y.forwardRef(({children:t,...e},r)=>Y.createElement(MNe,{...e},n=>Y.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));_Ne.displayName="Thumbnail";var Hee=Y.forwardRef(({children:t,...e},r)=>{let{src:n,img:i,crossOrigin:s}=rc(gg.state),a=Ut(n),o=Ut(s);return Y.createElement(ke.img,{crossOrigin:o,...e,src:a||void 0,ref:st(i.set,r)},t)});Hee.displayName="ThumbnailImg";var H2=Y.createContext({$chapters:be(null)});H2.displayName="TimeSliderContext";var ONe=ze(iw,{events:xp,domEventsRegex:/^onMedia/}),Gee=Y.forwardRef(({children:t,...e},r)=>{let n=Y.useMemo(()=>be(null),[]);return Y.createElement(H2.Provider,{value:{$chapters:n}},Y.createElement(ONe,{...e,ref:r},i=>Y.createElement(ke.div,{...i},t)))});Gee.displayName="TimeSlider";var DNe=ze(pw),Wee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(DNe,{...e},(n,i)=>Y.createElement(ke.div,{...n,ref:st(n.ref,r)},Y.createElement(Kee,{instance:i},t))));Wee.displayName="SliderChapters";function Kee({instance:t,children:e}){let r=Ut(()=>t.cues,t),n=Y.useRef([]),i=Y.useRef(null),{$chapters:s}=Y.useContext(H2);return i.current||(i.current=LNe()),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)})}Kee.displayName="SliderChapterTracks";var Yee=Y.forwardRef(({children:t,...e},r)=>{let{$chapters:n}=Y.useContext(H2),[i,s]=Y.useState();return Y.useEffect(()=>U(()=>{let a=n(),o=a?.activePointerCue||a?.activeCue;s(o?.text||"")}),[]),Y.createElement(ke.div,{...e,ref:r},i,t)});Yee.displayName="SliderChapterTitle";var Xee=Y.forwardRef((t,e)=>Y.createElement(ke.div,{...t,ref:e}));Xee.displayName="SliderProgress";var NNe=ze(cw),Qee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(NNe,{...e},n=>Y.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));Qee.displayName="SliderThumbnail";var FNe={Root:Qee,Img:Hee},BNe=ze(dw,{events:["onCanPlay","onError"]}),Zee=Y.forwardRef(({children:t,...e},r)=>Y.createElement(BNe,{...e},(n,i)=>Y.createElement(Jee,{...n,instance:i,ref:st(n.ref,r)},t)));Zee.displayName="SliderVideo";var Jee=Y.forwardRef(({instance:t,children:e,...r},n)=>{let{canLoad:i}=rc($u),{src:s,video:a,crossOrigin:o}=t.$state,l=Ut(s),c=Ut(i),u=Ut(o);return Y.createElement(ke.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)});Jee.displayName="SliderVideoProvider";var wp=Object.freeze({__proto__:null,ChapterTitle:Yee,Chapters:Wee,Preview:Rw,Progress:Xee,Root:Gee,Steps:Mw,Thumb:Iw,Thumbnail:FNe,Track:Aw,TrackFill:Pw,Value:Lw,Video:Zee}),VNe=ze(vw,{events:["onChange"]}),jNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(VNe,{...e,ref:r},n=>Y.createElement(ke.div,{...n},t)));jNe.displayName="RadioGroup";var $Ne=ze(bw,{events:["onChange","onSelect"]}),UNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement($Ne,{...e},n=>Y.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));UNe.displayName="RadioItem";var zNe=ze(hw,{events:["onOpen","onClose"],domEventsRegex:/^onMedia/}),qNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(zNe,{...e,ref:r},(n,i)=>Y.createElement(ke.div,{...n,style:{display:i.isSubmenu?void 0:"contents",...n.style}},t)));qNe.displayName="Menu";var HNe=ze(mw,{events:["onSelect"]}),GNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(HNe,{...e},n=>Y.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));GNe.displayName="MenuButton";var WNe=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,jee.createPortal)(Y.createElement(ke.div,{...n,style:{display:"contents",...n.style},ref:i},r),o)});WNe.displayName="MenuPortal";var KNe=ze(gw),YNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(KNe,{...e},n=>Y.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));YNe.displayName="MenuItems";var XNe=ze(yw),QNe=Y.forwardRef(({children:t,...e},r)=>Y.createElement(XNe,{...e},n=>Y.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));QNe.displayName="MenuItem";var ZNe=ze(ww,{events:["onWillTrigger","onTrigger"]}),G2=Y.forwardRef(({children:t,...e},r)=>Y.createElement(ZNe,{...e,ref:r},n=>Y.createElement(ke.div,{...n},t)));G2.displayName="Gesture";var JNe=ze(kw),ete=Y.forwardRef(({children:t,...e},r)=>Y.createElement(JNe,{...e},(n,i)=>Y.createElement(tte,{...n,instance:i,ref:st(n.ref,r)},t)));ete.displayName="Time";var tte=Y.forwardRef(({instance:t,children:e,...r},n)=>{let{timeText:i}=t.$state,s=Ut(i);return Y.createElement(ke.div,{...r,ref:n},s,e)});tte.displayName="TimeText";function W2(){return yg()?.player||null}co();var e4e=ze(zx,{events:["onChange"]}),rte=Pe.forwardRef(({style:t,children:e,...r},n)=>Pe.createElement(e4e,{...r},i=>Pe.createElement(ke.div,{...i,style:{display:"contents",...t},ref:st(i.ref,n)},e)));rte.displayName="MediaAnnouncer";var t4e=ze(qx),nte=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(t4e,{...e},n=>Pe.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));nte.displayName="Controls";var r4e=ze(Hx),ite=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(r4e,{...e},n=>Pe.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));ite.displayName="ControlsGroup";var gr=Object.freeze({__proto__:null,Group:ite,Root:nte}),n4e=ze(tw);function i4e({children:t,...e}){return Pe.createElement(n4e,{...e},t)}i4e.displayName="Tooltip";var s4e=ze(rw),a4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(s4e,{...e},n=>Pe.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));a4e.displayName="TooltipTrigger";var o4e=ze(nw),l4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(o4e,{...e},n=>Pe.createElement(ke.div,{...n,ref:st(n.ref,r)},t)));l4e.displayName="TooltipContent";var c4e=ze(Jx,{domEventsRegex:/^onMedia/}),ste=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(c4e,{...e},n=>Pe.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));ste.displayName="GoogleCastButton";var u4e=ze(lw,{events:xp,domEventsRegex:/^onMedia/}),d4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(u4e,{...e,ref:r},n=>Pe.createElement(ke.div,{...n},t)));d4e.displayName="QualitySlider";var f4e=ze(aw,{events:xp,domEventsRegex:/^onMedia/}),p4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(f4e,{...e,ref:r},n=>Pe.createElement(ke.div,{...n},t)));p4e.displayName="AudioGainSlider";var h4e=ze(ow,{events:xp,domEventsRegex:/^onMedia/}),m4e=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(h4e,{...e,ref:r},n=>Pe.createElement(ke.div,{...n},t)));m4e.displayName="SpeedSlider";var ate=Pe.forwardRef(({children:t,...e},r)=>{let n=Wi("title");return Pe.createElement(ke.span,{...e,ref:r},n,t)});ate.displayName="Title";function ote(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 lte(t){let e=yg(),[r,n]=Pe.useState(null);return Pe.useEffect(()=>Sw(e.textTracks,t,n),[t]),r}function K2(){let t=lte("chapters");return ote(t)[0]?.text||""}var cte=Pe.forwardRef(({defaultText:t="",children:e,...r},n)=>{let i=K2();return Pe.createElement(ke.span,{...r,ref:n},i||t,e)});cte.displayName="ChapterTitle";var g4e=ze(xw),Y2=Pe.forwardRef(({children:t,...e},r)=>Pe.createElement(g4e,{...e,ref:r},n=>Pe.createElement(ke.div,{...n},t)));Y2.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));co();var X2=Z(Te(),1),pF=X2.forwardRef((t,e)=>{let{width:r,height:n,size:i=null,paths:s,...a}=t;return X2.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}})});pF.displayName="VidstackIcon";lo();var pbt=Z(Rf(),1),y4e=Symbol(0),ute=class t{constructor(e,r,n,i,s){this.logger=e,this.level=r,this.title=n,this.root=i,this.parent=s}[y4e]=!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 v4e=[1,1.25,1.5,1.75,2,2.5,3,4],hF=class extends je{static props={normalLabel:"Disabled",gains:v4e};#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 Ux,this.#r.onValueChange=this.#o.bind(this)}onSetup(){this.#e=Et(),ao(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})}},mF=hF.prototype;mt(mF,"value");mt(mF,"disabled");$r(mF,"getOptions");var b4e=["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"],x4e=ze(vp,{events:b4e,eventsRegex:/^onHls/,domEventsRegex:/^onMedia/}),gF=Le.forwardRef(({aspectRatio:t,children:e,...r},n)=>Le.createElement(x4e,{...r,src:r.src,ref:n,style:{aspectRatio:t,...r.style}},i=>Le.createElement(ke.div,{...i},e)));gF.displayName="MediaPlayer";var w4e=ze(_2),yF=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(w4e,{...i,loaders:a,ref:s},(o,l)=>Le.createElement("div",{...o},Le.createElement(dte,{provider:l,mediaProps:n,iframeProps:r}),e))});yF.displayName="MediaProvider";function dte({provider:t,mediaProps:e,iframeProps:r}){let{sources:n,crossOrigin:i,poster:s,remotePlaybackInfo:a,nativeControls:o,viewType:l}=rc($u),{loader:c}=t.$state,{$provider:u,$providerSetup:d}=yg(),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(()=>(QD(),RZ)).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(pF,{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)}},Bee(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}dte.displayName="MediaOutlet";function k4e(t){let e=yg(),r=Le.useMemo(()=>new Kn(t),Object.values(t));return Le.useEffect(()=>(e.textTracks.add(r),()=>void e.textTracks.remove(r)),[r]),r}function S4e({lang:t,...e}){return k4e({language:t,...e}),null}S4e.displayName="Track";var C4e=ze(O2),T4e=Le.forwardRef(({children:t,...e},r)=>Le.createElement(C4e,{...e},n=>Le.createElement(ke.button,{...n,ref:st(n.ref,r)},t)));T4e.displayName="ToggleButton";var E4e=ze(D2),I4e=Le.forwardRef(({children:t,...e},r)=>Le.createElement(E4e,{src:e.asChild&&Le.isValidElement(t)?t.props.src:void 0,...e},(n,i)=>Le.createElement(fte,{...n,instance:i,ref:st(n.ref,r)},t)));I4e.displayName="Poster";var fte=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(ke.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)});fte.displayName="PosterImg";var A4e=Le.forwardRef(({children:t,...e},r)=>Le.createElement(ke.div,{translate:"yes","aria-live":"off","aria-atomic":"true",...e,ref:r},t));A4e.displayName="Caption";var P4e=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(ke.span,{...t,"data-part":"cue",dangerouslySetInnerHTML:{__html:n?.text||""},ref:e})});P4e.displayName="CaptionText";var MCt=Z(Rf(),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 kte(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=kte(i.content,s.content,r+1);if(a!=null)return a}r+=i.nodeSize}}function Ste(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=Ste(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 kte(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return Ste(this,e,r,n)}findIndex(e,r=-1){if(e==0)return Q2(0,e);if(e==this.size)return Q2(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?Q2(n+1,a):Q2(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 vF={index:0,offset:0};function Q2(t,e){return vF.index=t,vF.offset=e,vF}function J2(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(!J2(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!J2(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&&J2(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 Cp=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=Tte(this.content,e+this.openStart,r);return n&&new t(n,this.openStart,this.openEnd)}removeBetween(e,r){return new t(Cte(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 Cte(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(Cte(s.content,e-i-1,r-i-1)))}function Tte(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=Tte(a.content,e-s-1,r);return o&&t.replaceChild(i,a.copy(o))}function R4e(t,e,r){if(r.openStart>t.depth)throw new Cp("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new Cp("Inconsistent open depths");return Ete(t,e,r,0)}function Ete(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=Ete(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 Sp(a,o.cut(0,t.parentOffset).append(r.content).append(o.cut(e.parentOffset)))}else{let{start:a,end:o}=L4e(r,t);return Sp(s,Ate(t,a,o,e,n))}else return Sp(s,eI(t,e,n))}function Ite(t,e){if(!e.type.compatibleContent(t.type))throw new Cp("Cannot join "+e.type.name+" onto "+t.type.name)}function xF(t,e,r){let n=t.node(r);return Ite(n,e.node(r)),n}function kp(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 Ow(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&&(kp(t.nodeAfter,n),s++));for(let o=s;o<a;o++)kp(i.child(o),n);e&&e.depth==r&&e.textOffset&&kp(e.nodeBefore,n)}function Sp(t,e){return t.type.checkContent(e),t.copy(e)}function Ate(t,e,r,n,i){let s=t.depth>i&&xF(t,e,i+1),a=n.depth>i&&xF(r,n,i+1),o=[];return Ow(null,t,i,o),s&&a&&e.index(i)==r.index(i)?(Ite(s,a),kp(Sp(s,Ate(t,e,r,n,i+1)),o)):(s&&kp(Sp(s,eI(t,e,i+1)),o),Ow(e,r,i,o),a&&kp(Sp(a,eI(r,n,i+1)),o)),Ow(n,null,i,o),new se(o)}function eI(t,e,r){let n=[];if(Ow(null,t,r,n),t.depth>r){let i=xF(t,e,r+1);kp(Sp(i,eI(t,e,r+1)),n)}return Ow(e,null,r,n),new se(n)}function L4e(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 tI=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 kF(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=pte.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 pte.set(e,n=new wF);let i=n.elts[n.i]=t.resolve(e,r);return n.i=(n.i+1)%M4e,i}},wF=class{constructor(){this.elts=[],this.i=0}},M4e=12,pte=new WeakMap,kF=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)}},_4e=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&&J2(this.attrs,r||e.defaultAttrs||_4e)&&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 R4e(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 tI.resolveCached(this,e)}resolveNoCache(e){return tI.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()+")"),Pte(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 SF=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):Pte(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 Pte(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}var Tp=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new CF(e,r);if(n.next==null)return t.empty;let i=Rte(n);n.next&&n.err("Unexpected trailing text");let s=j4e(V4e(i));return $4e(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(`
|
|
`)}};Tp.empty=new Tp(!0);var CF=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 Rte(t){let e=[];do e.push(O4e(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function O4e(t){let e=[];do e.push(D4e(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function D4e(t){let e=B4e(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=N4e(t,e);else break;return e}function hte(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function N4e(t,e){let r=hte(t),n=r;return t.eat(",")&&(t.next!="}"?n=hte(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function F4e(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 B4e(t){if(t.eat("(")){let e=Rte(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=F4e(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 V4e(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 Lte(t,e){return e-t}function mte(t,e){let r=[];return n(e),r.sort(Lte);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 j4e(t){let e=Object.create(null);return r(mte(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]);mte(t,l).forEach(u=>{c||i.push([o,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[n.join(",")]=new Tp(n.indexOf(t.length-1)>-1);for(let a=0;a<i.length;a++){let o=i[a][1].sort(Lte);s.next.push({type:i[a][0],next:e[o.join(",")]||r(o)})}return s}}function $4e(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 Mte(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 _te(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 Ote(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 Dte(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new TF(t,n,e[n]);return r}var rI=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=Dte(e,n.attrs),this.defaultAttrs=Mte(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==Tp.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:_te(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){Ote(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 U4e(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 TF=class{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?U4e(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Nw=class t{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=Dte(e,i.attrs),this.excluded=null;let s=Mte(this.attrs);this.instance=s?new ct(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ct(this,_te(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){Ote(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},nI=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=rI.compile(this.spec.nodes,this),this.marks=Nw.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]=Tp.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?gte(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==""?[]:gte(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 rI){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 SF(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 gte(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 z4e(t){return t.tag!=null}function q4e(t){return t.style!=null}var Ep=class t{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(z4e(i))this.tags.push(i);else if(q4e(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 iI(this,r,!1);return n.addAll(e,ct.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new iI(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(W4e(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=vte(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=vte(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)))}},Nte={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},H4e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Fte={ol:!0,ul:!0},Fw=1,EF=2,Dw=4;function yte(t,e,r){return e!=null?(e?Fw:0)|(e==="full"?EF:0):t&&t.whitespace=="pre"?Fw|EF:r&~Dw}var vg=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&Dw?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&Fw)){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&&!Nte.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},iI=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=yte(null,r.preserveWhitespace,0)|(n?Dw:0);i?s=new vg(i.type,i.attrs,ct.none,!0,r.topMatch||i.type.contentMatch,a):n?s=new vg(null,null,ct.none,!0,null,a):s=new vg(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&EF?"full":this.localPreserveWS||(i.options&Fw)>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;Fte.hasOwnProperty(a)&&this.parser.normalizeLists&&G4e(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(l?l.ignore:H4e.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(Nte.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):bte(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=yte(e,s,a.options);a.options&Dw&&a.content.length==0&&(o|=Dw);let l=ct.none;return n=n.filter(c=>(a.type?a.type.allowsMarkType(c.type):bte(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new vg(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|=Fw)}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 G4e(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Fte.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function W4e(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function vte(t){let e={};for(let r in t)e[r]=t[r];return e}function bte(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=bF(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}=Z2(bF(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&&Z2(bF(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return Z2(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=xte(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return xte(e.marks)}};function xte(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function bF(t){return t.document||window.document}var wte=new WeakMap;function K4e(t){let e=wte.get(t);return e===void 0&&wte.set(t,e=Y4e(t)),e}function Y4e(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 Z2(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=K4e(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}=Z2(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 Vte=65535,jte=Math.pow(2,16);function X4e(t,e){return t+e*jte}function Bte(t){return t&Vte}function Q4e(t){return(t-(t&Vte))/jte}var $te=1,Ute=2,sI=4,zte=8,jw=class{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&zte)>0}get deletedBefore(){return(this.delInfo&($te|sI))>0}get deletedAfter(){return(this.delInfo&(Ute|sI))>0}get deletedAcross(){return(this.delInfo&sI)>0}},hc=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=Bte(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+Q4e(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:X4e(o/3,e-l),m=e==l?Ute:e==d?$te:sI;return(r<0?e!=l:e!=d)&&(m|=zte),new jw(p,m,h)}i+=u-c}return n?e+i:new jw(e+i,0,null)}touches(e,r){let n=0,i=Bte(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])}};hc.empty=new hc([]);var $w=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 jw(e,i,null)}},IF=Object.create(null),mn=class{getMap(){return hc.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=IF[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 IF)throw new RangeError("Duplicate use of step JSON ID "+e);return IF[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 Cp)return t.fail(s.message);throw s}}};function MF(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(MF(s.content,e,s))),s.isInline&&(s=e(s,r,i)),n.push(s)}return se.fromArray(n)}var Uw=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(MF(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 Ip(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",Uw);var Ip=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(MF(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 Uw(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",Ip);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.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 qw(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",zw);var qw=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 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:"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",qw);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&&RF(e,this.from,this.to)?_n.fail("Structure replace would overwrite content"):_n.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new hc([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&&(RF(e,this.from,this.gapFrom)||RF(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 hc([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 RF(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 Z4e(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 Ip(f,p,d[m])));o&&o.to==f?o.to=p:s.push(o=new Uw(f,p,n))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function J4e(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 Nw){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 Ip(a.from,a.to,a.style)))}function _F(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 Ip(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 eFe(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function cI(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||!eFe(i,s,a))break}return null}function tFe(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 rFe(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 nFe(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)&&iFe(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&&Hte(t,a,o,s),_F(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&&qte(t,a,o,s),!1}})}function qte(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 Hte(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 iFe(t,e,r){let n=t.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,r)}function sFe(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 mc(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 aFe(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 OF(t,e){let r=t.resolve(e),n=r.index();return lFe(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function oFe(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 lFe(t,e){return!!(t&&e&&!t.isLeaf&&oFe(t,e))}function cFe(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);Hte(t,u.node(),u.before(),o)}a.inlineContent&&_F(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);qte(t,u.node(),u.before(),t.steps.length)}return t}function uFe(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 uI(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 Hw(t,e,r=e,n=oe.empty){if(e==r&&!n.size)return null;let i=t.resolve(e),s=t.resolve(r);return Gte(i,s,n)?new Ki(e,r,n):new LF(i,s,n).fit()}function Gte(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}var LF=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=AF(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=AF(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=AF(e,r);if(i.childCount<=1&&r>0){let s=e.size-r<=r+i.size;this.unplaced=new oe(Bw(e,r-1,1),r-1,s?r-1:n)}else this.unplaced=new oe(Bw(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(Wte(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=Vw(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(Bw(a.content,e-1,1),e-1,p<0?a.openEnd:e-1):new oe(Bw(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||!PF(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=PF(e,r,i,n,s);if(a){for(let o=r-1;o>=0;o--){let{match:l,type:c}=this.frontier[o],u=PF(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=Vw(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=Vw(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=Vw(this.placed,this.frontier.length,r))}};function Bw(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Bw(t.firstChild.content,e-1,r)))}function Vw(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Vw(t.lastChild.content,e-1,r)))}function AF(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function Wte(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,Wte(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 PF(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&&!dFe(r,s.content,a)?o:null}function dFe(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function fFe(t){return t.spec.defining||t.spec.definingForContent}function pFe(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let i=t.doc.resolve(e),s=t.doc.resolve(r);if(Gte(i,s,n))return t.step(new Ki(e,r,n));let a=Yte(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=fFe(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(Kte(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 Kte(t,e,r,n,i){if(e<r){let s=t.firstChild;t=t.replaceChild(0,s.copy(Kte(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 hFe(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let i=uFe(t.doc,e,n.type);i!=null&&(e=r=i)}t.replaceRange(e,r,new oe(se.from(n),0,0))}function mFe(t,e,r){let n=t.doc.resolve(e),i=t.doc.resolve(r),s=Yte(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 Yte(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 aI=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 hc.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",aI);var oI=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 hc.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",oI);var bg=class extends Error{};bg=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};bg.prototype=Object.create(Error.prototype);bg.prototype.constructor=bg;bg.prototype.name="TransformError";var lI=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new $w}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new bg(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=Hw(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 pFe(this,e,r,n),this}replaceRangeWith(e,r,n){return hFe(this,e,r,n),this}deleteRange(e,r){return mFe(this,e,r),this}lift(e,r){return tFe(this,e,r),this}join(e,r=1){return cFe(this,e,r),this}wrap(e,r){return rFe(this,e,r),this}setBlockType(e,r=e,n,i=null){return nFe(this,e,r,n,i),this}setNodeMarkup(e,r,n=null,i){return sFe(this,e,r,n,i),this}setNodeAttribute(e,r,n){return this.step(new aI(e,r,n)),this}setDocAttribute(e,r){return this.step(new oI(e,r)),this}addNodeMark(e,r){return this.step(new zw(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 qw(e,r)),this}split(e,r=1,n){return aFe(this,e,r,n),this}addMark(e,r,n){return Z4e(this,e,r,n),this}removeMark(e,r,n){return J4e(this,e,r,n),this}clearIncompatible(e,r,n){return _F(this,e,r,n),this}};var DF=Object.create(null),Fe=class{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new wg(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&&Zte(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),Zte(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let i=e.parent.inlineContent?new Ze(e):xg(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?xg(e.node(0),e.node(s),e.before(s+1),e.index(s),r,n):xg(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 xg(e,e,0,0,1)||new Xn(e)}static atEnd(e){return xg(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=DF[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 DF)throw new RangeError("Duplicate use of selection JSON ID "+e);return DF[e]=r,r.prototype.jsonID=e,r}getBookmark(){return Ze.between(this.$anchor,this.$head).getBookmark()}};Fe.prototype.visible=!0;var wg=class{constructor(e,r){this.$from=e,this.$to=r}},Xte=!1;function Qte(t){!Xte&&!t.parent.inlineContent&&(Xte=!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){Qte(e),Qte(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 fI(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 fI=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 FF(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 FF=class t{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new fI(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 gFe}};Fe.jsonID("all",Xn);var gFe={map(){return this},resolve(t){return new Xn(t)}};function xg(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=xg(t,o,r+i,i<0?o.childCount:0,i,s);if(l)return l}r+=o.nodeSize*i}return null}function Zte(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 Jte=1,dI=2,ere=4,BF=class extends lI{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|Jte)&~dI,this.storedMarks=null,this}get selectionSet(){return(this.updated&Jte)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=dI,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&dI)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~dI,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|=ere,this}get scrolledIntoView(){return(this.updated&ere)>0}};function tre(t,e){return!e||!t?t:t.bind(e)}var Ap=class{constructor(e,r,n){this.name=e,this.init=tre(r.init,n),this.apply=tre(r.apply,n)}},yFe=[new Ap("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ap("selection",{init(t,e){return t.selection||Fe.atStart(e.doc)},apply(t){return t.selection}}),new Ap("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new Ap("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],Gw=class{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yFe.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 Ap(n.key,n.spec.state,n))})}},Ww=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 BF(this)}static create(e){let r=new Gw(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 Gw(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 Gw(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 rre(t,e,r){for(let n in t){let i=t[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=rre(i,e,{})),r[n]=i}return r}var Ve=class{constructor(e){this.spec=e,this.props={},e.props&&rre(e.props,this,this.props),this.key=e.key?e.key.key:nre("plugin")}getState(e){return e[this.key]}},NF=Object.create(null);function nre(t){return t in NF?t+"$"+ ++NF[t]:(NF[t]=0,t+"$")}var ut=class{constructor(e="key"){this.key=nre(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},Eg=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},qF=null,yc=function(t,e,r){let n=qF||(qF=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},vFe=function(){qF=null},Dp=function(t,e,r,n){return r&&(ire(t,e,r,n,-1)||ire(t,e,r,n,1))},bFe=/^(img|br|input|textarea|hr)$/i;function ire(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:ka(t))){let s=t.parentNode;if(!s||s.nodeType!=1||e1(t)||bFe.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?ka(t):0}else return!1}}function ka(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function xFe(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=ka(t)}else if(t.parentNode&&!e1(t))e=On(t),t=t.parentNode;else return null}}function wFe(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&&!e1(t))e=On(t)+1,t=t.parentNode;else return null}}function kFe(t,e,r){for(let n=e==0,i=e==ka(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==ka(t)}}function e1(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 CI=function(t){return t.focusNode&&Dp(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Pp(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function SFe(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function CFe(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:Math.min(ka(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:Math.min(ka(n.startContainer),n.startOffset)}}}var sl=typeof navigator<"u"?navigator:null,sre=typeof document<"u"?document:null,Xu=sl&&sl.userAgent||"",HF=/Edge\/(\d+)/.exec(Xu),Fre=/MSIE \d/.exec(Xu),GF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xu),Yi=!!(Fre||GF||HF),Ku=Fre?document.documentMode:GF?+GF[1]:HF?+HF[1]:0,go=!Yi&&/gecko\/(\d+)/i.test(Xu);go&&+(/Firefox\/(\d+)/.exec(Xu)||[0,0])[1];var WF=!Yi&&/Chrome\/(\d+)/.exec(Xu),Zn=!!WF,Bre=WF?+WF[1]:0,wi=!Yi&&!!sl&&/Apple Computer/.test(sl.vendor),Ig=wi&&(/Mobile\/\w+/.test(Xu)||!!sl&&sl.maxTouchPoints>2),wa=Ig||(sl?/Mac/.test(sl.platform):!1),TFe=sl?/Win/.test(sl.platform):!1,vc=/Android \d/.test(Xu),t1=!!sre&&"webkitFontSmoothing"in sre.documentElement.style,EFe=t1?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function IFe(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 gc(t,e){return typeof t=="number"?t:t[e]}function AFe(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 are(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=Eg(a);continue}let o=a,l=o==s.body,c=l?IFe(s):AFe(o),u=0,d=0;if(e.top<c.top+gc(n,"top")?d=-(c.top-e.top+gc(i,"top")):e.bottom>c.bottom-gc(n,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+gc(i,"top")-c.top:e.bottom-c.bottom+gc(i,"bottom")),e.left<c.left+gc(n,"left")?u=-(c.left-e.left+gc(i,"left")):e.right>c.right-gc(n,"right")&&(u=e.right-c.right+gc(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:Eg(a)}}function PFe(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:Vre(t.dom)}}function Vre(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=Eg(n));return e}function RFe({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;jre(r,n==0?0:n-e)}function jre(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 kg=null;function LFe(t){if(t.setActive)return t.setActive();if(kg)return t.focus(kg);let e=Vre(t);t.focus(kg==null?{get preventScroll(){return kg={preventScroll:!0},!0}}:void 0),kg||(kg=!1,jre(e,0))}function $re(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=yc(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?MFe(r,i):!r||n&&r.nodeType==1?{node:t,offset:s}:$re(r,i)}function MFe(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=Hu(n,1);if(s.top!=s.bottom&&l5(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function l5(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function _Fe(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function OFe(t,e,r){let{node:n,offset:i}=$re(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 DFe(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 Ure(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(l5(e,c))return Ure(a,e,c)}}if((s=(s+1)%n)==i)break}return t}function NFe(t,e){let r=t.dom.ownerDocument,n,i=0,s=CFe(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(!l5(e,c)||(a=Ure(t.dom,e,c),!a))return null}if(wi)for(let c=a;n&&c;c=Eg(c))c.draggable&&(n=void 0);if(a=_Fe(a,e),n){if(go&&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;t1&&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=DFe(t,n,i,e))}o==null&&(o=OFe(t,a,e));let l=t.docView.nearestDesc(a,!0);return{pos:o,inside:l?l.posAtStart-l.border:-1}}function ore(t){return t.top<t.bottom||t.left<t.right}function Hu(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(ore(n))return n}return Array.prototype.find.call(r,ore)||t.getBoundingClientRect()}var FFe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function zre(t,e,r){let{node:n,offset:i,atom:s}=t.docView.domFromPos(e,r<0?-1:1),a=t1||go;if(n.nodeType==3)if(a&&(FFe.test(n.nodeValue)||(r<0?!i:i==n.nodeValue.length))){let l=Hu(yc(n,i,i),r);if(go&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let c=Hu(yc(n,i-1,i-1),-1);if(c.top==l.top){let u=Hu(yc(n,i,i+1),-1);if(u.top!=l.top)return Kw(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++,Kw(Hu(yc(n,l,c),u),u<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(r<0||i==ka(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return VF(l.getBoundingClientRect(),!1)}if(s==null&&i<ka(n)){let l=n.childNodes[i];if(l.nodeType==1)return VF(l.getBoundingClientRect(),!0)}return VF(n.getBoundingClientRect(),r>=0)}if(s==null&&i&&(r<0||i==ka(n))){let l=n.childNodes[i-1],c=l.nodeType==3?yc(l,ka(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Kw(Hu(c,1),!1)}if(s==null&&i<ka(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?yc(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Kw(Hu(c,-1),!0)}return Kw(Hu(n.nodeType==3?yc(n):n,-r),r>=0)}function Kw(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 VF(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 qre(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 BFe(t,e,r){let n=e.selection,i=r=="up"?n.$from:n.$to;return qre(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=zre(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=yc(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 VFe=/[\u0590-\u08ac]/;function jFe(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?!VFe.test(n.parent.textContent)||!o.modify?r=="left"||r=="backward"?s:a:qre(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 lre=null,cre=null,ure=!1;function $Fe(t,e,r){return lre==e&&cre==r?ure:(lre=e,cre=r,ure=r=="up"||r=="down"?BFe(t,e,r):jFe(t,e,r))}var Sa=0,dre=1,Rp=2,al=3,Np=class{constructor(e,r,n,i){this.parent=e,this.children=r,this.dom=n,this.contentDOM=i,this.dirty=Sa,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 mI){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 pI&&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((go||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(go&&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)&&Dp(o.node,o.offset,u.anchorNode,u.anchorOffset)&&Dp(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?Rp:dre,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?Rp:al}n=a}this.dirty=Rp}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?Rp:dre;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}},pI=class extends Np{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==Sa&&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}},KF=class extends Np{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}},Ag=class t extends Np{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!=Sa){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=Sa}}slice(e,r,n){let i=t.create(this.parent,this.mark,!0,n),s=this.children,a=this.size;r<a&&(s=ZF(s,r,a,n)),e>0&&(s=ZF(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()}},Yu=class t extends Np{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=Wre(u,n,r),c?l=new YF(e,r,n,i,u,d||null,f,c,s,a+1):r.isText?new hI(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==Sa&&e.eq(this.node)&&gI(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 QF(this,a&&a.node,e);HFe(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==Rp)&&(a&&this.protectLocalComposition(e,a),Hre(this.contentDOM,this.children,e),Ig&&GFe(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=WFe(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 KF(this,s,r,i);e.input.compositionNodes.push(a),this.children=ZF(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=Sa}updateOuterDeco(e){if(gI(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Gre(this.dom,this.nodeDOM,XF(this.outerDeco,this.node,r),XF(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 fre(t,e,r,n,i){Wre(n,e,t);let s=new Yu(void 0,t,e,r,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}var hI=class t extends Yu{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!=Sa&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=Sa||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=Sa,!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}},mI=class extends Np{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Sa&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},YF=class extends Yu{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 Hre(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=pre(n),i=!0;n=n.nextSibling}else i=!0,t.insertBefore(o,n);if(a instanceof Ag){let l=n?n.previousSibling:t.lastChild;Hre(a.contentDOM,a.children,r),n=l?l.nextSibling:t.firstChild}}for(;n;)n=pre(n),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}var Yw=function(t){t&&(this.nodeName=t)};Yw.prototype=Object.create(null);var Lp=[new Yw];function XF(t,e,r){if(t.length==0)return Lp;let n=r?Lp[0]:new Yw,i=[n];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&i.push(n=new Yw(a.nodeName));for(let o in a){let l=a[o];l!=null&&(r&&i.length==1&&i.push(n=new Yw(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 Gre(t,e,r,n){if(r==Lp&&n==Lp)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=Lp[0]),i=l}UFe(i,o||Lp[0],a)}return i}function UFe(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 Wre(t,e,r){return Gre(t,t,Lp,XF(e,r,t.nodeType!=1))}function gI(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 pre(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var QF=class{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=zFe(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=Sa,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=Ag.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=Rp),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 Yu){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&&gI(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=Rp,d.updateChildren(i,a+1),d.dirty=Sa),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)||!gI(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let o=Yu.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=Yu.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 pI(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 Ag;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof hI)||/\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 mI(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 zFe(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 Ag)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 qFe(t,e){return t.type.side-e.type.side}function HFe(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(qFe);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 GFe(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 WFe(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 ZF(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 c5(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(CI(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&&kFe(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=u5(t,u,o,d)}return c}function Kre(t){return t.editable?t.hasFocus():Xre(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function bc(t,e=!1){let r=t.state.selection;if(Yre(t,r),!!Kre(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Zn){let n=t.domSelectionRange(),i=t.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&Dp(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)YFe(t);else{let{anchor:n,head:i}=r,s,a;hre&&!(r instanceof Ze)&&(r.$from.parent.inlineContent||(s=mre(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(a=mre(t,r.to))),t.docView.setSelection(n,i,t,e),hre&&(s&&gre(s),a&&gre(a)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&KFe(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}var hre=wi||Zn&&Bre<63;function mre(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 jF(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return jF(i);if(s)return jF(s)}}function jF(t){return t.contentEditable="true",wi&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function gre(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function KFe(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(()=>{(!Kre(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function YFe(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&&Ku<=11&&(n.disabled=!0,n.disabled=!1)}function Yre(t,e){if(e instanceof _e){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(yre(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else yre(t)}function yre(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function u5(t,e,r,n){return t.someProp("createSelectionBetween",i=>i(t,e,r))||Ze.between(e,r,n)}function vre(t){return t.editable&&!t.hasFocus()?!1:Xre(t)}function Xre(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 XFe(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return Dp(e.node,e.offset,r.anchorNode,r.anchorOffset)}function JF(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 Gu(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function bre(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 Gu(t,new Ze(n.$anchor,a))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=JF(t.state,e);return i&&i instanceof _e?Gu(t,i):!1}else if(!(wa&&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)?Gu(t,new _e(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):t1?Gu(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 Gu(t,new Ze(e>0?n.$to:n.$from));{let i=JF(t.state,e);return i?Gu(t,i):!1}}}function yI(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Xw(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Sg(t,e){return e<0?QFe(t):ZFe(t)}function QFe(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i,s,a=!1;for(go&&r.nodeType==1&&n<yI(r)&&Xw(r.childNodes[n],-1)&&(a=!0);;)if(n>0){if(r.nodeType!=1)break;{let o=r.childNodes[n-1];if(Xw(o,-1))i=r,s=--n;else if(o.nodeType==3)r=o,n=r.nodeValue.length;else break}}else{if(Qre(r))break;{let o=r.previousSibling;for(;o&&Xw(o,-1);)i=r.parentNode,s=On(o),o=o.previousSibling;if(o)r=o,n=yI(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}a?e5(t,r,n):i&&e5(t,i,s)}function ZFe(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let i=yI(r),s,a;for(;;)if(n<i){if(r.nodeType!=1)break;let o=r.childNodes[n];if(Xw(o,1))s=r,a=++n;else break}else{if(Qre(r))break;{let o=r.nextSibling;for(;o&&Xw(o,1);)s=o.parentNode,a=On(o)+1,o=o.nextSibling;if(o)r=o,n=0,i=yI(r);else{if(r=r.parentNode,r==t.dom)break;n=i=0}}}s&&e5(t,s,a)}function Qre(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function JFe(t,e){for(;t&&e==t.childNodes.length&&!e1(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 e5e(t,e){for(;t&&!e&&!e1(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 e5(t,e,r){if(e.nodeType!=3){let s,a;(a=JFe(e,r))?(e=a,r=0):(s=e5e(e,r))&&(e=s,r=s.nodeValue.length)}let n=t.domSelection();if(!n)return;if(CI(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&&bc(t)},50)}function xre(t,e){let r=t.state.doc.resolve(e);if(!(Zn||TFe)&&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 wre(t,e,r){let n=t.state.selection;if(n instanceof Ze&&!n.empty||r.indexOf("s")>-1||wa&&r.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=JF(t.state,e);if(a&&a instanceof _e)return Gu(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?Gu(t,o):!1}return!1}function kre(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 Sre(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function t5e(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;Sre(t,n,"true"),setTimeout(()=>Sre(t,n,"false"),20)}return!1}function r5e(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function n5e(t,e){let r=e.keyCode,n=r5e(e);if(r==8||wa&&r==72&&n=="c")return kre(t,-1)||Sg(t,-1);if(r==46&&!e.shiftKey||wa&&r==68&&n=="c")return kre(t,1)||Sg(t,1);if(r==13||r==27)return!0;if(r==37||wa&&r==66&&n=="c"){let i=r==37?xre(t,t.state.selection.from)=="ltr"?-1:1:-1;return bre(t,i,n)||Sg(t,i)}else if(r==39||wa&&r==70&&n=="c"){let i=r==39?xre(t,t.state.selection.from)=="ltr"?1:-1:1;return bre(t,i,n)||Sg(t,i)}else{if(r==38||wa&&r==80&&n=="c")return wre(t,-1,n)||Sg(t,-1);if(r==40||wa&&r==78&&n=="c")return t5e(t)||wre(t,1,n)||Sg(t,1);if(n==(wa?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function d5(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=nne(),l=o.createElement("div");l.appendChild(a.serializeFragment(n,{document:o}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=rne[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 Zre(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=o5e(r),t1&&l5e(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")||Ep.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!i5e.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)o=c5e(Cre(o,+u[1],+u[2]),u[4]);else if(o=oe.maxOpen(s5e(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=Cre(o,d,f)}return t.someProp("transformPasted",d=>{o=d(o,t)}),o}var i5e=/^(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 s5e(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&&ene(l,s,o,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=tne(a[a.length-1],s.length));let u=Jre(o,l);a.push(u),i=i.matchType(u.type),s=l}}),a)return se.from(a)}return t}function Jre(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,se.from(t));return t}function ene(t,e,r,n,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=ene(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(Jre(r,t,i+1))))}}function tne(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,tne(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(se.empty,!0);return t.copy(r.append(n))}function t5(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=t5(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 Cre(t,e,r){return e<t.openStart&&(t=new oe(t5(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new oe(t5(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}var rne={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Tre=null;function nne(){return Tre||(Tre=document.implementation.createHTMLDocument("title"))}var $F=null;function a5e(t){let e=window.trustedTypes;return e?($F||($F=e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),$F.createHTML(t)):t}function o5e(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=nne().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),i;if((i=n&&rne[n[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=a5e(t),i)for(let s=0;s<i.length;s++)r=r.querySelector(i[s])||r;return r}function l5e(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 c5e(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={},u5e={touchstart:!0,touchmove:!0},r5=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 d5e(t){for(let e in ki){let r=ki[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{p5e(t,n)&&!f5(t,n)&&(t.editable||!(n.type in Si))&&r(t,n)},u5e[e]?{passive:!0}:void 0)}wi&&t.dom.addEventListener("input",()=>null),n5(t)}function Wu(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function f5e(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 n5(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>f5(t,n))})}function f5(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function p5e(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 h5e(t,e){!f5(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,!sne(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(vc&&Zn&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),Ig&&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,Pp(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||n5e(t,r)?r.preventDefault():Wu(t,"key")};Si.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Si.keypress=(t,e)=>{let r=e;if(sne(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||wa&&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 TI(t){return{left:t.clientX,top:t.clientY}}function m5e(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function p5(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 Tg(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 g5e(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&_e.isSelectable(n)?(Tg(t,new _e(r),"pointer"),!0):!1}function y5e(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?(Tg(t,_e.create(t.state.doc,i),"pointer"),!0):!1}function v5e(t,e,r,n,i){return p5(t,"handleClickOn",e,r,n)||t.someProp("handleClick",s=>s(t,e,n))||(i?y5e(t,r):g5e(t,r))}function b5e(t,e,r,n){return p5(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",i=>i(t,e,n))}function x5e(t,e,r,n){return p5(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",i=>i(t,e,n))||w5e(t,r,n)}function w5e(t,e,r){if(r.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(Tg(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)Tg(t,Ze.create(n,o+1,o+1+a.content.size),"pointer");else if(_e.isSelectable(a))Tg(t,_e.create(n,o),"pointer");else continue;return!0}}function h5(t){return vI(t)}var ine=wa?"metaKey":"ctrlKey";ki.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=h5(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&m5e(r,t.input.lastClick)&&!r[ine]&&(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(TI(r));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new i5(t,a,r,!!n)):(s=="doubleClick"?b5e:x5e)(t,a.pos,a.inside,r)?r.preventDefault():Wu(t,"pointer"))};var i5=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[ine],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&&go&&!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)),Wu(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(()=>bc(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(TI(e))),this.updateAllowDefault(e),this.allowDefault||!r?Wu(this.view,"pointer"):v5e(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)?(Tg(this.view,Fe.near(this.view.state.doc.resolve(r.pos)),"pointer"),e.preventDefault()):Wu(this.view,"pointer")}move(e){this.updateAllowDefault(e),Wu(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(),h5(t),Wu(t,"pointer")};ki.touchmove=t=>{t.input.lastTouch=Date.now(),Wu(t,"pointer")};ki.contextmenu=t=>h5(t);function sne(t,e){return t.composing?!0:wi&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var k5e=vc?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(),vI(t,!0),t.markCursor=null;else if(vI(t,!e.selection.empty),go&&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}ane(t,k5e)};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++,ane(t,20))};function ane(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>vI(t),e))}function one(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=C5e());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function S5e(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=xFe(e.focusNode,e.focusOffset),n=wFe(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 C5e(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function vI(t,e=!1){if(!(vc&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),one(t),e||t.docView&&t.docView.dirty){let r=c5(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 T5e(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 Qw=Yi&&Ku<15||Ig&&EFe<604;ki.copy=Si.cut=(t,e)=>{let r=e,n=t.state.selection,i=r.type=="cut";if(n.empty)return;let s=Qw?null:r.clipboardData,a=n.content(),{dom:o,text:l}=d5(t,a);s?(r.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",l)):T5e(t,o),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function E5e(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function I5e(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?Zw(t,n.value,null,i,e):Zw(t,n.textContent,n.innerHTML,i,e)},50)}function Zw(t,e,r,n,i){let s=Zre(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=E5e(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 lne(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&&!vc)return;let n=Qw?null:r.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&Zw(t,lne(n),n.getData("text/html"),i,r)?r.preventDefault():I5e(t,r)};var bI=class{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}},cne=wa?"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(TI(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}=d5(t,o);(!r.dataTransfer.files.length||!Zn||Bre>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(Qw?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",Qw||r.dataTransfer.setData("text/plain",c),t.dragging=new bI(u,!r[cne],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(TI(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=Zre(t,lne(r.dataTransfer),Qw?null:r.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&!r[cne]);if(t.someProp("handleDrop",h=>h(t,r,a||oe.empty,o))){r.preventDefault();return}if(!a)return;r.preventDefault();let l=a?uI(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(u5(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())&&bc(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&&vc&&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,Pp(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 Jw(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 xI=class t{constructor(e,r){this.toDOM=e,this.spec=r||_p,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&&Jw(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Mp=class t{constructor(e,r){this.attrs=e,this.spec=r||_p}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&&Jw(this.attrs,e.attrs)&&Jw(this.spec,e.spec)}static is(e){return e.type instanceof t}destroy(){}},s5=class t{constructor(e,r){this.attrs=e,this.spec=r||_p}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&&Jw(this.attrs,e.attrs)&&Jw(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 xI(r,n))}static inline(e,r,n,i){return new t(e,r,new Mp(n,i))}static node(e,r,n,i){return new t(e,r,new s5(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Mp}get widget(){return this.type instanceof xI}},Cg=[],_p={},kr=class t{constructor(e,r){this.local=e.length?e:Cg,this.children=r.length?r:Cg}static create(e,r){return r.length?kI(r,e,0,_p):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||_p)}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?A5e(this.children,a||[],e,r,n,i,s):a?new t(a.sort(Op),Cg):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=dne(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,kI(u,o,c+1,_p)),s+=3}});let a=une(s?fne(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(Op):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 Mp){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(Op),Cg);return n?new wI([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 m5(this.localsInner(e))}localsInner(e){if(this==Qn)return Cg;if(e.inlineContent||!this.local.some(Mp.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Mp||r.push(this.local[n]);return r}forEachSet(e){e(this)}};kr.empty=new kr([],[]);kr.removeOverlap=m5;var Qn=kr.empty,wI=class t{constructor(e){this.members=e}map(e,r){let n=this.members.map(i=>i.map(e,r,_p));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?m5(n?r:r.sort(Op)):Cg}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 A5e(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=P5e(o,t,e,r,i,s,a),u=kI(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(Op),o)}function une(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 P5e(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 dne(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 fne(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function kI(t,e,r,n){let i=[],s=!1;e.forEach((o,l)=>{let c=dne(t,o,l+r);if(c){s=!0;let u=kI(c,o,r+l+1,n);u!=Qn&&i.push(l,l+o.nodeSize,u)}});let a=une(s?fne(t):t,-r).sort(Op);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 Op(t,e){return t.from-e.from||t.to-e.to}function m5(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),Ere(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),Ere(e,i,n.copy(s.from,n.to)));break}}}return e}function Ere(t,e,r){for(;e<t.length&&Op(r,t[e])>0;)e++;t.splice(e,0,r)}function UF(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])),wI.from(e)}var R5e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},L5e=Yi&&Ku<=11,a5=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}},o5=class{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new a5,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&&Ku<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),L5e&&(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,R5e)),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(vre(this.view)){if(this.suppressingSelectionUpdates)return bc(this.view);if(Yi&&Ku<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Dp(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=Eg(s))r.add(s);for(let s=e.anchorNode;s;s=Eg(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)&&vre(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(go&&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||O5e(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&&CI(n)&&(c=c5(e))&&c.eq(Fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,bc(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,a),M5e(e)),this.handleDOMChange(s,a,o,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||bc(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&&Ku<=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})}},Ire=new WeakMap,Are=!1;function M5e(t){if(!Ire.has(t)&&(Ire.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=go,Are)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."),Are=!0}}function Pre(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Dp(a.node,a.offset,i,s)&&([r,n,i,s]=[i,s,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:s}}function _5e(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Pre(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?Pre(t,r):null}function O5e(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 D5e(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}],CI(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")||Ep.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:N5e,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 N5e(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 F5e=/^(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 B5e(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=c5(t,E);if(P&&!t.state.selection.eq(P)){if(Zn&&vc&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",I=>I(t,Pp(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=D5e(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=$5e(d.content,c.doc.content,c.from,f,p);if(h&&t.input.domChangeCount++,(Ig&&t.input.lastIOSEnter>Date.now()-225||vc)&&i.some(E=>E.nodeType==1&&!F5e.test(E.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",E=>E(t,Pp(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=Rre(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&&Ku<=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((Ig&&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,Pp(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&j5e(u,h.start,h.endA,m,v)&&t.someProp("handleKeyDown",E=>E(t,Pp(8,"Backspace")))){vc&&Zn&&t.domObserver.suppressSelectionUpdates();return}Zn&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),vc&&!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,Pp(13,"Enter"))})},20));let w=h.start,C=h.endA,O,S,T;if(y){if(m.pos==v.pos)Yi&&Ku<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>bc(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=V5e(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=Rre(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 Rre(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:u5(t,e.resolve(r.anchor),e.resolve(r.head))}function V5e(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 j5e(t,e,r,n,i){if(r-e<=i.pos-n.pos||zF(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(zF(s,!0,!0));return!a.parent.isTextblock||a.pos>r||zF(a,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(a.parent.content)}function zF(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 $5e(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&&Lre(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&&Lre(t.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}return{start:s,endA:a,endB:o}}function Lre(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 SI=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 r5,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Nre),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=Ore(this),_re(this),this.nodeViews=Dre(this),this.docView=fre(this.state.doc,Mre(this),UF(this),this.dom,this),this.domObserver=new o5(this,(n,i,s,a)=>B5e(this,n,i,s,a)),this.domObserver.start(),d5e(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&&n5(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Nre),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&&(one(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=Dre(this);z5e(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(o||r.handleDOMEvents!=this._props.handleDOMEvents)&&n5(this),this.editable=Ore(this),_re(this);let l=UF(this),c=Mre(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&&PFe(this);if(a){this.domObserver.stop();let p=d&&(Yi||Zn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&U5e(i.selection,e.selection);if(d){let h=Zn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=S5e(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=fre(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&XFe(this))?bc(this,p):(Yre(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&&RFe(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&&are(this,r.getBoundingClientRect(),e)}else are(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 bI(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&&LFe(this.dom),bc(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 NFe(this,e)}coordsAtPos(e,r=1){return zre(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 $Fe(this,r||this.state,e)}pasteHTML(e,r){return Zw(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return Zw(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return d5(this,e)}destroy(){this.docView&&(f5e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],UF(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,vFe())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return h5e(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&&SFe(this.dom.ownerDocument)==this.dom&&_5e(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function Mre(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 _re(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 Ore(t){return!t.someProp("editable",e=>e(t.state)===!1)}function U5e(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 Dre(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 z5e(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 Nre(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 r1=q5e;function q5e(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{},g5=class extends Xi{constructor(){super("Unable to find editor. Pass it as an argument or call this function inside a ProseKit component.")}},pne=class extends Xi{constructor(){super("Unable to find browser Document. When not in the browser environment, you need to pass a DOM Document.")}};function i1(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 s1(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 H5e=0,hne=class{constructor(t,e,r,n){this._reducer=r,this._reduce=n,this.index=H5e++,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 hne(t.parent,t.singleton??!1,t.reducer,t.reduce)}function II(t){return t instanceof As}function mne(t){return t instanceof Fe}function Ls(t){return t!=null}function G5e(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 AI=new hne(null,!0,G5e),y5=Jr({reducer:t=>{gn(t.length<=1);let e=t[0];return{schema:e?new nI(e):null}},parent:AI,singleton:!0}),gne=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(y5)?.find(Boolean)?.schema??null}};function yne(t,e){let r=[...t];for(let n of e)r.includes(n)||r.push(n);return r}function W5e(t,e){return t.filter(r=>!e.includes(r))}function v5(t){return t.toReversed?.()??[...t].reverse()}function vne(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 K5e(t,e){return!t&&!e?null:yne(t??[],e??[])}function Y5e(t,e){return t?e?W5e(t,e):[...t]:null}function X5e(t,e){let r=new Map(t);for(let[n,i]of e.entries()){let s=t.get(n);r.set(n,s?b5(s,i):i)}return r}function Q5e(t,e){let r=new Map(t);for(let[n,i]of e.entries()){let s=t.get(n);s&&r.set(n,bne(s,i))}return r}function b5(t,e){return gn(t.facet===e.facet),new EI(t.facet,vne(t.inputs,e.inputs,K5e),X5e(t.children,e.children),t.reducers)}function bne(t,e){return gn(t.facet===e.facet),new EI(t.facet,vne(t.inputs,e.inputs,Y5e),Q5e(t.children,e.children),t.reducers)}var EI=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}},Z5e=class extends gne{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 EI(this.facet,r);for(;n.facet.parent;){let i=new Map([[n.facet.index,n]]);n=new EI(n.facet.parent,void 0,i)}return n}};function Ms(t,e){return new Z5e(t,e)}function J5e(t){return typeof t=="object"&&t!=null}var e8e=1;function a1(t){return J5e(t)&&t.nodeType===e8e&&typeof t.nodeName=="string"}function t8e(){if(typeof document<"u")return document;if(typeof globalThis<"u"&&globalThis.document)return globalThis.document}function xne(){if(typeof window<"u")return window;if(typeof globalThis<"u"&&globalThis.window)return globalThis.window}function wne(t){return t?.document??t8e()??xne()?.document}function r8e(t){return t?.document?.defaultView??xne()??wne(t)?.defaultView??void 0}function n8e(t){let e=wne(t);if(e)return e;throw new pne}function i8e(t){let e=r8e(t);if(e)return e;throw new pne}function o1(t){return t.toJSON()}function kne(t,e){let{DOMParser:r,schema:n,...i}=e;return(r||Ep).fromSchema(n).parse(t,i)}function Sne(t,e){let r=e?.DOMSerializer||Ps,n=n8e(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 s8e(t,e){let r=i8e(e);return new r.DOMParser().parseFromString(`<body><div>${t}</div></body>`,"text/html").body.firstElementChild}function Cne(t,e){return Sne(t,e).outerHTML}function Tne(t,e){return o1(kne(t,e))}function Ene(t,e){return Tne(s8e(t,e),e)}var x5=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=yne(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:AI});function Ine(t,e){return typeof e=="string"?Ene(e,{schema:t}):a1(e)?Tne(e,{schema:t}):e}function a8e(t,e){return II(e)?e:t.nodeFromJSON(Ine(t,e))}function o8e(t,e){let r=a8e(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 l8e(t,e){return mne(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 Ane({defaultSelection:t,defaultContent:e,defaultDoc:r,defaultHTML:n}){let i=e||r||n;return Ms(x5,[({schema:s})=>{let a={};if(i){let o=Ine(s,i);a.doc=s.nodeFromJSON(o),t&&(a.selection=Fe.fromJSON(a.doc,t))}return a}])}function c8e(t,e){return Object.keys(t).every(r=>t[r]===e[r])}function Pne(t,e,r){return r=r||{},t.some(n=>n.type===e&&c8e(r,n.attrs))}function PI(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,Pne(o.marks,n,i)||(s=!0))}),a?s:!0}function Rne(t,e,r){let{from:n,$from:i,to:s,empty:a}=t.selection,o=i1(t.schema,e);if(a){let l=t.storedMarks||i.marks();return Pne(l,o,r)}else return!PI(t.doc,n,s,o,r)}var u8e=class extends gne{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=b5(i,n[s]);return i}};function _s(...t){let e=t.flat();return gn(e.length>0,"At least one extension is required"),new u8e(e)}function n1(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)=>n1(r,e[n]));if(t instanceof Is&&e instanceof Is)return t.size===e.size&&n1(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=>n1(t[i],e[i]))}return!1}function d8e(t,e){let r=t.attrs;for(let[n,i]of Object.entries(e))if(r[n]!==i)return!1;return!0}function Lne(t,e,r){let n=t.selection.$from,i=s1(t.schema,e);for(let s=n.depth;s>=0;s--){let a=n.node(s);if(a.type===i&&(!r||d8e(a,r)))return!0}return!1}function f8e(t,e,r=b8e){return r1(t.nodes,n=>p8e(n,e,r))}function p8e(t,e,r){let n=(...i)=>v8e(t,i,r);return n.isActive=i=>{let s=e();return s?Lne(s,t,i):!1},n}function h8e(t,e,r=y8e){return r1(t.marks,n=>m8e(n,e,r))}function m8e(t,e,r){let n=(...i)=>g8e(t,i,r);return n.isActive=i=>{let s=e();return s?Rne(s,t,i):!1},n}function g8e(t,e,r){let[n,i]=Mne(e),s=t.create(n);return r(s,w5(t.schema,i))}var y8e=(t,e)=>e.map(r=>r.mark(t.addToSet(r.marks)));function v8e(t,e,r){let[n,i]=Mne(e);return r(t,n,w5(t.schema,i))}var b8e=(t,e,r)=>{let n=t.createAndFill(e,r);return gn(n,`Failed to create node ${t.name}`),n};function w5(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(...w5(t,n));else if(II(n))r.push(n);else throw new Xi(`Invalid node child: ${typeof n}`);return r}function Mne(t){let[e,...r]=t;return x8e(e)?(r.unshift(e),[null,r]):typeof e=="object"?[e,r]:[null,r]}function x8e(t){return t?typeof t=="string"||Array.isArray(t)||II(t):!1}function w8e(t){return t.defaultContent||t.defaultDoc||t.defaultHTML?_s(t.extension,Ane(t)):t.extension}function k5(t){let e=w8e(t),r=new _ne(e);return new One(r)}var _ne=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 o1(s.doc)},this.getDocHTML=s=>{let a=this.getProp("clipboardSerializer"),o=a?{fromSchema:()=>a}:void 0,l=this.getDoc();return Cne(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=Ww.create(n);if(e.commands)for(let[s,a]of Object.entries(e.commands))this.defineCommand(s,a);this.nodes=f8e(i.schema,this.getState),this.marks=h8e(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=o8e(this.schema,t);r.check();let n=l8e(r,e||"start"),i=this.getState();if(r.eq(i.doc)&&(!e||n.eq(i.selection)))return;let s=Ww.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?b5(this.tree,n):bne(this.tree,n);let o=this.tree.getRootOutput(),l=[...o?.state?.plugins??[]];if(!n1(a,l)){let c=r.state.reconfigure({plugins:l});r.updateState(c)}if(o?.commands&&!n1(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 SI({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]}},One=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 _ne))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 RI=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Nne(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}var k8e=(t,e,r)=>{let n=Nne(t,r);if(!n)return!1;let i=T5(n);if(!i){let a=n.blockRange(),o=a&&cI(a);return o==null?!1:(e&&e(t.tr.lift(a,o).scrollIntoView()),!0)}let s=i.nodeBefore;if(Vne(t,i,e,-1))return!0;if(n.parent.content.size==0&&(Pg(s,"end")||_e.isSelectable(s)))for(let a=n.depth;;a--){let o=Hw(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(Pg(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},Fne=(t,e,r)=>{let n=Nne(t,r);if(!n)return!1;let i=T5(n);return i?S8e(t,i,e):!1};function S8e(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=Hw(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 Pg(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 C5=(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=T5(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 T5(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 C8e(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}var T8e=(t,e,r)=>{let n=C8e(t,r);if(!n)return!1;let i=Bne(n);if(!i)return!1;let s=i.nodeAfter;if(Vne(t,i,e,1))return!0;if(n.parent.content.size==0&&(Pg(s,"start")||_e.isSelectable(s))){let a=Hw(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(Pg(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},E8e=(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=Bne(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 Bne(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 l1=(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 E5(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 I8e=(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=E5(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},c1=(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=E5(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},u1=(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(mc(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let n=r.blockRange(),i=n&&cI(n);return i==null?!1:(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)};function I5(t){return(e,r)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof _e&&e.selection.node.isBlock)return!n.parentOffset||!mc(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=E5(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=mc(u.doc,d,s.length,s);if(f||(s[0]=o?{type:o}:null,f=mc(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 A8e=I5();var P8e=(t,e)=>(e&&e(t.tr.setSelection(new Xn(t.doc))),!0);function R8e(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||OF(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function Vne(t,e,r,n){let i=e.nodeBefore,s=e.nodeAfter,a,o,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&R8e(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&&OF(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&&cI(d);if(f!=null&&f>=e.depth)return r&&r(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&Pg(s,"start",!0)&&Pg(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 jne(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 L8e=jne(-1),M8e=jne(1);function _8e(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 O8e(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 wg(n,n.doc.resolve(a+1))),n=n.doc.resolve(a+1+s.content.size),!1}),n.pos<i.pos&&e.push(new wg(n,i))}return e}function $ne(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||!_8e(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=O8e(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 S5=ol(RI,k8e,C5),Dne=ol(RI,T8e,E8e),xc={Enter:ol(l1,c1,u1,A8e),"Mod-Enter":I8e,Backspace:S5,"Mod-Backspace":S5,"Shift-Backspace":S5,Delete:Dne,"Mod-Delete":Dne,"Mod-a":P8e},Une={"Ctrl-h":xc.Backspace,"Alt-Backspace":xc["Mod-Backspace"],"Ctrl-d":xc.Delete,"Ctrl-Alt-Backspace":xc["Mod-Delete"],"Alt-Delete":xc["Mod-Delete"],"Alt-d":xc["Mod-Delete"],"Ctrl-a":L8e,"Ctrl-e":M8e};for(let t in xc)Une[t]=xc[t];var D8e=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,zne=D8e?Une:xc;var LI=d1;function d1(t){let e=t;var r={}.toString.call(t).slice(8,-1);if(r=="Set")return new Set([...t].map(i=>d1(i)));if(r=="Map")return new Map([...t].map(i=>[d1(i[0]),d1(i[1])]));if(r=="Date")return new Date(t.getTime());if(r=="RegExp")return RegExp(t.source,N8e(t));if(r=="Array"||r=="Object"){e=Array.isArray(t)?[]:{};for(var n in t)e[n]=d1(t[n])}return e}function N8e(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 MI=200,Dn=function(){};Dn.prototype.append=function(e){return e.length?(e=Dn.from(e),!this.length&&e||e.length<MI&&this.leafAppend(e)||this.length<MI&&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 F8e(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 qne(e):Dn.empty};var qne=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<=MI)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=MI)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 qne([]);var F8e=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),A5=Dn;var B8e=500,Bp=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>j8e&&(o=V8e(o,c),a-=c),new t(o.append(s),a)}remapping(e,r){let n=new $w;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()>B8e&&(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(A5.from(i.reverse()),s)}};Bp.empty=new Bp(A5.empty,0);function V8e(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}},j8e=20;function $8e(t,e,r,n){let i=r.getMeta(Fp),s;if(i)return i.historyState;r.getMeta(q8e)&&(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(Fp))return a.getMeta(Fp).redo?new cl(t.done.addTransform(r,void 0,n,_I(e)),t.undone,Hne(r.mapping.maps),t.prevTime,t.prevComposition):new cl(t.done,t.undone.addTransform(r,void 0,n,_I(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||!U8e(r,t.prevRanges)),c=a?P5(t.prevRanges,r.mapping):Hne(r.mapping.maps);return new cl(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,_I(e)),Bp.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),P5(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new cl(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),P5(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function U8e(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 Hne(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 P5(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 z8e(t,e,r){let n=_I(e),i=Fp.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(Fp,{redo:r,historyState:l})}var R5=!1,Gne=null;function _I(t){let e=t.plugins;if(Gne!=e){R5=!1,Gne=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){R5=!0;break}}return R5}var Fp=new ut("history"),q8e=new ut("closeHistory");function Wne(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ve({key:Fp,state:{init(){return new cl(Bp.empty,Bp.empty,null,0,-1)},apply(e,r,n){return $8e(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,i=n=="historyUndo"?DI:n=="historyRedo"?f1:null;return i?(r.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function OI(t,e){return(r,n)=>{let i=Fp.getState(r);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(n){let s=z8e(i,r,t);s&&n(e?s.scrollIntoView():s)}return!0}}var DI=OI(!1,!0),f1=OI(!0,!0),g0t=OI(!1,!1),y0t=OI(!0,!1);var wc={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:"'"},FI={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},H8e=typeof navigator<"u"&&/Mac/.test(navigator.platform),G8e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Ur=0;Ur<10;Ur++)wc[48+Ur]=wc[96+Ur]=String(Ur);var Ur;for(Ur=1;Ur<=24;Ur++)wc[Ur+111]="F"+Ur;var Ur;for(Ur=65;Ur<=90;Ur++)wc[Ur]=String.fromCharCode(Ur+32),FI[Ur]=String.fromCharCode(Ur);var Ur;for(NI in wc)FI.hasOwnProperty(NI)||(FI[NI]=wc[NI]);var NI;function Kne(t){var e=H8e&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||G8e&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?FI:wc)[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 W8e=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function K8e(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))W8e?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 Y8e(t){let e=Object.create(null);for(let r in t)e[K8e(r)]=t[r];return e}function L5(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 BI(t){let e=Y8e(t);return function(r,n){let i=Kne(n),s,a=e[L5(i,n)];if(a&&a(r.state,r.dispatch,r))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let o=e[L5(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=wc[n.keyCode])&&s!=i){let o=e[L5(s,n)];if(o&&o(r.state,r.dispatch,r))return!0}}return!1}}var Xne=X8e((t,e,r)=>{if(!e)return null;let n=r.depth==0?null:Qne(r.node(-1).contentMatchAt(r.indexAfter(-1)));if(!n)return null;let i=Q8e(t,n);return i?{type:n,attrs:i}:null});function X8e(t){return(e,r)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof _e&&e.selection.node.isBlock)return!n.parentOffset||!mc(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:Qne(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=t&&t(i.parent,s,n),c=l?[l]:s&&o?[{type:o}]:void 0,u=mc(a.doc,a.mapping.map(n.pos),1,c);if(!c&&!u&&mc(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 Q8e(t,e){let r=Yne(t.type,!0),n=Yne(e,!0),i=r.filter(s=>n.includes(s));return i.length===0?null:Object.fromEntries(i.map(s=>[s,t.attrs[s]]))}function Yne(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 Qne(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 Qu({type:t,attrs:e,removeWhenPresent:r=!1,enterInlineAtoms:n=!0}){return(i,s,a)=>$ne(i1(i.schema,t),e,{removeWhenPresent:r,enterInlineAtoms:n})(i,s,a)}function tie(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 Zne(()=>t);if(typeof t=="function")return Zne(t);throw new TypeError("Invalid plugin")}function Zne(t){return Ms(Ca,[t])}var Ca=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:x5});function VI(t){return e=>t.filter(Ls).reduce((r,n)=>n(r),e)}function jI(t,e){return e?e(t):t}var Z8e=class extends Ps{constructor(t,e,r,n){super(t,e),this.serializeFragmentWrapper=r,this.serializeNodeWrapper=n}serializeFragment(...t){return jI((...r)=>super.serializeFragment(...r),this.serializeFragmentWrapper)(...t)}serializeNode(...t){return jI((...r)=>super.serializeNode(...r),this.serializeNodeWrapper)(...t)}};function J8e(t,e){let r=(...a)=>Ps.nodesFromSchema(...a),n=(...a)=>Ps.marksFromSchema(...a),i=jI(r,e.nodesFromSchemaWrapper)(t),s=jI(n,e.marksFromSchemaWrapper)(t);return new Z8e(i,s,e.serializeFragmentWrapper,e.serializeNodeWrapper)}var H0t=Jr({reducer:t=>{let e={serializeFragmentWrapper:VI(t.map(r=>r.serializeFragmentWrapper)),serializeNodeWrapper:VI(t.map(r=>r.serializeNodeWrapper)),nodesFromSchemaWrapper:VI(t.map(r=>r.nodesFromSchemaWrapper)),marksFromSchemaWrapper:VI(t.map(r=>r.marksFromSchemaWrapper))};return({schema:r})=>{let n=J8e(r,e);return[new Ve({key:new ut("prosekit-clipboard-serializer"),props:{clipboardSerializer:n}})]}},singleton:!0,parent:Ca});var e9e=Jr({reducer:t=>({commands:Object.assign({},...t)}),parent:AI,singleton:!0});function ul(t){return Ms(e9e,[t])}var rie=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:y5,singleton:!0});function nie(t,e){let r={};for(let n of t){let i=e(n);(r[i]||(r[i]=[])).push(n)}return r}function iie(t){let e={};for(let[r,n]of t)(e[r]||(e[r]=[])).push(n);return e}function t9e(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r]=n);return e}function Jne(...t){let e=t.filter(Ls).map(t9e);return Object.assign({},...e)}function sie(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=Jne(a,o);l&&(r[s]=l)}let i=[...t.parseDOM??[],...e.parseDOM??[]];return Jne(t,e,{attrs:r,parseDOM:i})}function aie(t,e){return(r,...n)=>{let i=t(r,...n),s=e.map(a=>a.toDOM?.(r.attrs[a.attr])).filter(Ls);return r9e(i,s)}}function oie(t,e){let r=t.getAttrs,n=t.attrs;return{...t,getAttrs:i=>{let s=r?.(i)??n??{};if(s===!1||!i||!a1(i))return s??null;let a={};for(let o of e)o.parseDOM&&(a[o.attr]=o.parseDOM(i));return{...s,...a}}}}function r9e(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=n9e(n,e);return[t[0],i,...r]}return a1(t)?eie(t,e):typeof t=="object"&&"dom"in t&&a1(t.dom)?{...t,dom:eie(t.dom,e)}:t}function n9e(t,e){t={...t};for(let[r,n]of e){let i=t[r],s=r==="style"?lie(n,typeof i=="string"?i:""):n;t[r]=s}return t}function eie(t,e){t=t.cloneNode(!0);for(let[r,n]of e){let i=t.getAttribute(r),s=r==="style"?lie(n,typeof i=="string"?i:""):n;t.setAttribute(r,s)}return t}function lie(...t){return t.map(e=>e.trim().replace(/;$/,"")).filter(Boolean).join("; ")}function Rg(t){return Ms(i9e,[[t,void 0]])}var i9e=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,sie(c,l)):e=e.addToStart(a,l)}let s=nie(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=LI(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=aie(c.toDOM,o)),c.parseDOM&&(c.parseDOM=c.parseDOM.map(u=>oie(u,o))),e=e.update(a,c)}return{nodes:e,topNode:r}},parent:rie,singleton:!0});function cie(){return Rg({name:"doc",content:"block+",topNode:!0})}function uie(t){return die(["mount",t])}function M5(t){return die(["update",t])}function die(t){return Ms(s9e,[t])}var s9e=Jr({reduce:()=>{let t=[],e=[],r=[],n=new Ve({key:a9e,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:Ca,singleton:!0}),a9e=new ut("prosekit-plugin-view-handler");function fie(t){return M5((e,r)=>{e.state.doc.eq(r.doc)||t(e,r)})}function Os(){let t=[];function e(n){t=v5(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=iie(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:Ca,singleton:!0});function o9e(t){return Ms(l9e,[t])}function pie(t){return o9e(["clickOn",t])}var l9e=Jr({reduce:()=>{let[t,e]=c9e();return r=>(t(r),e)},parent:Ca,singleton:!0});function c9e(){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=iie(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 _5=typeof navigator<"u"?/Mac|iP(hone|[ao]d)/.test(navigator.platform):!1;function Vp(t){return Ms(u9e,[t])}var u9e=Jr({reduce:()=>{let t,e=(n,i)=>t?t(n,i):!1,r=new Ve({key:p9e,props:{handleKeyDown:e}});return n=>(t=BI(d9e(v5(n))),r)},parent:Ca,singleton:!0});function d9e(t){let e={};for(let r of t)for(let[n,i]of Object.entries(r))(e[n]||(e[n]=[])).push(i);return r1(e,f9e)}function f9e(t){return ol(...t)}var p9e=new ut("prosekit-keymap"),hie={"Mod-z":DI,"Shift-Mod-z":f1};_5||(hie["Mod-y"]=f1);var h9e={undo:()=>DI,redo:()=>f1};function mie({depth:t=200,newGroupDelay:e=250}={}){return _s(Ci(Wne({depth:t,newGroupDelay:e})),Vp(hie),ul(h9e))}var m9e=ol(l1,c1,u1,Xne),g9e=ol(RI,Fne,C5),axt={...zne,Enter:m9e,Backspace:g9e};function $I(t){return Ms(y9e,[[t,void 0]])}var y9e=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,sie(o,a)):e=e.addToStart(s,a)}let i=nie(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=LI(o);l.attrs||(l.attrs={});for(let c of a)l.attrs[c.attr]={default:c.default,validate:c.validate};l.toDOM&&(l.toDOM=aie(l.toDOM,a)),l.parseDOM&&(l.parseDOM=l.parseDOM.map(c=>v9e(c,a))),e=e.update(s,l)}return{marks:e,nodes:{}}},parent:rie,singleton:!0});function v9e(t,e){return t.tag?oie(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:Ca});function gie(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-mark-view-effect"),props:{markViews:e}})]},parent:Ca});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:Ca});function yie(t){return Ms(k9e,[[t,null]])}var w9e=typeof window>"u",k9e=Jr({reducer:t=>{if(w9e)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:Ca});function vie(){return Rg({name:"text",group:"inline"})}function S9e(t){let e;return()=>(e===void 0&&(e=t()),e)}var UI=S9e(()=>{try{return"ab".replace(new RegExp("(?<=a)b","g"),"c")==="ac"}catch{return!1}});function bie(t,...e){return typeof t=="function"?t(...e):t}var zI=Z(Te(),1),xie=(0,zI.createContext)(null);function O5(){return(0,zI.useContext)(xie)}var wie=xie.Provider;var Ke=Z(Te(),1);var kie=t=>{throw TypeError(t)},C9e=(t,e,r)=>e.has(t)||kie("Cannot "+r),B5=(t,e,r)=>e.has(t)?kie("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),p1=(t,e,r)=>(C9e(t,e,"access private method"),r),qI,D5,GI=class{constructor({mark:e,view:r,inline:n,options:i}){B5(this,qI),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 p1(this,qI,D5).call(this,e)}createContentDOM(e){return p1(this,qI,D5).call(this,e)}get component(){return this.options.component}};qI=new WeakSet,D5=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 HI,N5,WI=class{constructor({node:e,view:r,getPos:n,decorations:i,innerDecorations:s,options:a}){B5(this,HI),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 p1(this,HI,N5).call(this,e)}createContentDOM(e){return p1(this,HI,N5).call(this,e)}get component(){return this.options.component}};HI=new WeakSet,N5=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 KI=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)}},F5,Sie,YI=class{constructor({pos:e,spec:r,options:n}){B5(this,F5),this.pos=e,this.options=n,this.spec=r,this.dom=p1(this,F5,Sie).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}};F5=new WeakSet,Sie=function(t){return t instanceof HTMLElement?t:document.createElement(t)};var jp=Z(Rf(),1);var T9e=(0,Ke.createContext)({contentRef:()=>{},view:null,mark:null});var Cie=(0,Ke.createContext)(t=>{throw new Error("No ProsemirrorAdapterProvider detected, maybe you need to wrap the component with the Editor with ProsemirrorAdapterProvider?")}),Tie=()=>(0,Ke.useContext)(Cie),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,mark:this.mark},this.updateContext=()=>{Object.assign(this.context,{mark:this.mark})},this.render=()=>{let e=this.component;return(0,jp.createPortal)(Ke.default.createElement(T9e.Provider,{value:this.context},Ke.default.createElement(e,null)),this.dom,this.key)}}},E9e=(0,Ke.createContext)({contentRef:()=>{},view:null,getPos:()=>0,setAttrs:()=>{},node:null,selected:!1,decorations:[],innerDecorations:null});var Eie=(0,Ke.createContext)(t=>{throw new Error("No ProsemirrorAdapterProvider detected, maybe you need to wrap the component with the Editor with ProsemirrorAdapterProvider?")}),Iie=()=>(0,Ke.useContext)(Eie),j5=class extends WI{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,jp.createPortal)(Ke.default.createElement(E9e.Provider,{value:this.context},Ke.default.createElement(e,null)),this.dom,this.key)}}},I9e=(0,Ke.createContext)({view:null});var A9e=(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,prevState:this.prevState},this.updateContext=()=>{Object.assign(this.context,{view:this.view,prevState:this.prevState})},this.render=()=>{let e=this.component;return(0,jp.createPortal)(Ke.default.createElement(I9e.Provider,{value:this.context},Ke.default.createElement(e,null)),this.root,this.key)}}};function P9e(t,e){return(0,Ke.useCallback)(r=>(n,i,s)=>{let a=new V5({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 R9e(t,e){return(0,Ke.useCallback)(r=>(n,i,s,a,o)=>{let l=new j5({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 L9e(t,e){return(0,Ke.useCallback)(r=>n=>{let i=new $5({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 M9e(){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,jp.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 _9e=(0,Ke.createContext)({view:null,getPos:()=>{}});var O9e=(0,Ke.createContext)(t=>{throw new Error("out of scope")});var U5=class extends YI{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,jp.createPortal)(Ke.default.createElement(_9e.Provider,{value:this.context},Ke.default.createElement(e,null)),this.dom,this.key)}}};function D9e(t,e){return(0,Ke.useCallback)(r=>(n,i={})=>{let s=new U5({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 Aie=({children:t})=>{let{renderReactRenderer:e,removeReactRenderer:r,portals:n}=M9e(),i=R9e(e,r),s=P9e(e,r),a=L9e(e,r),o=D9e(e,r),l=(0,Ke.useMemo)(()=>Object.values(n),[n]);return Ke.default.createElement(Eie.Provider,{value:i},Ke.default.createElement(Cie.Provider,{value:s},Ke.default.createElement(A9e.Provider,{value:a},Ke.default.createElement(O9e.Provider,{value:o},t,l))))};var h1=Z(Te(),1);var z5=Z(Te(),1);var Pie=Z(Te(),1);var Rie=Z(Te(),1);var q5=Z(Te(),1);var Mie=Z(Te(),1);var XI=Z(Te(),1);var z9e=Z(Te(),1);var q9e=Z(Te(),1);function N9e(t,e){if(!t)throw new g5;(0,Pie.useEffect)(()=>{if(e)return t.use(e)},[t,e])}function F9e(t,e){return(0,Rie.useMemo)(()=>t&&e?tie(t,e):t,[t,e])}function $p(t,e){let r=O5();N9e(e?.editor||r,F9e(t,e?.priority))}var B9e=()=>{let t=Tie(),e=(0,z5.useMemo)(()=>V9e(t),[t]);return $p(e),null};function V9e(t){return gie({group:"react",factory:t})}var j9e=()=>{let t=Iie(),e=(0,q5.useMemo)(()=>$9e(t),[t]);return $p(e),null};function $9e(t){return yie({group:"react",factory:t})}var Lie=t=>{let{editor:e,children:r}=t;return(0,h1.createElement)(Aie,null,(0,h1.createElement)(wie,{value:e},(0,h1.createElement)(j9e),(0,h1.createElement)(B9e),r))};function _ie(t,e){let r=(0,Mie.useMemo)(()=>fie(n=>t(n.state.doc)),[t]);return $p(r,e)}function H5(t){let e=t?.update??!1,r=O5();if(!r)throw new Xi("useEditor must be used within the ProseKit component");let n=U9e();return(0,XI.useEffect)(()=>{if(e){let i=_s(uie(n),M5(n));return r.use(i)}},[r,e,n]),r}function U9e(){let[,t]=(0,XI.useReducer)(e=>e+1,0);return t}var g1=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&&!K9e(this.search)),this.wholeWord=!!e.wholeWord,this.filter=e.filter||null,this.impl=this.valid?this.regexp?new K5(this):new W5(this):H9e}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||Die(e,r.from)&&Die(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?G9e(l):[[0,r.to-r.from]],u=W9e(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}},H9e=new class{findNext(){return null}findPrev(){return null}},W5=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 Mg(e.doc,r,n,(i,s)=>{let a=Math.max(r,s),o=y1(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 Mg(e.doc,r,n,(i,s)=>{let a=Math.max(s,n),o=y1(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}})}},Nie="g"+(/x/.unicode==null?"":"u")+(/x/.hasIndices==null?"":"d"),K5=class{constructor(e){this.query=e,this.regexp=new RegExp(e.search,Nie+(e.caseSensitive?"":"i"))}findNext(e,r,n){return Mg(e.doc,r,n,(i,s)=>{let a=y1(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 Mg(e.doc,r,n,(i,s)=>{let a=y1(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 G9e(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 W9e(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 K9e(t){try{return new RegExp(t,Nie),!0}catch{return!1}}var Oie=new WeakMap;function y1(t){let e=Oie.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+=" "+y1(i)+" "}return Oie.set(t,r),r}function Mg(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=Mg(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=Mg(o,e,r,n,l+1);if(c!=null)return c}}return null}function Die(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 m1=class{constructor(e,r,n){this.query=e,this.range=r,this.deco=n}};function G5(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 Lg=new ut("search");function Fie(t={}){return new Ve({key:Lg,state:{init(e,r){let n=t.initialQuery||new g1({search:""}),i=t.initialRange||null;return new m1(n,i,G5(r,n,i))},apply(e,r,n,i){let s=e.getMeta(Lg);if(s)return new m1(s.query,s.range,G5(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 m1(r.query,a,G5(i,r.query,a))}return r}},props:{decorations:e=>Lg.getState(e).deco}})}function Y5(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 Y9e(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 QI(t,e){return(r,n)=>{let i=Lg.getState(r);if(!i||!i.query.valid)return!1;let{from:s,to:a}=r.selection,o=e>0?Y5(i,r,t,s,a):Y9e(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 Bie=QI(!0,1),Vie=QI(!1,1),jie=QI(!0,-1),$ie=QI(!1,-1);function X5(t,e){return(r,n)=>{let i=Lg.getState(r);if(!i||!i.query.valid)return!1;let{from:s}=r.selection,a=Y5(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&&Y5(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 Uie=X5(!0,!0),zie=X5(!1,!0),qie=X5(!1,!1),Hie=(t,e)=>{let r=Lg.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 Gie(t){let e=new g1(t);return Ci(Fie({initialQuery:e}))}function X9e(t){if(t.isDestroyed)return;t.dom.querySelector(".ProseMirror-active-search-match")?.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}function Zu(t){return(e,r,n)=>{let i=t(e,r,n);return i&&r&&n&&setTimeout(()=>X9e(n),50),i}}function Wie(){return ul({findNext:()=>Zu(Bie),findPrev:()=>Zu(jie),findNextNoWrap:()=>Zu(Vie),findPrevNoWrap:()=>Zu($ie),replaceNext:()=>Zu(Uie),replaceNextNoWrap:()=>Zu(zie),replaceCurrent:()=>Zu(qie),replaceAll:()=>Zu(Hie)})}var dl=class{constructor(e,r,n={}){this.match=e,this.match=e,this.handler=typeof r=="string"?Q9e(r):r,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function Q9e(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 Z9e=500;function Yie({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 Kie(r,n,i,s,t,e)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&Kie(r,n.pos,n.pos,"",t,e)})}}},isInputRules:!0});return e}function Kie(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-Z9e),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 J9e(t){return t7e(()=>t)}function e7e({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=i1(c,e),m=h.create(bie(r,s));if(!PI(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 ZI(t){return J9e(e7e(t))}function t7e(t){return Ms(r7e,[t])}var r7e=Jr({reducer:t=>e=>{let r=t.flatMap(n=>n(e));return[Yie({rules:r})]},parent:Ca});function n7e(){return ul({toggleBold:()=>Qu({type:"bold"})})}function i7e(){return ZI({regex:UI()?/(?<=\s|^)\*\*([^\s*]|[^\s*][^*]*[^\s*])\*\*$/:/\*\*([^\s*]|[^\s*][^*]*[^\s*])\*\*$/,type:"bold"})}function s7e(){return Vp({"Mod-b":Qu({type:"bold"})})}function a7e(){return $I({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 Xie(){return _s(a7e(),n7e(),s7e(),i7e())}function Qie(t={}){return new Ve({view(e){return new Q5(e,t)}})}var Q5=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=uI(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 Zie(t){return Ci(()=>Qie(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 Z5(this.anchor)}static valid(e){let r=e.parent;if(r.isTextblock||!o7e(e)||!l7e(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 Z5=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 o7e(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 l7e(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 Jie(){return new Ve({props:{decorations:f7e,createSelectionBetween(t,e,r){return e.pos==r.pos&&Jn.valid(r)?new Jn(r):null},handleClick:u7e,handleKeyDown:c7e,handleDOMEvents:{beforeinput:d7e}}})}var c7e=BI({ArrowLeft:JI("horiz",-1),ArrowRight:JI("horiz",1),ArrowUp:JI("vert",-1),ArrowDown:JI("vert",1)});function JI(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 u7e(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 d7e(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 f7e(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 ese(){return Ci(()=>Jie())}function p7e(){return ul({toggleItalic:()=>Qu({type:"italic"})})}function h7e(){return ZI({regex:UI()?/(?<=\s|^)\*([^\s*]|[^\s*][^*]*[^\s*])\*$/:/\*([^\s*]|[^\s*][^*]*[^\s*])\*$/,type:"italic"})}function m7e(){return Vp({"Mod-i":Qu({type:"italic"})})}function g7e(){return $I({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 tse(){return _s(g7e(),p7e(),m7e(),h7e())}function rse(){return Ci(new Ve({key:y7e,props:{handleClick:v7e}}))}var y7e=new ut("prosekit-mod-click-prevention");function v7e(t,e,r){return!!r[b7e]}var b7e=_5?"metaKey":"ctrlKey";function ise(){return Ci(k7e)}var eA=new ut("prosekit-virtual-selection");function x7e(t){return t.getMeta(eA)}function nse(t,e){return t.setMeta(eA,e)}function w7e(t){return eA.getState(t)}var k7e=new Ve({key:eA,state:{init:()=>!1,apply:(t,e)=>x7e(t)??e},props:{handleDOMEvents:{focus:t=>{t.dispatch(nse(t.state.tr,!1))},blur:t=>{let{dom:e,root:r}=t;r.activeElement!==e&&t.dispatch(nse(t.state.tr,!0))}},decorations:t=>{let{selection:e,doc:r}=t;return e.empty||!w7e(t)?null:kr.create(r,[Zr.inline(e.from,e.to,{class:"prosekit-virtual-selection"})])}}});var S7e=Math.pow(10,8)*24*60*60*1e3,$wt=-S7e;var sse=864e5,ase=6e4,ose=36e5;var C7e=3600;var lse=C7e*24,Uwt=lse*7,T7e=lse*365.2425,E7e=T7e/12,zwt=E7e*3,J5=Symbol.for("constructDateFrom");function Ds(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&J5 in t?t[J5](e):t instanceof Date?new t.constructor(e):new Date(e)}function lr(t,e){return Ds(e||t,t)}function cse(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 use(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 _g(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?use(u,i+n*12):u,f=a||s?cse(d,a+s*7):d,p=l+o*60,m=(c+p*60)*1e3;return Ds(r?.in||t,+f+m)}function dse(t,e,r){return Ds(r?.in||t,+lr(t)+e)}function e8(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 t8(t,e){let r=lr(t,e?.in);return r.setHours(0,0,0,0),r}function fse(t,e,r){let[n,i]=ei(r?.in,t,e),s=t8(n),a=t8(i),o=+s-e8(s),l=+a-e8(a);return Math.round((o-l)/sse)}function pse(t,e,r){return dse(t,e*1e3,r)}function Up(t,e){let r=+lr(t)-+lr(e);return r<0?-1:r>0?1:r}function hse(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 mse(t,e,r){let[n,i]=ei(r?.in,t,e);return n.getFullYear()-i.getFullYear()}function yse(t,e,r){let[n,i]=ei(r?.in,t,e),s=gse(n,i),a=Math.abs(fse(n,i));n.setDate(n.getDate()-s*a);let o=+(gse(n,i)===-s),l=s*(a-o);return l===0?0:l}function gse(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 Og(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function vse(t,e,r){let[n,i]=ei(r?.in,t,e),s=(+n-+i)/ose;return Og(r?.roundingMethod)(s)}function tA(t,e){return+lr(t)-+lr(e)}function bse(t,e,r){let n=tA(t,e)/ase;return Og(r?.roundingMethod)(n)}function xse(t,e){let r=lr(t,e?.in);return r.setHours(23,59,59,999),r}function wse(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 kse(t,e){let r=lr(t,e?.in);return+xse(r,e)==+wse(r,e)}function Sse(t,e,r){let[n,i,s]=ei(r?.in,t,t,e),a=Up(i,s),o=Math.abs(hse(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Up(i,s)===-a;kse(n)&&o===1&&Up(n,s)===1&&(l=!1);let c=a*(o-+l);return c===0?0:c}function Cse(t,e,r){let n=tA(t,e)/1e3;return Og(r?.roundingMethod)(n)}function Tse(t,e,r){let[n,i]=ei(r?.in,t,e),s=Up(n,i),a=Math.abs(mse(n,i));n.setFullYear(1584),i.setFullYear(1584);let o=Up(n,i)===-s,l=s*(a-+o);return l===0?0:l}function Ese(t,e){let[r,n]=ei(t,e.start,e.end);return{start:r,end:n}}function v1(t,e){let{start:r,end:n}=Ese(e?.in,t),i={},s=Tse(n,r);s&&(i.years=s);let a=_g(r,{years:i.years}),o=Sse(n,a);o&&(i.months=o);let l=_g(a,{months:i.months}),c=yse(n,l);c&&(i.days=c);let u=_g(l,{days:i.days}),d=vse(n,u);d&&(i.hours=d);let f=_g(u,{hours:i.hours}),p=bse(n,f);p&&(i.minutes=p);let h=_g(f,{minutes:i.minutes}),m=Cse(n,h);return m&&(i.seconds=m),i}b1();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 k1={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 Bg(t){if(!t)return null;let e=t.match(k1.main);if(!e)return null;let{start:r,end:n}=e.groups;return iBe(r,n)}function iBe(t,e){let r=t||null,n=e??null,i,s;if(r&&n)i=oA(r),s=n==="e"?Number.POSITIVE_INFINITY:oA(n);else if(r)i=oA(r),s=-1;else if(n)i=-1,s=oA(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 oA(t){let e=t.match(k1.npt_time);if(!e)return null;let r=e[1],n=r.match(k1.npt_sec);if(n)return Number(n[0]);let i=r.match(k1.npt_mmss);if(i){let{mm:a,ss:o}=i.groups;return Number(a)*60+Number(o)}let s=r.match(k1.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 $se(t){if(t===0)return"DT0S";let e=v1({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 lA(t){if(t===0)return"00:00";let e=v1({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 S1(t){let{start:e,end:r}=t;return Qi(t)?e===0?null:`${cA(e)}`:e<0&&r>0?Number.isFinite(r)?`,${cA(r)}`:null:e>0&&r>0?`${cA(e)},${cA(r)}`:null}function cA(t){if(Number.isNaN(t)||t<0)throw new Error("durationInSecond must be positive");if(t===Number.POSITIVE_INFINITY)return"e";let e=v1({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 Use="&",d8="=",Vg="t",f8="xywh",jg=class t{#e;constructor(e){if(typeof e=="string"){this.#e=[];let r=e.replace(/^[#?]+/,"").split(Use);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!==Vg||Bg(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 Bg(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(Vg),!0;let r=S1(e);return r?(this.#t(Vg,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===Vg||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===Vg||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===Vg||r===f8?[r,encodeURI(n)].join(d8):!n&&e?encodeURIComponent(r):[r,n].map(encodeURIComponent).join(d8)).join(Use)}};function td(t,e,r){return Hn(e,(n,i)=>{let s=r?.[i];return s?zse(t,s):zse(t,n)})}var zse=(t,e)=>{if(typeof e=="string")return t[e];let r=e.find(n=>n in t);if(r)return t[r]};function $g(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=uA(i,e,r);n[o]=a}else n[i]=a}return n}var uA=(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 rd(t){return An(Hn(t,e=>Vt(ks(e),void 0)))}var dA=Ee(we(),gi(),yD(({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=sBe(t,e),n=t/r,i=e/r;return{width:n,height:i,syntax:`${n} / ${i}`}}function sBe(t,e){let r=t,n=e;for(;n!==0;){let i=n;n=r%n,r=i}return r}var aBe=Ee(Zo([Ee(we(),gi()),Qo(!0)]),oa(t=>t==="use-credentials"?"use-credentials":"anonymous")),fA=Zo([aBe,Qo(!1)]);function pA(t){return t==="use-credentials"?"use-credentials":t==="anonymous"?!0:null}var zp=Pt(["horizontal","vertical","both","none"]);var kc=Ee(hr(),Wl(0),xs(4),Gl("audioGain"));var qp=Pt(["play","eager"]);var qse=Pt(["video","audio"]);var Hp=Ee(hr(),Wl(0),Gl("playbackRate"));var vo=Ee(hr(),u0(),Qa(0),xs(100),Gl("volume"));var Sc={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"}}},oBe=Ee(we(),Za(),gi()),h8=Ee(ks(we()),oa(t=>t==="true"||t==="1"||t===""?!0:void 0)),p8=t=>Ee(we(),oa(e=>Number.parseFloat(e)),t),Hse=rd({type:qse,title:oBe,aspectRatio:dA,crossOrigin:fA,flip:zp,volume:p8(vo),audioGain:p8(kc),playbackRate:p8(Hp),embedLoadStrategy:qp});function Gse(t){let e=typeof t.crossOrigin<"u"&&t.crossOrigin!==null?pA(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 jg(t),r=Object.fromEntries(e),n={flagEnabled:td(r,Sc.flag.enable),flagDisabled:td(r,Sc.flag.disable),fields:td(r,Sc.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(Hse,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:XT(a,o=>typeof o<"u"),input:t.replace(/^#+/,"")}}function Cc(t,e){let r=new jg(e);for(let a of Object.keys(Sc.flag.enable)){let o=a,l=uA(o,Sc.flag.enable),c=uA(o,Sc.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}=Gse(t);typeof n<"u"&&r.setTemporal(n);let s=$g(i,Sc.regular);for(let[a,o]of Object.entries(s))o===null?r.delete(a):r.set(a,String(o));return r}function Ug(t){return typeof t=="object"&&t!==null}var lBe=bD(Ee(we(),gi(),oa(t=>Bg(t)))),Wse=Ee(lBe,Rm(t=>!Qi(t)));var hA={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"},Kse=Ee(rd({loop:wr(),muted:wr(),autoPlay:wr(),volume:vo,aspectRatio:dA,crossOrigin:fA,flip:zp,audioGain:kc,playbackRate:Hp,tempFragment:Wse,preservePitch:wr()}));function Yse(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?pA(t.crossOrigin):t.crossOrigin,flip:t.flip,audioGain:t.audioGain,playbackRate:t.playbackRate,tempFragment:t.tempFragment&&(S1(t.tempFragment)??void 0),preservePitch:t.preservePitch}}function g8(t){if(!Ug(t))return{};let e=Pn(Kse,td(t,hA));return e.success?{...e.output}:(console.warn("fallback parsing failed for fm control",e.issues),{})}function y8(t){let e=Yse(t);return $g(e,hA)}var C1=Ee(hr(),Wl(0),Gl("duration"));var nd=Ee(we(),Za(),gi()),mA=Ee(hr(),u0(),Wl(0)),cBe=Ee(Zo([Ee(we(),hD()),Ee(we(),mD()),Ee(we(),gD())]),oa(t=>new Date(t))),Xse=rd({title:nd,cover:nd,duration:C1,description:nd,creator:nd,album:nd,albumArtist:nd,trackNumber:mA,tracksTotal:mA,discNumber:mA,discsTotal:mA,genre:nd,mediaDate:cBe,comment:nd});var gA={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 Qse(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(!Ug(t))return{};let r=Pn(Xse,td(t,gA,e));return r.success?{...r.output}:(console.warn("fallback parsing failed for fm metadata",r.issues),{})}function b8(t,e){let r=Qse(t);return $g(r,gA,{mappings:e})}var x8=Ee(we(),Za(),gi()),uBe=Ee(An({video:ks(x8),audio:ks(x8),media:ks(x8)}),oa(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 yA(t){if(!Ug(t))return null;let e=Pn(uBe,t);return e.success?e.output:null}var dBe=Object.defineProperty,Zse=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Jse=t=>{throw TypeError(t)},fBe=(t,e,r)=>e in t?dBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vA=(t,e,r)=>fBe(t,typeof e!="symbol"?e+"":e,r),eae=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&Jse("Object expected");var n,i;r&&(n=e[Zse("asyncDispose")]),n===void 0&&(n=e[Zse("dispose")],r&&(i=n)),typeof n!="function"&&Jse("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},tae=(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()},rae={exports:{}},T1={};var nae;function pBe(){if(nae)return T1;nae=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 T1.Fragment=e,T1.jsx=r,T1.jsxs=r,T1}var iae;function hBe(){return iae||(iae=1,rae.exports=pBe()),rae.exports}var g=hBe();function mBe(t,e){let r=0;for(let n of t)e(n)&&(t[r]=n,r+=1);return t.splice(r),t}function gBe(t,e,r){return loe(t,e,new Set,r)}function loe(t,e,r,n){let i={},s=new Set([...lae(t),...lae(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(oae(o)&&oae(l)&&!r.has(o)&&!r.has(l)){r.add(o),r.add(l),i[a]=yBe(o,l,r,n);continue}i[a]=l}return i}function yBe(t,e,r,n={arrays:"merge",sets:"merge",maps:"merge"}){if(sae(t)&&sae(e))return loe(t,e,r,n);if(aae(t)&&aae(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 sae(t){return Object.getPrototypeOf(t)===Object.prototype}function aae(t){return typeof t[Symbol.iterator]=="function"}function oae(t){return t!==null&&typeof t=="object"}function lae(t){let e=Object.getOwnPropertySymbols(t);return mBe(e,r=>Object.prototype.propertyIsEnumerable.call(t,r)),e.push(...Object.keys(t)),e}function vBe(t,e){let r={},n=Object.entries(t);for(let[i,s]of n)e(s)&&(r[i]=s);return r}function bBe(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}var V1=t=>t.type==="checkbox",Wp=t=>t instanceof Date,Ei=t=>t==null,coe=t=>typeof t=="object",Mr=t=>!Ei(t)&&!Array.isArray(t)&&coe(t)&&!Wp(t),uoe=t=>Mr(t)&&t.target?V1(t.target)?t.target.checked:t.target.value:t,xBe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,doe=(t,e)=>t.has(xBe(e)),wBe=t=>{let e=t.constructor&&t.constructor.prototype;return Mr(e)&&e.hasOwnProperty("isPrototypeOf")},s9=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(!(s9&&(t instanceof Blob||n))&&(r||Mr(t)))if(e=r?[]:{},!r&&!wBe(t))e=t;else for(let i in t)t.hasOwnProperty(i)&&(e[i]=yn(t[i]));else return t;return e}var jA=t=>/^\w*$/.test(t),Sr=t=>t===void 0,a9=t=>Array.isArray(t)?t.filter(Boolean):[],o9=t=>a9(t.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(t,e,r)=>{if(!e||!Mr(t))return r;let n=(jA(e)?[e]:o9(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=jA(e)?[e]:o9(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]}},PA={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Tc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},l9=$.default.createContext(null);l9.displayName="HookFormContext";var $A=()=>$.default.useContext(l9),kBe=t=>{let{children:e,...r}=t;return $.default.createElement(l9.Provider,{value:r},e)},foe=(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]!==xo.all&&(e._proxyFormState[a]=!n||xo.all),r&&(r[a]=!0),t[a]}});return i},c9=typeof window<"u"?N.useLayoutEffect:N.useEffect;function poe(t){let e=$A(),{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 c9(()=>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(()=>foe(a,r,l.current,!1),[a,r])}var ml=t=>typeof t=="string",hoe=(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 u9(t){let e=$A(),{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 c9(()=>r._subscribe({name:n,formState:{values:!0},exact:a,callback:u=>!s&&c(hoe(n,r._names,u.values||r._formValues,!1,o.current))}),[n,r,s,a]),$.default.useEffect(()=>r._removeUnmounted()),l}function SBe(t){let e=$A(),{name:r,disabled:n,control:i=e.control,shouldUnregister:s}=t,a=doe(i._names.array,r),o=u9({control:i,name:r,defaultValue:ae(i._formValues,r,ae(i._defaultValues,r,t.defaultValue)),exact:!0}),l=poe({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:uoe(v),name:r},type:PA.CHANGE}),[r]),p=$.default.useCallback(()=>u.current.onBlur({target:{value:ae(i._formValues,r),name:r},type:PA.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 CBe=t=>t.render(SBe(t)),moe=(t,e,r,n,i)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:i||!0}}:{},N1=t=>Array.isArray(t)?t:[t],cae=()=>{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=[]}}},N8=t=>Ei(t)||!coe(t);function ld(t,e,r=new WeakSet){if(N8(t)||N8(e))return t===e;if(Wp(t)&&Wp(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(Wp(a)&&Wp(o)||Mr(a)&&Mr(o)||Array.isArray(a)&&Array.isArray(o)?!ld(a,o,r):a!==o)return!1}}return!0}var Ji=t=>Mr(t)&&!Object.keys(t).length,d9=t=>t.type==="file",wo=t=>typeof t=="function",RA=t=>{if(!s9)return!1;let e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},goe=t=>t.type==="select-multiple",f9=t=>t.type==="radio",TBe=t=>f9(t)||V1(t),w8=t=>RA(t)&&t.isConnected;function EBe(t,e){let r=e.slice(0,-1).length,n=0;for(;n<r;)t=Sr(t)?n++:t[e[n++]];return t}function IBe(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:jA(e)?[e]:o9(e),n=r.length===1?t:EBe(t,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(Mr(n)&&Ji(n)||Array.isArray(n)&&IBe(n))&&zr(t,r.slice(0,-1)),t}var yoe=t=>{for(let e in t)if(wo(t[e]))return!0;return!1};function LA(t,e={}){let r=Array.isArray(t);if(Mr(t)||r)for(let n in t)Array.isArray(t[n])||Mr(t[n])&&!yoe(t[n])?(e[n]=Array.isArray(t[n])?[]:{},LA(t[n],e[n])):Ei(t[n])||(e[n]=!0);return e}function voe(t,e,r){let n=Array.isArray(t);if(Mr(t)||n)for(let i in t)Array.isArray(t[i])||Mr(t[i])&&!yoe(t[i])?Sr(e)||N8(r[i])?r[i]=Array.isArray(t[i])?LA(t[i],[]):{...LA(t[i])}:voe(t[i],Ei(e)?{}:e[i],r[i]):r[i]=!ld(t[i],e[i]);return r}var E1=(t,e)=>voe(t,e,LA(e)),uae={value:!1,isValid:!1},dae={value:!0,isValid:!0},boe=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===""?dae:{value:t[0].value,isValid:!0}:dae:uae}return uae},xoe=(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,fae={isValid:!1,value:null},woe=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,fae):fae;function pae(t){let e=t.ref;return d9(e)?e.files:f9(e)?woe(t.refs).value:goe(e)?[...e.selectedOptions].map(({value:r})=>r):V1(e)?boe(t.refs).value:xoe(Sr(e.value)?t.ref.value:e.value,t)}var ABe=(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}},MA=t=>t instanceof RegExp,I1=t=>Sr(t)?t:MA(t)?t.source:Mr(t)?MA(t.value)?t.value.source:t.value:t,hae=t=>({isOnSubmit:!t||t===xo.onSubmit,isOnBlur:t===xo.onBlur,isOnChange:t===xo.onChange,isOnAll:t===xo.all,isOnTouch:t===xo.onTouched}),mae="AsyncFunction",PBe=t=>!!t&&!!t.validate&&!!(wo(t.validate)&&t.validate.constructor.name===mae||Mr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===mae)),RBe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),gae=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(n=>t.startsWith(n)&&/^\.\w+/.test(t.slice(n.length)))),F1=(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(F1(o,e))break}else if(Mr(o)&&F1(o,e))break}}};function yae(t,e,r){let n=ae(t,r);if(n||jA(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 LBe=(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||xo.all))},MBe=(t,e,r)=>!t||!e||t===e||N1(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),_Be=(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,OBe=(t,e)=>!a9(ae(t,e)).length&&zr(t,e),DBe=(t,e,r)=>{let n=N1(ae(t,r));return It(n,"root",e[r]),It(t,r,n),t},TA=t=>ml(t);function vae(t,e,r="validate"){if(TA(t)||Array.isArray(t)&&t.every(TA)||Fs(t)&&!t)return{type:r,message:TA(t)?t:"",ref:e}}var zg=t=>Mr(t)&&!MA(t)?t:{value:t,message:""},bae=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=f9(a),S=V1(a),T=O||S,E=(v||d9(a))&&Sr(a.value)&&Sr(y)||RA(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,P=moe.bind(null,m,n,C),R=(I,B,M,z=Tc.maxLength,G=Tc.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&&!boe(o).isValid||O&&!woe(o).isValid)){let{value:I,message:B}=TA(l)?{value:!!l,message:l}:zg(l);if(I&&(C[m]={type:Tc.required,message:B,ref:x,...P(Tc.required,B)},!n))return w(B),C}if(!E&&(!Ei(d)||!Ei(f))){let I,B,M=zg(f),z=zg(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,Tc.max,Tc.min),!n))return w(C[m].message),C}if((c||u)&&!E&&(ml(y)||s&&Array.isArray(y))){let I=zg(c),B=zg(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}=zg(p);if(MA(I)&&!y.match(I)&&(C[m]={type:Tc.pattern,message:B,ref:a,...P(Tc.pattern,B)},!n))return w(B),C}if(h){if(wo(h)){let I=await h(y,r),B=vae(I,x);if(B&&(C[m]={...B,...P(Tc.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=vae(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},NBe={mode:xo.onSubmit,reValidateMode:xo.onChange,shouldFocusError:!0};function FBe(t={}){let e={...NBe,...t},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:wo(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:cae(),state:cae()},p=e.criteriaMode===xo.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),OBe(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=E1(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:pae(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=ld(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?!ld(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,ABe(_||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&&PBe(q._f);ve&&u.validatingFields&&v([D],!0);let Qe=await bae(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?DBe(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))&<(_)}o.unMount=new Set},R=(_,k)=>!e.disabled&&(_&&k&&It(s,_,k),!ld(Me(),i)),I=(_,k,A)=>hoe(_,o,{...a.mount?s:Sr(k)?i:ml(_)?{[_]:k}:k},A,k),B=_=>a9(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,_,xoe(k,j)),q=RA(j.ref)&&Ei(k)?"":k,goe(j.ref)?[...j.ref.options].forEach(H=>H.selected=q.includes(H.value)):j.refs?V1(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):d9(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)&&!Wp(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:E1(i,s),isDirty:R(_,j)})):D&&!D._f&&!Ei(j)?z(_,j,A):M(_,j,A),gae(_,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)||Wp(ve)&&isNaN(ve.getTime())||ld(ve,ae(s,A,ve))},H=hae(e.mode),ne=hae(e.reValidateMode);if(q){let ve,Qe,En=k.type?pae(q._f):uoe(_),hs=_.type===PA.BLUR||_.type===PA.FOCUS_OUT,Uo=!RBe(q._f)&&!e.resolver&&!ae(r.errors,A)&&!q._f.deps||_Be(hs,ae(r.touchedFields,A),r.isSubmitted,ne,H),tb=gae(A,o,hs);It(s,A,En),hs?(q._f.onBlur&&q._f.onBlur(_),l&&l(0)):q._f.onChange&&q._f.onChange(_);let Sf=C(A,En,hs),rb=!Ji(Sf)||tb;if(!hs&&f.state.next({name:A,type:_.type,values:yn(s)}),Uo)return(u.isValid||d.isValid)&&(e.mode==="onBlur"?hs&&m():hs||m()),rb&&f.state.next({name:A,...tb?{}:Sf});if(!hs&&tb&&f.state.next({...r}),e.resolver){let{errors:pC}=await S([A]);if(j(En),D){let hC=yae(r.errors,n,A),mC=yae(pC,n,hC.name||A);ve=mC.error,A=mC.name,Qe=Ji(pC)}}else v([A],!0),ve=(await bae(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,Sf))}},K=(_,k)=>{if(ae(r.errors,k)&&_.focus)return _.focus(),1},de=async(_,k={})=>{let A,D,q=N1(_);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&&F1(n,K,_?q:o.mount),D},Me=_=>{let k={...a.mount?s:i};return Sr(_)?k:ml(_)?ae(k,_):_.map(A=>ae(k,A))},ht=(_,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=_=>{_&&N1(_).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)=>wo(_)?f.state.subscribe({next:A=>_(I(void 0,k),A)}):I(_,k,!0),Kr=_=>f.state.subscribe({next:k=>{MBe(_.name,k.name,_.exact)&&LBe(k,_.formState||u,m_,_.reRenderRoot)&&_.callback({values:{...s},...r,...k})}}).unsubscribe,Di=_=>(a.mount=!0,d={...d,..._.formState},Kr({..._,formState:d})),lt=(_,k={})=>{for(let A of _?N1(_):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:I1(k.min),max:I1(k.max),minLength:I1(k.minLength),maxLength:I1(k.maxLength),pattern:I1(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=TBe(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)&&!(doe(o.array,_)&&a.action)&&o.unMount.add(_)}}},Ar=()=>e.shouldFocusError&&F1(n,K,o.mount),Zs=_=>{Fs(_)&&(f.state.next({disabled:_}),F1(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},kf=(_,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}))},Bl=(_,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(E1(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(s9&&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(RA(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&&!ld(_,i)),isSubmitted:k.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:q?{}:k.keepDirtyValues?k.keepDefaultValues&&s?E1(i,s):r.dirtyFields:k.keepDefaultValues&&_?E1(i,_):k.keepDirty?r.dirtyFields:{},touchedFields:k.keepTouched?r.touchedFields:{},errors:k.keepErrors?r.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},hu=(_,k)=>Bl(wo(_)?_(s):_,k),zh=(_,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&&wo(q.select)&&q.select())}},m_=_=>{r={...r,..._}},g_={control:{register:Ir,unregister:lt,getFieldState:ht,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:Bl,_resetDefaultValues:()=>wo(e.defaultValues)&&e.defaultValues().then(_=>{hu(_,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:hu,resetField:kf,clearErrors:At,unregister:lt,setError:Ue,setFocus:zh,getFieldState:ht};return{...g_,formControl:g_}}function p9(t={}){let e=$.default.useRef(void 0),r=$.default.useRef(void 0),[n,i]=$.default.useState({isDirty:!1,isValidating:!1,isLoading:wo(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:wo(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!wo(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{let{formControl:a,...o}=FBe(t);e.current={...o,formState:n}}let s=e.current.control;return s._options=t,c9(()=>{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&&!ld(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=foe(n,s),e.current}function xae(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function h9(...t){return e=>{let r=!1,n=t.map(i=>{let s=xae(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():xae(t[i],null)}}}}function dd(...t){return N.useCallback(h9(...t),t)}function BBe(t){let e=VBe(t),r=N.forwardRef((n,i)=>{let{children:s,...a}=n,o=N.Children.toArray(s),l=o.find($Be);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 UA=BBe("Slot");function VBe(t){let e=N.forwardRef((r,n)=>{let{children:i,...s}=r;if(N.isValidElement(i)){let a=zBe(i),o=UBe(s,i.props);return i.type!==N.Fragment&&(o.ref=n?h9(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 jBe=Symbol("radix.slottable");function $Be(t){return N.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===jBe}function UBe(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 zBe(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 wae(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function koe(...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 Zg(...t){return N.useCallback(koe(...t),t)}var _A=N.forwardRef((t,e)=>{let{children:r,...n}=t,i=N.Children.toArray(r),s=i.find(HBe);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(F8,{...n,ref:e,children:N.isValidElement(a)?N.cloneElement(a,void 0,o):null})}return g.jsx(F8,{...n,ref:e,children:r})});_A.displayName="Slot";var F8=N.forwardRef((t,e)=>{let{children:r,...n}=t;if(N.isValidElement(r)){let i=WBe(r),s=GBe(n,r.props);return r.type!==N.Fragment&&(s.ref=e?koe(e,i):i),N.cloneElement(r,s)}return N.Children.count(r)>1?N.Children.only(null):null});F8.displayName="SlotClone";var qBe=({children:t})=>g.jsx(g.Fragment,{children:t});function HBe(t){return N.isValidElement(t)&&t.type===qBe}function GBe(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 WBe(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 KBe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ko=KBe.reduce((t,e)=>{let r=N.forwardRef((n,i)=>{let{asChild:s,...a}=n,o=s?_A: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}},{}),YBe="Label",Soe=N.forwardRef((t,e)=>g.jsx(ko.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())}}));Soe.displayName=YBe;var XBe=Soe;function Coe(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=Coe(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Toe(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=Coe(t))&&(n&&(n+=" "),n+=e);return n}var m9="-",QBe=t=>{let e=JBe(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:i=>{let s=i.split(m9);return s[0]===""&&s.length!==1&&s.shift(),Eoe(s,e)||ZBe(i)},getConflictingClassGroupIds:(i,s)=>{let a=r[i]||[];return s&&n[i]?[...a,...n[i]]:a}}},Eoe=(t,e)=>{var r;if(t.length===0)return e.classGroupId;let n=t[0],i=e.nextPart.get(n),s=i?Eoe(t.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;let a=t.join(m9);return(r=e.validators.find(({validator:o})=>o(a)))==null?void 0:r.classGroupId},kae=/^\[(.+)\]$/,ZBe=t=>{if(kae.test(t)){let e=kae.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},JBe=t=>{let{theme:e,classGroups:r}=t,n={nextPart:new Map,validators:[]};for(let i in r)B8(r[i],n,i,e);return n},B8=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){let s=i===""?e:Sae(e,i);s.classGroupId=r;return}if(typeof i=="function"){if(eVe(i)){B8(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,a])=>{B8(a,Sae(e,s),r,n)})})},Sae=(t,e)=>{let r=t;return e.split(m9).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},eVe=t=>t.isThemeGetter,tVe=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)}}},V8="!",j8=":",rVe=j8.length,nVe=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===j8){s.push(i.slice(l,h)),l=h+rVe;continue}if(m==="/"){c=h;continue}}m==="["?a++:m==="]"?a--:m==="("?o++:m===")"&&o--}let u=s.length===0?i:i.substring(l),d=iVe(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+j8,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},iVe=t=>t.endsWith(V8)?t.substring(0,t.length-1):t.startsWith(V8)?t.substring(1):t,sVe=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}},aVe=t=>({cache:tVe(t.cacheSize),parseClassName:nVe(t),sortModifiers:sVe(t),...QBe(t)}),oVe=/\s+/,lVe=(t,e)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],o=t.trim().split(oVe),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+V8: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 cVe(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=Ioe(e))&&(n&&(n+=" "),n+=r);return n}var Ioe=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Ioe(t[n]))&&(r&&(r+=" "),r+=e);return r};function uVe(t,...e){let r,n,i,s=a;function a(l){let c=e.reduce((u,d)=>d(u),t());return r=aVe(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=lVe(l,r);return i(l,u),u}return function(){return s(cVe.apply(null,arguments))}}var en=t=>{let e=r=>r[t]||[];return e.isThemeGetter=!0,e},Aoe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Poe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dVe=/^\d+\/\d+$/,fVe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pVe=/\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$/,hVe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mVe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gVe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qg=t=>dVe.test(t),Je=t=>!!t&&!Number.isNaN(Number(t)),id=t=>!!t&&Number.isInteger(Number(t)),k8=t=>t.endsWith("%")&&Je(t.slice(0,-1)),Ec=t=>fVe.test(t),yVe=()=>!0,vVe=t=>pVe.test(t)&&!hVe.test(t),Roe=()=>!1,bVe=t=>mVe.test(t),xVe=t=>gVe.test(t),wVe=t=>!pe(t)&&!he(t),kVe=t=>ey(t,_oe,Roe),pe=t=>Aoe.test(t),Gp=t=>ey(t,Ooe,vVe),S8=t=>ey(t,IVe,Je),Cae=t=>ey(t,Loe,Roe),SVe=t=>ey(t,Moe,xVe),bA=t=>ey(t,Doe,bVe),he=t=>Poe.test(t),A1=t=>ty(t,Ooe),CVe=t=>ty(t,AVe),Tae=t=>ty(t,Loe),TVe=t=>ty(t,_oe),EVe=t=>ty(t,Moe),xA=t=>ty(t,Doe,!0),ey=(t,e,r)=>{let n=Aoe.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},ty=(t,e,r=!1)=>{let n=Poe.exec(t);return n?n[1]?e(n[1]):r:!1},Loe=t=>t==="position"||t==="percentage",Moe=t=>t==="image"||t==="url",_oe=t=>t==="length"||t==="size"||t==="bg-size",Ooe=t=>t==="length",IVe=t=>t==="number",AVe=t=>t==="family-name",Doe=t=>t==="shadow",PVe=()=>{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=()=>[qg,"full","auto",...T()],P=()=>[id,"none","subgrid",he,pe],R=()=>["auto",{span:["full",id,he,pe]},id,he,pe],I=()=>[id,"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=()=>[qg,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],K=()=>[t,he,pe],de=()=>[...w(),Tae,Cae,{position:[he,pe]}],Me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ht=()=>["auto","cover","contain",TVe,kVe,{size:[he,pe]}],At=()=>[k8,A1,Gp],Ue=()=>["","none","full",c,he,pe],Gt=()=>["",Je,A1,Gp],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,Tae,Cae],ps=()=>["","none",h,he,pe],Ir=()=>["none",Je,he,pe],Ar=()=>["none",Je,he,pe],Zs=()=>[Je,he,pe],ui=()=>[qg,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ec],breakpoint:[Ec],color:[yVe],container:[Ec],"drop-shadow":[Ec],ease:["in","out","in-out"],font:[wVe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ec],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ec],shadow:[Ec],spacing:["px",Je],text:[Ec],"text-shadow":[Ec],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qg,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:[id,"auto",he,pe]}],basis:[{basis:[qg,"full","auto",o,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Je,qg,"auto","initial","none",pe]}],grow:[{grow:["",Je,he,pe]}],shrink:[{shrink:["",Je,he,pe]}],order:[{order:[id,"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,A1,Gp]}],"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:[CVe,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,Gp]}],"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:ht()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},id,he,pe],radial:["",he,pe],conic:[id,he,pe]},EVe,SVe]}],"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,A1,Gp]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",u,xA,bA]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",d,xA,bA]}],"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,Gp]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":Gt()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",f,xA,bA]}],"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:ht()}],"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,xA,bA]}],"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,A1,Gp,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"]}},Noe=uVe(PVe);function Ce(...t){return Noe(Toe(t))}function RVe({className:t,...e}){return g.jsx(XBe,{"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 zA=kBe,Foe=N.createContext({}),Xt=({...t})=>g.jsx(Foe.Provider,{value:{name:t.name},children:g.jsx(CBe,{...t})}),qA=()=>{let t=N.useContext(Foe),e=N.useContext(Boe),{getFieldState:r}=$A(),n=poe({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}},Boe=N.createContext({});function Bs({className:t,...e}){return g.jsx(j1,{className:Ce("grid gap-2",t),...e})}function j1({className:t,...e}){let r=N.useId();return g.jsx(Boe.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}=qA();return g.jsx(RVe,{"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}=qA();return g.jsx(UA,{"data-slot":"form-control",id:r,"aria-describedby":e?`${n} ${i}`:`${n}`,"aria-invalid":!!e,...t})}function gl({className:t,...e}){let{formDescriptionId:r}=qA();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}=qA(),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 $8({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 Eae=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Iae=Toe,Zp=(t,e)=>r=>{var n;if(e?.variants==null)return Iae(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=Eae(u)||Eae(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 Iae(t,a,l,r?.class,r?.className)},Voe=({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(Mu,{className:"size-3.5"})})]}):null,LVe=Zp("font-medium",{variants:{variant:{default:"text-muted-foreground",override:"text-foreground"}},defaultVariants:{variant:"default"}}),joe=({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:LVe({variant:n}),children:e}),g.jsx(Voe,{variant:n,onReset:i})]}),g.jsx(gl,{className:"text-xs mt-1 ml-6",children:r})]}),Gg=({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 MVe({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(Gg,{children:[g.jsx(joe,{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($8,{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($8,{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 Hg;function $oe(t){return{lang:t?.lang??Hg?.lang,message:t?.message,abortEarly:t?.abortEarly??Hg?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Hg?.abortPipeEarly}}var Aae;function _Ve(t){return Aae?.get(t)}var Pae;function OVe(t){return Pae?.get(t)}var Rae;function DVe(t,e){var r;return(r=Rae?.get(t))==null?void 0:r.get(e)}function fd(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??fd(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??DVe(t.reference,l.lang)??(c?OVe(l.lang):null)??n.message??_Ve(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 Ia(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},$oe())}}}function NVe(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Uoe(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}function FVe(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 Xg(t,e){return{kind:"validation",type:"check",reference:Xg,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 U8(t,e){return{kind:"validation",type:"gt_value",reference:U8,async:!1,expects:`>${t instanceof Date?t.toJSON():fd(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():fd(r.value)}),r}}}function Kp(t){return{kind:"validation",type:"integer",reference:Kp,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 EA(t,e){return{kind:"validation",type:"lt_value",reference:EA,async:!1,expects:`<${t instanceof Date?t.toJSON():fd(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():fd(r.value)}),r}}}function _1(t,e){return{kind:"validation",type:"min_value",reference:_1,async:!1,expects:`>=${t instanceof Date?t.toJSON():fd(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():fd(r.value)}),r}}}function g9(t){return{kind:"transformation",type:"transform",reference:g9,async:!1,operation:t,"~run"(e){return e.value=this.operation(e.value),e}}}function zoe(t){return{kind:"validation",type:"url",reference:zoe,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 BVe(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function y9(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 Ia(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:Bn(this,"type",e,r),e}}}function qoe(t){return{kind:"schema",type:"file",reference:qoe,expects:"File",async:!1,message:t,get"~standard"(){return Ia(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 Ia(this)},"~run"(r,n){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=y9(this,r,n)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Yp(t){return{kind:"schema",type:"number",reference:Yp,expects:"number",async:!1,message:t,get"~standard"(){return Ia(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Bn(this,"type",e,r),e}}}function pd(t,e){return{kind:"schema",type:"object",reference:pd,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return Ia(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]:y9(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]=BVe(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 Pc(t,e){return{kind:"schema",type:"optional",reference:Pc,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return Ia(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=y9(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Jg(t,e){return{kind:"schema",type:"picklist",reference:Jg,expects:Uoe(t.map(fd),"|"),async:!1,options:t,message:e,get"~standard"(){return Ia(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:Bn(this,"type",r,n),r}}}function Hoe(t,e,r){return{kind:"schema",type:"record",reference:Hoe,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return Ia(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(NVe(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 Ia(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:Bn(this,"type",e,r),e}}}function Goe(t){return{kind:"schema",type:"undefined",reference:Goe,expects:"undefined",async:!1,message:t,get"~standard"(){return Ia(this)},"~run"(e,r){return e.value===void 0?e.typed=!0:Bn(this,"type",e,r),e}}}function Lae(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function v9(t,e){return{kind:"schema",type:"union",reference:v9,expects:Uoe(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return Ia(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:Lae(s)}),r.typed=!0}else{if(a?.length===1)return a[0];Bn(this,"type",r,n,{issues:Lae(a)})}return r}}}function Ea(...t){return{...t[0],pipe:t,get"~standard"(){return Ia(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 VVe(t,e,r){let n=await t["~run"]({value:e},$oe(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var z8=pd({hours:Ea(Yp(),Kp(),_1(0)),minutes:Ea(Yp(),Kp(),_1(0),EA(60)),seconds:Ea(Yp(),Kp(),_1(0),EA(60)),milliseconds:Ea(Yp(),Kp(),_1(0),EA(1e3))}),$1={hours:0,minutes:0,seconds:0,milliseconds:0};function jVe(t){let e=Number.parseInt(t,10);return!Number.isNaN(e)&&e>=0&&e<=99}function $Ve(t){let e=Number.parseInt(t,10);return!Number.isNaN(e)&&e>=0&&e<=59}function UVe(t){let e=Number.parseInt(t,10);return!Number.isNaN(e)&&e>=0&&e<=59}function zVe(t){let e=Number.parseInt(t,10);return!Number.isNaN(e)&&e>=0&&e<=999}function Ta(t,e){return t.toString().padStart(e,"0")}function HA(t,e,r,n){let i=Number.parseInt(t,10);if(Number.isNaN(i))return Ta(e,n);let s=Math.min(Math.max(i,e),r);return Ta(s,n)}function qVe(t){return HA(t,0,99,2)}function HVe(t){return HA(t,0,59,2)}function GVe(t){return HA(t,0,59,2)}function WVe(t){return HA(t,0,999,3)}function GA(t,e,r,n,i,s=!0){let a=Number.parseInt(t,10);if(Number.isNaN(a))return Ta(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),Ta(o,i)}function KVe(t,e,r=!1){return GA(t,e,0,99,2,r)}function YVe(t,e,r=!0){return GA(t,e,0,59,2,r)}function XVe(t,e,r=!0){return GA(t,e,0,59,2,r)}function QVe(t,e,r=!0){return GA(t,e,0,999,3,r)}function WA(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 Qp(t){return t.hours*36e5+t.minutes*6e4+t.seconds*1e3+t.milliseconds}function q8(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 ZVe(t,e,r){if(!e&&!t)return;let n=q8(t??$1),i=r?"Video End":e?q8(e):"?";return`${n} \u2192 ${i}`}var JVe=Ea(z8,Xg(t=>Wg(t),"Specify a time for the timestamp")),eje=Ea(pd({start:Pc(z8),end:Pc(z8),playToEnd:Pc(hl())}),Xg(t=>!(Mae(t.start)&&(t.playToEnd||Mae(t.end))),"Specify either a start time or an end time for the media clip"),Xg(t=>!(Wg(t.start)&&Wg(t.end)&&!t.playToEnd)||Qp(t.start)<Qp(t.end),"Start time must be before end time"),Xg(t=>!(Wg(t.start)&&!Wg(t.end)&&!t.playToEnd),"Specify an end time for the media clip or choose to play to the end")),tje=Ea(Jg(["anonymous","use-credentials","disabled"])),rje=Ea(pd({width:tn(Ea(Yp(),Kp(),U8(0))),height:tn(Ea(Yp(),Kp(),U8(0)))}),Xg(t=>typeof t.width=="number"&&typeof t.height=="number"||!t.width&&!t.height,"Both width and height must be specified"),g9(t=>t.width&&t.height?{width:t.width,height:t.height}:null)),nje=Jg(["video","audio","media"]),KA=pd({loop:tn(hl()),autoPlay:tn(hl()),showControls:tn(hl()),muted:tn(hl()),volume:tn(vo),audioGain:tn(kc),playbackRate:tn(Hp),preservePitch:tn(hl()),aspectRatio:tn(rje),flip:tn(zp),title:tn(yl()),crossOrigin:tn(tje),type:tn(nje),play:tn(qp),timestamp:tn(JVe),clip:Ea(tn(v9([Hoe(yl(),Goe()),eje])),g9(t=>b9(t)?t:void 0))});function b9(t){return!!(t!=null&&t.start||t!=null&&t.end||t?.playToEnd!==void 0)}function Wg(t){return!!t&&Qp(t)>0}function Mae(t){return!Wg(t)}var ije=Zp("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?UA:"button";return g.jsx(s,{"data-slot":"button",className:Ce(ije({variant:e,size:r,className:t})),...i})}function U1(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,sje(i,...e)]}function sje(...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 x9(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 ry({prop:t,defaultProp:e,onChange:r=()=>{}}){let[n,i]=aje({defaultProp:e,onChange:r}),s=t!==void 0,a=s?t:n,o=x9(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 aje({defaultProp:t,onChange:e}){let r=N.useState(t),[n]=r,i=N.useRef(n),s=x9(e);return N.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function Woe(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 OA=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{};function Koe(t){let[e,r]=N.useState(void 0);return OA(()=>{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 oje(t,e){return N.useReducer((r,n)=>e[r][n]??r,t)}var Yoe=t=>{let{present:e,children:r}=t,n=lje(e),i=typeof r=="function"?r({present:n.isPresent}):N.Children.only(r),s=Zg(n.ref,cje(i));return typeof r=="function"||n.isPresent?N.cloneElement(i,{ref:s}):null};Yoe.displayName="Presence";function lje(t){let[e,r]=N.useState(),n=N.useRef({}),i=N.useRef(t),s=N.useRef("none"),a=t?"mounted":"unmounted",[o,l]=oje(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{let c=wA(n.current);s.current=o==="mounted"?c:"none"},[o]),OA(()=>{let c=n.current,u=i.current;if(u!==t){let d=s.current,f=wA(c);t?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&d!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),OA(()=>{if(e){let c,u=e.ownerDocument.defaultView??window,d=p=>{let h=wA(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=wA(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 wA(t){return t?.animationName||"none"}function cje(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 w9="Checkbox",[uje,QCt]=U1(w9),[dje,fje]=uje(w9),Xoe=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=Zg(e,w=>p(w)),m=N.useRef(!1),v=f?u||!!f.closest("form"):!0,[b=!1,y]=ry({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(dje,{scope:r,state:b,disabled:o,children:[g.jsx(ko.button,{type:"button",role:"checkbox","aria-checked":ud(b)?"mixed":b,"aria-required":a,"data-state":Joe(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=>ud(C)?!0:!C),v&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),v&&g.jsx(pje,{control:f,bubbles:!m.current,name:n,value:l,checked:b,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"},defaultChecked:ud(s)?!1:s})]})});Xoe.displayName=w9;var Qoe="CheckboxIndicator",Zoe=N.forwardRef((t,e)=>{let{__scopeCheckbox:r,forceMount:n,...i}=t,s=fje(Qoe,r);return g.jsx(Yoe,{present:n||ud(s.state)||s.state===!0,children:g.jsx(ko.span,{"data-state":Joe(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});Zoe.displayName=Qoe;var pje=t=>{let{control:e,checked:r,bubbles:n=!0,defaultChecked:i,...s}=t,a=N.useRef(null),o=Woe(r),l=Koe(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=ud(r),f.call(u,ud(r)?!1:r),u.dispatchEvent(p)}},[o,r,n]);let c=N.useRef(ud(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 ud(t){return t==="indeterminate"}function Joe(t){return ud(t)?"indeterminate":t?"checked":"unchecked"}var hje=Xoe,mje=Zoe;function ele({className:t,...e}){return g.jsx(hje,{"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(mje,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:g.jsx(ep,{className:"size-3.5"})})})}var k9=({value:t,onChange:e,onBlur:r,disabled:n,className:i,...s})=>{let a=t??$1,[o,l]=(0,$.useState)(Ta(a.hours,2)),[c,u]=(0,$.useState)(Ta(a.minutes,2)),[d,f]=(0,$.useState)(Ta(a.seconds,2)),[p,h]=(0,$.useState)(Ta(a.milliseconds,3)),m=(0,$.useRef)(null),v=(0,$.useRef)(null),b=(0,$.useRef)(null),y=(0,$.useRef)(null);(0,$.useEffect)(()=>{l(Ta(a.hours,2)),u(Ta(a.minutes,2)),f(Ta(a.seconds,2)),h(Ta(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&&jVe(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&&$Ve(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&&UVe(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&&zVe(z)&&x("milliseconds",z)},E=M=>{var z;let G=((z=M?.currentTarget)==null?void 0:z.value)??o,V=qVe(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=HVe(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=GVe(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=WVe(G);h(V),x("milliseconds",V),M&&w(M)},B=(M,z)=>{var G,V,K,de,Me,ht;if(M.key==="ArrowUp"||M.key==="ArrowDown"){M.preventDefault();let At=M.key==="ArrowUp"?1:-1;switch(z){case"hours":{let Ue=KVe(o,At,!1);l(Ue),x("hours",Ue);break}case"minutes":{let Ue=YVe(c,At,!0);u(Ue),x("minutes",Ue);break}case"seconds":{let Ue=XVe(d,At,!0);f(Ue),x("seconds",Ue);break}case"milliseconds":{let Ue=QVe(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":(ht=y.current)==null||ht.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})]})},gje=Zp("font-medium text-sm",{variants:{variant:{default:"text-muted-foreground",override:"text-foreground"}},defaultVariants:{variant:"default"}});function tle({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:gje({variant:n}),children:t}),e&&g.jsx("span",{className:"text-xs text-muted-foreground",children:e}),g.jsx(Voe,{variant:n,onReset:i})]}),s&&g.jsx("div",{className:"flex-shrink-0",children:s})]})}function rle({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(tle,{title:"Media Clip",icon:qm,subtitle:ZVe(l,c,u??!1),variant:b9({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(Ru,{className:"size-3.5"}),"Timestamp"]})}),g.jsxs("div",{className:"ml-6 flex flex-wrap gap-y-3 gap-x-6",children:[g.jsx(yje,{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(bje,{form:t,value:c,onBlur:s,onChange:d=>a({start:l,end:d,playToEnd:u}),disabled:o}),g.jsx(vje,{form:t,value:u,onBlur:s,onChange:d=>a({start:l,end:c,playToEnd:d}),disabled:o})]})]}),g.jsx(Ii,{className:"ml-6"})]})}})}function yje({form:t,value:e,onBlur:r,onChange:n,disabled:i}){return g.jsx(Xt,{control:t.control,name:"clip.start",render:()=>g.jsxs(j1,{className:"flex flex-col gap-1",children:[g.jsx(Fn,{children:"Start"}),g.jsx(qr,{children:g.jsx(k9,{value:e??$1,onChange:s=>n(s),onBlur:r,disabled:i})}),g.jsx(Ii,{})]})})}function vje({form:t,value:e,onBlur:r,onChange:n,disabled:i}){return g.jsx(Xt,{control:t.control,name:"clip.playToEnd",render:()=>g.jsxs(j1,{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(ele,{checked:e??!1,onCheckedChange:s=>n(s===!0),onBlur:r,disabled:i})}),g.jsx(Fn,{children:"Play to video end"})]}),g.jsx(Ii,{})]})})}function bje({form:t,value:e,onBlur:r,onChange:n,disabled:i}){let s=u9({control:t.control,name:"clip.playToEnd"});return g.jsx(Xt,{control:t.control,name:"clip.end",render:()=>g.jsxs(j1,{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(k9,{value:e??$1,onChange:a=>n(a),onBlur:r,disabled:i})}),g.jsx(Ii,{})]})})}function nle({form:t,onReset:e,onSwitchMode:r,className:n}){return g.jsx(Xt,{control:t.control,name:"timestamp",render:({field:i})=>{let s=i.value?q8(i.value):"this timestamp";return g.jsxs(j1,{className:Ce("p-4 pb-6 space-y-2 group/item",n),children:[g.jsx(tle,{title:"Timestamp",icon:Ru,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(k9,{value:i.value??$1,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(Bm,{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(Um,{className:"size-3.5"}),"Set end time to create media clip"]})]})]}),g.jsx(Ii,{className:"ml-6"})]})}})}function xje({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(rle,{form:t,onReset:r,onSwitchMode:a,className:e}):g.jsx(nle,{form:t,onReset:r,onSwitchMode:a,className:e})}var wje=Zp("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 ile({className:t,variant:e,asChild:r=!1,...n}){let i=r?UA:"span";return g.jsx(i,{"data-slot":"badge",className:Ce(wje({variant:e}),t),...n})}function sle(t,[e,r]){return Math.min(r,Math.max(e,t))}function Kg(t,e,{checkForDefaultPrevented:r=!0}={}){return function(n){if(t?.(n),r===!1||!n.defaultPrevented)return e?.(n)}}function ale(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,kje(i,...e)]}function kje(...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 ole=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},Sje=N[" useInsertionEffect ".trim().toString()]||ole;function lle({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){let[i,s,a]=Cje({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=Tje(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 Cje({defaultProp:t,onChange:e}){let[r,n]=N.useState(t),i=N.useRef(r),s=N.useRef(e);return Sje(()=>{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 Tje(t){return typeof t=="function"}var Eje=N.createContext(void 0);function Ije(t){let e=N.useContext(Eje);return t||e||"ltr"}function Aje(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 Pje(t){let[e,r]=N.useState(void 0);return ole(()=>{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 H8(t){let e=Rje(t),r=N.forwardRef((n,i)=>{let{children:s,...a}=n,o=N.Children.toArray(s),l=o.find(Mje);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 Rje(t){let e=N.forwardRef((r,n)=>{let{children:i,...s}=r;if(N.isValidElement(i)){let a=Oje(i),o=_je(s,i.props);return i.type!==N.Fragment&&(o.ref=n?h9(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 Lje=Symbol("radix.slottable");function Mje(t){return N.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Lje}function _je(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 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 Dje=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],z1=Dje.reduce((t,e)=>{let r=H8(`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 Nje(t){let e=t+"CollectionProvider",[r,n]=ale(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=H8(o),c=$.default.forwardRef((m,v)=>{let{scope:b,children:y}=m,x=s(o,b),w=dd(v,x.collectionRef);return g.jsx(l,{ref:w,children:y})});c.displayName=o;let u=t+"CollectionItemSlot",d="data-radix-collection-item",f=H8(u),p=$.default.forwardRef((m,v)=>{let{scope:b,children:y,...x}=m,w=$.default.useRef(null),C=dd(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 cle=["PageUp","PageDown"],ule=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dle={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ny="Slider",[G8,Fje,Bje]=Nje(ny),[fle,ZCt]=ale(ny,[Bje]),[Vje,YA]=fle(ny),ple=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"?jje:$je,[x=[],w]=lle({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=Gje(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=Xje(s),M=Qje(Math.round((P-n)/s)*s+n,B),z=sle(M,[n,i]);w((G=[])=>{let V=qje(G,z,R);if(Yje(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(Vje,{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(G8.Provider,{scope:t.__scopeSlider,children:g.jsx(G8.Slot,{scope:t.__scopeSlider,children:g.jsx(y,{"aria-disabled":o,"data-disabled":o?"":void 0,...m,ref:e,onPointerDown:Kg(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=cle.includes(P.key)||P.shiftKey&&ule.includes(P.key)?10:1,B=b.current,M=x[B],z=s*I*R;E(M+z,B,{commit:!0})}}})})})})});ple.displayName=ny;var[hle,mle]=fle(ny,{startEdge:"left",endEdge:"right",size:"width",direction:1}),jje=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=dd(e,x=>f(x)),h=N.useRef(void 0),m=Ije(i),v=m==="ltr",b=v&&!s||!v&&s;function y(x){let w=h.current||d.getBoundingClientRect(),C=[0,w.width],O=S9(C,b?[r,n]:[n,r]);return h.current=w,O(x-w.left)}return g.jsx(hle,{scope:t.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:g.jsx(gle,{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=dle[b?"from-left":"from-right"].includes(x.key);c?.({event:x,direction:w?-1:1})}})})}),$je=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=dd(e,u),f=N.useRef(void 0),p=!i;function h(m){let v=f.current||u.current.getBoundingClientRect(),b=[0,v.height],y=S9(b,p?[n,r]:[r,n]);return f.current=v,y(m-v.top)}return g.jsx(hle,{scope:t.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:g.jsx(gle,{"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=dle[p?"from-bottom":"from-top"].includes(m.key);l?.({event:m,direction:v?-1:1})}})})}),gle=N.forwardRef((t,e)=>{let{__scopeSlider:r,onSlideStart:n,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:l,...c}=t,u=YA(ny,r);return g.jsx(z1.span,{...c,ref:e,onKeyDown:Kg(t.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(o(d),d.preventDefault()):cle.concat(ule).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:Kg(t.onPointerDown,d=>{let f=d.target;f.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(f)?f.focus():n(d)}),onPointerMove:Kg(t.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:Kg(t.onPointerUp,d=>{let f=d.target;f.hasPointerCapture(d.pointerId)&&(f.releasePointerCapture(d.pointerId),s(d))})})}),yle="SliderTrack",vle=N.forwardRef((t,e)=>{let{__scopeSlider:r,...n}=t,i=YA(yle,r);return g.jsx(z1.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...n,ref:e})});vle.displayName=yle;var W8="SliderRange",ble=N.forwardRef((t,e)=>{let{__scopeSlider:r,...n}=t,i=YA(W8,r),s=mle(W8,r),a=N.useRef(null),o=dd(e,a),l=i.values.length,c=i.values.map(f=>kle(f,i.min,i.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return g.jsx(z1.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...n,ref:o,style:{...t.style,[s.startEdge]:u+"%",[s.endEdge]:d+"%"}})});ble.displayName=W8;var K8="SliderThumb",xle=N.forwardRef((t,e)=>{let r=Fje(t.__scopeSlider),[n,i]=N.useState(null),s=dd(e,o=>i(o)),a=N.useMemo(()=>n?r().findIndex(o=>o.ref.current===n):-1,[r,n]);return g.jsx(Uje,{...t,ref:s,index:a})}),Uje=N.forwardRef((t,e)=>{let{__scopeSlider:r,index:n,name:i,...s}=t,a=YA(K8,r),o=mle(K8,r),[l,c]=N.useState(null),u=dd(e,y=>c(y)),d=l?a.form||!!l.closest("form"):!0,f=Pje(l),p=a.values[n],h=p===void 0?0:kle(p,a.min,a.max),m=Hje(n,a.values.length),v=f?.[o.size],b=v?Wje(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(G8.ItemSlot,{scope:t.__scopeSlider,children:g.jsx(z1.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:Kg(t.onFocus,()=>{a.valueIndexToChangeRef.current=n})})}),d&&g.jsx(wle,{name:i??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:p},n)]})});xle.displayName=K8;var zje="RadioBubbleInput",wle=N.forwardRef(({__scopeSlider:t,value:e,...r},n)=>{let i=N.useRef(null),s=dd(i,n),a=Aje(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(z1.input,{style:{display:"none"},...r,ref:s,defaultValue:e})});wle.displayName=zje;function qje(t=[],e,r){let n=[...t];return n[r]=e,n.sort((i,s)=>i-s)}function kle(t,e,r){let n=100/(r-e)*(t-e);return sle(n,[0,100])}function Hje(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function Gje(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 Wje(t,e,r){let n=t/2,i=S9([0,50],[0,n]);return(n-i(e)*r)*r}function Kje(t){return t.slice(0,-1).map((e,r)=>t[r+1]-e)}function Yje(t,e){if(e>0){let r=Kje(t);return Math.min(...r)>=e}return!0}function S9(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 Xje(t){return(String(t).split(".")[1]||"").length}function Qje(t,e){let r=Math.pow(10,e);return Math.round(t*r)/r}var Zje=ple,Jje=vle,e$e=ble,t$e=xle;function r$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(Zje,{"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(Jje,{"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(e$e,{"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(t$e,{"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 C9="Switch",[n$e,JCt]=U1(C9),[i$e,s$e]=n$e(C9),Sle=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=Zg(e,x=>p(x)),m=N.useRef(!1),v=f?u||!!f.closest("form"):!0,[b=!1,y]=ry({prop:i,defaultProp:s,onChange:c});return g.jsxs(i$e,{scope:r,checked:b,disabled:o,children:[g.jsx(ko.button,{type:"button",role:"switch","aria-checked":b,"aria-required":a,"data-state":Ele(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(a$e,{control:f,bubbles:!m.current,name:n,value:l,checked:b,required:a,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});Sle.displayName=C9;var Cle="SwitchThumb",Tle=N.forwardRef((t,e)=>{let{__scopeSwitch:r,...n}=t,i=s$e(Cle,r);return g.jsx(ko.span,{"data-state":Ele(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:e})});Tle.displayName=Cle;var a$e=t=>{let{control:e,checked:r,bubbles:n=!0,...i}=t,s=N.useRef(null),a=Woe(r),o=Koe(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 Ele(t){return t?"checked":"unchecked"}var o$e=Sle,l$e=Tle;function Ile({className:t,...e}){return g.jsx(o$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(l$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 Y8(){return Y8=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},Y8.apply(null,arguments)}function c$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 u$e=$.useLayoutEffect,d$e=function(t){var e=$.default.useRef(t);return u$e(function(){e.current=t}),e},_ae=function(t,e){if(typeof t=="function"){t(e);return}t.current=e},f$e=function(t,e){var r=$.default.useRef();return $.default.useCallback(function(n){t.current=n,r.current&&_ae(r.current,null),r.current=e,e&&_ae(e,n)},[e])},Oae={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},p$e=function(t){Object.keys(Oae).forEach(function(e){t.style.setProperty(e,Oae[e],"important")})},Dae=p$e,Ti=null,Nae=function(t,e){var r=t.scrollHeight;return e.sizingStyle.boxSizing==="border-box"?r+e.borderSize:r-e.paddingSize};function h$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"),Dae(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]}),Dae(Ti),Ti.value=e;var l=Nae(Ti,t);Ti.value=e,l=Nae(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 Fae=function(){},m$e=function(t,e){return t.reduce(function(r,n){return r[n]=e[n],r},{})},g$e=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],y$e=!!document.documentElement.currentStyle,v$e=function(t){var e=window.getComputedStyle(t);if(e===null)return null;var r=m$e(g$e,e),n=r.boxSizing;if(n==="")return null;y$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}},b$e=v$e;function T9(t,e,r){var n=d$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 x$e=function(t,e){T9(document.body,"reset",function(r){t.current.form===r.target&&e(r)})},w$e=function(t){T9(window,"resize",t)},k$e=function(t){T9(document.fonts,"loadingdone",t)},S$e=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],C$e=function(t,e){var r=t.cacheMeasurements,n=t.maxRows,i=t.minRows,s=t.onChange,a=s===void 0?Fae:s,o=t.onHeightChange,l=o===void 0?Fae:o,c=c$e(t,S$e),u=c.value!==void 0,d=N.useRef(null),f=f$e(d,e),p=N.useRef(0),h=N.useRef(),m=function(){var b=d.current,y=r&&h.current?h.current:b$e(b);if(y){h.current=y;var x=h$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),x$e(d,function(){if(!u){var b=d.current.value;requestAnimationFrame(function(){var y=d.current;y&&b!==y.value&&m()})}}),w$e(m),k$e(m),N.createElement("textarea",Y8({},c,{onChange:v,ref:f}))},T$e=N.forwardRef(C$e),E$e=Zp("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 I$e({className:t,size:e,...r}){return g.jsx(T$e,{"data-slot":"textarea",className:Ce(E$e({size:e,className:t})),...r})}var A$e={clip:{label:"Media Clip",description:"Clip the media to a specific time range",icon:qm},timestamp:{label:"Timestamp",description:"Set the timestamp for the media",icon:Ru},muted:{label:"Muted",description:"Mute the media",icon:Wm},volume:{label:"Volume",description:"Volume level",icon:Gm},autoPlay:{label:"Auto Play",description:"Start playing automatically",icon:Lu},loop:{label:"Loop",description:"Restart playback when it ends",icon:q0},showControls:{label:"Controls",description:"Display player controls",icon:Fm},title:{label:"Title",description:"Custom title for the media",icon:X0,placeholder:"Enter title"},audioGain:{label:"Audio Gain",description:"Audio amplification multiplier",icon:k0,min:0,max:5,step:.1},playbackRate:{label:"Playback Rate",description:"Playback speed multiplier",icon:M0,min:.25,max:8,step:.1},preservePitch:{label:"Preserve Pitch",description:"Maintain audio pitch when changing speed",icon:jm},aspectRatio:{label:"Aspect Ratio",description:"Video aspect ratio (e.g., 16:9)",icon:D0},flip:{label:"Flip",description:"Mirror video horizontally or vertically",icon:_u,options:[{value:"none",label:"None"},{value:"horizontal",label:"Horizontal"},{value:"vertical",label:"Vertical"}]},crossOrigin:{label:"Cross Origin",description:"CORS policy for media loading",icon:_0,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:tx,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:nx,options:[{value:"eager",label:"Eager"},{value:"play",label:"On Play"}]}};function XA({form:t,defaultValues:e={clip:{}},fallbackValues:r,onSubmit:n,onError:i,settingItems:s,fields:a={},description:o,submitLabel:l="Apply"}){let c=gBe(A$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(MVe,{form:t,icon:c[y].icon,label:c[y].label,description:c[y].description,onReset:()=>u(y)},y);let x=w=>g.jsx(joe,{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(Gg,{children:[x(w),g.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:g.jsx(qr,{children:g.jsx(Ile,{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(Gg,{children:[x(w),g.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:g.jsx(qr,{children:g.jsx(I$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(Gg,{children:[x(w),g.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:g.jsx(qr,{children:g.jsx($8,{...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(Gg,{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(r$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(Gg,{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(zA,{...t,children:g.jsx("form",{onSubmit:t.handleSubmit(y=>{let x=bBe(y,s),w=vBe(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(Bm,{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(P$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(xje,{className:"border-b border-border",form:t,onReset:v,defaultMode:e.clip?"clip":e.timestamp?"timestamp":h<m?"clip":"timestamp"}):h>=0?g.jsx(rle,{className:"border-b border-border",form:t,onReset:v}):m>=0?g.jsx(nle,{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 P$e({form:t,onResetAll:e,onReset:r,fields:n}){let i=u9({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 b9(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(ile,{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(Mu,{className:"size-3"}),"Reset to current"]})]})}var O1={},Bae=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,Vae=t=>"init"in t,C8=t=>!!t.write,jae=t=>"v"in t||"e"in t,kA=t=>{if("e"in t)throw t.e;if((O1?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},DA=new WeakMap,$ae=t=>{var e;return NA(t)&&!!((e=DA.get(t))!=null&&e[0])},R$e=t=>{let e=DA.get(t);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(r=>r()))},Ale=(t,e)=>{let r=DA.get(t);if(!r){r=[!0,new Set],DA.set(t,r);let n=()=>{r[0]=!1};t.then(n,n)}r[1].add(e)},NA=t=>typeof t?.then=="function",Ple=(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(NA(e))for(let a of n.d.keys())Ple(t,e,r(a));n.v=e,delete n.e,(!i||!Object.is(s,n.v))&&(++n.n,NA(s)&&R$e(s))},Uae=(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},L$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},M$e=t=>(t.c||(t.c=E8()),t.m||(t.m=E8()),t.u||(t.u=E8()),t.f||(t.f=L$e()),t),_$e=Symbol(),O$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((O1?"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((O1?"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 Uae(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(jae(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(Bae(S,V)){let Me=f(V);if(!jae(Me))if(Vae(V))T8(V,V.init,f);else throw new Error("no atom init");return kA(Me)}let de=m(V);try{return kA(de)}finally{E.d.set(V,de.n),$ae(E.v)&&Ple(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(O1?"production":void 0)!=="production"&&!C8(S)&&console.warn("setSelf function cannot be used with read-only atom"),!M&&C8(S)&&(M=(...V)=>{if((O1?"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),NA(V)&&(Ale(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 Uae(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=>kA(m(I)),R=(I,...B)=>{var M;let z=f(I);try{if(Bae(S,I)){if(!Vae(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&&!$ae(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=>kA(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,_$e,{value:C}),O},Rle=O$e,D$e=M$e,zae=Ale,E9={},N$e=0;function cd(t,e){let r=`atom${++N$e}`,n={toString(){return(E9?"production":void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof t=="function"?n.read=t:(n.init=t,n.read=F$e,n.write=B$e),e&&(n.write=e),n}function F$e(t){return t(this)}function B$e(t,e,r){return e(this,typeof r=="function"?r(t(this)):r)}var V$e=()=>{let t=0,e=D$e({}),r=new WeakMap,n=new WeakMap,i=Rle(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 Lle(){return(E9?"production":void 0)!=="production"?V$e():Rle()}var P1;function j$e(){return P1||(P1=Lle(),(E9?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=P1),globalThis.__JOTAI_DEFAULT_STORE__!==P1&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),P1}var $$e={},Mle=(0,$.createContext)(void 0);function QA(t){return(0,$.useContext)(Mle)||j$e()}function U$e({children:t,store:e}){let r=(0,$.useRef)(void 0);return!e&&!r.current&&(r.current=Lle()),(0,$.createElement)(Mle.Provider,{value:e||r.current},t)}var _le=t=>typeof t?.then=="function",z$e=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},q$e=$.default.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(z$e(t),t)}),I8=new WeakMap,H$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();_le(c)?(I8.set(c,r),s=c,c.then(a(c),o(c)),zae(c,l)):n(c)}catch(c){i(c)}};t.then(a(t),o(t)),zae(t,l)}),I8.set(t,r)),r};function I9(t,e){let r=QA(),[[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),_le(o)){let l=H$e(o,()=>r.get(t));return q$e(l)}return o}function X8(t,e){let r=QA();return(0,$.useCallback)((...n)=>{if(($$e?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return r.set(t,...n)},[r,t])}function G$e(t,e){return[I9(t),X8(t)]}function W$e(t){let e=cd(0),r=cd(()=>({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=cd(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=cd(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 Q8(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 K$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 Y$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 X$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 qae(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 Hae(t,e,r){return r?t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height:!1}var Ole=(0,$.createContext)(null);function Q$e(){let t=(0,$.use)(Ole);if(!t)throw new Error("ImageClipper components must be used within ImageClipper.Root");return t}var Xp=cd(null),A9=cd(null),Yg=cd(null),Z$e=W$e(t=>{let e=t(Yg),r=t(A9),n=t(Xp);if(e&&r){e.width=r.naturalWidth,e.height=r.naturalHeight;let i=Q8(e);Y$e({selection:n,canvas:e,image:r,scale:i})}}),IA=cd("crosshair");function J$e(){let t=QA(),e=(0,$.useRef)({mode:"none",handle:null,startX:0,startY:0});return(0,$.useMemo)(()=>{let r=(i,s)=>{let a=t.get(Xp),o=t.get(Yg);if(!o)return;let l=Q8(o),c=qae(i,s,a,l);c?t.set(IA,X$e(c)):Hae(i,s,a)?t.set(IA,"move"):t.set(IA,"crosshair")},n=i=>{t.set(Xp,i)};return{handleInteractionStart:i=>{i.preventDefault();let s=t.get(Yg),a=t.get(Xp);if(!s)return;let o=A8(i.nativeEvent,s),l=Q8(s),c=qae(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):Hae(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(Yg),a=t.get(Xp);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(Yg);if(!s)return;let a=A8(i.nativeEvent,s);r(a.x,a.y)}}}},[t])}var eUe=({className:t,onMouseDown:e,onMouseMove:r,onMouseUp:n,onTouchStart:i,onTouchMove:s,onTouchEnd:a,style:o,...l})=>{G$e(Z$e);let c=X8(A9),u=X8(Yg),{imageBlob:d}=Q$e(),{handleInteractionStart:f,handleInteractionMove:p,handleInteractionEnd:h,handleMouseHover:m}=J$e(),v=I9(IA);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})},Gae=({onClip:t,type:e="button",onClick:r,className:n,format:i,quality:s,...a})=>{let o=QA(),l=I9(Xp),c=(0,$.useCallback)(async u=>{r?.(u);let d=o.get(Xp),f=o.get(A9);!d||!f||t==null||t(u,K$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})},tUe=({children:t,format:e,imageBlob:r})=>g.jsx(U$e,{children:g.jsx(Ole.Provider,{value:{imageBlob:r,format:e},children:t})});function Dle({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(tUe,{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(eUe,{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(Gae,{size:"sm",variant:"outline",onClip:(a,o)=>e?.(a,o),disabled:i,...n,children:[i?g.jsx(ro,{className:"size-4 animate-spin"}):g.jsx(Nm,{className:"size-4"}),"Copy"]}),r&&g.jsxs(Gae,{variant:"default",size:"sm",onClip:r,disabled:s,...n,children:[s?g.jsx(ro,{className:"size-4 animate-spin"}):g.jsx(zm,{className:"size-4"}),"Save"]})]})]})})}var Wae=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Zi=t=>!t||typeof t!="object"||Object.keys(t).length===0,rUe=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function Nle(t,e){t.forEach(function(r){Array.isArray(r)?Nle(r,e):e.push(r)})}function Fle(t){let e=[];return Nle(t,e),e}var Ble=(...t)=>Fle(t).filter(Boolean),Vle=(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]=Ble(o,a):typeof a=="object"&&typeof o=="object"?r[s]=Vle(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},Kae=t=>!t||typeof t!="string"?t:t.replace(/\s+/g," ").trim(),P9="-",nUe=t=>{let e=sUe(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:i=>{let s=i.split(P9);return s[0]===""&&s.length!==1&&s.shift(),jle(s,e)||iUe(i)},getConflictingClassGroupIds:(i,s)=>{let a=r[i]||[];return s&&n[i]?[...a,...n[i]]:a}}},jle=(t,e)=>{var r;if(t.length===0)return e.classGroupId;let n=t[0],i=e.nextPart.get(n),s=i?jle(t.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;let a=t.join(P9);return(r=e.validators.find(({validator:o})=>o(a)))==null?void 0:r.classGroupId},Yae=/^\[(.+)\]$/,iUe=t=>{if(Yae.test(t)){let e=Yae.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},sUe=t=>{let{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return oUe(Object.entries(t.classGroups),r).forEach(([i,s])=>{Z8(s,n,i,e)}),n},Z8=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){let s=i===""?e:Xae(e,i);s.classGroupId=r;return}if(typeof i=="function"){if(aUe(i)){Z8(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,a])=>{Z8(a,Xae(e,s),r,n)})})},Xae=(t,e)=>{let r=t;return e.split(P9).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},aUe=t=>t.isThemeGetter,oUe=(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,lUe=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)}}},$le="!",cUe=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($le),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},uUe=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},dUe=t=>({cache:lUe(t.cacheSize),parseClassName:cUe(t),...nUe(t)}),fUe=/\s+/,pUe=(t,e)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=e,s=[],a=t.trim().split(fUe),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=uUe(u).join(":"),b=d?v+$le: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 hUe(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=Ule(e))&&(n&&(n+=" "),n+=r);return n}var Ule=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Ule(t[n]))&&(r&&(r+=" "),r+=e);return r};function J8(t,...e){let r,n,i,s=a;function a(l){let c=e.reduce((u,d)=>d(u),t());return r=dUe(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=pUe(l,r);return i(l,u),u}return function(){return s(hUe.apply(null,arguments))}}var tr=t=>{let e=r=>r[t]||[];return e.isThemeGetter=!0,e},zle=/^\[(?:([a-z-]+):)?(.+)\]$/i,mUe=/^\d+\/\d+$/,gUe=new Set(["px","full","screen"]),yUe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vUe=/\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$/,bUe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,xUe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wUe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ic=t=>Qg(t)||gUe.has(t)||mUe.test(t),sd=t=>iy(t,"length",PUe),Qg=t=>!!t&&!Number.isNaN(Number(t)),P8=t=>iy(t,"number",Qg),R1=t=>!!t&&Number.isInteger(Number(t)),kUe=t=>t.endsWith("%")&&Qg(t.slice(0,-1)),Ye=t=>zle.test(t),ad=t=>yUe.test(t),SUe=new Set(["length","size","percentage"]),CUe=t=>iy(t,SUe,qle),TUe=t=>iy(t,"position",qle),EUe=new Set(["image","url"]),IUe=t=>iy(t,EUe,LUe),AUe=t=>iy(t,"",RUe),L1=()=>!0,iy=(t,e,r)=>{let n=zle.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},PUe=t=>vUe.test(t)&&!bUe.test(t),qle=()=>!1,RUe=t=>xUe.test(t),LUe=t=>wUe.test(t),e9=()=>{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=()=>["",Ic,sd],M=()=>["auto",Qg,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"],ht=()=>[Qg,Ye];return{cacheSize:500,separator:":",theme:{colors:[L1],spacing:[Ic,sd],blur:["none","",ad,Ye],brightness:ht(),borderColor:[t],borderRadius:["none","","full",ad,Ye],borderSpacing:I(),borderWidth:B(),contrast:ht(),grayscale:de(),hueRotate:ht(),invert:de(),gap:I(),gradientColorStops:[t],gradientColorStopPositions:[kUe,sd],inset:R(),margin:R(),opacity:ht(),padding:I(),saturate:ht(),scale:ht(),sepia:de(),skew:ht(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[ad]}],"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",R1,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",R1,Ye]}],"grid-cols":[{"grid-cols":[L1]}],"col-start-end":[{col:["auto",{span:["full",R1,Ye]},Ye]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[L1]}],"row-start-end":[{row:["auto",{span:[R1,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:[ad]},ad]}],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",ad,sd]}],"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:[L1]}],"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",Qg,P8]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ic,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",Ic,sd]}],"underline-offset":[{"underline-offset":["auto",Ic,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(),TUe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",CUe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},IUe]}],"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":[Ic,Ye]}],"outline-w":[{outline:[Ic,sd]}],"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":[Ic,sd]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ad,AUe]}],"shadow-color":[{shadow:[L1]}],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",ad,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:ht()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:ht()}],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:[R1,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:[Ic,sd,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"]}}},MUe=(t,{cacheSize:e,prefix:r,separator:n,experimentalParseClassName:i,extend:s={},override:a={}})=>{D1(t,"cacheSize",e),D1(t,"prefix",r),D1(t,"separator",n),D1(t,"experimentalParseClassName",i);for(let o in a)_Ue(t[o],a[o]);for(let o in s)OUe(t[o],s[o]);return t},D1=(t,e,r)=>{r!==void 0&&(t[e]=r)},_Ue=(t,e)=>{if(e)for(let r in e)D1(t,r,e[r])},OUe=(t,e)=>{if(e)for(let r in e){let n=e[r];n!==void 0&&(t[r]=(t[r]||[]).concat(n))}},DUe=(t,...e)=>typeof t=="function"?J8(e9,t,...e):J8(()=>MUe(e9(),t),...e),NUe=J8(e9),FUe={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},Hle=t=>t||void 0,B1=(...t)=>Hle(Fle(t).filter(Boolean).join(" ")),R8=null,Ac={},t9=!1,M1=(...t)=>e=>e.twMerge?((!R8||t9)&&(t9=!1,R8=Zi(Ac)?NUe:DUe({...Ac,extend:{theme:Ac.theme,classGroups:Ac.classGroups,conflictingClassGroupModifiers:Ac.conflictingClassGroupModifiers,conflictingClassGroups:Ac.conflictingClassGroups,...Ac.extend}})),Hle(R8(B1(t)))):B1(t),Qae=(t,e)=>{for(let r in e)t.hasOwnProperty(r)?t[r]=B1(t[r],e[r]):t[r]=e[r];return t},Jp=(t,e)=>{let{extend:r=null,slots:n={},variants:i={},compoundVariants:s=[],compoundSlots:a=[],defaultVariants:o={}}=t,l={...FUe,...e},c=r!=null&&r.base?B1(r.base,t?.base):t?.base,u=r!=null&&r.variants&&!Zi(r.variants)?Vle(i,r.variants):i,d=r!=null&&r.defaultVariants&&!Zi(r.defaultVariants)?{...r.defaultVariants,...o}:o;!Zi(l.twMergeConfig)&&!rUe(l.twMergeConfig,Ac)&&(t9=!0,Ac=l.twMergeConfig);let f=Zi(r?.slots),p=Zi(n)?{}:{base:B1(t?.base,f&&r?.base),...n},h=f?p:Qae({...r?.slots},Zi(p)?{base:t?.base}:p),m=Zi(r?.compoundVariants)?s:Ble(r?.compoundVariants,s),v=y=>{if(Zi(u)&&Zi(n)&&f)return M1(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(Kae(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=Kae(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=Wae(K),Me=Array.isArray(l.responsiveVariants)&&l.responsiveVariants.length>0||l.responsiveVariants===!0,ht=d?.[I],At=[];if(typeof de=="object"&&Me)for(let[Kr,Di]of Object.entries(de)){let lt=V[Di];if(Kr==="initial"){ht=Di;continue}Array.isArray(l.responsiveVariants)&&!l.responsiveVariants.includes(Kr)||(At=x(Kr,lt,At,M))}let Ue=de!=null&&typeof de!="object"?de:Wae(ht),Gt=V[Ue||"false"];return typeof At=="object"&&typeof M=="string"&&At[M]?Qae(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 ht=T(de,B)[de];if(Array.isArray(Me)){if(!Me.includes(ht)){K=!1;break}}else{let At=Ue=>Ue==null||Ue===!1;if(At(Me)&&At(ht))continue;if(ht!==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=M1(M.base,z)(l)),typeof z=="object")for(let[G,V]of Object.entries(z))M[G]=M1(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 M1(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 M1(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},BUe=Jp({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"}}),Rc=Jp({extend:BUe,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 Gle({className:t,variant:e,size:r,...n}){let i=Rc({variant:e,size:r});return g.jsx("button",{className:i.base({className:t}),...n,children:g.jsx(Pu,{className:i.icon()})})}function Wle({className:t,variant:e,size:r,...n}){let i=Rc({variant:e,size:r});return g.jsx("button",{className:i.base({className:t}),...n,children:g.jsx(W0,{className:i.icon()})})}var VUe="Separator",Zae="horizontal",jUe=["horizontal","vertical"],Kle=N.forwardRef((t,e)=>{let{decorative:r,orientation:n=Zae,...i}=t,s=$Ue(n)?n:Zae,a=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return g.jsx(ko.div,{"data-orientation":s,...a,...i,ref:e})});Kle.displayName=VUe;function $Ue(t){return jUe.includes(t)}var UUe=Kle;function q1({className:t,orientation:e="horizontal",decorative:r=!0,...n}){return g.jsx(UUe,{"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 ZA({className:t,variant:e,size:r,...n}){let i=Rc({variant:e,size:r});return g.jsxs(V2,{className:i.base({className:t}),...n,children:[g.jsx(Lu,{className:i.icon({class:"not-group-data-paused:opacity-0"})}),g.jsx(j0,{className:i.icon({class:"group-data-paused:opacity-0"})})]})}function FA({seconds:t=30,className:e,variant:r,size:n,...i}){if(t===0)return null;let s=t>0?U0:J0,a=Rc({variant:r,size:n});return g.jsx(q2,{className:a.base({className:e}),seconds:t,...i,children:g.jsx(s,{className:a.icon()})})}var H1=(0,$.createContext)({});function Yle({className:t,onTimestamp:e,onScreenshot:r,onTogglePip:n,onResetClip:i,flip:s="none",coverImage:a,creator:o,...l}){return g.jsx(H1.Provider,{value:{onTimestamp:e,onScreenshot:r,onTogglePip:n,onResetClip:i,coverImage:a,creator:o},children:g.jsx(gF,{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 zUe=Jp({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 Xle({size:t,className:e}){let{coverImage:r}=(0,$.useContext)(H1),[n,i]=(0,$.useState)(!1),[s,a]=(0,$.useState)(!1),o=zUe({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(jm,{className:o.fallback()})]})}function qUe(t){let e=getComputedStyle(t);return e.display!=="none"&&Number.parseInt(e.opacity,10)>0}function HUe(t){return!!t&&("checkVisibility"in t?t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):qUe(t))}function hd({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=pc(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(HUe(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 GUe=Jp({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 JA({className:t,...e}){let r=Wi("title"),n=K2(),{creator:i}=(0,$.useContext)(H1),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}=GUe({variant:s});return g.jsxs("div",{"data-title":s,className:f({className:t}),...e,children:[g.jsxs("div",{className:u(),children:[g.jsx(O0,{className:d()}),g.jsx("h2",{className:c(),children:n})]}),g.jsx(q1,{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 WUe(){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 KUe=async()=>(L8!==void 0||(L8=WUe()),L8);function YUe({className:t,variant:e,size:r,...n}){let i=Rc({variant:e,size:r});return g.jsxs(U2,{className:i.base({className:t}),...n,children:[g.jsx(Wm,{className:i.icon({class:"not-group-data-muted:opacity-0"})}),g.jsx(rx,{className:i.icon({class:"group-data-[state=high]:opacity-0 group-data-muted:opacity-0"})}),g.jsx(Gm,{className:i.icon({class:"not-group-data-[state=high]:opacity-0 group-data-muted:opacity-0"})})]})}function XUe(){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 QUe=Jp({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:Qle,track:ZUe,preview:JUe,trackFill:eze,thumb:tze}=QUe();function Zle({className:t,focus:e,variant:r,tooltip:n,...i}){return g.jsx(_w.Track,{className:ZUe({className:t,variant:r,focus:e,tooltip:n}),...i})}function Jle({className:t,variant:e,focus:r,tooltip:n,...i}){return g.jsx(_w.TrackFill,{className:eze({className:t,variant:e,focus:r,tooltip:n}),...i})}function ece({className:t,variant:e,focus:r,tooltip:n,...i}){return g.jsx(_w.Thumb,{className:tze({className:t,variant:e,focus:r,tooltip:n}),...i})}function rze({ref:t,children:e,className:r,style:n,variant:i,focus:s,tooltip:a,...o}){let[l,{width:c}]=XUe(),u=c?`calc(var(--slider-pointer) - ${c/2}px)`:"calc(var(--slider-pointer))";return g.jsx("div",{ref:yT([l,t]),className:JUe({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 nze({className:t,variant:e,...r}){return g.jsxs(fF.Root,{className:Ce("max-w-20",Qle({className:t,variant:e})),...r,children:[g.jsx(Zle,{focus:"default",variant:e,children:g.jsx(Jle,{variant:e})}),g.jsx(ece,{variant:e})]})}var ize=Jp({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:sze,slider:aze}=ize();function oze(){let[t,e]=(0,$.useState)(null);return(0,$.useEffect)(()=>{KUe().then(e)},[]),t}function eP({className:t,direction:e,variant:r,sliderVariant:n,size:i,...s}){let a=oze();return g.jsxs("div",{className:sze({direction:e,className:t}),"data-supported":a===!1?void 0:"",...s,children:[g.jsx(YUe,{className:"peer",variant:r,size:i}),g.jsx("div",{className:aze({direction:e}),children:g.jsx(nze,{className:"h-full w-full",variant:n})})]})}function tP({className:t,variant:e,focus:r,tooltip:n,...i}){let s={variant:e,focus:r,tooltip:n};return g.jsxs(wp.Root,{className:Ce(Qle({className:t}),"rounded-none"),...s,...i,children:[g.jsx(wp.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(Zle,{...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(Jle,{...s,className:Ce("z-10 w-(--chapter-fill) rounded-sm")}),g.jsx(wp.Progress,{className:"absolute h-full w-(--chapter-progress) rounded-sm bg-primary/40 will-change-[width]"})]})},l.startTime))}),g.jsxs(rze,{...s,children:[g.jsx(wp.ChapterTitle,{className:Ce("text-sm",s.variant==="audio"&&"rounded-sm bg-background/90 px-2 py-1")}),g.jsx(wp.Value,{className:"rounded-sm bg-secondary px-2 py-px text-[13px] font-medium text-secondary-foreground"})]}),g.jsx(ece,{...s})]})}function lze({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(Xle,{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(JA,{})}),g.jsxs("div",{className:"flex items-center gap-x-1.5 pl-2 text-sm font-medium",children:[g.jsx(hd,{type:"current"}),g.jsx(q1,{className:"data-[orientation=vertical]:h-3",orientation:"vertical"}),g.jsx(hd,{type:"duration"})]})]}),g.jsxs(gr.Group,{className:"col-start-2 row-start-2 flex items-center gap-x-1 pl-1",children:[g.jsx(FA,{seconds:-30,variant:"ghost"}),g.jsx(ZA,{variant:"ghost"}),g.jsx(FA,{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(tP,{variant:"audio"})})}),g.jsxs(gr.Group,{className:"col-start-4 row-start-2 flex w-full items-center justify-end",children:[g.jsx(eP,{variant:"ghost",direction:"reverse"}),t]})]})}function cze({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(tP,{variant:"audio"})})}),g.jsxs(gr.Group,{className:"peer/title col-span-3 mt-2 flex items-center gap-2",children:[g.jsx(Xle,{size:"mobile"}),g.jsx("div",{className:"h-full w-full min-w-0",children:g.jsx(JA,{})}),g.jsxs("div",{className:"flex items-center gap-x-1.5 pl-2 text-sm font-medium",children:[g.jsx(hd,{type:"current"}),g.jsx(q1,{className:"h-3",orientation:"vertical"}),g.jsx(hd,{type:"duration"})]})]}),g.jsx(gr.Group,{className:"col-start-1 row-start-3 flex w-full items-end",children:g.jsx(eP,{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(FA,{seconds:-30,variant:"ghost"}),g.jsx(ZA,{variant:"outline",size:"center"}),g.jsx(FA,{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 tce({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(lze,{utilsSlot:t}),g.jsx(cze,{utilsSlot:t})]})}var uze="_captions_1ihkv_9",dze={captions:uze},fze=Jp({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"}}}),SA=(0,$.forwardRef)(function({className:t,area:e,...r},n){return g.jsx(G2,{className:fze({className:t,area:e}),ref:n,...r})});function pze(){return g.jsxs(g.Fragment,{children:[g.jsx(SA,{area:"full",event:"pointerup",action:"toggle:paused"}),g.jsx(SA,{area:"full",event:"dblpointerup",action:"toggle:fullscreen"}),g.jsx(SA,{area:"left",event:"dblpointerup",action:"seek:-10"}),g.jsx(SA,{area:"right",event:"dblpointerup",action:"seek:10"})]})}function rce({className:t,variant:e,size:r,...n}){let i=Rc({variant:e,size:r});return g.jsxs(j2,{className:i.base({className:t,"may-support":!0}),...n,children:[g.jsx(E0,{className:i.icon({active:!0})}),g.jsx(Zl,{className:i.icon({inactive:!0})})]})}function nce({className:t,variant:e,size:r,...n}){let i=Rc({variant:e,size:r});return g.jsxs($2,{className:i.base({className:t,"may-support":!0}),...n,children:[g.jsx(F0,{className:i.icon({active:!0})}),g.jsx(V0,{className:i.icon({inactive:!0})})]})}function ice({className:t,variant:e,size:r,...n}){let{onTogglePip:i}=(0,$.use)(H1),s=W2(),a=Rc({variant:e,size:r});return i&&s?g.jsx("button",{className:a.base({className:t}),...n,onClick:()=>i(s),children:g.jsx($m,{className:a.icon({active:!0})})}):g.jsxs(z2,{className:a.base({className:t,"may-support":!0}),...n,children:[g.jsx($m,{className:a.icon({inactive:!0})}),g.jsx($0,{className:a.icon({active:!0})})]})}function hze({className:t,variant:e,size:r,asChild:n=!1,...i}){let s=n?UA:"button",a=Rc({variant:e,size:r});return g.jsx(s,{"data-slot":"button",className:a.base({className:t}),...i})}var M8=t=>!Number.isNaN(t)&&t>0;function sce(){let{clipStartTime:t,clipEndTime:e}=B2(),r=W2(),{onResetClip:n}=(0,$.use)(H1);if(!M8(t)&&!M8(e))return null;let i=t>0?pc(t):"start",s=M8(e)&&Number.isFinite(e)?pc(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(Ou,{className:"size-4 text-primary"})}),n&&r&&g.jsx(hze,{type:"button",onClick:()=>n(r),title:"Reset clip",children:g.jsx(Z0,{})})]})}function mze({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(JA,{})}),g.jsx(gr.Group,{className:"col-span-1 flex w-full place-content-end items-center overflow-hidden",children:g.jsx(sce,{})}),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(ZA,{}),g.jsx(eP,{sliderVariant:"video"}),g.jsxs("div",{className:"ml-2 flex items-center gap-x-1.5 text-sm font-medium",children:[g.jsx(hd,{type:"current"}),g.jsx(q1,{className:"h-3 bg-foreground/80",orientation:"vertical"}),g.jsx(hd,{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(nce,{className:"peer"}),g.jsx(ice,{className:"max-w-full opacity-100"})]}),g.jsx(rce,{})]}),g.jsx(gr.Group,{className:"col-span-3 flex w-full items-center px-1 row-start-3",children:g.jsx(tP,{variant:"video"})})]})})}function gze({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(JA,{})}),g.jsxs(gr.Group,{className:"col-span-1 flex w-full place-content-end items-center overflow-hidden",children:[g.jsx(sce,{}),g.jsx(rce,{}),t]}),g.jsx("div",{className:"pointer-events-none col-span-3 flex items-center justify-center",children:g.jsx(ZA,{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(hd,{type:"current"}),g.jsx(q1,{className:"h-3 bg-foreground/80",orientation:"vertical"}),g.jsx(hd,{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(nce,{className:"peer"}),g.jsx(ice,{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(eP,{direction:"reverse",sliderVariant:"video"})]}),g.jsx(gr.Group,{className:"col-span-3 flex w-full items-center px-1",children:g.jsx(tP,{variant:"video"})})]})})}function ace({utilsSlot:t}){return Wi("viewType")==="audio"?null:g.jsxs(g.Fragment,{children:[g.jsx(pze,{}),g.jsx(Y2,{className:Ce(`${dze.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(gze,{utilsSlot:t}),g.jsx(mze,{utilsSlot:t})]})}function yze({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(ec,{className:"size-4 text-success"});case"not-matched":return g.jsx(Iu,{className:"size-4 text-warning"});case"invalid-pattern":case"error":return g.jsx(Jl,{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(Y0,{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 oce({defaultValues:t,resolver:e,onSave:r,onInvalid:n,onCancel:i,testPattern:s}){let a=p9({resolver:e,defaultValues:{...t,pattern:"",username:"",password:""}}),o=a.watch("pattern"),l=c=>s(o||"",c);return g.jsx(zA,{...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(yze,{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(zm,{className:"size-4"}),"Save"]})]})]})})}function vze(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}):xze(t)}var bze=[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 xze(t){for(let e of bze)try{let r=e(t);if(typeof r=="string")return r}catch{}return"[[Unable to format value]]"}var r9=class extends Error{constructor(e,r){super(e,r),this.name="AssertionError"}};function n9(t,e){throw new r9(`Expect ${vze(t)} to be of type never`)}function Jae(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=wze(()=>{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 eoe=2**31-1;function wze(t,e){let r=e=Math.trunc(Math.max(e,0)||0),n=Date.now(),i,s=()=>{r=e-(Date.now()-n),i=r>eoe?setTimeout(s,eoe):setTimeout(t,r)};return s(),{valueOf:()=>i}}function od({className:t,...e}){return g.jsx("div",{"data-slot":"skeleton",className:Ce("bg-accent animate-pulse rounded-md",t),...e})}function lce({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(toe,{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(toe,{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(P0,{className:"size-3"}):g.jsx(Fm,{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(Q0,{className:"size-4"})]})]})]})})}function cce({children:t}){return g.jsx("ul",{className:"flex flex-col gap-4 h-full",children:t})}function uce({onAdd:t}){return g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-12 text-center",children:[g.jsx(N0,{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(Um,{}),"Add Password"]})]})}function dce(){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(od,{className:"h-3 w-16 mb-2"}),g.jsx(od,{className:"h-4 w-32"})]}),g.jsxs("div",{className:"min-w-0",children:[g.jsx(od,{className:"h-3 w-12 mb-2"}),g.jsx(od,{className:"h-4 w-24"})]}),g.jsxs("div",{className:"min-w-0",children:[g.jsx(od,{className:"h-3 w-12 mb-2"}),g.jsx(od,{className:"h-4 w-20"})]})]}),g.jsxs("div",{className:"flex items-center space-x-1 ml-6 shrink-0",children:[g.jsx(od,{className:"h-7 w-7 rounded-sm"}),g.jsx(od,{className:"h-7 w-7 rounded-sm"})]})]})},`skeleton-${e}`))})}function kze(){let[t,e]=(0,$.useState)("idle");return{copyState:t,copy:(0,$.useCallback)((r,n={})=>{let i=new AbortController;Jae(200,{signal:i.signal}).then(()=>e("copying")).catch(()=>{}),navigator.clipboard.writeText(r).then(()=>e("copied")).catch(()=>e("error")).finally(async()=>{i.abort(),await Jae(n.timeout??2e3),e("idle")})},[])}}function toe({value:t,target:e}){let{copyState:r,copy:n}=kze(),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`:n9(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(Nm,{className:"size-3"}):r==="copied"?g.jsx(ep,{className:"size-3"}):r==="error"?g.jsx(el,{className:"size-3"}):r==="copying"?g.jsx(ro,{className:"size-3 animate-spin"}):n9(r)]})}function fce({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 Sze({className:t,...e}){return g.jsx("div",{"data-slot":"card-content",className:Ce("px-6",t),...e})}function pce({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(ele,{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 roe=(t,e,r)=>{if(t&&"reportValidity"in t){let n=ae(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},Cze=(t,e)=>{for(let r in e.fields){let n=e.fields[r];n&&n.ref&&"reportValidity"in n.ref?roe(n.ref,r,t):n&&n.refs&&n.refs.forEach(i=>roe(i,r,t))}},Tze=(t,e)=>{e.shouldUseNativeValidation&&Cze(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(Eze(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},Eze=(t,e)=>{let r=noe(e);return t.some(n=>noe(n).match(`^${r}\\.\\d+`))};function noe(t){return t.replace(/\]|\[/g,"")}function hce(t,e,r){return r===void 0&&(r={}),function(n,i,s){try{var a=!s.shouldUseNativeValidation&&s.criteriaMode==="all";return Promise.resolve(VVe(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=FVe(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]=moe(u,a,l,c.type,f?[].concat(f,c.message):c.message)}o.issues.shift()}return{values:{},errors:Tze(l,s)}}return{values:r.raw?Object.assign({},n):o.output,errors:{}}})}catch(o){return Promise.reject(o)}}}var Ize=pd({"track-kind":Jg(["captions","subtitles"]),"default-enable":hl(),label:Pc(yl()),language:Pc(yl()),file:v9([qoe("Please select a text track file."),pd({path:yl(),name:yl()})])}),Aze=pd({"track-kind":Jg(["captions","subtitles"]),"default-enable":hl(),label:Pc(yl()),language:Pc(yl()),url:Ea(yl(),zoe("Please enter a valid URL.")),"should-download":hl(),format:Pc(Jg(["vtt","srt","ass","ssa"]))}),Pze=hce(Aze),Rze=hce(Ize);function Lze(t){let e=t+"CollectionProvider",[r,n]=U1(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=Zg(h,b.collectionRef);return g.jsx(_A,{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=Zg(h,y),w=s(c,m);return $.default.useEffect(()=>(w.itemMap.set(y,{ref:y,...b}),()=>void w.itemMap.delete(y))),g.jsx(_A,{[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 Mze=N.useId||(()=>{}),_ze=0;function Oze(t){let[e,r]=N.useState(Mze());return OA(()=>{r(n=>n??String(_ze++))},[t]),e?`radix-${e}`:""}var Dze=N.createContext(void 0);function mce(t){let e=N.useContext(Dze);return t||e||"ltr"}var _8="rovingFocusGroup.onEntryFocus",Nze={bubbles:!1,cancelable:!0},rP="RovingFocusGroup",[i9,gce,Fze]=Lze(rP),[Bze,yce]=U1(rP,[Fze]),[Vze,jze]=Bze(rP),vce=N.forwardRef((t,e)=>g.jsx(i9.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(i9.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx($ze,{...t,ref:e})})}));vce.displayName=rP;var $ze=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=Zg(e,f),h=mce(s),[m=null,v]=ry({prop:a,defaultProp:o,onChange:l}),[b,y]=N.useState(!1),x=x9(c),w=gce(r),C=N.useRef(!1),[O,S]=N.useState(0);return N.useEffect(()=>{let T=f.current;if(T)return T.addEventListener(_8,x),()=>T.removeEventListener(_8,x)},[x]),g.jsx(Vze,{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(ko.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(_8,Nze);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);wce(M,u)}}C.current=!1}),onBlur:vl(t.onBlur,()=>y(!1))})})}),bce="RovingFocusGroupItem",xce=N.forwardRef((t,e)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...a}=t,o=Oze(),l=s||o,c=jze(bce,r),u=c.currentTabStopId===l,d=gce(r),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return N.useEffect(()=>{if(n)return f(),()=>p()},[n,f,p]),g.jsx(i9.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:g.jsx(ko.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=qze(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?Hze(v,b+1):v.slice(b+1)}setTimeout(()=>wce(v))}})})})});xce.displayName=bce;var Uze={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zze(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function qze(t,e,r){let n=zze(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Uze[n]}function wce(t,e=!1){let r=document.activeElement;for(let n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function Hze(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var Gze=vce,Wze=xce,Kze="Toggle",kce=N.forwardRef((t,e)=>{let{pressed:r,defaultPressed:n=!1,onPressedChange:i,...s}=t,[a=!1,o]=ry({prop:r,onChange:i,defaultProp:n});return g.jsx(ko.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)})})});kce.displayName=Kze;var sy="ToggleGroup",[Sce,eTt]=U1(sy,[yce]),Cce=yce(),R9=$.default.forwardRef((t,e)=>{let{type:r,...n}=t;if(r==="single"){let i=n;return g.jsx(Yze,{...i,ref:e})}if(r==="multiple"){let i=n;return g.jsx(Xze,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${sy}\``)});R9.displayName=sy;var[Tce,Ece]=Sce(sy),Yze=$.default.forwardRef((t,e)=>{let{value:r,defaultValue:n,onValueChange:i=()=>{},...s}=t,[a,o]=ry({prop:r,defaultProp:n,onChange:i});return g.jsx(Tce,{scope:t.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:o,onItemDeactivate:$.default.useCallback(()=>o(""),[o]),children:g.jsx(Ice,{...s,ref:e})})}),Xze=$.default.forwardRef((t,e)=>{let{value:r,defaultValue:n,onValueChange:i=()=>{},...s}=t,[a=[],o]=ry({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(Tce,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:g.jsx(Ice,{...s,ref:e})})});R9.displayName=sy;var[Qze,Zze]=Sce(sy),Ice=$.default.forwardRef((t,e)=>{let{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:i=!0,orientation:s,dir:a,loop:o=!0,...l}=t,c=Cce(r),u=mce(a),d={role:"group",dir:u,...l};return g.jsx(Qze,{scope:r,rovingFocus:i,disabled:n,children:i?g.jsx(Gze,{asChild:!0,...c,orientation:s,dir:u,loop:o,children:g.jsx(ko.div,{...d,ref:e})}):g.jsx(ko.div,{...d,ref:e})})}),BA="ToggleGroupItem",Ace=$.default.forwardRef((t,e)=>{let r=Ece(BA,t.__scopeToggleGroup),n=Zze(BA,t.__scopeToggleGroup),i=Cce(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(Wze,{asChild:!0,...i,focusable:!a,active:s,ref:l,children:g.jsx(ioe,{...o,ref:e})}):g.jsx(ioe,{...o,ref:e})});Ace.displayName=BA;var ioe=$.default.forwardRef((t,e)=>{let{__scopeToggleGroup:r,value:n,...i}=t,s=Ece(BA,r),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=s.type==="single"?a:void 0;return g.jsx(kce,{...o,...i,ref:e,onPressedChange:l=>{l?s.onItemActivate(n):s.onItemDeactivate(n)}})}),Jze=R9,eqe=Ace,tqe=Zp("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"}}),Pce=N.createContext({size:"default",variant:"default"});function rqe({className:t,variant:e,size:r,children:n,...i}){return g.jsx(Jze,{"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(Pce.Provider,{value:{variant:e,size:r},children:n})})}function soe({className:t,children:e,variant:r,size:n,...i}){let s=N.useContext(Pce);return g.jsx(eqe,{"data-slot":"toggle-group-item","data-variant":s.variant||r,"data-size":s.size||n,className:Ce(tqe({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 Rce({onChange:t,disabled:e,value:r}){let n=(0,$.useId)();return g.jsxs(Sze,{className:"gap-4 flex flex-col px-4",children:[g.jsxs(rqe,{type:"single",onValueChange:i=>t(i),value:r,disabled:e,children:[g.jsxs(soe,{value:"captions","aria-label":"Caption","aria-describedby":`${n}-caption-desc`,className:"px-4",children:[g.jsx(Zl,{className:"size-4"}),"Caption"]}),g.jsxs(soe,{value:"subtitles","aria-label":"Subtitle","aria-describedby":`${n}-subtitle-desc`,className:"px-4",children:[g.jsx(Vm,{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 Lce(){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 Mce({onSubmit:t,renderFilePicker:e,isLoading:r=!1,disabled:n=!1,inferDefaults:i}){let s=p9({resolver:Rze,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(zA,{...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(Lce,{}),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(fce,{className:"py-4",children:g.jsx(Xt,{control:s.control,name:"track-kind",render:({field:l})=>g.jsx(Rce,{...l})})}),g.jsx(Xt,{control:s.control,name:"default-enable",render:({field:l})=>g.jsx(pce,{...l})}),g.jsx("div",{className:"flex justify-end",children:g.jsxs(Cr,{type:"submit",disabled:r||!s.formState.isValid||n,children:[g.jsx(R0,{className:"size-4"}),r?"Loading...":"Import"]})})]})})}function L9({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(tp,{className:"size-5 text-primary shrink-0"}):g.jsx(ex,{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 _ce({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=iqe(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 nqe(){return"oncancel"in HTMLInputElement.prototype}function iqe(t){if(nqe())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 Oce({onSubmit:t,isLoading:e=!1,disabled:r=!1}){let n=p9({resolver:Pze,mode:"onChange",defaultValues:{"track-kind":"captions","default-enable":!1,"should-download":!0}}),i=async s=>{await t?.(s)};return g.jsx(zA,{...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(Lce,{}),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(fce,{className:"py-4",children:g.jsx(Xt,{control:n.control,name:"track-kind",render:({field:s})=>g.jsx(Rce,{...s})})}),g.jsx(Xt,{control:n.control,name:"default-enable",render:({field:s})=>g.jsx(pce,{...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(Ile,{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(rp,{className:"size-4"}),e?"Loading...":"Import from URL"]})})]})})}function sqe({onClick:t}){return g.jsx(Cr,{type:"button",onClick:t,disabled:!t,size:"iconSubtitle",variant:"ghost",title:"Open in Obsidian",children:g.jsx(Au,{className:"size-4"})})}function aqe({onClick:t}){return g.jsx(Cr,{type:"button",onClick:t,disabled:!t,size:"iconSubtitle",variant:"ghost",title:"Import to Obsidian",children:g.jsx(A0,{className:"size-4"})})}function oqe({onClick:t}){return g.jsx(Cr,{type:"button",onClick:t,size:"iconSubtitle",disabled:!t,variant:"ghost",title:"Retry import",children:g.jsx(z0,{className:"size-4"})})}function lqe(){return g.jsx(Cr,{type:"button",disabled:!0,size:"iconSubtitle",variant:"ghost",title:"Importing...",children:g.jsx(ro,{className:"size-4 animate-spin"})})}function cqe({status:t}){return t==="success"?g.jsx(ec,{className:"size-4 text-green-600"}):t==="error"?g.jsx(Jl,{className:"size-4 text-red-600"}):null}function M9(t){let[e,r,...n]=t.split(/\s*-\s*/);return e===r&&n.length===0&&e?e:t.trim()}function VA(t){let[e,r]=t.split("-");return r&&!r.match(/^[a-z]{2}$/)?e:t}function O8({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?M9(e):r?VA(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(Hm,{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(Dm,{className:"size-3"})}),r&&e&&g.jsx(ile,{variant:"outline",className:"text-xs",children:VA(r)})]})}),g.jsxs("div",{className:"flex items-center gap-2 opacity-60 group-hover:opacity-100 transition-opacity",children:[g.jsx(cqe,{status:t}),t==="idle"?g.jsx(aqe,{onClick:n}):t==="importing"?g.jsx(lqe,{}):t==="success"?g.jsx(sqe,{onClick:i}):t==="error"?g.jsx(oqe,{onClick:s}):n9(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 aoe({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 ooe({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 uqe(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 D8(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 Dce({subtitles:t,userLanguage:e,onImport:r,onOpen:n,onRetry:i}){let[s,a]=(0,$.useState)(""),o=uqe(t,e),l=D8(o.recommended,s),c=D8(o.professional,s),u=D8(o.timestamped,s);return g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsxs("div",{className:"relative",children:[g.jsx(G0,{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(O8,{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(ooe,{icon:g.jsx(Hm,{className:"size-4 text-emerald-600"}),title:"Creator Provided",count:c.length,description:"Subtitles uploaded by the video creator"}),g.jsx(aoe,{items:c,isSearching:!!s,renderItem:({data:d,state:f})=>g.jsx(O8,{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(ooe,{icon:g.jsx(Dm,{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(aoe,{items:u,isSearching:!!s,renderItem:({data:d,state:f})=>g.jsx(O8,{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(Vm,{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 Nce(t,e){return t.id||`cue-${e}`}function dqe({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 fqe(){return Rg({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 pqe=new Ve({key:new ut("webvtt-readonly"),props:{editable:()=>!1}});function hqe(){return Ci(pqe)}var Nn=class t{constructor({hours:e=0,minutes:r=0,seconds:n=0,milliseconds:i=0}={}){if(vA(this,"hours"),vA(this,"minutes"),vA(this,"seconds"),vA(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 mqe(){return Rg({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 gqe=I5((t,e)=>{if(t.type.name==="webvttCue"){let r=t.attrs;if(!e)return{type:t.type,attrs:{...r}};let n=r.end,i=pse(n.toDate(),1);return{type:t.type,attrs:{...r,start:n,end:Nn.fromDate(i)}}}return null});function yqe(){return Vp({Enter:ol(l1,c1,u1,gqe)})}function*vqe(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 bqe(){return Rg({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 xqe(){return ul({insertTimestamp:t=>(e,r)=>{if(!r)return!0;let{schema:n,tr:i}=e,s=s1(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 wqe({onTimestampClicked:t}){return pie((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 Fce(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*Fce(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 kqe(){return _s(Ci(AA),ul({dispatchTrackChange:t=>(e,r,n)=>{var i,s;if(!r)return!0;r(e.tr.setMeta(AA,{type:"update",...t}));let a=(i=AA.getState(e))==null?void 0:i.activeCues;if(t.scrollContainer&&t.activeCues&&a&&Bce(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 AA=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(AA);if(!(r!=null&&r.type)&&!t.docChanged)return e;if(r?.type==="update"){if(!r.activeCues&&!r.currentTime||(!r.activeCues||!Bce(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,[...Sqe(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}}}),CA=(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*Sqe(t,e,r){let n=t.map(s=>s.id),i=Nn.fromTimestamp(e);for(let[s,a]of vqe(r)){let o=[...Fce(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 CA(l,c,{"data-future":""}):i.compare(c.end)>0?yield CA(l,c,{"data-past":""}):yield CA(l,c,{"data-current":""})}else{if(o.length<=1)continue;for(let[l,c]of o)yield CA(l,c)}}}function Bce(t,e){return t.length!==e.length||t.some(r=>!e.includes(r))}var nP=(0,$.createContext)({emitter:null,remote:null});function Cqe({className:t,onKeyDown:e,onClose:r}){let[n,i]=(0,$.useState)(""),s=(0,$.useMemo)(()=>n?Gie({search:n}):null,[n]);$p(s);let a=H5(),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(w0,{className:"size-4"})}),g.jsx(Cr,{size:"iconSm",variant:"ghost",onClick:a.commands.findNext,children:g.jsx(b0,{className:"size-4"})}),g.jsx(Cr,{size:"iconSm",variant:"ghost",onClick:r,children:g.jsx(el,{className:"size-4"})})]})]})})}function Tqe(t){return t+.001}function Eqe({target:t="start"}={}){let{remote:e}=(0,$.use)(nP);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(Tqe(s),r):e.seek(s,r),!0},[e,t])}function Vce({onDocUpdate:t,showSearch:e,editor:r,handleSearchKeyDown:n,onClose:i,...s}){return g.jsx(nP.Provider,{value:s,children:g.jsx(Iqe,{editor:r,showSearch:e,onClose:i,handleSearchKeyDown:n,onDocUpdate:t})})}function Iqe({onDocUpdate:t,showSearch:e,editor:r,handleSearchKeyDown:n,onClose:i}){let s=(0,$.useCallback)(c=>t?.(o1(c)),[t]);_ie(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(Lie,{editor:r,children:[g.jsxs("div",{className:"vtt-editor-container h-full w-full flex gap-2 flex-col",children:[e&&g.jsx(Cqe,{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(Aqe,{scrollContainerRef:a}),g.jsx(Pqe,{}),g.jsx(Rqe,{})]})}function Aqe({scrollContainerRef:t}){let{emitter:e}=(0,$.use)(nP),r=H5();return(0,$.useEffect)(()=>{var n=[];try{if(!r||!e)return;let a=eae(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:Nce(b,m.indexOf(b))}));r.commands.dispatchTrackChange({activeCues:v,scrollContainer:t.current??r.view.dom})};p();let h=eae(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{tae(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{tae(n,i,s)}},[r,e,t]),null}function Pqe(){let t=Eqe(),e=(0,$.useMemo)(()=>wqe({onTimestampClicked:t}),[t]);return $p(e),null}function Rqe(){let{clipboardTextSerializer:t,clipboardSerializer:e,onCopy:r,transformCopied:n}=(0,$.use)(nP),i=(0,$.useMemo)(()=>dqe({clipboardTextSerializer:t,clipboardSerializer:e,onCopy:r,transformCopied:n}),[t,e,r,n]);return $p(i),null}function jce(){return _s(cie(),vie(),mie(),tse(),Xie(),Zie(),ese(),ise(),fqe(),rse(),yqe(),mqe(),xqe(),bqe(),kqe(),hqe(),Wie())}function $ce(t){return t.map((e,r)=>{let n=c8(e);return{type:"webvttCue",attrs:{id:Nce(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 Uce=(0,$.createContext)({show:!0,setShow:()=>{}}),Lqe=({children:t,visible:e,defaultVisible:r=!0,onClose:n,className:i,inset:s=!1,...a})=>{let[o,l]=lle({defaultProp:r,prop:e,onChange:n});return o?g.jsx(Uce.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},Mqe=({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})}),_qe=({className:t,...e})=>g.jsx("p",{className:Ce("flex-1 text-sm",t),...e}),Oqe=({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}),Dqe=({variant:t="ghost",size:e="icon",onClick:r,className:n,...i})=>{let{setShow:s}=(0,$.useContext)(Uce),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})})},Nqe=Zp("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 bo({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:Noe(Nqe({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 zce({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(Lqe,{inset:!0,onClose:a,children:[g.jsx(Mqe,{icon:H0}),g.jsx(_qe,{children:"Media Extended v4.0 is here! Major stability improvements and new features"}),g.jsx(Oqe,{asChild:!0,children:g.jsxs("a",{href:n("/blog/v4-release"),target:"_blank",rel:"noopener noreferrer",children:["Learn more",g.jsx(Au,{})]})}),g.jsx(Dqe,{})]}),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(I0,{})]})]})]}),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(x0,{})]})]})]}),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(K0,{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(Om,{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(bo,{icon:g.jsx(L0,{}),href:n("/docs/v4/load-media"),title:"Load media",description:"Local files, remote URLs, and media-hosting services."}),g.jsx(bo,{icon:g.jsx(Lu,{}),href:n("/docs/v4/playback"),title:"Playback",description:"Control playback while taking notes"}),g.jsx(bo,{icon:g.jsx(Om,{}),href:n("/docs/v4/screenshot"),title:"Capture screenshots",description:"Capture screenshots with timestamp links"}),g.jsx(bo,{icon:g.jsx(rp,{}),href:n("/docs/v4/media-links"),title:"Links and embeds",description:"Include media links and embeds in your notes"}),g.jsx(bo,{icon:g.jsx(tp,{}),href:n("/docs/v4/transcript"),title:"Transcripts",description:"Quick navigation using transcript and subtitles"}),g.jsx(bo,{icon:g.jsx(S0,{}),href:n("/docs/v4/template"),title:"Customize templates",description:"Customize timestamp and screenshot formats"}),g.jsx(bo,{icon:g.jsx(B0,{}),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(bo,{variant:"link",icon:g.jsx(C0,{}),href:n("/docs/v4"),title:"Explore all features",description:"Dive deep into tutorials, guides, and tips to master Media Extended"}),g.jsx(bo,{variant:"link",icon:g.jsx(Mu,{}),href:n("/blog/v4-release"),title:"What's new in v4",description:"Discover new features, improvements, and important changes from v3"}),g.jsx(bo,{variant:"link",icon:g.jsx(Au,{}),href:n("/changelog"),title:"View all updates",description:"Track every update, bug fix, and enhancement across all versions"}),g.jsx(bo,{variant:"link",icon:g.jsx(T0,{}),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",qce="wid",Hce=An({id:la(we()),format:la(BQ),kind:la(Pt(["subtitles","captions"])),language:la(we()),label:la(we()),isDefault:wr(),wid:la(we())});function _9(t){return t.type==="internal"?`link:${t.path}`:Aa(t)}function Aa(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:${tE(t.src)}`;Be(t)}function iP(t,e){return!t||!e?!1:Aa(t)===Aa(e)}var es=re(null),O9=re(async t=>{let e=t(es),{transcriptLoader:r}=t(Tt);if(!e)return null;let n=await r.loadAndParseTrack(e);return{id:Aa(e),node:{type:"doc",content:$ce(n.cues)}}}),sP=YQ(re(async t=>{let e=await t(O9);return e?k5({extension:jce(),defaultContent:e.node}):null}),()=>null),G1=re(!1);var aP=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 ay=class{constructor(e){this.generateIdentifier=e,this.kv=new aP}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 oP=class extends ay{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 Fqe(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 Gce(t,e){let r=Fqe(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 eh(t,e){Object.entries(t).forEach(([r,n])=>e(n,r))}function oy(t,e){return t.indexOf(e)!==-1}function D9(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(e(n))return n}}var lP=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return Gce(this.transfomers,r=>r.isApplicable(e))}findByName(e){return this.transfomers[e]}};var Bqe=t=>Object.prototype.toString.call(t).slice(8,-1),N9=t=>typeof t>"u",Vqe=t=>t===null,th=t=>typeof t!="object"||t===null||t===Object.prototype?!1:Object.getPrototypeOf(t)===null?!0:Object.getPrototypeOf(t)===Object.prototype,cP=t=>th(t)&&Object.keys(t).length===0,So=t=>Array.isArray(t),jqe=t=>typeof t=="string",$qe=t=>typeof t=="number"&&!isNaN(t),Uqe=t=>typeof t=="boolean",Wce=t=>t instanceof RegExp,md=t=>t instanceof Map,gd=t=>t instanceof Set,F9=t=>Bqe(t)==="Symbol",Kce=t=>t instanceof Date&&!isNaN(t.valueOf()),Yce=t=>t instanceof Error,B9=t=>typeof t=="number"&&isNaN(t),Xce=t=>Uqe(t)||Vqe(t)||N9(t)||$qe(t)||jqe(t)||F9(t),Qce=t=>typeof t=="bigint",Zce=t=>t===1/0||t===-1/0,Jce=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),eue=t=>t instanceof URL;var V9=t=>t.replace(/\./g,"\\."),uP=t=>t.map(String).map(V9).join("."),ly=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 tue=[bl(N9,"undefined",()=>null,()=>{}),bl(Qce,"bigint",t=>t.toString(),t=>typeof BigInt<"u"?BigInt(t):(console.error("Please add a BigInt polyfill."),t)),bl(Kce,"Date",t=>t.toISOString(),t=>new Date(t)),bl(Yce,"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(Wce,"regexp",t=>""+t,t=>{let e=t.slice(1,t.lastIndexOf("/")),r=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,r)}),bl(gd,"set",t=>[...t.values()],t=>new Set(t)),bl(md,"map",t=>[...t.entries()],t=>new Map(t)),bl(t=>B9(t)||Zce(t),"number",t=>B9(t)?"NaN":t>0?"Infinity":"-Infinity",Number),bl(t=>t===0&&1/t===-1/0,"number",()=>"-0",Number),bl(eue,"URL",t=>t.toString(),t=>new URL(t))];function dP(t,e,r,n){return{isApplicable:t,annotation:e,transform:r,untransform:n}}var rue=dP((t,e)=>F9(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}),zqe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((t,e)=>(t[e.name]=e,t),{}),nue=dP(Jce,t=>["typed-array",t.constructor.name],t=>[...t],(t,e)=>{let r=zqe[e[1]];if(!r)throw new Error("Trying to deserialize unknown typed array");return new r(t)});function j9(t,e){return t?.constructor?!!e.classRegistry.getIdentifier(t.constructor):!1}var iue=dP(j9,(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)}),sue=dP((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)}),qqe=[iue,rue,sue,nue],$9=(t,e)=>{let r=D9(qqe,i=>i.isApplicable(t,e));if(r)return{value:r.transform(t,e),type:r.annotation(t,e)};let n=D9(tue,i=>i.isApplicable(t,e));if(n)return{value:n.transform(t,e),type:n.annotation}},aue={};tue.forEach(t=>{aue[t.annotation]=t});var oue=(t,e,r)=>{if(So(e))switch(e[0]){case"symbol":return rue.untransform(t,e,r);case"class":return iue.untransform(t,e,r);case"custom":return sue.untransform(t,e,r);case"typed-array":return nue.untransform(t,e,r);default:throw new Error("Unknown transformation: "+e)}else{let n=aue[e];if(!n)throw new Error("Unknown transformation: "+e);return n.untransform(t,r)}};var cy=(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 lue(t){if(oy(t,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(oy(t,"prototype"))throw new Error("prototype is not allowed as a property");if(oy(t,"constructor"))throw new Error("constructor is not allowed as a property")}var cue=(t,e)=>{lue(e);for(let r=0;r<e.length;r++){let n=e[r];if(gd(t))t=cy(t,+n);else if(md(t)){let i=+n,s=+e[++r]==0?"key":"value",a=cy(t,i);switch(s){case"key":t=a;break;case"value":t=t.get(a);break}}else t=t[n]}return t},fP=(t,e,r)=>{if(lue(e),e.length===0)return r(t);let n=t;for(let s=0;s<e.length-1;s++){let a=e[s];if(So(n)){let o=+a;n=n[o]}else if(th(n))n=n[a];else if(gd(n)){let o=+a;n=cy(n,o)}else if(md(n)){if(s===e.length-2)break;let l=+a,c=+e[++s]==0?"key":"value",u=cy(n,l);switch(c){case"key":n=u;break;case"value":n=n.get(u);break}}}let i=e[e.length-1];if(So(n)?n[+i]=r(n[+i]):th(n)&&(n[i]=r(n[i])),gd(n)){let s=cy(n,+i),a=r(s);s!==a&&(n.delete(s),n.add(a))}if(md(n)){let s=+e[e.length-2],a=cy(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 U9(t,e,r=[]){if(!t)return;if(!So(t)){eh(t,(s,a)=>U9(s,e,[...r,...ly(a)]));return}let[n,i]=t;i&&eh(i,(s,a)=>{U9(s,e,[...r,...ly(a)])}),e(n,r)}function uue(t,e,r){return U9(e,(n,i)=>{t=fP(t,i,s=>oue(s,n,r))}),t}function due(t,e){function r(n,i){let s=cue(t,ly(i));n.map(ly).forEach(a=>{t=fP(t,a,()=>s)})}if(So(e)){let[n,i]=e;n.forEach(s=>{t=fP(t,ly(s),()=>t)}),i&&eh(i,r)}else eh(e,r);return t}var Hqe=(t,e)=>th(t)||So(t)||md(t)||gd(t)||j9(t,e);function Gqe(t,e,r){let n=r.get(t);n?n.push(e):r.set(t,[e])}function fue(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(uP):r[uP(s)]=a.map(uP)}),n?cP(r)?[n]:[n,r]:cP(r)?void 0:r}var z9=(t,e,r,n,i=[],s=[],a=new Map)=>{let o=Xce(t);if(!o){Gqe(t,i,e);let p=a.get(t);if(p)return n?{transformedValue:null}:p}if(!Hqe(t,r)){let p=$9(t,r),h=p?{transformedValue:p.value,annotations:[p.type]}:{transformedValue:t};return o||a.set(t,h),h}if(oy(s,t))return{transformedValue:null};let l=$9(t,r),c=l?.value??t,u=So(c)?[]:{},d={};eh(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=z9(p,e,r,n,[...i,h],[...s,t],a);u[h]=m.transformedValue,So(m.annotations)?d[h]=m.annotations:th(m.annotations)&&eh(m.annotations,(v,b)=>{d[V9(h)+"."+b]=v})});let f=cP(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 pP(t){return Object.prototype.toString.call(t).slice(8,-1)}function q9(t){return pP(t)==="Array"}function pue(t){if(pP(t)!=="Object")return!1;let e=Object.getPrototypeOf(t);return!!e&&e.constructor===Object&&e===Object.prototype}function Wqe(t){return pP(t)==="Null"}function Kqe(t,e,r,n,i){return s=>t(s)||e(s)||!!r&&r(s)||!!n&&n(s)||!!i&&i(s)}function Yqe(t){return pP(t)==="Undefined"}var NTt=Kqe(Wqe,Yqe);function Xqe(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 hP(t,e={}){if(q9(t))return t.map(i=>hP(i,e));if(!pue(t))return t;let r=Object.getOwnPropertyNames(t),n=Object.getOwnPropertySymbols(t);return[...r,...n].reduce((i,s)=>{if(q9(e.props)&&!e.props.includes(s))return i;let a=t[s],o=hP(a,e);return Xqe(i,s,o,t,e.nonenumerable),i},{})}var Oe=class{constructor({dedupe:e=!1}={}){this.classRegistry=new oP,this.symbolRegistry=new ay(r=>r.description??""),this.customTransformerRegistry=new lP,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let r=new Map,n=z9(e,r,this,this.dedupe),i={json:n.transformedValue};n.annotations&&(i.meta={...i.meta,values:n.annotations});let s=fue(r,this.dedupe);return s&&(i.meta={...i.meta,referentialEqualities:s}),i}deserialize(e){let{json:r,meta:n}=e,i=hP(r);return n?.values&&(i=uue(i,n.values,this)),n?.referentialEqualities&&(i=due(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 uy(t){return{mx:Oe.serialize(t)}}function mP(t){try{return Oe.deserialize(t.mx)}catch(e){return console.error("Failed to deserialize media view state",e),null}}var rh=Z(Te(),1),W1=re(null),gt=re(t=>t(W1)?.player??null,(t,e,r)=>{if(!r){e(W1,null);return}let n=t(W1);if(n?.player===r)return;let i=n?.remote??new gp;i.setPlayer(r),i.setTarget(r),e(W1,{player:r,remote:i})});function hue(){let t=Am(gt),e=Zqe();return(0,rh.useCallback)(n=>{t(n),e.current=n},[t,e])}var aEt=re(t=>({current:t(gt)})),Qqe=re({current:null});function Zqe(){return St(Qqe)}function K1(){return St(gt)}var Y1=re(t=>t(W1)?.remote);function Jqe(t){let e=(0,rh.useRef)(null);e.current||(e.current=new gp);let r=K1(),n=t&&"current"in t?t.current:t;return(0,rh.useEffect)(()=>{let i=n instanceof vp?n:r,s=e.current;s.setPlayer(i??null),s.setTarget(n??null)},[r,n]),e}function mue(){return Jqe().current}var gue=()=>({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 nh(){let t=gue();return t.once=function(r,n){let i=this.on(r,(...s)=>{i(),n(...s)});return i},t}var gP=Z(Te(),1);var vue=Z(Ge(),1);function yue(){let t=St(O9),e=St(sP),r=mue(),n=tHe(t?.id),i=eHe(),[s,a]=aa(G1);return e&&(0,vue.jsx)(Vce,{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 eHe(){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 tHe(t){let e=K1(),r=(0,gP.useMemo)(()=>nh(),[]);return(0,gP.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 yd(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 bue(n(t.name));if("path"in t)return Co(t.path,{sep:e,urlEncoded:r});if("pathname"in t)return Co(t.pathname,{sep:e,urlEncoded:r});Be(t)}function bue(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 Co(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),...bue(i)}}var vP=require("obsidian");var H9=require("obsidian");function xue(t){let e=kue();e&&e.showItemInFolder(t)}async function wue(t){let e=kue();if(!e)return;let r=await e.openPath(t);if(r)throw new Error(r)}function kue(){if(!H9.Platform.isDesktopApp)return null;let t=window.electron;if(t)return H9.Platform.isMacOS?t.remote.shell:t.shell}var Sue=require("obsidian");function yP(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 Sue.Notice(`${r}: ${s}`)):console.error(i)}}}function bP(t,e){t.addItem(r=>r.setIcon("folder").setTitle(vP.Platform.isMacOS?"Reveal in Finder":"Show in system explorer").setSection("system").onClick(yP(()=>xue(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(yP(()=>wue(e),{notice:"Failed to open file in system player"}))).addItem(r=>r.setIcon("copy").setTitle("Copy file path").setSection("info").onClick(yP(async()=>{await navigator.clipboard.writeText(e),new vP.Notice("File path copied to clipboard")},{notice:"Failed to copy file path"})))}var jhe=Z(HR(),1);function xV({atomValues:t,children:e}){return JQ(new Map(t)),e}var tS=Z(Ge(),1);function rv({children:t,target:e,shadowRootClassName:r,ctx:{store:n,isEmbed:i}={}}){var o=[];try{let s=J(o,new DisposableStack);let a=jhe.default.createRoot(e);s.defer(()=>{a.unmount()});n||a.render((0,tS.jsx)(Mf,{className:r,children:t}));a.render((0,tS.jsx)(Mf,{className:r,children:(0,tS.jsx)(PQ,{store:n,children:(0,tS.jsx)(xV,{atomValues:[[Eu,i]],children:t})})}));return s.move()}catch(l){var c=l,u=!0}finally{ee(o,c,u)}}var $he=require("obsidian");var qd=re(!0),Uhe=re(t=>t(qd)?t(gt)!==null:null);function zhe(t,e){t.defer(ua((r,n)=>{var l=[];try{let i=r(es);if(!i){n(gt,null);return}if(!r(qd)){n(gt,null);return}let s=J(l,new DisposableStack);let a=(0,$he.debounce)(async()=>{let f=await PWe(i,e);r(gt)!==f&&(f&&AWe(i,f),n(gt,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 AWe(t,e){let r=Aa(t);e.textTracks.getById(r)?.setMode("showing")}async function PWe(t,e){let r=await e.workspaceFind.findLinkedMediaLeaf(t);return r?.view?r.view.service.player:null}var qhe=Z(Ge(),1),GR=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 rv({ctx:{store:n,isEmbed:r},target:e,shadowRootClassName:"shadow-root",children:(0,qhe.jsx)(yue,{})})}#e(e){if(!e)return"Transcript";if(e.type==="url"){let r=yd(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 ua(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);dm(r,e,null,"Escape",()=>{this.service.toggleSearch(!1)});dm(r,e,null,"F3",()=>{this.service.editor?.commands.findNext()});dm(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"&&bP(e,n.src.path)}addDisconnectAction(e){let r=e.addAction("lucide-refresh-cw-off","Stop syncing with player",()=>{this.service.store.set(qd,!1)});return r.addClass("mx-connect-action"),ua(n=>{n(qd)?r.dataset.active="":delete r.dataset.active,n(Uhe)?r.dataset.connected="":delete r.dataset.connected},this.service.store)}};var nv=class{workspace;store;trackParser;trackStringifier;app;helper;#e;constructor(e){var s=[];try{let r=e.createScope();r.register({service:Yf(this),helper:ji(GR).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);zhe(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 wV.Notice("No track opened");return}await this.workspace.openLinkedMediaForTrack(e,{newLeaf:"split"})||new wV.Notice("No linked media found")}get editor(){return this.store.get(sP)}toggleSearch(e){e===void 0?this.store.set(G1,r=>!r):this.store.set(G1,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 iP(r,n)?r:n})}setUrlState(e){let r=mP(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 uy({src:r})}get playerSyncEnabled(){return this.store.get(qd)}set playerSyncEnabled(e){this.store.set(qd,e)}};var Sh=class extends WR.EditableFileView{allowNoFile=!1;scope;service;constructor(e,r){super(e),this.contentEl.addClasses(["mx","custom","mx-track-view"]),this.scope=new WR.Scope(this.app.scope),this.service=new nv(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 m0}canAcceptExtension(e){return JT({extension:e})}};var KR=require("obsidian");var Ch=class extends KR.ItemView{scope;navigation=!0;service;constructor(e,r){super(e),this.contentEl.addClasses(["mx","custom","mx-track-view"]),this.scope=new KR.Scope(this.app.scope),this.service=new nv(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 _m}getIcon(){return"notepad-text"}getDisplayText(){return this.service.helper.getDisplayText()}};function Hhe(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(Sh)||t.workspace.getActiveViewOfType(Ch);if(!i)return r(n);if(n)return!0;i.service.toggleSearch()}})}var rS=require("obsidian"),RWe=[{id:"flip-video-none",name:"Reset video flip",icon:"rotate-ccw-square",checkCallback(t,{mediaView:e}){if(!e?.player||ho(e.player.provider))return!1;if(t)return!0;e.flip="none",new rS.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||ho(e.player.provider))return!1;if(t)return!0;e.flip="horizontal",new rS.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||ho(e.player.provider))return!1;if(t)return!0;e.flip="vertical",new rS.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||ho(e.player.provider))return!1;if(t)return!0;e.flip="both",new rS.Notice("Video flipped to both ways (upside down and mirror)")}}],Ghe=RWe;var LWe="__MX_ONLINE__";function Ao(){return localStorage.getItem(LWe)==="true"}var MWe=[{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})}},{id:"insert-timestamp-embed",name:"Insert media clip embed starting from current timestamp",icon:"file-embed",checkCallback(t,{mediaView:e,insertTarget:r}){if(!e?.player||!r)return!1;if(t)return!0;e.timestampAction.insertTimestampEmbed({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,insertTarget:i}){if(!n?.supportsScreenshot)return!1;if(r)return!0;n.screenshotAction.saveScreenshot({clip:t,sourcePath:i?.file?.path})}},{id:`set-cover${e}`,name:t?"Set clipped screenshot as media cover":"Set current screenshot as media cover",icon:"image",checkCallback(r,{mediaView:n,insertTarget:i}){if(!n?.supportsScreenshot)return!1;if(r)return!0;n.screenshotAction.setAsCover({clip:t,sourcePath:i?.file?.path})}}]),{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 kV(){let t=[...MWe];return Ao()&&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 _We=[{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 SV(){return _We.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 Ro=require("obsidian");var OWe=new Set(["https://www.youtube-nocookie.com","https://www.youtube.com"]);function Whe(t,e){return(t.source===null||!e||t.source===e.contentWindow)&&OWe.has(t.origin)}var DWe=Ee(we(),d0(),An({event:Pt(["initialDelivery"]),info:An({availablePlaybackRates:Kl(hr()),videoData:An({title:we(),author:we(),video_id:Ee(we(),gi())})})})),Hd=fn(re(),(t,e)=>{let r=t(Kt),n=t(gt);if(!da(r)){e(Hd,null);return}let i=s=>{if(!(zu(n?.provider)&&Whe(s)))return;let a=Pn(DWe,s.data);if(!a.success)return;let{videoData:{title:o,author:l,video_id:c},availablePlaybackRates:u}=a.output.info;e(Hd,{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=>{fa(f.src,r)&&s(n.getMediaMeta(r)?.meta)}));a.defer(n.on("media-meta-removed",f=>{fa(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 YR=[.25,.5,.75,1,1.25,1.5,1.75,2,3,5],Khe=re(t=>{let e=t(Kt);return da(e)?t(Hd)?.availablePlaybackRates??[.25,.5,.75,1,1.25,1.5,1.75,2]:YR}),Yhe=re(t=>{let e=t(jt)?.playbackRate,r=t(qt)?.playbackRate;return e??r??1});var Qhe=require("obsidian");function CV(t){return new Promise(e=>setTimeout(e,t))}var Xhe=Symbol("loading"),TV=class{#e=null;setMessage(e){this.#e?this.#e.setMessage(e):this.#e=new Qhe.Notice(e,0)}[Symbol.dispose](){this.#e?.hide()}};async function NWe(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 TV);if(r)try{let f=n>0?CV(n):Promise.resolve();await Promise.race([t,f.then(()=>Xhe)])===Xhe&&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 CV(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 CV(s)}}catch(c){var u=c,d=!0}finally{ee(l,u,d)}}async function dt(t,{swallowError:e=!0,...r}){try{NWe(t,r).catch(()=>{});let n=await t;if(!e)return n}catch(n){if(e)return;throw n}}var EV=require("obsidian");var Zhe=require("obsidian"),Jhe=Z(HR(),1);var eme=Z(Ge(),1),Kc=class extends Zhe.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 Kc{#e=null;async onOpen(){var i=[];try{await super.onOpen();let e=J(i,new DisposableStack);let r=Jhe.default.createRoot(this.contentEl);e.defer(()=>{r.unmount()});let n=this.getShadowRootClassName?.();r.render((0,eme.jsx)(Mf,{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 iv=class extends Kc{#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 EV.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 EV.Notice("Invalid playback rate");return}this.resolveWith(s)}}};var IV=class{#e=null;notify(e,{autoHide:r=!0}={}){!this.#e||this.#e.messageEl.isConnected===!1?this.#e=new Ro.Notice(e,0):this.#e.setMessage(e),r&&this.autoHide()}autoHide=(0,Ro.debounce)(()=>this.#e?.hide(),2e3,!0);dismiss(){this.#e?.hide()}};function AV(){let t=new IV,e=YR.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[...YR.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 Ro.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 Ro.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;dt(new iv(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 Ro.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 Ro.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 Ro.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 Ro.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,Ro.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 tme=require("obsidian");function rme({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})});um(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=FWe(p);(v.code===p.code&&b.every(y=>tme.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 FWe(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 XR=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(SV()),this.addMediaCommands(AV()),this.addMediaCommands(Ghe),this.addMediaCommands(kV()),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(Hhe(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(!Gd.Platform.isDesktopApp)return!1;if(r)return!0;e.passwordManagerModal.open()}}),this.addGlobalCommand({id:"clear-youtube-coockies",name:"Clear YouTube cookies",checkCallback:r=>{if(!Gd.Platform.isDesktopApp)return!1;if(r)return!0;let n=sa().getCurrentWebContents().session;Promise.all(["https://www.youtube-nocookie.com","https://www.youtube.com"].map(i=>n.clearStorageData({origin:i,storages:["cookies"]}))).then(()=>new Gd.Notice("YouTube cookies cleared")).catch(i=>{console.error(i),new Gd.Notice("Failed to clear YouTube cookies, see console for details")})}})}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({...Qf(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=rme({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(Gd.MarkdownView);if(i?.file){let u=this.mediaLib.findMediaByNote(i.file);if(u){let d=this.workspaceFind.findMediaLeavesWithSameMedia(u.src).filter(l0).sort(ql(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(l0).sort(ql(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(ql(c0,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(BWe)}function BWe(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 iS=require("obsidian");var nme={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 ime=[nme];function sme(t){let e=new URLSearchParams({path:t.path});return new URL(`https://pan.baidu.com/pfile/video?${e.toString()}`)}function Th(t,e=0){if(!t)return null;let r=Number.parseInt(t.slice(e),10);return Number.isNaN(r)?null:r}function QR(t){if(!t)return null;let e=Number.parseFloat(t);return Number.isNaN(e)?null:e}function ZR(t){let e=t.get("t");return{t:QR(e)}}var ame={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=ZR(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 ome={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 lme={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=Th(t.searchParams.get("p")),i=ZR(t.searchParams);if(r.startsWith("BV"))return{host:this.host,type:"bvid",bvid:r,page:n??1,...i};if(r.startsWith("av")){let s=Th(r,2);return s===null?null:{host:this.host,type:"aid",aid:s,page:n??1,...i}}return null}};var cme=[lme,ame,ome];function ume(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 dme=[{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 fme=[...dme];function pme(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 JR=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 sv(t){if(!t)return null;let e=QR(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=Th(i)??0,l=Th(s)??0,c=Th(a)??0;return o*3600+l*60+c}function eL(t){let r=new URLSearchParams(t.hash.replace(/^#/,"")).get("t");return{t:sv(r)}}var hme={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,...eL(t)}:null}};var mme={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,...eL(t)}}};var gme=[mme,hme];function yme(t){return new URL(`https://vimeo.com/${t.vid}`)}function av(t){let e=t.get("t"),r=t.get("start"),n=t.get("end");return{t:sv(e),start:sv(r),end:sv(n)}}function tL(t){return t.toFixed(0)}var vme={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"),...av(t.searchParams)}}};var bme={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"),...av(t.searchParams)}}};var xme={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"),...av(t.searchParams)}:null}};var wme=[xme,vme,bme];function kme(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",tL(e.start)),r):(e.start>0&&r.searchParams.set("start",tL(e.start)),e.end>0&&r.searchParams.set("end",tL(e.end)),r):r}function Sme(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 Cme=new JR([...wme,...gme,...ime,...cme,...fme]);function nS(t,e={}){let r=new URL(t);return Bt(r)&&(r=Sme(r)),r.searchParams.sort(),r.hash=Cc(e).toString(),r}function Bt(t){return t.protocol==="file:"}function Wd(t,e={}){let r,n=e.tempFragment;return t.host==="youtube"?r=kme(t,n):t.host==="bilibili"?r=ume(t,n):t.host==="coursera"?r=pme(t):t.host==="baidu-pan"?r=sme(t):t.host==="vimeo"?r=yme(t):Be(t),r.hash=Cc(e).toString(),r}var Tme=require("obsidian");function Eme(t,e,r){if(!e)return Kd(t)??!1;let n=Kd(t);return r.click===null?n??!1:n===void 0||n===!1?r.click:r.alt!==null&&n===r.click?r.alt:n}function Yd(t){let e=Tme.Keymap.isModEvent(t);return Kd(e)}function Kd(t){return t===!0?"tab":t}var rL=require("obsidian");function nL(t){if(rL.Platform.isDesktopApp&&!(0,rL.requireApiVersion)("1.9.0")){require("electron").shell.openExternal(t);return}window.open(t,"external")}var VWe=re(1),Ime=$i(t=>{let e=t(VWe);t(Y1)?.changeAudioGain(e,new Event("audio-gain-change"))}),Ame=$i(t=>{let e=t(Y1);if(!e)return;let r=t(jt),n=r?.audioGain,i=t.peek(qt),s=i?.audioGain;e.changeAudioGain(n??s??1,new nE({hash:r,noteMeta:i}))}),Pme=[{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 PV=require("obsidian");var iL=class extends Kc{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 PV.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(kc,Number(o.get("audio-gain").toString()));if(!l.success){new PV.Notice("Invalid audio gain value. Please enter a number between 0.1 and 10.");return}this.resolveWith(l.output)}}};function Rme(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 Pme)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(()=>{dt(new iL(e.app).requestInput().then(o=>(n.setAudioGain(o),o)),{success:o=>`Audio gain set to ${o}`,error:o=>`Cannot set audio gain: ${o}`})})})})}function Lme(t,e){!e.player||ho(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 Mme(t,e){if(!(!e.supportsScreenshot||!Ao())){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,sourcePath:void 0})})}).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,sourcePath:void 0})})})}}function _me(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&&jWe(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(()=>{dt(new iv(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 jWe(t,e){return e.preservePitch===null?!1:(t.addItem(r=>r.setTitle("Preserve pitch").setChecked(e.preservePitch).onClick(()=>{e.preservePitch=!e.preservePitch})),!0)}var Ome=require("obsidian");var sL=class extends Kc{#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 Ome.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 Dme(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 Nme(t,e,r){t.addItem(n=>{n.setSection("view").setTitle("Open transcript").setIcon("book-text").onClick(async()=>{let i=await dt(r.transcriptLoader.getTracks(e),{swallowError:!1,loading:"Loading track list..."});await dt(new sL(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 aL=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),Zf(r.media)&&n!=="player-menu-embed"&&n!=="player-menu-view"&&($We(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&&bP(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 iS.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:Yd(s)})})}),this.openTranscriptMenu(e,r.media),n==="more-options"&&(this.updateMetadataActions(e,r.media),this.editMetadataActions(e,r.media))}mediaViewActions(e,r,n){Zf(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")&&(_me(e,r),Rme(e,r),Lme(e,r),Dme(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")&&Mme(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 iS.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:Yd(i)})})})}openTranscriptMenu(e,r){Nme(e,r,{transcriptLoader:this.transcriptLoader,app:this.app,workspaceOpen:this.workspaceOpen})}};function $We(t,e){t.addItem(r=>r.setTitle("Open in default browser").setIcon("globe").setSection("open").onClick(()=>{nL(e.url.toString())})).addItem(r=>r.setTitle("Copy URL").setIcon("link").setSection("info").onClick(async()=>{await navigator.clipboard.writeText(e.url.toString()),new iS.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 Eh(`Validation failed: ${i}`,{status:n});case 401:case 403:throw new ov(`Authentication failed: ${i}`,{status:n});case 404:throw new RV(`Resource not found: ${i}`,{status:n});case 429:throw new LV("Rate limit exceeded",{status:n});case 500:case 502:case 503:case 504:throw new MV(`Server error: ${i}`,{status:n});default:throw new t(`API error: ${i}`,{status:n})}}},ov=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??401}),this.name="AuthError"}},Lo=class extends ov{constructor(e,r){super(e,{...r,status:r?.status??401}),this.name="UnauthorizedError"}},sS=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??202}),this.name="ProcessingError"}},RV=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??404}),this.name="NotFoundError"}},LV=class extends Pi{constructor(e="Rate limit exceeded. Please try again later.",r){super(e,{...r,status:r?.status??429}),this.name="RateLimitError"}},MV=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??500}),this.name="ServerError"}},Eh=class extends Pi{constructor(e,r){super(e,{...r,status:r?.status??400}),this.name="ValidationError"}},lv=class extends Error{constructor(e="No text found in the provided image"){super(e),this.name="NoTextFoundError"}};var UWe=(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},Fme=(t,e,r)=>(e=encodeURIComponent(e),UWe(t,e,r));var Bme=(t,e)=>(t=t.replace(/\/+$/,""),t=t+"/",e=e.replace(/^\/+/,""),t+e),lL=(t,e)=>{for(let[r,n]of Object.entries(e)){let i=new RegExp("/:"+r+"(?:{[^/]+})?\\??");t=t.replace(i,n?`/${n}`:"")}return t},_V=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},Vme=(t,e)=>{switch(e){case"ws":return t.replace(/^http/,"ws");case"http":return t.replace(/^ws/,"http")}},jme=t=>/^https?:\/\/[^\/]+?\/index$/.test(t)?t.replace(/\/index$/,"/"):t.replace(/\/index$/,"");function oL(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function OV(t,e){if(!oL(t)&&!oL(e))return e;let r={...t};for(let n in e){let i=e[n];oL(r[n])&&oL(i)?r[n]=OV(r[n],i):r[n]=i}return r}var $me=(t,e)=>new Proxy(()=>{},{get(n,i){if(!(typeof i!="string"||i==="then"))return $me(t,[...e,i])},apply(n,i,s){return t({path:e,args:s})}}),zWe=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=_V(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(Fme(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=jme(s),s=lL(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})}},DV=(t,e)=>$me(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=Bme(t,o);if(a==="url"){let u=l;return n.args[0]&&(n.args[0].param&&(u=lL(l,n.args[0].param)),n.args[0].query&&(u=u+"?"+_V(n.args[0].query).toString())),new URL(u)}if(a==="ws"){let u=Vme(n.args[0]&&n.args[0].param?lL(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 zWe(l,a);if(a){e??={};let u=OV(e,{...n.args[1]});return c.fetch(n.args[0],u)}return c},[]);var Ume=(...t)=>DV(...t);async function zme(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 xT(c,i);let u=T6(n,s,l,r,a);await new Promise(d=>setTimeout(d,u))}l++}}async function qWe(t,{retry:e,...r}){return await zme(async()=>{let i=await fetch(t,r);if(i.status===202)throw new sS("Request is still being processed");return i},e)}async function qme(t,e){return await qWe(t,{retry:{maxAttempts:5,minTimeout:5e3,maxTimeout:3e4,multiplier:2,jitter:.1,isRetriable:i=>i instanceof sS},...e})}async function Hme(){let{data:t,error:e}=await un.auth.getSession();if(e)throw new ov("Failed to get access token",{cause:e,status:e.status});let r=t.session?.access_token;if(!r)throw new Lo("No access token available. Please log in.");return r}var cv=Ume("https://api-production.aiden-lx.workers.dev",{headers:async()=>({Authorization:`Bearer ${await Hme()}`}),fetch:qme});var NV=4*1024*1024,Gme=Pt(["image/png","image/jpeg","image/webp","image/heic","image/heif"]);var HWe=cv["text-extract"].$post,aS=class{#e(e){if(!ws(Gme,e.type))throw new Eh(`Unsupported image type: ${e.type}`);if(e.size>NV)throw new Eh(`Image file size exceeds the limit of ${NV} bytes`);if(e.size===0)throw new Eh("Image file is empty")}async extractText(e){this.#e(e);let r=await HWe({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 lv;return n.content}};var GWe=cv.youtube.video[":video_id"].metadata.$get,WWe=cv.youtube.video[":video_id"].subtitles.$get,KWe=cv.youtube.video[":video_id"].subtitles[":subtitle_id"].$get,oS=class{async getVideoMetadata(e){let r=await GWe({param:{video_id:e}});if(!r.ok)throw Pi.fromResponse(r,await r.text());return await r.json()}async getSubtitlesList(e){let r=await WWe({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 KWe({param:{video_id:e,subtitle_id:r}});if(!n.ok)throw Pi.fromResponse(n,await n.text());return await n.text()}};var Wme=require("obsidian"),cL=class{app;constructor(e){this.app=e.app}async getAttachmentFolder(e){let{vault:r}=this.app,n;if(!e.folderPath){let i=await this.#e(e.sourcePath);return n=r.getFolderByPath(i),n||(n=await r.createFolder(i)),n}return n=r.getFolderByPath(e.folderPath),n||(n=await r.createFolder(e.folderPath)),n}async#e(e){let r=Math.random().toString(36).substring(2),i=(await this.app.fileManager.getAvailablePathForAttachment(r,e)).replace(r,"");return(0,Wme.normalizePath)(i)||"/"}};var Pl=require("obsidian");var uL=require("@codemirror/language"),Kme=require("@lezer/common");function dL(t,e){let r=e.getCursor("to");e.replaceRange(t,r,r),e.setCursor(e.offsetToPos(e.posToOffset(r)+t.length))}function fL(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 FV(t){return new Set(t.prop(uL.tokenClassNodeProp)?.split(" "))}function BV(t,e){let r=t.activeCM,n=r.state.doc.lineAt(e),i=(0,uL.syntaxTree)(r.state).cursorAt(e,-1,Kme.IterMode.ExcludeBuffers);do{let s=FV(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 BV(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 YWe(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=YWe(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[VV]===!0)return delete f[VV],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 VV=Symbol("MX_INTERNAL_OPENFILE");async function pL(t,e){return this[VV]=!0,await this.openFile(t,e)}var hL=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=ZWe(l,this.app),!a){let c=this.app.workspace.getLeaf("tab");if(await pL.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(XWe(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=QWe(i,a);this.settings.loaded.then(l=>{l["note.template.insert-at"]==="before-cursor"?fL(o,r):dL(o,r)}),this.#t.set(r,n.file)}})}};function XWe(t){return new RegExp(`%%REC_${t}_(?<offset>\\d+)%%`,"g")}function QWe(t,e){return`%%REC_${t}_${e}%%`}function ZWe(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 mL=require("obsidian");var Yc=require("obsidian");var Xd=class t extends Yc.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 Yc.Notice(l?`Welcome ${l}!`:"Welcome to Media Extended!")}catch(o){new Yc.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 Yc.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 Yc.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://${jV}`}});r?(console.error("Error signing in with GitHub:",r),new Yc.Notice("Error signing in with GitHub")):nL(e.url)}};var jV="mx-auth-callback",gL=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=nh();on(e,r){return this.#r.on(e,r)}#n(){this.plugin.registerObsidianProtocolHandler(jV,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 mL.Notice(`Error signing out: ${e.message}`)):new mL.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 mL.Notice(`You are already logged in as ${e.user.email}`);return}await Xd.open(this)}})}#s(e){un.auth.startAutoRefresh(),e.defer(()=>un.auth.stopAutoRefresh()),um(e,document,"visibilitychange",()=>{document.visibilityState==="visible"?un.auth.startAutoRefresh():un.auth.stopAutoRefresh()})}};var Mo=require("obsidian");var yL=class{app;constructor(e){this.app=e.app}getFullPath(e){if(!(Mo.Platform.isDesktopApp&&this.app.vault.adapter instanceof Mo.FileSystemAdapter))return null;try{if(e instanceof Mo.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 Qd("not-supported",e);if(!Mo.Platform.isDesktopApp||!(this.app.vault.adapter instanceof Mo.FileSystemAdapter))throw new Qd("not-supported",e);let r=this.app.vault.adapter.getFullPath("/"),n=Cm(r);if(n&&JWe(e,n))throw new Qd("in-vault",e);if(e.hostname)throw new Qd("network-path",e);try{return Vi().fileURLToPath(e.toString())}catch(i){throw console.warn(`Invalid file URL: ${e.toString()}`,i),new Qd("invalid-file-uri",e)}}safeResolveFileUri(e){try{return{success:!0,path:Vi().fileURLToPath(e.toString())}}catch(r){return r instanceof Qd?{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 JWe(t,e){let r=(0,Mo.normalizePath)(t.pathname),n=(0,Mo.normalizePath)(e.pathname);return r.startsWith(n)}var Qd=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 RL=require("obsidian");var kL=Z(Te(),1),Va=Z(Te(),1),fS=t=>t.type==="checkbox",Ih=t=>t instanceof Date,Ri=t=>t==null,gge=t=>typeof t=="object",Nr=t=>!Ri(t)&&!Array.isArray(t)&&gge(t)&&!Ih(t),eKe=t=>Nr(t)&&t.target?fS(t.target)?t.target.checked:t.target.value:t,tKe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,rKe=(t,e)=>t.has(tKe(e)),nKe=t=>{let e=t.constructor&&t.constructor.prototype;return Nr(e)&&e.hasOwnProperty("isPrototypeOf")},zV=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(!(zV&&(t instanceof Blob||n))&&(r||Nr(t)))if(e=r?[]:{},!r&&!nKe(t))e=t;else for(let i in t)t.hasOwnProperty(i)&&(e[i]=Un(t[i]));else return t;return e}var SL=t=>/^\w*$/.test(t),Dr=t=>t===void 0,qV=t=>Array.isArray(t)?t.filter(Boolean):[],HV=t=>qV(t.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(t,e,r)=>{if(!e||!Nr(t))return r;let n=(SL(e)?[e]:HV(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=SL(e)?[e]:HV(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"},_o={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Xc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},iKe=Va.default.createContext(null);iKe.displayName="HookFormContext";var sKe=(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]!==_o.all&&(e._proxyFormState[a]=!n||_o.all),r&&(r[a]=!0),t[a]}});return i},aKe=typeof window<"u"?kL.useLayoutEffect:kL.useEffect;var Ll=t=>typeof t=="string",oKe=(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 GV=(t,e,r,n,i)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:i||!0}}:{},uS=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=[]}}},UV=t=>Ri(t)||!gge(t);function Zd(t,e,r=new WeakSet){if(UV(t)||UV(e))return t===e;if(Ih(t)&&Ih(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(Ih(a)&&Ih(o)||Nr(a)&&Nr(o)||Array.isArray(a)&&Array.isArray(o)?!Zd(a,o,r):a!==o)return!1}}return!0}var as=t=>Nr(t)&&!Object.keys(t).length,WV=t=>t.type==="file",Oo=t=>typeof t=="function",bL=t=>{if(!zV)return!1;let e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},yge=t=>t.type==="select-multiple",KV=t=>t.type==="radio",lKe=t=>KV(t)||fS(t),$V=t=>bL(t)&&t.isConnected;function cKe(t,e){let r=e.slice(0,-1).length,n=0;for(;n<r;)t=Dr(t)?n++:t[e[n++]];return t}function uKe(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:SL(e)?[e]:HV(e),n=r.length===1?t:cKe(t,r),i=r.length-1,s=r[i];return n&&delete n[s],i!==0&&(Nr(n)&&as(n)||Array.isArray(n)&&uKe(n))&&Wr(t,r.slice(0,-1)),t}var vge=t=>{for(let e in t)if(Oo(t[e]))return!0;return!1};function xL(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])?[]:{},xL(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)||UV(r[i])?r[i]=Array.isArray(t[i])?xL(t[i],[]):{...xL(t[i])}:bge(t[i],Ri(e)?{}:e[i],r[i]):r[i]=!Zd(t[i],e[i]);return r}var lS=(t,e)=>bge(t,e,xL(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 WV(e)?e.files:KV(e)?kge(t.refs).value:yge(e)?[...e.selectedOptions].map(({value:r})=>r):fS(e)?xge(t.refs).value:wge(Dr(e.value)?t.ref.value:e.value,t)}var dKe=(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}},wL=t=>t instanceof RegExp,cS=t=>Dr(t)?t:wL(t)?t.source:Nr(t)?wL(t.value)?t.value.source:t.value:t,uge=t=>({isOnSubmit:!t||t===_o.onSubmit,isOnBlur:t===_o.onBlur,isOnChange:t===_o.onChange,isOnAll:t===_o.all,isOnTouch:t===_o.onTouched}),dge="AsyncFunction",fKe=t=>!!t&&!!t.validate&&!!(Oo(t.validate)&&t.validate.constructor.name===dge||Nr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===dge)),pKe=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)))),dS=(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(dS(o,e))break}else if(Nr(o)&&dS(o,e))break}}};function pge(t,e,r){let n=fe(t,r);if(n||SL(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 hKe=(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||_o.all))},mKe=(t,e,r)=>!t||!e||t===e||uS(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),gKe=(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,yKe=(t,e)=>!qV(fe(t,e)).length&&Wr(t,e),vKe=(t,e,r)=>{let n=uS(fe(t,r));return Mt(n,"root",e[r]),Mt(t,r,n),t},vL=t=>Ll(t);function hge(t,e,r="validate"){if(vL(t)||Array.isArray(t)&&t.every(vL)||Rl(t)&&!t)return{type:r,message:vL(t)?t:"",ref:e}}var uv=t=>Nr(t)&&!wL(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=KV(a),S=fS(a),T=O||S,E=(v||WV(a))&&Dr(a.value)&&Dr(y)||bL(a)&&a.value===""||y===""||Array.isArray(y)&&!y.length,P=GV.bind(null,m,n,C),R=(I,B,M,z=Xc.maxLength,G=Xc.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}=vL(l)?{value:!!l,message:l}:uv(l);if(I&&(C[m]={type:Xc.required,message:B,ref:x,...P(Xc.required,B)},!n))return w(B),C}if(!E&&(!Ri(d)||!Ri(f))){let I,B,M=uv(f),z=uv(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,Xc.max,Xc.min),!n))return w(C[m].message),C}if((c||u)&&!E&&(Ll(y)||s&&Array.isArray(y))){let I=uv(c),B=uv(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}=uv(p);if(wL(I)&&!y.match(I)&&(C[m]={type:Xc.pattern,message:B,ref:a,...P(Xc.pattern,B)},!n))return w(B),C}if(h){if(Oo(h)){let I=await h(y,r),B=hge(I,x);if(B&&(C[m]={...B,...P(Xc.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},bKe={mode:_o.onSubmit,reValidateMode:_o.onChange,shouldFocusError:!0};function xKe(t={}){let e={...bKe,...t},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Oo(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===_o.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),yKe(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=lS(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=Zd(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?!Zd(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,dKe(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&&fKe(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?vKe(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=>!$V(D)):!$V(A._f.ref))&<(k)}o.unMount=new Set},R=(k,A)=>!e.disabled&&(k&&A&&Mt(s,k,A),!Zd(Me(),i)),I=(k,A,D)=>oKe(k,o,{...a.mount?s:Dr(A)?i:Ll(k)?{[k]:A}:A},D,A),B=k=>qV(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=bL(H.ref)&&Ri(A)?"":A,yge(H.ref)?[...H.ref.options].forEach(ne=>ne.selected=j.includes(ne.value)):H.refs?fS(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):WV(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)&&!Ih(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:lS(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)||Ih(Qe)&&isNaN(Qe.getTime())||Zd(Qe,fe(s,D,Qe))},ne=uge(e.mode),ve=uge(e.reValidateMode);if(j){let Qe,En,hs=A.type?cge(j._f):eKe(k),Uo=k.type===ige.BLUR||k.type===ige.FOCUS_OUT,tb=!pKe(j._f)&&!e.resolver&&!fe(r.errors,D)&&!j._f.deps||gKe(Uo,fe(r.touchedFields,D),r.isSubmitted,ve,ne),Sf=fge(D,o,Uo);Mt(s,D,hs),Uo?(j._f.onBlur&&j._f.onBlur(k),l&&l(0)):j._f.onChange&&j._f.onChange(k);let rb=C(D,hs,Uo),pC=!as(rb)||Sf;if(!Uo&&f.state.next({name:D,type:k.type,values:Un(s)}),tb)return(u.isValid||d.isValid)&&(e.mode==="onBlur"?Uo&&m():Uo||m()),pC&&f.state.next({name:D,...Sf?{}:rb});if(!Uo&&Sf&&f.state.next({...r}),e.resolver){let{errors:hC}=await S([D]);if(H(hs),q){let mC=pge(r.errors,n,D),IU=pge(hC,n,mC.name||D);Qe=IU.error,D=IU.name,En=as(hC)}}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,rb))}},K=(k,A)=>{if(fe(r.errors,A)&&k.focus)return k.focus(),1},de=async(k,A={})=>{let D,q,j=uS(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&&dS(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))},ht=(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&&uS(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)=>Oo(k)?f.state.subscribe({next:D=>k(I(void 0,A),D)}):I(k,A,!0),Kr=k=>f.state.subscribe({next:A=>{mKe(k.name,A.name,k.exact)&&hKe(A,k.formState||u,m_,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?uS(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:cS(A.min),max:cS(A.max),minLength:cS(A.minLength),maxLength:cS(A.maxLength),pattern:cS(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=lKe(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($V),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)&&!(rKe(o.array,k)&&a.action)&&o.unMount.add(k)}}},Ar=()=>e.shouldFocusError&&dS(n,K,o.mount),Zs=k=>{Rl(k)&&(f.state.next({disabled:k}),dS(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},kf=(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}))},Bl=(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(lS(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(zV&&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(bL(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&&!Zd(k,i)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:j?{}:A.keepDirtyValues?A.keepDefaultValues&&s?lS(i,s):r.dirtyFields:A.keepDefaultValues&&k?lS(i,k):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},hu=(k,A)=>Bl(Oo(k)?k(s):k,A),zh=(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&&Oo(j.select)&&j.select())}},m_=k=>{r={...r,...k}},_={control:{register:Ir,unregister:lt,getFieldState:ht,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:Bl,_resetDefaultValues:()=>Oo(e.defaultValues)&&e.defaultValues().then(k=>{hu(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:hu,resetField:kf,clearErrors:At,unregister:lt,setError:Ue,setFocus:zh,getFieldState:ht};return{..._,formControl:_}}function CL(t={}){let e=Va.default.useRef(void 0),r=Va.default.useRef(void 0),[n,i]=Va.default.useState({isDirty:!1,isValidating:!1,isLoading:Oo(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:Oo(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!Oo(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{let{formControl:a,...o}=xKe(t);e.current={...o,formState:n}}let s=e.current.control;return s._options=t,aKe(()=>{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]),Va.default.useEffect(()=>s._disableForm(t.disabled),[s,t.disabled]),Va.default.useEffect(()=>{t.mode&&(s._options.mode=t.mode),t.reValidateMode&&(s._options.reValidateMode=t.reValidateMode)},[s,t.mode,t.reValidateMode]),Va.default.useEffect(()=>{t.errors&&(s._setErrors(t.errors),s._focusError())},[s,t.errors]),Va.default.useEffect(()=>{t.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,t.shouldUnregister]),Va.default.useEffect(()=>{if(s._proxyFormState.isDirty){let a=s._getDirty();a!==n.isDirty&&s._subjects.state.next({isDirty:a})}},[s,n.isDirty]),Va.default.useEffect(()=>{t.values&&!Zd(t.values,r.current)?(s._reset(t.values,s._options.resetOptions),r.current=t.values,i(a=>({...a}))):s._resetDefaultValues()},[s,t.values]),Va.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=sKe(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()}},wKe=(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&&wKe(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(kKe(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},kKe=(t,e)=>{let r=Cge(e);return t.some(n=>Cge(n).match(`^${r}\\.\\d+`))};function Cge(t){return t.replace(/\]|\[/g,"")}function dv(t,e,r){return r===void 0&&(r={}),function(n,i,s){try{var a=!s.shouldUseNativeValidation&&s.criteriaMode==="all";return Promise.resolve(FQ(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=OQ(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]=GV(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 TL(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 EL(t){return{timestamp:Qi(t)?WA(t.start*1e3):void 0,clip:fl(t)?{start:WA(t.start*1e3),end:WA(t.end*1e3),playToEnd:t.end===Number.POSITIVE_INFINITY}:void 0}}function Ege(t){return{start:Qp(t)/1e3,end:-1}}function IL(t){return{start:t.start?Qp(t.start)/1e3:-1,end:t.playToEnd?Number.POSITIVE_INFINITY:t.end?Qp(t.end)/1e3:-1}}var YV=Z(Ge(),1),pS=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,...EL(n)}}#i(e){let{crossOrigin:r,play:n,aspectRatio:i,type:s,...a}=e,o=(e.clip&&IL(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=TL(e),i=SKe.filter(a=>this.#t?a!=="timestamp":a!=="play");return(0,YV.jsx)(()=>{let a=CL({resolver:dv(KA),defaultValues:r});return(0,YV.jsx)(XA,{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."}}})},{})}},SKe=["clip","timestamp","autoPlay","loop","muted","volume","showControls","audioGain","playbackRate","preservePitch","aspectRatio","flip","crossOrigin","type","title","play"];var hS=new RegExp(`\\.(?:${VQ().join("|")})$`,"i");async function Age(t){await fm(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(hS.test(p))return null}}return n.call(this,i,s,a)}})}var Ah=require("obsidian");var AL=class extends Ah.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=XV.find(p=>p.key===this.#t&&p.hasValue),u=c&&a(c)?c.options??[]:[],d=(0,Ah.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,...XV.filter(a).slice(0,20)];let l=(0,Ah.prepareSimpleSearch)(r);return XV.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,Ah.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;{let h=Rge(i,")",o+1);if(h!==-1&&h<e.ch)return null}let 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://")&&!hS.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 p=Mge(i,a+2);if(p!==-1&&p<=e.ch)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(!hS.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))}},XV=[{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 Rge(t,e,r){for(let n=r;n<t.length;n++)if(t[n]===e&&!Lge(t,n))return n;return-1}function Lge(t,e){let r=0;for(let n=e-1;n>=0&&t[n]==="\\";n--)r++;return(r&1)===1}function Mge(t,e){for(let r=e;r<t.length-1;r++)if(t[r]==="]"&&!Lge(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=Rge(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=Mge(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 PL=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 pS(e,o,l).requestInput();let r=J(n,new DisposableStack);um(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 AL(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=Cc(o).toString();if(r.getRange(e.start,e.end)!==e.text){new RL.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:BV(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,RL.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 JV=(t,e)=>e.some(r=>t instanceof r),_ge,Oge;function CKe(){return _ge||(_ge=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function TKe(){return Oge||(Oge=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var ej=new WeakMap,QV=new WeakMap,LL=new WeakMap;function EKe(t){let e=new Promise((r,n)=>{let i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",a)},s=()=>{r(Jd(t.result)),i()},a=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",a)});return LL.set(e,t),e}function IKe(t){if(ej.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)});ej.set(t,e)}var tj={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return ej.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Jd(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 Bge(t){tj=t(tj)}function AKe(t){return TKe().includes(t)?function(...e){return t.apply(rj(this),e),Jd(this.request)}:function(...e){return Jd(t.apply(rj(this),e))}}function PKe(t){return typeof t=="function"?AKe(t):(t instanceof IDBTransaction&&IKe(t),JV(t,CKe())?new Proxy(t,tj):t)}function Jd(t){if(t instanceof IDBRequest)return EKe(t);if(QV.has(t))return QV.get(t);let e=PKe(t);return e!==t&&(QV.set(t,e),LL.set(e,t)),e}var rj=t=>LL.get(t);function ij(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){let a=indexedDB.open(t,e),o=Jd(a);return n&&a.addEventListener("upgradeneeded",l=>{n(Jd(a.result),l.oldVersion,l.newVersion,Jd(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 Vge(t,{blocked:e}={}){let r=indexedDB.deleteDatabase(t);return e&&r.addEventListener("blocked",n=>e(n.oldVersion,n)),Jd(r).then(()=>{})}var RKe=["get","getKey","getAll","getAllKeys","count"],LKe=["put","add","delete","clear"],ZV=new Map;function Dge(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(ZV.get(e))return ZV.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 ZV.set(e,s),s}Bge(t=>({...t,get:(e,r,n)=>Dge(e,r)||t.get(e,r,n),has:(e,r)=>!!Dge(e,r)||t.has(e,r)}));var MKe=["continue","continuePrimaryKey","advance"],Nge={},nj=new WeakMap,jge=new WeakMap,_Ke={get(t,e){if(!MKe.includes(e))return t[e];let r=Nge[e];return r||(r=Nge[e]=function(...n){nj.set(this,jge.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(jge.set(r,e),LL.set(r,rj(e));e;)yield r,e=await(nj.get(r)||e.continue()),nj.delete(r)}function Fge(t,e){return e===Symbol.asyncIterator&&JV(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&JV(t,[IDBIndex,IDBObjectStore])}Bge(t=>({...t,get(e,r,n){return Fge(e,r)?OKe:t.get(e,r,n)},has(e,r){return Fge(e,r)||t.has(e,r)}}));var ML=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=ij("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=ij("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=LQ(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 Vge("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 $ge=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Uge=t=>{throw TypeError(t)},zge=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&Uge("Object expected");var n,i;r&&(n=e[$ge("asyncDispose")]),n===void 0&&(n=e[$ge("dispose")],r&&(i=n)),typeof n!="function"&&Uge("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},qge=(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 mS(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=zge(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{qge(o,l,c)}},{with:async(a,o)=>{var l=[];try{let d=Xr(),f={type:"TASK",taskId:d,fnName:n,args:a},p=zge(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=o0(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{qge(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 Hge(t){return t?.type==="TASK"}function Gge(t){return t?.type==="RESULT"}function Wge(t){return t?.type==="ERROR"}function Kge(t){return t?.type==="ABORT"}function sj(t){return t?.type==="EVENT"}function Yge(t){if(typeof t!="object"||t===null)return!1;let e=t;return Gge(e)||Wge(e)||Hge(e)||Kge(e)||sj(e)}function _L(t,e){let r=e;return!r||sj(r)?!1:r.taskId===t.taskId&&(Gge(r)||Wge(r))}var Ph=require("obsidian");async function aj(t,{onExternalLinkClick:e,onInternalLinkClick:r}){let n=await XY();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,Kd(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,Kd(a),l)}catch(c){console.error("onExternalLinkClick error in editor, fallback to default",c),l()}else l()}})}var Xge=require("obsidian");function oj(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,Yd(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(Xge.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 Qge=require("obsidian");function lj(t,{onInternalLinkClick:e}){var n=[];try{let r=J(n,new DisposableStack);r.defer(pr(Qge.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,Kd(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 cj(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 Zge=require("obsidian");function uj(t,e){let r=new DisposableStack,n=r.use(new bu);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(Zge.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(WY(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,Yd(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??"",Yd(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 OL=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);aj(this,{onExternalLinkClick:this.#i,onInternalLinkClick:this.#r}).then(o=>this.#e.defer(o));r.use(uj(this,{onExternalLinkClick:this.#i,onInternalLinkClick:this.#r}));r.use(lj(this,{onInternalLinkClick:this.#n}));r.use(nge(this,{onOpenFile:this.#t}));cj(this.plugin);oj(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=wD(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=wD(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,Ph.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,Ph.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 Ph.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 Ph.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 Ph.Notice(`Failed to open media link: ${s.message}`)}throw s}}};var fye=require("obsidian");var Jge="4.1.4";var S3t=Symbol.for("mx:main-ps"),eye="mx:main-ps:ready",tye="mx:main-ps:connect",rye="mx:main-ps:disconnect",nye=Jge;var DL="mx:ipc-emit:v1",iye="mx:ipc-invoke:v1";function NL(t){return Yge(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(Qf(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(Qf(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 sye(t){try{let e=Oe.deserialize(t);return NL(e)}catch(e){return console.warn("Error deserializing SuperJSON payload",e,t),null}}function aye(t){return Oe.serialize(t)}function FL(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 oye=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),lye=t=>{throw TypeError(t)},cye=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&lye("Object expected");var n,i;r&&(n=e[oye("asyncDispose")]),n===void 0&&(n=e[oye("dispose")],r&&(i=n)),typeof n!="function"&&lye("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},uye=(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()},BL={parse:sye,stringify:aye},VL=class{#e;constructor(e){this.#e=e}async sendMessage(e){this.#e.send(DL,BL.stringify(e))}addMessageHandler(e){var r=[];try{let s=cye(r,new DisposableStack),a=(o,l)=>{let c=BL.parse(l);c&&e(c)};return this.#e.on(DL,a),s.defer(()=>{this.#e.off(DL,a)}),s.move()}catch(s){var n=s,i=!0}finally{uye(r,n,i)}}async invoke(e,{signal:r}={}){var n=[];try{let a=cye(n,new DisposableStack);return await Promise.race([this.#e.invoke(iye,BL.stringify(e)).then(o=>{let l=BL.parse(o);return _L(e,l)?l:{type:"ERROR",taskId:e.taskId,error:new Error("Invalid invoke response")}}),FL(r,{taskId:e.taskId,stack:a})])}catch(a){var i=a,s=!0}finally{uye(n,i,s)}}};var fv={getAll:"get-credentials",set:"set-credential",delete:"delete-credential",clear:"clear-credentials",import:"import-credentials"};function dj(t){let e=new VL(t),r=mS(e);return{getCredentials:r.createRemoteFn(fv.getAll),setCredential:r.createRemoteFn(fv.set),deleteCredential:r.createRemoteFn(fv.delete),clearCredentials:r.createRemoteFn(fv.clear),importCredentials:r.createRemoteFn(fv.import),[Symbol.dispose]:()=>{}}}var fj='"use strict";var qm=Object.create;var mr=Object.defineProperty;var Nm=Object.getOwnPropertyDescriptor;var Dm=Object.getOwnPropertyNames;var Lm=Object.getPrototypeOf,Mm=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),jm=(e,t)=>{for(var r in t)mr(e,r,{get:t[r],enumerable:!0})},Ia=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Dm(t))!Mm.call(e,i)&&i!==r&&mr(e,i,{get:()=>t[i],enumerable:!(n=Nm(t,i))||n.enumerable});return e};var at=(e,t,r)=>(r=e!=null?qm(Lm(e)):{},Ia(t||!e||!e.__esModule?mr(r,"default",{value:e,enumerable:!0}):r,e)),$m=e=>Ia(mr({},"__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((nA,qa)=>{"use strict";qa.exports=function(e){try{return!!e()}catch{return!0}}});var fe=p((iA,Na)=>{"use strict";var Fm=re();Na.exports=!Fm(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var gr=p((sA,Da)=>{"use strict";var Hm=re();Da.exports=!Hm(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")})});var Qe=p((oA,La)=>{"use strict";var Bm=gr(),vr=Function.prototype.call;La.exports=Bm?vr.bind(vr):function(){return vr.apply(vr,arguments)}});var Fa=p($a=>{"use strict";var Ma={}.propertyIsEnumerable,ja=Object.getOwnPropertyDescriptor,Um=ja&&!Ma.call({1:2},1);$a.f=Um?function(t){var r=ja(this,t);return!!r&&r.enumerable}:Ma});var Nt=p((uA,Ha)=>{"use strict";Ha.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}});var J=p((cA,Ga)=>{"use strict";var Ba=gr(),Ua=Function.prototype,ai=Ua.call,Gm=Ba&&Ua.bind.bind(ai,ai);Ga.exports=Ba?Gm:function(e){return function(){return ai.apply(e,arguments)}}});var _r=p((lA,Ka)=>{"use strict";var Va=J(),Vm=Va({}.toString),Km=Va("".slice);Ka.exports=function(e){return Km(Vm(e),8,-1)}});var za=p((fA,Wa)=>{"use strict";var Wm=J(),zm=re(),Ym=_r(),ui=Object,Xm=Wm("".split);Wa.exports=zm(function(){return!ui("z").propertyIsEnumerable(0)})?function(e){return Ym(e)==="String"?Xm(e,""):ui(e)}:ui});var br=p((pA,Ya)=>{"use strict";Ya.exports=function(e){return e==null}});var Sr=p((hA,Xa)=>{"use strict";var Qm=br(),Zm=TypeError;Xa.exports=function(e){if(Qm(e))throw new Zm("Can\'t call method on "+e);return e}});var Dt=p((dA,Qa)=>{"use strict";var Jm=za(),eg=Sr();Qa.exports=function(e){return Jm(eg(e))}});var Z=p((yA,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((mA,Ja)=>{"use strict";var tg=Z();Ja.exports=function(e){return typeof e=="object"?e!==null:tg(e)}});var qe=p((gA,eu)=>{"use strict";var li=W(),rg=Z(),ng=function(e){return rg(e)?e:void 0};eu.exports=function(e,t){return arguments.length<2?ng(li[e]):li[e]&&li[e][t]}});var Er=p((vA,tu)=>{"use strict";var ig=J();tu.exports=ig({}.isPrototypeOf)});var su=p((_A,iu)=>{"use strict";var sg=W(),ru=sg.navigator,nu=ru&&ru.userAgent;iu.exports=nu?String(nu):""});var pi=p((bA,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((SA,hu)=>{"use strict";var pu=pi(),og=re(),ag=W(),ug=ag.String;hu.exports=!!Object.getOwnPropertySymbols&&!og(function(){var e=Symbol("symbol detection");return!ug(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&pu&&pu<41})});var di=p((EA,du)=>{"use strict";var cg=hi();du.exports=cg&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var yi=p((wA,yu)=>{"use strict";var lg=qe(),fg=Z(),pg=Er(),hg=di(),dg=Object;yu.exports=hg?function(e){return typeof e=="symbol"}:function(e){var t=lg("Symbol");return fg(t)&&pg(t.prototype,dg(e))}});var gu=p((RA,mu)=>{"use strict";var yg=String;mu.exports=function(e){try{return yg(e)}catch{return"Object"}}});var Ze=p((xA,vu)=>{"use strict";var mg=Z(),gg=gu(),vg=TypeError;vu.exports=function(e){if(mg(e))return e;throw new vg(gg(e)+" is not a function")}});var Lt=p((PA,_u)=>{"use strict";var _g=Ze(),bg=br();_u.exports=function(e,t){var r=e[t];return bg(r)?void 0:_g(r)}});var Su=p((OA,bu)=>{"use strict";var mi=Qe(),gi=Z(),vi=xe(),Sg=TypeError;bu.exports=function(e,t){var r,n;if(t==="string"&&gi(r=e.toString)&&!vi(n=mi(r,e))||gi(r=e.valueOf)&&!vi(n=mi(r,e))||t!=="string"&&gi(r=e.toString)&&!vi(n=mi(r,e)))return n;throw new Sg("Can\'t convert object to primitive value")}});var Mt=p((AA,Eu)=>{"use strict";Eu.exports=!1});var Rr=p((TA,Ru)=>{"use strict";var wu=W(),Eg=Object.defineProperty;Ru.exports=function(e,t){try{Eg(wu,e,{value:t,configurable:!0,writable:!0})}catch{wu[e]=t}return t}});var jt=p((CA,Ou)=>{"use strict";var wg=Mt(),Rg=W(),xg=Rr(),xu="__core-js_shared__",Pu=Ou.exports=Rg[xu]||xg(xu,{});(Pu.versions||(Pu.versions=[])).push({version:"3.41.0",mode:wg?"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((IA,Tu)=>{"use strict";var Au=jt();Tu.exports=function(e,t){return Au[e]||(Au[e]=t||{})}});var bi=p((kA,Cu)=>{"use strict";var Pg=Sr(),Og=Object;Cu.exports=function(e){return Og(Pg(e))}});var oe=p((qA,Iu)=>{"use strict";var Ag=J(),Tg=bi(),Cg=Ag({}.hasOwnProperty);Iu.exports=Object.hasOwn||function(t,r){return Cg(Tg(t),r)}});var Si=p((NA,ku)=>{"use strict";var Ig=J(),kg=0,qg=Math.random(),Ng=Ig(1 .toString);ku.exports=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ng(++kg+qg,36)}});var ne=p((DA,Nu)=>{"use strict";var Dg=W(),Lg=_i(),qu=oe(),Mg=Si(),jg=hi(),$g=di(),ut=Dg.Symbol,Ei=Lg("wks"),Fg=$g?ut.for||ut:ut&&ut.withoutSetter||Mg;Nu.exports=function(e){return qu(Ei,e)||(Ei[e]=jg&&qu(ut,e)?ut[e]:Fg("Symbol."+e)),Ei[e]}});var ju=p((LA,Mu)=>{"use strict";var Hg=Qe(),Du=xe(),Lu=yi(),Bg=Lt(),Ug=Su(),Gg=ne(),Vg=TypeError,Kg=Gg("toPrimitive");Mu.exports=function(e,t){if(!Du(e)||Lu(e))return e;var r=Bg(e,Kg),n;if(r){if(t===void 0&&(t="default"),n=Hg(r,e,t),!Du(n)||Lu(n))return n;throw new Vg("Can\'t convert object to primitive value")}return t===void 0&&(t="number"),Ug(e,t)}});var wi=p((MA,$u)=>{"use strict";var Wg=ju(),zg=yi();$u.exports=function(e){var t=Wg(e,"string");return zg(t)?t:t+""}});var xi=p((jA,Hu)=>{"use strict";var Yg=W(),Fu=xe(),Ri=Yg.document,Xg=Fu(Ri)&&Fu(Ri.createElement);Hu.exports=function(e){return Xg?Ri.createElement(e):{}}});var Pi=p(($A,Bu)=>{"use strict";var Qg=fe(),Zg=re(),Jg=xi();Bu.exports=!Qg&&!Zg(function(){return Object.defineProperty(Jg("div"),"a",{get:function(){return 7}}).a!==7})});var $t=p(Gu=>{"use strict";var ev=fe(),tv=Qe(),rv=Fa(),nv=Nt(),iv=Dt(),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 Oi=p((HA,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((BA,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=Oi(),xr=ct(),Wu=wi(),mv=TypeError,Ai=Object.defineProperty,gv=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=gv(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 Ai(t,r,n)}:Ai:function(t,r,n){if(xr(t),r=Wu(r),xr(n),dv)try{return Ai(t,r,n)}catch{}if("get"in n||"set"in n)throw new mv("Accessors not supported");return"value"in n&&(t[r]=n.value),t}});var Ft=p((GA,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((VA,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((KA,Ju)=>{"use strict";var xv=J(),Pv=Z(),Ni=jt(),Ov=xv(Function.toString);Pv(Ni.inspectSource)||(Ni.inspectSource=function(e){return Ov(e)});Ju.exports=Ni.inspectSource});var nc=p((WA,rc)=>{"use strict";var Av=W(),Tv=Z(),tc=Av.WeakMap;rc.exports=Tv(tc)&&/native code/.test(String(tc))});var Pr=p((zA,sc)=>{"use strict";var Cv=_i(),Iv=Si(),ic=Cv("keys");sc.exports=function(e){return ic[e]||(ic[e]=Iv(e))}});var Or=p((YA,oc)=>{"use strict";oc.exports={}});var Cr=p((XA,cc)=>{"use strict";var kv=nc(),uc=W(),qv=xe(),Nv=Ft(),Di=oe(),Li=jt(),Dv=Pr(),Lv=Or(),ac="Object already initialized",Mi=uc.TypeError,Mv=uc.WeakMap,Ar,Ht,Tr,jv=function(e){return Tr(e)?Ht(e):Ar(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||Li.state?(he=Li.state||(Li.state=new Mv),he.get=he.get,he.has=he.has,he.set=he.set,Ar=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=Dv("state"),Lv[Je]=!0,Ar=function(e,t){if(Di(e,Je))throw new Mi(ac);return t.facade=e,Nv(e,Je,t),t},Ht=function(e){return Di(e,Je)?e[Je]:{}},Tr=function(e){return Di(e,Je)});var he,Je;cc.exports={set:Ar,get:Ht,has:Tr,enforce:jv,getterFor:$v}});var Fi=p((QA,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 Oe=p((ZA,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((JA,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((e0,mc)=>{"use strict";var i_=yc();mc.exports=function(e){var t=+e;return t!==t||t===0?0:i_(t)}});var vc=p((t0,gc)=>{"use strict";var s_=Hi(),o_=Math.max,a_=Math.min;gc.exports=function(e,t){var r=s_(e);return r<0?o_(r+t,0):a_(r,t)}});var bc=p((r0,_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((n0,Sc)=>{"use strict";var l_=bc();Sc.exports=function(e){return l_(e.length)}});var xc=p((i0,Rc)=>{"use strict";var f_=Dt(),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((s0,Oc)=>{"use strict";var d_=J(),Bi=oe(),y_=Dt(),m_=xc().indexOf,g_=Or(),Pc=d_([].push);Oc.exports=function(e,t){var r=y_(e),n=0,i=[],s;for(s in r)!Bi(g_,s)&&Bi(r,s)&&Pc(i,s);for(;t.length>n;)Bi(r,s=t[n++])&&(~m_(i,s)||Pc(i,s));return i}});var qr=p((o0,Ac)=>{"use strict";Ac.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((c0,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((l0,Lc)=>{"use strict";var Dc=oe(),O_=Nc(),A_=$t(),T_=Pe();Lc.exports=function(e,t,r){for(var n=O_(t),i=T_.f,s=A_.f,o=0;o<n.length;o++){var a=n[o];!Dc(e,a)&&!(r&&Dc(r,a))&&i(e,a,s(t,a))}}});var jc=p((f0,Mc)=>{"use strict";var C_=re(),I_=Z(),k_=/#|\\.prototype\\./,Bt=function(e,t){var r=N_[q_(e)];return r===L_?!0:r===D_?!1:I_(t)?C_(t):!!t},q_=Bt.normalize=function(e){return String(e).replace(k_,".").toLowerCase()},N_=Bt.data={},D_=Bt.NATIVE="N",L_=Bt.POLYFILL="P";Mc.exports=Bt});var Dr=p((p0,$c)=>{"use strict";var Nr=W(),M_=$t().f,j_=Ft(),$_=Oe(),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((h0,Fc)=>{"use strict";var U_=re();Fc.exports=!U_(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})});var Lr=p((d0,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((y0,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((m0,Kc)=>{"use strict";var Z_=xe();Kc.exports=function(e){return Z_(e)||e===null}});var Yc=p((g0,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((v0,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((_0,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=Oi(),lb=Pe(),fb=ct(),pb=Dt(),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((S0,rl)=>{"use strict";var db=qe();rl.exports=db("document","documentElement")});var $r=p((E0,ll)=>{"use strict";var yb=ct(),mb=tl(),il=qr(),gb=Or(),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()};gb[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:mb.f(n,r)}});var dl=p((w0,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 ml=p((R0,yl)=>{"use strict";var Pb=re(),Ob=Nt();yl.exports=!Pb(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",Ob(1,7)),e.stack!==7):!0})});var _l=p((x0,vl)=>{"use strict";var Ab=Ft(),Tb=dl(),Cb=ml(),gl=Error.captureStackTrace;vl.exports=function(e,t,r,n){Cb&&(gl?gl(e,t):Ab(e,"stack",Tb(r,n)))}});var El=p((P0,Sl)=>{"use strict";var Ib=ne(),kb=Ib("toStringTag"),bl={};bl[kb]="z";Sl.exports=String(bl)==="[object z]"});var Rl=p((O0,wl)=>{"use strict";var qb=El(),Nb=Z(),Fr=_r(),Db=ne(),Lb=Db("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),Lb))=="string"?r:jb?Fr(t):(n=Fr(t))==="Object"&&Nb(t.callee)?"Arguments":n}});var Pl=p((A0,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 Al=p((T0,Ol)=>{"use strict";var Bb=Pl();Ol.exports=function(e,t){return e===void 0?arguments.length<2?"":t:Bb(e)}});var Il=p(()=>{"use strict";var Ub=Dr(),Gb=W(),Vb=Er(),Tl=Lr(),Br=Qc(),Kb=Gi(),Cl=$r(),Hr=Ft(),Yi=Nt(),Wb=_l(),zb=Al(),Yb=ne(),Xb=re(),Qb=Mt(),lt=Gb.SuppressedError,Zb=Yb("toStringTag"),Ur=Error,Jb=!!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((k0,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((q0,ql)=>{"use strict";var nS=Oe();ql.exports=function(e,t,r){for(var n in t)nS(e,n,t[n],r);return e}});var Zi=p((N0,Dl)=>{"use strict";var Nl=Fi(),iS=Pe();Dl.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((D0,Ll)=>{"use strict";var sS=_r(),oS=J();Ll.exports=function(e){if(sS(e)==="Function")return oS(e)}});var Fl=p((L0,$l)=>{"use strict";var jl=Ml(),aS=Ze(),uS=gr(),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((M0,Vl)=>{"use strict";var lS=qe(),fS=Qe(),pS=J(),hS=Fl(),dS=ct(),yS=Ze(),Ul=br(),Ji=Lt(),Gl=ne(),mS=Gl("asyncDispose"),Hl=Gl("dispose"),gS=pS([].push),vS=function(e,t){if(t==="async-dispose"){var r=Ji(e,mS);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);gS(e.stack,i)}});var Jl=p(()=>{"use strict";var _S=Dr(),Kr=fe(),Yl=qe(),Kl=Ze(),bS=Xi(),Xl=Oe(),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",OS=Zl.set,Wr=Zl.getterFor(zr),rs="async-dispose",Gt="disposed",AS="pending",Vr=function(e){var t=Wr(e);if(t.state===Gt)throw new RS(zr+" already disposed");return t},ns=function(){OS(bS(this,ft),{type:zr,state:AS,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((F0,uf)=>{"use strict";var sf=W(),of=jt(),af=Z(),CS=$r(),Yr=Lr(),IS=Oe(),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(),DS=Oe(),LS=qe(),MS=Lt(),jS=oe(),$S=ne(),lf=cf(),ff=$S("asyncDispose"),pf=LS("Promise");jS(lf,ff)||DS(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=Dr(),Qr=fe(),HS=qe(),df=Ze(),BS=Xi(),yf=Oe(),US=Qi(),GS=Zi(),mf=ne(),gf=Cr(),ss=es(),VS=HS("SuppressedError"),KS=ReferenceError,WS=mf("dispose"),zS=mf("toStringTag"),Jr="DisposableStack",YS=gf.set,Zr=gf.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((V0,Sf)=>{"use strict";var QS=re(),ZS=Z(),JS=xe(),eE=$r(),_f=Lr(),tE=Oe(),rE=ne(),nE=Mt(),ls=rE("iterator"),bf=!1,Ae,us,cs;[].keys&&(cs=[].keys(),"next"in cs?(us=_f(_f(cs)),us!==Object.prototype&&(Ae=us)):bf=!0);var iE=!JS(Ae)||QS(function(){var e={};return Ae[ls].call(e)!==e});iE?Ae={}:nE&&(Ae=eE(Ae));ZS(Ae[ls])||tE(Ae,ls,function(){return this});Sf.exports={IteratorPrototype:Ae,BUGGY_SAFARI_ITERATORS:bf}});var xf=p(()=>{"use strict";var sE=Qe(),oE=Oe(),aE=Lt(),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 Of=p((z0,Pf)=>{"use strict";var lE=W();Pf.exports=lE});var Tf=p(Af=>{"use strict";var fE=ne();Af.f=fE});var fs=p((X0,If)=>{"use strict";var Cf=Of(),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(),mE=fs(),gE=Pe().f,vE=$t().f,ps=yE.Symbol;mE("asyncDispose");ps&&(Kt=vE(ps,"asyncDispose"),Kt.enumerable&&Kt.configurable&&Kt.writable&&gE(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 Op=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 Ap=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 mw(e,t){return new qs(e,t)}dn.createDirentFromStats=mw});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 gw=require("os"),vw=require("path"),Tp=gw.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:Ds;function Ns(e){return e.replace(Sw,"\\\\$2")}G.escapeWindowsPath=Ns;function Ds(e){return e.replace(bw,"\\\\$2")}G.escapePosixPath=Ds;G.convertPathToPattern=Tp?Cp:Ip;function Cp(e){return Ns(e).replace(Ew,"//$1").replace(ww,"/")}G.convertWindowsPathToPattern=Cp;function Ip(e){return Ds(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,Lp)=>{var Ow=Np(),Dp={"{":"}","(":")","[":"]"},Aw=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=Dp[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=Dp[r];if(n){var i=e.indexOf(n,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1};Lp.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(Ow(t))return!0;var n=Aw;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",Ls="/",qw=/\\\\/g,Nw=/[\\{\\[].*[\\}\\]]$/,Dw=/(^|[^\\\\])([\\{\\[]|\\([^\\)]+$)/,Lw=/\\\\([\\!\\*\\?\\|\\[\\]\\(\\)\\{\\}])/g;jp.exports=function(t,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&kw&&t.indexOf(Ls)<0&&(t=t.replace(qw,Ls)),Nw.test(t)&&(t+=Ls),t+="a";do t=Iw(t);while(Cw(t)||Dw.test(t));return t.replace(Lw,"$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 mn=p((gk,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},gn=(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 gn(e,t,1,{transform:r});if(Jp(r))return gn(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):gn(e,t,1,r)};sh.exports=gn});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=mn(),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,gh)=>{"use strict";var rR=mn(),{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:mh,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===mh){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===mh&&(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};gh.exports=dR});var Sh=p((xk,bh)=>{"use strict";var _h=mn(),yR=uh(),mR=fh(),gR=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={})=>gR(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=mR(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}]`,OR=`${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:OR,START_ANCHOR:Rh},AR={...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?AR: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:DR}=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(DR,"\\\\$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((Ak,qh)=>{"use strict";var Oh=rr(),{CHAR_ASTERISK:Gs,CHAR_AT:LR,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:Ah,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,O=!1,k=!1,_=!1,P=0,E,R,A={value:"",depth:0,isGlob:!1},L=()=>c>=n,y=()=>u.charCodeAt(c+1),j=()=>(E=R,u.charCodeAt(++c));for(;c<n;){R=j();let X;if(R===nr){C=A.backslashes=!0,R=j(),R===Ws&&(T=!0);continue}if(T===!0||R===Ws){for(P++;L()!==!0&&(R=j());){if(R===nr){C=A.backslashes=!0,j();continue}if(R===Ws){P++;continue}if(T!==!0&&R===Vs&&(R=j())===Vs){if(h=A.isBrace=!0,d=A.isGlob=!0,_=!0,i===!0)continue;break}if(T!==!0&&R===MR){if(h=A.isBrace=!0,d=A.isGlob=!0,_=!0,i===!0)continue;break}if(R===FR&&(P--,P===0)){T=!1,h=A.isBrace=!0,_=!0;break}}if(i===!0)continue;break}if(R===kh){if(s.push(c),o.push(A),A={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===LR||R===Gs||R===Ah||R===Ks)===!0&&y()===zs){if(d=A.isGlob=!0,v=A.isExtglob=!0,_=!0,R===Ks&&c===l&&(k=!0),i===!0){for(;L()!==!0&&(R=j());){if(R===nr){C=A.backslashes=!0,R=j();continue}if(R===Th){d=A.isGlob=!0,_=!0;break}}continue}break}if(R===Gs){if(E===Gs&&(b=A.isGlobstar=!0),d=A.isGlob=!0,_=!0,i===!0)continue;break}if(R===Ah){if(d=A.isGlob=!0,_=!0,i===!0)continue;break}if(R===jR){for(;L()!==!0&&(X=j());){if(X===nr){C=A.backslashes=!0,j();continue}if(X===HR){w=A.isBracket=!0,d=A.isGlob=!0,_=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&R===Ks&&c===l){O=A.negated=!0,l++;continue}if(r.noparen!==!0&&R===zs){if(d=A.isGlob=!0,i===!0){for(;L()!==!0&&(R=j());){if(R===zs){C=A.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="",m="";l>0&&(ke=u.slice(0,l),u=u.slice(l),f-=l),$&&d===!0&&f>0?($=u.slice(0,f),m=u.slice(f)):d===!0?($="",m=u):$=u,$&&$!==""&&$!=="/"&&$!==u&&Ch($.charCodeAt($.length-1))&&($=$.slice(0,-1)),r.unescape===!0&&(m&&(m=Oh.removeBackslashes(m)),$&&C===!0&&($=Oh.removeBackslashes($)));let g={prefix:ke,input:e,start:l,base:$,glob:m,isBrace:h,isBracket:w,isGlob:d,isExtglob:v,isGlobstar:b,negated:O,negatedExtglob:k};if(r.tokens===!0&&(g.maxDepth=0,Ch(R)||o.push(A),g.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let M=0;M<s.length;M++){let ge=X?X+1:l,ve=s[M],te=e.slice(ge,ve);r.tokens&&(M===0&&l!==0?(o[M].isPrefix=!0,o[M].value=ke):o[M].value=te,Ih(o[M]),g.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]),g.maxDepth+=o[o.length-1].depth)}g.slashes=s,g.parts=a}return g};qh.exports=BR});var Mh=p((Tk,Lh)=>{"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:Dh}=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=Dh[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:O,QMARK_NO_DOT:k,STAR:_,START_ANCHOR:P}=c,E=x=>`(${a}(?:(?!${P}${x.dot?v:f}).)*?)`,R=r.dot?"":b,A=r.dot?O:k,L=r.bash===!0?E(r):_;r.capture&&(L=`(${L})`),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=[],m=s,g,X=()=>y.index===i-1,M=y.peek=(x=1)=>e[y.index+x],ge=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)},Im=()=>{let x=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)ge(),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()},D=x=>{if(m.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,-m.output.length),m.type="star",m.value="*",m.output=L,y.output+=m.output)}if(j.length&&x.type!=="paren"&&(j[j.length-1].inner+=x.value),(x.value||x.output)&&pr(x),m&&m.type==="text"&&x.type==="text"){m.value+=x.value,m.output=(m.output||"")+x.value;return}x.prev=m,o.push(x),m=x},dr=(x,F)=>{let S={...l[F],conditions:1,inner:""};S.prev=m,S.parens=y.parens,S.output=y.output;let N=(r.capture?"(":"")+S.open;hr("parens"),D({type:x,value:F,output:y.output?"":d}),D({type:"paren",extglob:!0,value:ge(),output:N}),j.push(S)},km=x=>{let F=x.close+(r.capture?")":""),S;if(x.type==="negate"){let N=L;if(x.inner&&x.inner.length>1&&x.inner.includes("/")&&(N=E(r)),(N!==L||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)}D({type:"paren",extglob:!0,value:g,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?O.repeat(V.length):""):si===0?A+(V?O.repeat(V.length):""):O.repeat(B.length):Q==="."?f.repeat(B.length):Q==="*"?N?N+Q+(V?L:""):L: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(g=ge(),g==="\\0")continue;if(g==="\\\\"){let S=M();if(S==="/"&&r.bash!==!0||S==="."||S===";")continue;if(!S){g+="\\\\",D({type:"text",value:g});continue}let N=/^\\\\+/.exec(ve()),B=0;if(N&&N[0].length>2&&(B=N[0].length,y.index+=B,B%2!==0&&(g+="\\\\")),r.unescape===!0?g=ge():g+=ge(),y.brackets===0){D({type:"text",value:g});continue}}if(y.brackets>0&&(g!=="]"||m.value==="["||m.value==="[^")){if(r.posix!==!1&&g===":"){let S=m.value.slice(1);if(S.includes("[")&&(m.posix=!0,S.includes(":"))){let N=m.value.lastIndexOf("["),B=m.value.slice(0,N),Q=m.value.slice(N+2),V=UR[Q];if(V){m.value=B+V,y.backtrack=!0,ge(),!s.output&&o.indexOf(m)===1&&(s.output=d);continue}}}(g==="["&&M()!==":"||g==="-"&&M()==="]")&&(g=`\\\\${g}`),g==="]"&&(m.value==="["||m.value==="[^")&&(g=`\\\\${g}`),r.posix===!0&&g==="!"&&m.value==="["&&(g="^"),m.value+=g,pr({value:g});continue}if(y.quotes===1&&g!==\'"\'){g=se.escapeRegex(g),m.value+=g,pr({value:g});continue}if(g===\'"\'){y.quotes=y.quotes===1?0:1,r.keepQuotes===!0&&D({type:"text",value:g});continue}if(g==="("){hr("parens"),D({type:"paren",value:g});continue}if(g===")"){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){km(j.pop());continue}D({type:"paren",value:g,output:y.parens?")":"\\\\)"}),ze("parens");continue}if(g==="["){if(r.nobracket===!0||!ve().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Et("closing","]"));g=`\\\\${g}`}else hr("brackets");D({type:"bracket",value:g});continue}if(g==="]"){if(r.nobracket===!0||m&&m.type==="bracket"&&m.value.length===1){D({type:"text",value:g,output:`\\\\${g}`});continue}if(y.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Et("opening","["));D({type:"text",value:g,output:`\\\\${g}`});continue}ze("brackets");let S=m.value.slice(1);if(m.posix!==!0&&S[0]==="^"&&!S.includes("/")&&(g=`/${g}`),m.value+=g,pr({value:g}),r.literalBrackets===!1||se.hasRegexChars(S))continue;let N=se.escapeRegex(m.value);if(y.output=y.output.slice(0,-m.value.length),r.literalBrackets===!0){y.output+=N,m.value=N;continue}m.value=`(${a}${N}|${m.value})`,y.output+=m.value;continue}if(g==="{"&&r.nobrace!==!0){hr("braces");let S={type:"brace",value:g,output:"(",outputIndex:y.output.length,tokensIndex:y.tokens.length};$.push(S),D(S);continue}if(g==="}"){let S=$[$.length-1];if(r.nobrace===!0||!S){D({type:"text",value:g,output:g});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="\\\\{",g=N="\\\\}",y.output=B;for(let V of Q)y.output+=V.output||V.value}D({type:"brace",value:g,output:N}),ze("braces"),$.pop();continue}if(g==="|"){j.length>0&&j[j.length-1].conditions++,D({type:"text",value:g});continue}if(g===","){let S=g,N=$[$.length-1];N&&ke[ke.length-1]==="braces"&&(N.comma=!0,S="|"),D({type:"comma",value:g,output:S});continue}if(g==="/"){if(m.type==="dot"&&y.index===y.start+1){y.start=y.index+1,y.consumed="",y.output="",o.pop(),m=s;continue}D({type:"slash",value:g,output:w});continue}if(g==="."){if(y.braces>0&&m.type==="dot"){m.value==="."&&(m.output=f);let S=$[$.length-1];m.type="dots",m.output+=g,m.value+=g,S.dots=!0;continue}if(y.braces+y.parens===0&&m.type!=="bos"&&m.type!=="slash"){D({type:"text",value:g,output:f});continue}D({type:"dot",value:g,output:f});continue}if(g==="?"){if(!(m&&m.value==="(")&&r.noextglob!==!0&&M()==="("&&M(2)!=="?"){dr("qmark",g);continue}if(m&&m.type==="paren"){let N=M(),B=g;if(N==="<"&&!se.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(m.value==="("&&!/[!=<:]/.test(N)||N==="<"&&!/<([!=]|\\w+>)/.test(ve()))&&(B=`\\\\${g}`),D({type:"text",value:g,output:B});continue}if(r.dot!==!0&&(m.type==="slash"||m.type==="bos")){D({type:"qmark",value:g,output:k});continue}D({type:"qmark",value:g,output:O});continue}if(g==="!"){if(r.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){dr("negate",g);continue}if(r.nonegate!==!0&&y.index===0){Im();continue}}if(g==="+"){if(r.noextglob!==!0&&M()==="("&&M(2)!=="?"){dr("plus",g);continue}if(m&&m.value==="("||r.regex===!1){D({type:"plus",value:g,output:h});continue}if(m&&(m.type==="bracket"||m.type==="paren"||m.type==="brace")||y.parens>0){D({type:"plus",value:g});continue}D({type:"plus",value:h});continue}if(g==="@"){if(r.noextglob!==!0&&M()==="("&&M(2)!=="?"){D({type:"at",extglob:!0,value:g,output:""});continue}D({type:"text",value:g});continue}if(g!=="*"){(g==="$"||g==="^")&&(g=`\\\\${g}`);let S=GR.exec(ve());S&&(g+=S[0],y.index+=S[0].length),D({type:"text",value:g});continue}if(m&&(m.type==="globstar"||m.star===!0)){m.type="star",m.star=!0,m.value+=g,m.output=L,y.backtrack=!0,y.globstar=!0,te(g);continue}let x=ve();if(r.noextglob!==!0&&/^\\([^?]/.test(x)){dr("star",g);continue}if(m.type==="star"){if(r.noglobstar===!0){te(g);continue}let S=m.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]!=="/")){D({type:"star",value:g,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){D({type:"star",value:g,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()){m.type="globstar",m.value+=g,m.output=E(r),y.output=m.output,y.globstar=!0,te(g);continue}if(S.type==="slash"&&S.prev.type!=="bos"&&!Q&&X()){y.output=y.output.slice(0,-(S.output+m.output).length),S.output=`(?:${S.output}`,m.type="globstar",m.output=E(r)+(r.strictSlashes?")":"|$)"),m.value+=g,y.globstar=!0,y.output+=S.output+m.output,te(g);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+m.output).length),S.output=`(?:${S.output}`,m.type="globstar",m.output=`${E(r)}${w}|${w}${yr})`,m.value+=g,y.output+=S.output+m.output,y.globstar=!0,te(g+ge()),D({type:"slash",value:"/",output:""});continue}if(S.type==="bos"&&x[0]==="/"){m.type="globstar",m.value+=g,m.output=`(?:^|${w}|${E(r)}${w})`,y.output=m.output,y.globstar=!0,te(g+ge()),D({type:"slash",value:"/",output:""});continue}y.output=y.output.slice(0,-m.output.length),m.type="globstar",m.output=E(r),m.value+=g,y.output+=m.output,y.globstar=!0,te(g);continue}let F={type:"star",value:g,output:L};if(r.bash===!0){F.output=".*?",(m.type==="bos"||m.type==="slash")&&(F.output=R+F.output),D(F);continue}if(m&&(m.type==="bracket"||m.type==="paren")&&r.regex===!0){F.output=g,D(F);continue}(y.index===y.start||m.type==="slash"||m.type==="dot")&&(m.type==="dot"?(y.output+=T,m.output+=T):r.dot===!0?(y.output+=C,m.output+=C):(y.output+=R,m.output+=R),M()!=="*"&&(y.output+=d,m.output+=d)),D(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&&(m.type==="star"||m.type==="bracket")&&D({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=Dh[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:""},O=r.bash===!0?".*?":w;r.capture&&(O=`(${O})`);let k=R=>R.noglobstar===!0?O:`(${T}(?:(?!${d}${R.dot?c:o}).)*?)`,_=R=>{switch(R){case"*":return`${v}${u}${O}`;case".*":return`${o}${u}${O}`;case"*.*":return`${v}${O}${o}${u}${O}`;case"*/*":return`${v}${O}${a}${u}${b}${O}`;case"**":return v+k(r);case"**/*":return`(?:${v}${k(r)}${a})?${b}${u}${O}`;case"**/*.*":return`(?:${v}${k(r)}${a})?${b}${O}${o}${u}${O}`;case"**/.*":return`(?:${v}${k(r)}${a})?${o}${u}${O}`;default:{let A=/^(.*?)\\.(\\w+)$/.exec(R);if(!A)return;let L=_(A[1]);return L?L+o+A[2]:void 0}}},P=se.removePrefix(e,C),E=_(P);return E&&r.strictSlashes!==!0&&(E+=`${a}?`),E};Lh.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 mx(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=mx;function td(e,t){return Js.makeRe(e,t)}I.makeRe=td;function gx(e,t){return e.map(r=>td(r,t))}I.convertPatternsToRe=gx;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 Ox(e){return e===""}wt.isEmpty=Ox});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 Ax=Pp();z.array=Ax;var Tx=Op();z.errno=Tx;var Cx=Ap();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 Dx(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=Dx;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 md=p(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.read=void 0;function Lx(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=Lx;function yd(e,t){e(t)}function so(e,t){e(null,t)}});var gd=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=md(),Fx=gd(),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(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var On=process.versions.node.split(".");if(On[0]===void 0||On[1]===void 0)throw new Error(`Unexpected behavior. The \'process.versions.node\' variable has invalid value: ${process.versions.node}`);var Pd=Number.parseInt(On[0],10),Vx=Number.parseInt(On[1],10),Od=10,Kx=10,Wx=Pd>Od,zx=Pd===Od&&Vx>=Kx;An.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Wx||zx});var Ad=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=Ad();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(),Dd=po(),Ld=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:Ld.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let s=t.fs.statSync(i.path);i.dirent=Dd.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=Ld.joinPathSegments(e,n,t.pathSegmentSeparator),s=rP.statSync(i,t.fsStatSettings),o={name:n,path:i,dirent:Dd.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(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});var oP=require("path"),aP=st(),uP=Fd(),mo=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}};go.default=mo});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((t1,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((r1,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:O,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 O(){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 mP(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}we.isFatalError=mP;function gP(e,t){return e===null||e(t)}we.isAppliedFilter=gP;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(),Dn=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||!Dn.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=Dn.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Dn.isAppliedFilter(this._settings.entryFilter,t)&&this._emitEntry(t),t.dirent.isDirectory()&&Dn.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(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});var xP=Po(),Oo=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(()=>{OP(t,this._storage)}),this._reader.read()}};Ao.default=Oo;function PP(e,t){e(t)}function OP(e,t){e(null,t)}});var zd=p(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});var AP=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 AP.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(),Ln=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(Ln.isFatalError(this._settings,t))throw t}_handleEntry(t,r){let n=t.path;r!==void 0&&(t.path=Ln.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)),Ln.isAppliedFilter(this._settings.entryFilter,t)&&this._pushToStorage(t),t.dirent.isDirectory()&&Ln.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(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});var qP=require("path"),NP=qn(),Do=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}};Lo.default=Do});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(),DP=zd(),LP=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 LP.default(e,r).read()}Re.walkSync=jP;function $P(e,t){let r=Mn(t);return new DP.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(),eO=iy(),tO=sy(),rO=ay(),na=class{constructor(t){this._settings=t,this.errorFilter=new tO.default(this._settings),this.entryFilter=new eO.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new JP.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new rO.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 nO=ey(),iO=Hn(),sa=class extends iO.default{constructor(){super(...arguments),this._reader=new nO.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 sO=require("stream"),oO=Bo(),aO=Hn(),aa=class extends aO.default{constructor(){super(...arguments),this._reader=new oO.default(this._settings)}read(t){let r=this._getRootDirectory(t),n=this._getReaderOptions(t),i=this.api(r,t,n),s=new sO.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 uO=st(),cO=jn(),lO=$n(),ca=class extends lO.default{constructor(){super(...arguments),this._walkSync=cO.walkSync,this._statSync=uO.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 fO=ly(),pO=Hn(),fa=class extends pO.default{constructor(){super(...arguments),this._reader=new fO.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"),hO=require("os"),dO=Math.max(hO.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,dO),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((O1,dy)=>{"use strict";var hy=dd(),yO=uy(),mO=cy(),gO=fy(),da=py(),le=Ie();async function ya(e,t){me(e);let r=ma(e,yO.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){me(c);let f=ma(c,gO.default,l);return le.array.flatten(f)}e.sync=t;function r(c,l){me(c);let f=ma(c,mO.default,l);return le.stream.merge(f)}e.stream=r;function n(c,l){me(c);let f=[].concat(c),h=new da.default(l);return hy.generate(f,h)}e.generateTasks=n;function i(c,l){me(c);let f=new da.default(l);return le.pattern.isDynamicPattern(c,f)}e.isDynamicPattern=i;function s(c){return me(c),le.path.escape(c)}e.escapePath=s;function o(c){return me(c),le.path.convertPathToPattern(c)}e.convertPathToPattern=o;let a;(function(c){function l(h){return me(h),le.path.escapePosixPath(h)}c.escapePath=l;function f(h){return me(h),le.path.convertPosixPathToPattern(h)}c.convertPathToPattern=f})(a=e.posix||(e.posix={}));let u;(function(c){function l(h){return me(h),le.path.escapeWindowsPath(h)}c.escapePath=l;function f(h){return me(h),le.path.convertWindowsPathToPattern(h)}c.convertPathToPattern=f})(u=e.win32||(e.win32={}))})(ya||(ya={}));function ma(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 me(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 gy=p((A1,my)=>{function vO(e){return import(e)}my.exports={importModule:vO}});var va=p((T1,Gn)=>{var vy,_y,by,Sy,Ey,wy,Ry,xy,Py,Oy,Ay,Ty,Cy,Bn,ga,Iy,ky,qy,Ot,Ny,Dy,Ly,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 O={};for(var k in u)O[k]=k==="access"?{}:u[k];for(var k in u.access)O.access[k]=u.access[k];O.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],O);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})},Oy=function(s,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,o)},Ay=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.")},ga=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(ga(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))},Ot=function(s){return this instanceof Ot?(this.v=s,this):new Ot(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(O){return Promise.resolve(O).then(C,b)}}function h(C,O){u[C]&&(c[C]=function(k){return new Promise(function(_,P){l.push([C,k,_,P])>1||w(C,k)})},O&&(c[C]=O(c[C])))}function w(C,O){try{d(u[C](O))}catch(k){T(l[0][3],k)}}function d(C){C.value instanceof Ot?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,O){C(O),l.shift(),l.length&&w(l[0][0],l[0][1])}},Dy=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:Ot(s[c](f)),done:!1}:l?l(f):f}:l}},Ly=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",Oy),e("__awaiter",Ay),e("__generator",Ty),e("__exportStar",Cy),e("__createBinding",Un),e("__values",Bn),e("__read",ga),e("__spread",Iy),e("__spreadArrays",ky),e("__spreadArray",qy),e("__await",Ot),e("__asyncGenerator",Ny),e("__asyncDelegator",Dy),e("__asyncValues",Ly),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(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.lowerCase=At.localeLowerCase=void 0;var _O={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 bO(e,t){var r=_O[t.toLowerCase()];return _a(r?e.replace(r.regexp,function(n){return r.map[n]}):e)}At.localeLowerCase=bO;function _a(e){return e.toLowerCase()}At.lowerCase=_a});var zy=p(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.noCase=void 0;var SO=Ky(),EO=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],wO=/[^A-Z0-9]+/gi;function RO(e,t){t===void 0&&(t={});for(var r=t.splitRegexp,n=r===void 0?EO:r,i=t.stripRegexp,s=i===void 0?wO:i,o=t.transform,a=o===void 0?SO.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=RO;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 xO=va(),PO=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 OO(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}Ke.pascalCaseTransformMerge=OO;function AO(e,t){return t===void 0&&(t={}),PO.noCase(e,xO.__assign({delimiter:"",transform:Yy},t))}Ke.pascalCase=AO});var Zy=p(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.camelCase=We.camelCaseTransformMerge=We.camelCaseTransform=void 0;var TO=va(),ba=Xy();function Qy(e,t){return t===0?e.toLowerCase():ba.pascalCaseTransform(e,t)}We.camelCaseTransform=Qy;function CO(e,t){return t===0?e.toLowerCase():ba.pascalCaseTransformMerge(e)}We.camelCaseTransformMerge=CO;function IO(e,t){return t===void 0&&(t={}),ba.pascalCase(e,TO.__assign({transform:Qy},t))}We.camelCase=IO});var tA={};jm(tA,{init:()=>JO});module.exports=$m(tA);var nT=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=O=>{if(o<r.length&&r[o].type===O)return r[o++].value},l=()=>c("OTHER_MODIFIER")??c("ASTERISK"),f=O=>{let k=c(O);if(k!==void 0)return k;let{type:_,index:P}=r[o];throw new TypeError(`Unexpected ${_} at ${P}, expected ${O}`)},h=()=>{let O="",k;for(;k=c("CHAR")??c("ESCAPED_CHAR");)O+=k;return O},w=O=>O,d=t.encodePart||w,v="",b=O=>{v+=O},T=()=>{v.length&&(i.push(new Xt(3,"","",d(v),"",3)),v="")},C=(O,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(O);return}if(T(),!k&&!_){if(!O)return;i.push(new Xt(3,"","",d(O),"",R));return}let A;_?_==="*"?A=ys:A=_:A=n;let L=2;A===n?(L=1,A=""):A===ys&&(L=0,A="");let y;if(k?y=k:_&&(y=s++),u.has(y))throw new TypeError(`Duplicate name \'${y}\'.`);u.add(y),i.push(new Xt(L,y,d(O),A,d(P),R))};for(;o<r.length;){let O=c("CHAR"),k=c("NAME"),_=c("REGEX");if(!k&&!_&&(_=c("ASTERISK")),k||_){let E=O??"";t.prefixes.indexOf(E)===-1&&(b(E),E=""),T();let R=l();C(E,k,_,"",R);continue}let P=O??c("ESCAPED_CHAR");if(P){b(P);continue}if(c("OPEN")){let E=h(),R=c("NAME"),A=c("REGEX");!R&&!A&&(A=c("ASTERISK"));let L=h();f("CLOSE");let y=l();C(E,R,A,L,y);continue}T(),f("END")}return i}function ae(e){return e.replace(/([.+*?^${}()[\\]|/\\\\])/g,"\\\\$1")}function Df(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,Df(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,Df(r))}var De={delimiter:"",prefixes:"",sensitive:!0,strict:!0},OE={delimiter:".",prefixes:"",sensitive:!0,strict:!0},AE={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 DE(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.username=e,r.username}function LE(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:ms(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 ms(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.#g()?this.#h(3):(this.#v()||this.#p()||this.#f())&&this.#h(5);break;case 3:this.#w()?this.#s(4,1):this.#g()&&this.#s(5,1);break;case 4:this.#g()&&this.#s(5,1);break;case 5:this.#O()?this.#d+=1:this.#A()&&(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}#m(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.#m(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,"/")}#g(){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.#m(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"}#O(){return this.#u(this.#e,"[")}#A(){return this.#u(this.#e,"]")}#l(){let e=this.#r[this.#e],t=this.#m(this.#a).index;return this.#t.substring(t,e.index)}#T(){let e={};Object.assign(e,De),e.encodePart=ms;let t=PE(this.#l(),void 0,e);this.#y=Uf(t)}},ds=["protocol","username","password","hostname","port","pathname","search","hash"],Ne="*";function Lf(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=DE(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=LE(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,De),a.encodePart=ms;break;case"username":Object.assign(a,De),a.encodePart=$E;break;case"password":Object.assign(a,De),a.encodePart=FE;break;case"hostname":Object.assign(a,OE),Hf(u)?a.encodePart=Kf:a.encodePart=Vf;break;case"port":Object.assign(a,De),a.encodePart=Wf;break;case"pathname":Uf(this.#r.protocol)?(Object.assign(a,AE,i),a.encodePart=HE):(Object.assign(a,De,i),a.encodePart=BE);break;case"search":Object.assign(a,De,i),a.encodePart=UE;break;case"hash":Object.assign(a,De,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,Lf(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,Lf(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 Cm=require("electron");var Yf="4.1.4";var gs=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 mt(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,Le=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 Os=e=>e.replace(/\\./g,"\\\\."),sn=e=>e.map(String).map(Os).join("."),gt=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(Le,"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 As(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var hp=on(As,(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 mp=(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 gp(e){if(mt(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(mt(e,"prototype"))throw new Error("prototype is not allowed as a property");if(mt(e,"constructor"))throw new Error("constructor is not allowed as a property")}var vp=(e,t)=>{gp(t);for(let r=0;r<t.length;r++){let n=t[r];if(Me(e))e=vt(e,+n);else if(Le(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(gp(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(Le(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(Le(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,...gt(o)]));return}let[n,i]=e;i&&tt(i,(s,o)=>{Cs(s,t,[...r,...gt(o)])}),t(n,r)}function _p(e,t,r){return Cs(t,(n,i)=>{e=an(e,i,s=>mp(s,n,r))}),e}function bp(e,t){function r(n,i){let s=vp(e,gt(i));n.map(gt).forEach(o=>{e=an(e,o,()=>s)})}if(de(t)){let[n,i]=t;n.forEach(s=>{e=an(e,gt(s),()=>e)}),i&&tt(i,r)}else tt(t,r);return e}var nw=(e,t)=>rt(e)||de(e)||Le(e)||Me(e)||As(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(mt(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[Os(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),sm=at(yy(),1),Wn=at(require("path"),1),om=at(gy(),1),am=at(Zy(),1),um=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 kO(e,t){return e===K.SINGLETON&&t!==K.SINGLETON||e===K.SCOPED&&t===K.TRANSIENT}function cm(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(em(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 O=e.charAt(r+1);return C==="*"&&O==="/"},!0),r++);break}default:if(LO(b))return l(),n;r++}}}function l(){let b=e.charAt(r),T=++r;for(;MO(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(em(C)){r++;continue}if(qO(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 em(e){switch(e){case"\\r":case`\n`:case" ":return!0}return!1}function qO(e){switch(e){case"\'":case\'"\':case"`":return!0}return!1}var NO=/^[_$a-zA-Z\\xA0-\\uFFFF]$/,DO=/^[?._$a-zA-Z0-9\\xA0-\\uFFFF]$/;function LO(e){return NO.test(e)}function MO(e){return DO.test(e)}function jO(e){let t=[];return e.forEach(r=>{r.forEach(n=>{t.push(n)})}),t}function $O(e,t){let r=e;return typeof r=="string"||typeof r=="symbol"?{[e]:t}:r}function FO(e){return e[e.length-1]}function lm(e){if(typeof e!="function")return!1;let t=cm(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 HO(e){return Array.from(new Set(e))}var BO=/(.*)\\..*/i;function tm(e,t){t={cwd:process.cwd(),glob:sm.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:BO.exec(Wn.basename(s))[1],path:Wn.resolve(t.cwd,s),opts:r}))}function UO(e,t){return Array.isArray(e)?jO(e.map(r=>tm(r,t))):tm(e,t)}function GO(e){let{next:t,done:r}=cm(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=fm(r,t,e[zn]);let i={resolve:hm(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=fm(r,t,e[zn]);let i=hm(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 pm(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 pm(e,{disposer:t})}function sr(e,t){return function(){return e.call(this,t)}}function fm(e,...t){return Object.assign({},e,...t)}function pm(e,t){return{...e,...t}}function VO(e,t){return function(n,i){return n in t?t[n]:e.resolve(n,i)}}function KO(e,t){let r=t(e),n=HO([...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 hm(e,t){t||(t=e);let r=dm(t);return function(i){if((this.injectionMode||i.options.injectionMode||cr.PROXY)!==cr.CLASSIC){let o=this.injector?KO(i,this.injector):i.cradle;return e(o)}if(r.length>0){let o=this.injector?VO(i,this.injector(i)):i.resolve,a=r.map(u=>o(u.name,{allowUnregistered:u.optional}));return e(...a)}return e()}}function dm(e){let t=GO(e.toString());if(!t){let r=Object.getPrototypeOf(e);return typeof r=="function"&&r!==Function.prototype?dm(r):[]}return t}var WO={camelCase:e=>(0,am.camelCase)(e)};function rm(e,t,r){r??={};let n=e.container;r=YO(r);let i=e.listModules(t,r);if(r.esModules)return zO(e,n,i,r);{let s=i.map(o=>{let a=e.require(o.path);return ym(a,o)});return mm(s,n,i,r)}}async function zO(e,t,r,n){let i=[];for(let a of r){let u=(0,um.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(ym(s[a],r[a]));return mm(o,t,r,n)}function ym(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 mm(e,t,r,n){return e.reduce((i,s)=>i.concat(s),[]).filter(i=>i).forEach(XO.bind(null,t,n)),{loadedModules:r}}function YO(e){return{resolverOptions:{lifetime:K.TRANSIENT,...e&&e.resolverOptions},...e}}function XO(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=WO[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:lm(r.value)?Xn:Yn;e.register(i,a(r.value,o))}var nm=Symbol("familyTree"),im=Symbol("rollUpRegistrations"),QO="AwilixContainerCradle";function Ra(e={}){return gm(e)}function gm(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:O,createScope:h,register:w,build:C,resolve:b,hasRegistration:T,dispose:k,getRegistration:v,[Kn.inspect.custom]:c,[im]:l,get registrations(){return l()}},a=t?[o].concat(t[nm]):[o];o[nm]=a;let u=FO(a);return o;function c(){return`[AwilixContainer (${t?"scoped, ":""}registrations: ${Object.keys(o.registrations).length})]`}function l(){return{...t&&t[im](),...i}}function*f(){let _=l();for(let P in _)yield P}function h(){return gm(e,o,n)}function w(_,P){let E=$O(_,P),R=[...Object.keys(E),...Object.getOwnPropertySymbols(E)];for(let A of R){let L=E[A];if(e.strict&&L.lifetime===K.SINGLETON&&t)throw new Ea(A,"Cannot register a singleton on a scoped container.");i[A]=L}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 QO;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})=>kO(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 A,L;switch(R){case K.TRANSIENT:L=E.resolve(o);break;case K.SINGLETON:A=u.cache.get(_),A?L=A.value:(L=E.resolve(e.strict?u:o),u.cache.set(_,{resolver:E,value:L}));break;case K.SCOPED:if(A=o.cache.get(_),A!==void 0){L=A.value;break}L=E.resolve(o),o.cache.set(_,{resolver:E,value:L});break;default:throw new Tt(_,n,`Unknown lifetime "${E.lifetime}"`)}return n.pop(),L}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",_),(lm(_)?Xn(_,P):Yn(_,P)).resolve(o)}function O(_,P){let E={require:e.require||function(R){return require(R)},listModules:UO,container:o};return P?.esModules?(E.require=om.importModule,rm(E,_,P).then(()=>o)):(rm(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,A=E;return A.dispose?Promise.resolve().then(()=>A.dispose(R)):Promise.resolve()})).then(()=>{})}}var Am=require("electron");function Qn(e,{lifetime:t=K.SINGLETON,...r}={}){return Xn(e,{...r,lifetime:t}).disposer(_m)}function vm(e,{lifetime:t=K.SINGLETON,...r}={}){return Yn(e,{...r,lifetime:t}).disposer(_m)}function _m(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"),bm=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,bm.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 Sm(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 Em=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wm=e=>{throw TypeError(e)},Rm=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&wm("Object expected");var n,i;r&&(n=t[Em("asyncDispose")]),n===void 0&&(n=t[Em("dispose")],r&&(i=n)),typeof n!="function"&&wm("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},xm=(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()},ZO={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,ZO.stringify(t))}get#n(){return this.#t.id}addMessageHandler(t){var r=[];try{let s=Rm(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{xm(r,n,i)}}async invoke(t,{signal:r}={}){var n=[];try{let o=Rm(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))}),Sm(r,{taskId:t.taskId,stack:o})])}catch(o){var i=o,s=!0}finally{xm(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 Pm=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Om=e=>{throw TypeError(e)},Oa=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Om("Object expected");var n,i;r&&(n=t[Pm("asyncDispose")]),n===void 0&&(n=t[Pm("dispose")],r&&(i=n)),typeof n!="function"&&Om("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},Aa=(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=Oa(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{Aa(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;Oa(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{Aa(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=Oa(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{Aa(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 Tm(){let e=Ra();e.register({vaults:Qn(ii),ipcEventRegistry:vm(()=>new pn(Am.ipcMain)),loginPref:Qn(Jn),login:Qn(ei)});let{vaults:t,login:r,loginPref:n}=e.cradle;return await n.load(),e}var JO=async e=>{await eA(e),console.log("connector server ready");for(let t of Cm.webContents.getAllWebContents())t.send(Xf,{version:bs})};async function eA(e){console.log("!!!","production",e);let t=globalThis;t[gs]??=new Map;let r=t[gs];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 Tm()})().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 dye=require("obsidian");async function pj(){if(!dye.Platform.isDesktopApp)throw new Error("node env required for main process hack module");let t=sa().app.getPath("temp"),{createHash:e}=zT(),r=e("md5").update(fj).digest("hex"),{join:n}=vs(),{writeFile:i,unlink:s}=ia(),a=n(t,`mx-hack-${r}.js`);return await i(a,fj),{require:()=>sa().require(a),md5:r,async[Symbol.asyncDispose](){await s(a).catch(console.error)}}}var gS=class{app;#e=null;get connected(){return this.#e}instance;#t;constructor(e){var s=[];try{this.app=e.app;this.#e=!1;if(!fye.Platform.isDesktopApp)throw new Error("BrowserConnect is only available on desktop");let r=J(s,new DisposableStack);let{ipcRenderer:n}=iQ();let{createHash:i}=zT();r.defer(()=>{this.#e=null});this.instance=r.use(dj(n));console.log("waiting for connector ready");n.once(eye,async(c,u)=>{if(console.log("connector ready",u),u.version!==nye)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(tye,{name:this.app.vault.getName()})&&(this.#e=!0,console.log("connected to main process"))});r.defer(()=>{n.send(rye)});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 pj(),!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 hj=require("obsidian");function jL(t){if(!Bt(t))throw new Error(`not a file uri: ${t.href}`);if(!hj.Platform.isDesktopApp)throw new Error(`not a desktop app: ${t.href}`);let e=new URL(hj.Platform.resourcePathPrefix+t.href.substring(8));return e.search=Date.now().toString(),e}var $L=class{app;constructor(e){this.app=e.app}inferMediaType(e){if(e){if(e.type==="file")return xD(e.file)?"audio":h0(e.file)?"video":void 0;if(e.type==="url:direct"){let r=Co(e.url.pathname,{urlEncoded:!0});return xD(r)?"audio":h0(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)?jL(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 yd(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`${Co(t.path,{urlEncoded:!0}).name} - Baidu Pan`;Be(t)}var pye=require("obsidian");var UL=require("obsidian");function*pv(t){for(let e of t.children)e instanceof UL.TFolder?yield*pv(e):e instanceof UL.TFile&&(yield e)}async function mj(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 zL=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 qL({trackInfoParser:e.trackInfoParser,app:e.plugin.app}));this.noteFrom=r.use(new HL);this.#e=r.move();let n=J(i,new DisposableStack);this.#r=n.use(new bu);mj(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 qL({trackInfoParser:this.trackInfoParser,app:this.plugin.app}));this.noteFrom=e.use(new HL);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(Ql(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=Ql(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=nh();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 pye.TFile&&this.noteTo.rename(r,e)}))}*iterateMediaNote(){for(let e of pv(this.app.vault.getRoot())){if(e.extension!=="md")continue;let r=this.metadataParser.getMediaMeta(e);r&&(yield{meta:r,file:e})}}},qL=class{trackInfoParser;app;constructor(e){this.trackInfoParser=e.trackInfoParser,this.app=e.app}#e=new Map;#t=nh();#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=>[_9(l),l])??[]),i=new Map(r.textTracks.map(l=>[_9(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&&(Ql(s.src)!==Ql(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=Aa(e);return[...this.#e.entries()].map(([i,{tracks:s}])=>s.map(o=>this.#n(o,{sourcePath:i})).filter(o=>o!==null).some(o=>Aa(o)===r)?this.app.vault.getFileByPath(i):null).filter(i=>i!==null)}[Symbol.dispose](){this.#e.clear()}},HL=class{media=new Map;uid=new Map;addNote(e,r){this.media.set(Ql(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(Ql(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 nve=Z(Cj(),1),Do="mx-uid";function ive(){return(0,nve.createId)()}var EYe="cover",YL=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=ive(),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=>({[Do]:i,[o]:`[[${r.fileToLinktext(c,u)}]]`,...a?.serialized})})}else e.type==="url:direct"||e.type==="url:hosted"?l=await this.#t({noteName:s,fm:()=>({[Do]: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 Ej(t){return{[Tj]:t}}var Tj=Symbol("mx_hash"),XL=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:nS(r)},hash:n};let i=Cme.parse(r);return i?AYe(i,n):{info:{type:"url:direct",url:nS(r)},hash:n}}parseFile(e){return!e||!Yl(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[Tj]?r[Tj]:"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:Wd(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:Wd(t.vid)},hash:e};if(t.host==="baidu-pan")return{info:{type:"url:hosted",vid:t.vid,url:Wd(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:Wd(t.vid)},hash:e});if(t.host==="coursera")return{info:{type:"url:hosted",vid:t.vid,url:Wd(t.vid)},hash:e};Be(t)}var VMt=new TextEncoder;var Ij={Base32:new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Base32Hex:new TextEncoder().encode("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Base32Crockford:new TextEncoder().encode("0123456789ABCDEFGHJKMNPQRSTVWXYZ")},Aj={Base32:new Uint8Array(128).fill(32),Base32Hex:new Uint8Array(128).fill(32),Base32Crockford:new Uint8Array(128).fill(32)};Ij.Base32.forEach((t,e)=>Aj.Base32[t]=e);Ij.Base32Hex.forEach((t,e)=>Aj.Base32Hex[t]=e);Ij.Base32Crockford.forEach((t,e)=>Aj.Base32Crockford[t]=e);function kS(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 ZMt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split("");var sve={Base64:new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Base64Url:new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_")},ave={Base64:new Uint8Array(128).fill(64),Base64Url:new Uint8Array(128).fill(64)};sve.Base64.forEach((t,e)=>ave.Base64[t]=e);sve.Base64Url.forEach((t,e)=>ave.Base64Url[t]=e);function Pj(t){return((t+2)/3|0)*4}function Rj(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,ove=new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),OYe=new Uint8Array(128).fill(64);ove.forEach((t,e)=>OYe[t]=e);function lve(t){typeof t=="string"?t=new TextEncoder().encode(t):t instanceof ArrayBuffer?t=new Uint8Array(t).slice():t=t.slice();let[e,r]=kS(t,Pj(t.length));return Rj(e,r,0,ove,_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"),cve=new Uint8Array(128).fill(16);FYe.forEach((t,e)=>cve[t]=e);new TextEncoder().encode("ABCDEF").forEach((t,e)=>cve[t]=e+10);var BYe=new TextEncoder().encode("0123456789abcdef"),uve=new Uint8Array(128).fill(16);BYe.forEach((t,e)=>uve[t]=e);new TextEncoder().encode("ABCDEF").forEach((t,e)=>uve[t]=e+10);var dve=new ArrayBuffer(8),h_t=new Uint32Array(dve),m_t=new BigUint64Array(dve);function F(t){if(!t)throw new Error("Assertion failed.")}var QL=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)},gv=t=>{let e=ye(t);return(e&1)===0?-(e>>1):e+1>>1};var SS=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,Lj=new TextEncoder;var Mj=t=>Object.fromEntries(Object.entries(t).map(([e,r])=>[r,e])),_j={bt709:1,bt470bg:5,smpte170m:6,bt2020:9,smpte432:12},ZL=Mj(_j),Oj={bt709:1,smpte170m:6,linear:8,"iec61966-2-1":13,pg:16,hlg:18},JL=Mj(Oj),Dj={rgb:0,bt709:1,bt470bg:5,smpte170m:6,"bt2020-ncl":9},e3=Mj(Dj);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}},Nj=t=>[...t].map(e=>e.toString(16).padStart(2,"0")).join(""),Fj=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},ft=(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},Jc=(t,e,r)=>{let n=ft(t,r(e),r);t.splice(n+1,0,e)},Lh=()=>{let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}};var Bj=(t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r]))return t[r]},t3=(t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1};var rf=t=>{throw new Error(`Unexpected value: ${t}`)},CS=(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 Vj=(t,e,r)=>Math.max(e,Math.min(r,t)),Sn="und",Mh=(t,e)=>{let r=10**e;return Math.round(t*r)/r},pve=(t,e)=>Math.round(t/e)*e,hve=t=>{let e=0;for(;t;)e++,t>>=1;return e},VYe=/^[a-z]{3}$/,r3=t=>VYe.test(t),jj=1e6*(1+Number.EPSILON),$j=(t,e)=>{let r={...t,...e};if(t.headers||e.headers){let n=t.headers?fve(t.headers):{},i=e.headers?fve(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},fve=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},Uj=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 _h=(t,e)=>t!==-1?t:e,n3=(t,e,r,n)=>t<=n&&r<=e;var mve=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 nf=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.")}},i3=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 ES=["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"],P_t=[...jYe,...ES];var Oh=[{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 gve=".01.01.01.01.00",yve=".0.110.01.01.01.0";var s3=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.${Nj(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.${Nj(r.subarray(1,4))}`}else if(e==="hevc"){let l,c,u,d,f,p;if(s)l=s.generalProfileSpace,c=s.generalProfileIdc,u=Fj(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=Fj(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(Oh).level;for(let x of Oh)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(gve)&&(v=v.slice(0,-gve.length)),v}else if(e==="av1"){if(!o){let x=t.width*t.height,w=Li(Oh).level;for(let C of Oh)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?_j[n.primaries]:1,m=n?.transfer?Oj[n.transfer]:1,v=n?.matrix?Dj[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(yve)&&(y=y.slice(0,-yve.length)),y}}throw new TypeError(`Unhandled codec '${e}'.`)};var a3=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.${qj(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&&ES.includes(e))return e}throw new TypeError(`Unhandled codec '${e}'.`)},TS=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],zj=[-1,1,2,3,4,5,6,8],qj=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<TS.length&&(i=TS[n]);let s=e.readBits(4),a=null;return s>=1&&s<=7&&(a=zj[s]),{objectType:r,frequencyIndex:n,sampleRate:i,channelConfiguration:s,numberOfChannels:a}},Dh=48e3,$Ye=/^pcm-([usf])(\d+)+(be)?$/,vve=t=>{if(F(ES.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 yv;(function(t){t[t.IDR=5]="IDR",t[t.SPS=7]="SPS",t[t.PPS=8]="PPS",t[t.SPS_EXT=13]="SPS_EXT"})(yv||(yv={}));var ja;(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"})(ja||(ja={}));var l3=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},xve=(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=CS(i,n,!1):e===4?s=i.getUint32(n,!1):(rf(e),F(!1)),n+=e;let a=t.subarray(n,n+s);r.push(a),n+=s}return r},Hj=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=(SS(e.description)[4]&3)+1;return xve(t,i)}else return l3(t)},o3=t=>t[0]&31,wve=t=>{try{let e=l3(t),r=e.filter(f=>o3(f)===yv.SPS),n=e.filter(f=>o3(f)===yv.PPS),i=e.filter(f=>o3(f)===yv.SPS_EXT);if(r.length===0||n.length===0)return null;let s=r[0],a=new Ht(Hj(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=(SS(e.description)[21]&3)+1;return xve(t,i)}else return l3(t)},Nh=t=>t[0]>>1&63,kve=t=>{try{let e=l3(t),r=e.filter(P=>Nh(P)===ja.VPS_NUT),n=e.filter(P=>Nh(P)===ja.SPS_NUT),i=e.filter(P=>Nh(P)===ja.PPS_NUT),s=e.filter(P=>Nh(P)===ja.PREFIX_SEI_NUT||Nh(P)===ja.SUFFIX_SEI_NUT);if(n.length===0||i.length===0)return null;let a=n[0],o=new Ht(Hj(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(Hj(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),gv(R),R.skipBits(1),R.skipBits(1),R.readBits(1)&&ye(R),gv(R),gv(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:ja.VPS_NUT,nalUnits:r}]:[],...n.length?[{arrayCompleteness:1,nalUnitType:ja.SPS_NUT,nalUnits:n}]:[],...i.length?[{arrayCompleteness:1,nalUnitType:ja.PPS_NUT,nalUnits:i}]:[],...s.length?[{arrayCompleteness:1,nalUnitType:Nh(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&&gv(t);for(let s=0;s<i;s++)gv(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&&bve(t,u,s),i&&bve(t,u,s)}},bve=(t,e,r)=>{for(let n=0;n<e;n++)ye(t),ye(t),r&&(ye(t),ye(t)),t.readBits(1)};var c3=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(Oh).level;for(let O of Oh)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}},Sve=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)}},u3=t=>{for(let{type:e,data:r}of Sve(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},Cve=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],Tve=t=>{let e=t[0]>>3;return{durationInSamples:QYe[e]}},Eve=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}},Ive=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=>o3(s)===yv.IDR)?"key":"delta"}case"hevc":{let r=await t.getDecoderConfig();return F(r),qYe(e.data,r).some(s=>{let a=Nh(s);return ja.BLA_W_LP<=a&&a<=ja.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 Sve(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:rf(t.codec),F(!1)}},sf;(function(t){t[t.STREAMINFO=0]="STREAMINFO",t[t.VORBIS_COMMENT=4]="VORBIS_COMMENT",t[t.PICTURE=6]="PICTURE"})(sf||(sf={}));var IS=(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=mve(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 Ave=[],Pve=[];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(jj*this.timestamp)}get microsecondDuration(){return Math.trunc(jj*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 vv=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.")},Rve=t=>{if(typeof t!="number"||Number.isNaN(t))throw new TypeError("timestamp must be a number.")},Gj=(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,d3=class{constructor(e){if(!(e instanceof bv))throw new TypeError("track must be an InputTrack.");this._track=e}getFirstPacket(e={}){if(vv(e),this._track.input._disposed)throw new zn;return Gj(this._track,this._track._backing.getFirstPacket(e),e)}getPacket(e,r={}){if(Rve(e),vv(r),this._track.input._disposed)throw new zn;return Gj(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(vv(r),this._track.input._disposed)throw new zn;return Gj(this._track,this._track._backing.getNextPacket(e,r),r)}async getKeyPacket(e,r={}){if(Rve(e),vv(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(vv(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(vv(n),this._track.input._disposed)throw new zn;let i=[],{promise:s,resolve:a}=Lh(),{promise:o,resolve:l}=Lh(),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}=Lh()),await o;continue}i.push(m),a(),{promise:s,resolve:a}=Lh(),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 bv=class{constructor(e,r){this.input=e,this._backing=r}isVideoTrack(){return this instanceof af}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 d3(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}}},af=class extends bv{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),Ave.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:Ive(this,e)}},Tn=class extends bv{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),Pve.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 Lve=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 eu=8,Fh=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}},of=t=>tu(t)/65536,f3=t=>tu(t)/1073741824,p3=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},No=t=>{let e=on(t);return t.skip(2),kn.decode(xe(t,e))},Mve=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 nf(n,"image/jpeg");case 14:return new nf(n,"image/png");case 27:return new nf(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"]),h3=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 Lve({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,eu,Fh);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-Fh){let s=this.reader.requestSliceRange(i,eu,Fh);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&&ES.includes(e.info.codec)&&r.sampleCompositionTimeOffsets.length===0){F(e.info?.type==="audio");let s=vve(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=ft(r.sampleTimingEntries,p,T=>T.startIndex),v=r.sampleTimingEntries[m],b=ft(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,eu,Fh);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=ft(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-eu;){if(d?.nextFragment)d=d.nextFragment,u=d.moofOffset+d.moofSize;else{let m=this.reader.requestSliceRange(u,eu,Fh);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),Ove(l,m.endTimestamp)}l.startTimestampIsFinal=!0}return a}readContiguousBoxes(e){let r=e.filePos;for(;e.filePos-r<=e.length-eu&&this.traverseBox(e););}*iterateContiguousBoxes(e){let r=e.filePos;for(;e.filePos-r<=e.length-eu;){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 af(this.input,new Wj(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 Kj(o)),this.tracks.push(a)}}this.currentTrack=null}break;case"tkhd":{let a=this.currentTrack;if(!a)break;let o=ge(e);if(!((lf(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=[of(e),of(e),f3(e),of(e),of(e),f3(e),of(e),of(e),f3(e)],d=QL(pve(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?Nve(e):tu(e),h=of(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;r3(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=g3(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=Dh),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:ZL[l],transfer:JL[c],matrix:e3[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),p3(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=p3(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=p3(e);if(a.info.codecDescription=xe(e,b),a.info.codec==="aac"){let y=qj(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=AS(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=lf(e);if((h&o)===sf.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=tu(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,lf,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)),Jc(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){Jc(this.currentTrack.fragments,this.currentFragment,c=>c.moofOffset),a.firstKeyFrameTimestamp!==null&&Jc(this.currentTrack.fragmentsWithKeyFrame,this.currentFragment,c=>c.moofOffset);let{currentFragmentState:l}=this.currentTrack;F(l),l.startTimestamp!==null&&(Ove(a,l.startTimestamp),a.startTimestampIsFinal=!0)}this.currentTrack.currentFragmentState=null,this.currentTrack=null}break;case"tfhd":{F(this.currentFragment),e.skip(1);let a=lf(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=lf(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+=tu(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=tu(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]??=No(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??=No(l);break;case"\xA9des":this.currentTrack||(this.metadataTags.description??=No(l));break;case"\xA9ART":this.currentTrack||(this.metadataTags.artist??=No(l));break;case"\xA9alb":this.currentTrack||(this.metadataTags.album??=No(l));break;case"albr":this.currentTrack||(this.metadataTags.albumArtist??=No(l));break;case"\xA9gen":this.currentTrack||(this.metadataTags.genre??=No(l));break;case"\xA9day":if(!this.currentTrack){let c=new Date(No(l));Number.isNaN(c.getTime())||(this.metadataTags.date??=c)}break;case"\xA9cmt":this.currentTrack||(this.metadataTags.comment??=No(l));break;case"\xA9lyr":this.currentTrack||(this.metadataTags.lyrics??=No(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=Mve(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 nf?(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}},m3=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 Mh(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=_ve(i,n),a=await this.fetchPacketForSampleIndex(s,r);return!Dve(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=_ve(i,n),a=s===-1?-1:eXe(i,s),o=await this.fetchPacketForSampleIndex(a,r);return!Dve(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=ft(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=ft(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=ft(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=t3(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?ft(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,eu,Fh);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()}}},Wj=class extends m3{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&&c3(e.data)}else if(this.internalTrack.info.codec==="av1"&&!this.internalTrack.info.av1CodecInfo){let e=await this.getFirstPacket({});this.internalTrack.info.av1CodecInfo=e&&u3(e.data)}return{codec:s3(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}},Kj=class extends m3{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:a3(this.internalTrack.info),numberOfChannels:this.internalTrack.info.numberOfChannels,sampleRate:this.internalTrack.info.sampleRate,description:this.internalTrack.info.codecDescription??void 0}:null}},_ve=(t,e)=>{if(t.presentationTimestamps){let r=ft(t.presentationTimestamps,e,n=>n.presentationTimestamp);return r===-1?-1:t.presentationTimestamps[r].sampleIndex}else{let r=ft(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=ft(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=ft(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=ft(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=ft(t.keySampleIndices,e,n=>n);return t.keySampleIndices[r]??-1},tXe=(t,e)=>{if(!t.keySampleIndices)return e+1;let r=ft(t.keySampleIndices,e,n=>n);return t.keySampleIndices[r+1]??-1},Ove=(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},Dve=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],xv=[Q.SeekHead,Q.Info,Q.Cluster,Q.Tracks,Q.Cues,Q.Attachments,Q.Chapters,Q.Tags],y3=[...nXe,...xv];var Yj=8,us=2,Fo=2*Yj,Xj=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},wv=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},pt=(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},Fve=(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},Bve=(t,e)=>{let r=pt(t,e);return r&1<<e*8-1&&(r-=2**(e*8)),r},v3=t=>{let e=Xj(t);return e===null?null:pt(t,e)},Qj=t=>{let e=ge(t);return e===255?e=null:(t.skip(-1),e=wv(t),e===72057594037927940&&(e=null)),e},Bo=t=>{let e=v3(t);if(e===null)return null;let r=Qj(t);return{id:e,size:r}},cf=(t,e)=>{let r=xe(t,e),n=0;for(;n<e&&r[n]!==0;)n+=1;return String.fromCharCode(...r.subarray(0,n))},kv=(t,e)=>{let r=xe(t,e),n=0;for(;n<e&&r[n]!==0;)n+=1;return kn.decode(r.subarray(0,n))},b3=(t,e)=>{if(e===0)return 0;if(e!==4&&e!==8)throw new Error("Bad float size "+e);return e===4?Vve(t):g3(t)},x3=async(t,e,r,n)=>{let i=new Set(r),s=e;for(;n===null||s<n;){let a=t.requestSliceRange(s,us,Fo);if(a instanceof Promise&&(a=await a),!a)break;let o=Bo(a);if(!o)break;if(i.has(o.id))return{pos:s,found:!0};ru(o.size),s=a.filePos+o.size}return{pos:n!==null&&n>s?n:s,found:!1}},Zj=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<Yj)break;for(let l=0;l<o.length-Yj;l++){o.filePos=a;let c=v3(o);if(c!==null&&s.has(c))return a;a++}}return null},Vo={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 ru(t){if(t===null)throw new Error("Undefined element size is used in a place where it is not supported.")}var jve=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 nu;(function(t){t[t.None=0]="None",t[t.Xiph=1]="Xiph",t[t.FixedSize=2]="FixedSize",t[t.Ebml=3]="Ebml"})(nu||(nu={}));var w3;(function(t){t[t.Block=1]="Block",t[t.Private=2]="Private",t[t.Next=4]="Next"})(w3||(w3={}));var PS;(function(t){t[t.Zlib=0]="Zlib",t[t.Bzlib=1]="Bzlib",t[t.lzo1x=2]="lzo1x",t[t.HeaderStripping=3]="HeaderStripping"})(PS||(PS={}));var Jj=[{id:Q.SeekHead,flag:"seekHeadSeen"},{id:Q.Info,flag:"infoSeen"},{id:Q.Tracks,flag:"tracksSeen"},{id:Q.Cues,flag:"cuesSeen"}],$ve=10*2**20,k3=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 jve({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,Fo);if(r instanceof Promise&&(r=await r),!r)break;let n=Bo(r);if(!n)break;let i=n.id,s=n.size,a=r.filePos;if(i===Q.EBML){ru(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 x3(this.reader,a,y3,this.reader.fileSize)).pos-a);let o=Li(this.segments);o&&(o.elementEndPos=a+s)}ru(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,Fo);if(l instanceof Promise&&(l=await l),!l)break;let c=n,u=Bo(l);if(!u||!xv.includes(u.id)&&u.id!==Q.Void){let m=await Zj(this.reader,c,xv,Math.min(this.currentSegment.elementEndPos??1/0,c+$ve));if(m){n=m;continue}else break}let{id:d,size:f}=u,p=l.filePos,h=Jj.findIndex(m=>m.id===d);if(h!==-1){let m=Jj[h].flag;this.currentSegment[m]=!0,ru(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,ru(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=Jj.find(m=>m.id===l.id);if(!c||this.currentSegment[c.flag])continue;let u=this.reader.requestSliceRange(e+l.segmentPosition,us,Fo);if(u instanceof Promise&&(u=await u),!u)continue;let d=Bo(u);if(!d)continue;let{id:f,size:p}=d;if(f!==c.id)continue;ru(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,Fo);n instanceof Promise&&(n=await n),F(n);let i=e,s=Bo(n);F(s);let a=s.id,o=s.size,l=n.filePos;o===null&&(o=(await x3(this.reader,l,y3,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!==nu.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===nu.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,Jc(f.clusters,u,y=>y.elementStartPos),d.firstKeyFrameTimestamp!==null&&Jc(f.clustersWithKeyFrame,u,y=>y.elementStartPos)}return Jc(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===nu.None)continue;i.decoded||(i.data=this.decodeBlockData(r,i.data),i.decoded=!0);let s=Sv.tempFromBytes(i.data),a=[],o=ge(s)+1;switch(i.lacing){case nu.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 nu.FixedSize:{let l=s.length-1,c=Math.floor(l/o);for(let u=0;u<o;u++)a.push(c)}break;case nu.Ebml:{let l=wv(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=wv(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:nu.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,Fo);if(n instanceof Promise&&(n=await n),!n)continue;let i=Bo(n);if(!i||i.id!==r.id)continue;let{size:s}=i;ru(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=Bo(e);if(!r)return!1;let{id:n,size:i}=r,s=e.filePos;switch(ru(i),n){case Q.DocType:this.isWebM=cf(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=pt(e,i)}break;case Q.SeekPosition:{let a=this.currentSegment?.seekEntries[this.currentSegment.seekEntries.length-1];if(!a)break;a.segmentPosition=pt(e,i)}break;case Q.TimestampScale:{if(!this.currentSegment)break;this.currentSegment.timestampScale=pt(e,i),this.currentSegment.timestampFactor=1e9/this.currentSegment.timestampScale}break;case Q.Duration:{if(!this.currentSegment)break;this.currentSegment.duration=b3(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!==w3.Block||a.data.algorithm!==PS.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===Vo.avc?(this.currentTrack.info.codec="avc",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):this.currentTrack.codecId===Vo.hevc?(this.currentTrack.info.codec="hevc",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):o===Vo.vp8?this.currentTrack.info.codec="vp8":o===Vo.vp9?this.currentTrack.info.codec="vp9":o===Vo.av1&&(this.currentTrack.info.codec="av1");let l=this.currentTrack,c=new af(this.input,new e$(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===Vo.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===Vo.mp3?this.currentTrack.info.codec="mp3":o===Vo.opus?(this.currentTrack.info.codec="opus",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate,this.currentTrack.info.sampleRate=Dh):o===Vo.vorbis?(this.currentTrack.info.codec="vorbis",this.currentTrack.info.codecDescription=this.currentTrack.codecPrivate):o===Vo.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 t$(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=pt(e,i)}break;case Q.TrackType:{if(!this.currentTrack)break;let a=pt(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;pt(e,i)||(this.currentSegment.tracks.pop(),this.currentTrack=null)}break;case Q.FlagDefault:{if(!this.currentTrack)break;this.currentTrack.isDefault=!!pt(e,i)}break;case Q.CodecID:{if(!this.currentTrack)break;this.currentTrack.codecId=cf(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*pt(e,i)/1e9}break;case Q.Name:{if(!this.currentTrack)break;this.currentTrack.name=kv(e,i)}break;case Q.Language:{if(!this.currentTrack||this.currentTrack.languageCode!==Sn)break;this.currentTrack.languageCode=cf(e,i),r3(this.currentTrack.languageCode)||(this.currentTrack.languageCode=Sn)}break;case Q.LanguageBCP47:{if(!this.currentTrack)break;let o=cf(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=pt(e,i)}break;case Q.PixelHeight:{if(this.currentTrack?.info?.type!=="video")break;this.currentTrack.info.height=pt(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=pt(e,i),o=e3[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=pt(e,i)===2}break;case Q.TransferCharacteristics:{if(this.currentTrack?.info?.type!=="video"||!this.currentTrack.info.colorSpace)break;let a=pt(e,i),o=JL[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=pt(e,i),o=ZL[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=-b3(e,i);try{this.currentTrack.info.rotation=QL(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=b3(e,i)}break;case Q.Channels:{if(this.currentTrack?.info?.type!=="audio")break;this.currentTrack.info.numberOfChannels=pt(e,i)}break;case Q.BitDepth:{if(this.currentTrack?.info?.type!=="audio")break;this.currentTrack.info.bitDepth=pt(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=pt(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=pt(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+pt(e,i)}break;case Q.Timestamp:{if(!this.currentCluster)break;this.currentCluster.timestamp=pt(e,i)}break;case Q.SimpleBlock:{if(!this.currentCluster)break;let a=wv(e);if(a===null)break;let o=this.getTrackDataInCluster(this.currentCluster,a);if(!o)break;let l=AS(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=wv(e);if(a===null)break;let o=this.getTrackDataInCluster(this.currentCluster,a);if(!o)break;let l=AS(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=pt(e,i)}break;case Q.ReferenceBlock:{if(!this.currentBlock)break;this.currentBlock.isKeyFrame=!1;let a=Bve(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:pt(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=kv(e,i);break;case Q.TagString:{if(!this.currentSimpleTagName)break;let a=kv(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 i3(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=Fve(e,i)}break;case Q.FileName:{if(!this.currentAttachedFile)break;this.currentAttachedFile.fileName=kv(e,i)}break;case Q.FileMediaType:{if(!this.currentAttachedFile)break;this.currentAttachedFile.fileMediaType=cf(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=kv(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:w3.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=pt(e,i)}break;case Q.ContentEncodingScope:{if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.scope=pt(e,i)}break;case Q.ContentCompression:{if(!this.currentDecodingInstruction)break;this.currentDecodingInstruction.data={type:"decompress",algorithm:PS.Zlib,settings:null},this.readContiguousElements(e.slice(s,i))}break;case Q.ContentCompAlgo:{if(this.currentDecodingInstruction?.data?.type!=="decompress")break;this.currentDecodingInstruction.data.algorithm=pt(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 PS.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}}},S3=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 Mh(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=ft(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=ft(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=ft(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=t3(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=ft(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,Fo);if(x instanceof Promise&&(x=await x),!x)break;let w=v,C=Bo(x);if(!C||!xv.includes(C.id)&&C.id!==Q.Void){let E=await Zj(s.reader,w,xv,Math.min(a.elementEndPos??1/0,w+$ve));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 x3(s.reader,T,y3,a.elementEndPos)).pos-T;let E=T+S;if(a.elementEndPos!==null&&E>a.elementEndPos-us)break;{let P=s.reader.requestSliceRange(E,us,Fo);if(P instanceof Promise&&(P=await P),!P)break;if(v3(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()}}},e$=class extends S3{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:s3({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?wve(e.data):null,hevcCodecInfo:this.internalTrack.info.codec==="hevc"&&e?kve(e.data):null,vp9CodecInfo:this.internalTrack.info.codec==="vp9"&&e?c3(e.data):null,av1CodecInfo:this.internalTrack.info.codec==="av1"&&e?u3(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}},t$=class extends S3{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:a3({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],Uve=1483304551,zve=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,qve=(t,e)=>t===3?e===3?21:36:e===3?13:21,Hve=(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 C3=t=>{let e=2130706432,r=0;for(;e!==0;)r>>=1,r|=t&e,e>>=8;return r};var Tv;(function(t){t[t.Unsynchronisation=128]="Unsynchronisation",t[t.ExtendedHeader=64]="ExtendedHeader",t[t.ExperimentalIndicator=32]="ExperimentalIndicator",t[t.Footer=16]="Footer"})(Tv||(Tv={}));var Ev;(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"})(Ev||(Ev={}));var RS=128,Av=10,Iv=["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"],Gve=(t,e)=>{let r=t.filePos;e.raw??={},e.raw.TAG??=xe(t,RS-3),t.filePos=r;let n=Cv(t,30);n&&(e.title??=n);let i=Cv(t,30);i&&(e.artist??=i);let s=Cv(t,30);s&&(e.album??=s);let a=Cv(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=Cv(t,28),t.skip(2)}else t.skip(-30),c=Cv(t,30);c&&(e.comment??=c);let u=ge(t);u<Iv.length&&(e.genre??=Iv[u])},Cv=(t,e)=>{let r=xe(t,e),n=_h(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()},Bh=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=C3(a);return{majorVersion:n,revision:i,flags:s,size:o}},T3=(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 r$(e,n);if(e.flags&Tv.Footer&&i.removeFooter(),e.flags&Tv.Unsynchronisation&&e.majorVersion===3&&i.ununsynchronizeAll(),e.flags&Tv.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&Tv.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(Iv[p]!==void 0){r.genre??=Iv[p];break}}if(f=/^\d+$/.exec(d),f){let p=Number.parseInt(f[0]);if(Iv[p]!==void 0){r.genre??=Iv[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}},r$=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-Av),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?C3(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:C3(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 Ev.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 Ev.UTF_16_WITH_BOM:if(i[0]===255&&i[1]===254){let s=new TextDecoder("utf-16le"),a=_h(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=_h(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=_h(i.findIndex(a=>a===0),i.length);return this.pos=n+Math.min(s+1,i.length),kn.decode(i.subarray(0,s))}case Ev.UTF_16_BE_NO_BOM:{let s=new TextDecoder("utf-16be"),a=_h(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 Ev.UTF_8:{let s=_h(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 LS=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=Hve(s,t.fileSize!==null?t.fileSize-n:null);if(a.header)return{header:a.header,startPos:n};n+=a.bytesAdvanced}return null};var E3=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 n$(this))]})()}async advanceReader(){if(this.lastLoadedPos===0)for(;;){let o=this.reader.requestSlice(this.lastLoadedPos,Av);if(o instanceof Promise&&(o=await o),!o){this.lastSampleLoaded=!0;return}let l=Bh(o);if(!l)break;this.lastLoadedPos=o.filePos+l.size}let e=await LS(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=qve(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===Uve||o===zve)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,Av);if(i instanceof Promise&&(i=await i),!i)break;let s=Bh(i);if(!s)break;n=!0;let a=this.reader.requestSlice(i.filePos,s.size);if(a instanceof Promise&&(a=await a),!a)break;T3(a,s,this.metadataTags),r=i.filePos+s.size}if(!n&&this.reader.fileSize!==null&&this.reader.fileSize>=RS){let i=this.reader.requestSlice(this.reader.fileSize-RS,RS);i instanceof Promise&&(i=await i),F(i),br(i,3)==="TAG"&&Gve(i,this.metadataTags)}return this.metadataTags}finally{e()}}},n$=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=ft(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 i$=1399285583,lXe=79764919,Kve=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;Kve[t]=e>>>0&4294967295}var Yve=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^Kve[n>>>24^s])>>>0}return e.setUint32(22,r,!0),n},Xve=(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<<hve(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=Tve(t).durationInSamples);return{durationInSamples:n,vorbisBlockSize:i}},Qve=t=>{let e="audio/ogg";if(t.codecStrings){let r=[...new Set(t.codecStrings)];e+=`; codecs="${r.join(", ")}"`}return e};var uf=27,jh=282,Zve=jh+255*255,Pv=t=>{let e=t.filePos;if(Vh(t)!==i$)return null;t.skip(1);let n=ge(t),i=ebe(t),s=Vh(t),a=Vh(t),o=Vh(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}},Jve=(t,e)=>{for(;t.filePos<e-3;){let r=Vh(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===i$)return!0;t.skip(1)}}return!1};var I3=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,uf,jh);if(r instanceof Promise&&(r=await r),!r)break;let n=Pv(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 s$(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:Eve(s.data).modeBlockflags},IS(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=Cve(e.data);r.numberOfChannels=s.outputChannelCount,r.sampleRate=Dh,r.codecInfo.opusInfo={preSkip:s.preSkip},IS(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,uf,jh);if(h instanceof Promise&&(h=await h),!h)return null;let m=Pv(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,uf,jh);if(i instanceof Promise&&(i=await i),!i)return null;let s=Pv(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 Qve({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}},s$=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"?Dh: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}=Xve(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=Mh(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+Zve,a-uf),O=this.demuxer.reader.requestSlice(w,C-w);if(O instanceof Promise&&(O=await O),F(O),!Jve(O,C)){a=x+uf;continue e}let T=this.demuxer.reader.requestSliceRange(O.filePos,uf,jh);T instanceof Promise&&(T=await T),F(T);let E=Pv(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=Yve(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,uf,jh);x instanceof Promise&&(x=await x),F(x);let w=Pv(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=rbe(u,c,d);F(w);let C=tbe(u,w.page,w.segmentIndex);C&&(c=C.page,d=C.segmentIndex)}else for(;;){let w=rbe(u,c,d);if(!w)break;let C=tbe(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=Mh(e*this.internalSampleRate,14);e=i/this.internalSampleRate;let s=ft(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)}},tbe=(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=Bj(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}},rbe=(t,e,r)=>{if(r>0)return{page:e,segmentIndex:r-1};let n=Bj(t,i=>i.headerStartPos<e.headerStartPos);return n?{page:n,segmentIndex:n.lacingValues.length-1}:null};var iu;(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"})(iu||(iu={}));var A3=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=su(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=su(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=o$(f,n);c=o$(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 a$(this)))})()}async parseFmtChunk(e,r,n){let i=this.reader.requestSlice(e,r);if(i instanceof Promise&&(i=await i),!i)return;let s=Lv(i,n),a=Lv(i,n),o=su(i,n);i.skip(4);let l=Lv(i,n),c;if(r===14?c=8:c=Lv(i,n),r>=18&&s!==357){let u=Lv(i,n),d=r-18;if(Math.min(d,u)>=22&&s===iu.EXTENSIBLE){i.skip(6);let p=xe(i,16);s=p[0]|p[1]<<8}}(s===iu.MULAW||s===iu.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=su(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=Bh(n);if(i){let s=n.slice(e+10,i.size);T3(s,i,this.metadataTags)}}getCodec(){if(F(this.audioInfo),this.audioInfo.format===iu.MULAW)return"ulaw";if(this.audioInfo.format===iu.ALAW)return"alaw";if(this.audioInfo.format===iu.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===iu.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}},Rv=2048,a$=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*Rv*this.demuxer.audioInfo.blockSizeInBytes;if(n>=this.demuxer.dataSize)return null;let i=Math.min(Rv*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*Rv/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/Rv,(this.demuxer.dataSize-1)/(Rv*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/Rv);return this.getPacketAtIndex(n+1,r)}getKeyPacket(e,r){return this.getPacket(e,r)}getNextKeyPacket(e,r){return this.getNextPacket(e,r)}};var Mv=7,_v=9,MS=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 l$=1024,P3=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 c$(this))]})()}async advanceReader(){let e=this.reader.requestSliceRange(this.lastLoadedPos,Mv,_v);if(e instanceof Promise&&(e=await e),!e){this.lastSampleLoaded=!0;return}let r=MS(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=TS[r.samplingFrequencyIndex];F(n!==void 0);let i=l$/n,s=r.crcCheck?_v:Mv,a={timestamp:this.nextTimestampInSamples/n,duration:i,dataStart:r.startPos+s,dataSize:r.frameLength-s};this.loadedSamples.push(a),this.nextTimestampInSamples+=l$,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{}}},c$=class{constructor(e){this.demuxer=e}getId(){return 1}async getFirstTimestamp(){return 0}getTimeResolution(){return this.getSampleRate()/l$}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=zj[this.demuxer.firstFrameHeader.channelConfiguration];return F(e!==void 0),e}getSampleRate(){F(this.demuxer.firstFrameHeader);let e=TS[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=ft(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 nbe=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,ibe=(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}},sbe=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)},abe=(t,e)=>{if(e==="uncommon-u16")return on(t)+1;if(e==="uncommon-u8")return ge(t)+1;if(typeof e=="number")return e;rf(e),F(!1)},obe=(t,e)=>e==="uncommon-u16"?on(t):e==="uncommon-u16-10"?on(t)*10:e==="uncommon-u8"?ge(t):typeof e=="number"?e:null,lbe=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 R3=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=lf(r),s=(n&128)!==0;switch(n&127){case sf.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 u$(this));break}case sf.VORBIS_COMMENT:{let o=this.reader.requestSlice(e,i);o instanceof Promise&&(o=await o),F(o),IS(xe(o,i),this.metadataTags);break}case sf.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=nbe(s.readBits(4));if(!o)return null;F(this.audioInfo);let l=ibe(s.readBits(4),this.audioInfo.sampleRate);if(!l||(s.readBits(4),s.readBits(3),s.readBits(1)!==0))return null;let u=sbe(e),d=abe(e,o),f=obe(e,l);if(f===null)return null;let p=e.filePos-n,h=ge(e);e.skip(-p),e.skip(-1);let m=lbe(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}}},u$=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=ft(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 $a=class{},_S=class extends $a{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 h3(e)}},L3=class extends _S{async _canReadInput(e){let r=await this._getMajorBrand(e);return!!r&&r!=="qt "}get name(){return"MP4"}get mimeType(){return"video/mp4"}},M3=class extends _S{async _canReadInput(e){return await this._getMajorBrand(e)==="qt "}get name(){return"QuickTime File Format"}get mimeType(){return"video/quicktime"}},OS=class extends $a{async isSupportedEBMLOfDocType(e,r){let n=e._reader.requestSlice(0,Fo);if(n instanceof Promise&&(n=await n),!n)return!1;let i=Xj(n);if(i===null||i<1||i>8||pt(n,i)!==Q.EBML)return!1;let a=Qj(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=Bo(o);if(!c)break;let{id:u,size:d}=c,f=o.filePos;if(d===null)return!1;switch(u){case Q.EBMLVersion:if(pt(o,d)!==1)return!1;break;case Q.EBMLReadVersion:if(pt(o,d)!==1)return!1;break;case Q.DocType:if(cf(o,d)!==r)return!1;break;case Q.DocTypeVersion:if(pt(o,d)>4)return!1;break}o.filePos=f+d}return!0}_canReadInput(e){return this.isSupportedEBMLOfDocType(e,"matroska")}_createDemuxer(e){return new k3(e)}get name(){return"Matroska"}get mimeType(){return"video/x-matroska"}},_3=class extends OS{_canReadInput(e){return this.isSupportedEBMLOfDocType(e,"webm")}get name(){return"WebM"}get mimeType(){return"video/webm"}},O3=class extends $a{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,Av);if(c instanceof Promise&&(c=await c),!c)break;let u=Bh(c);if(!u)break;i=!0,n=c.filePos+u.size}let s=await LS(e._reader,n,n+4096);if(!s)return!1;if(i)return!0;n=s.startPos+s.header.totalSize;let a=await LS(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 E3(e)}get name(){return"MP3"}get mimeType(){return"audio/mpeg"}},D3=class extends $a{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 A3(e)}get name(){return"WAVE"}get mimeType(){return"audio/wav"}},N3=class extends $a{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 I3(e)}get name(){return"Ogg"}get mimeType(){return"application/ogg"}},F3=class extends $a{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 R3(e)}},B3=class extends $a{async _canReadInput(e){let r=e._reader.requestSliceRange(0,Mv,_v);if(r instanceof Promise&&(r=await r),!r)return!1;let n=MS(r);if(!n||(r=e._reader.requestSliceRange(n.frameLength,Mv,_v),r instanceof Promise&&(r=await r),!r))return!1;let i=MS(r);return i?n.objectType===i.objectType&&n.samplingFrequencyIndex===i.samplingFrequencyIndex&&n.channelConfiguration===i.channelConfiguration:!1}_createDemuxer(e){return new P3(e)}get name(){return"ADTS"}get mimeType(){return"audio/aac"}},cbe=new L3,ube=new M3,dbe=new OS,fbe=new _3,pbe=new O3,hbe=new D3,mbe=new N3,gbe=new B3,ybe=new F3,d$=[cbe,ube,dbe,fbe,hbe,mbe,ybe,pbe,gbe];var df=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}},DS=class extends df{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=SS(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 vbe=.5*2**20,cXe=t=>Math.min(2**(t-2),16),NS=class extends df{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 V3({maxCacheSize:r.maxCacheSize??64*2**20,maxWorkerCount:2,runWorker:this._runWorker.bind(this),prefetchProfile:bbe.network})}async _retrieveSize(){let e=new AbortController,r=await Uj(this._options.fetchFn??fetch,this._url,$j(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,vbe));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 Uj(this._options.fetchFn??fetch,this._url,$j(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 FS=class extends df{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 V3({maxCacheSize:e.maxCacheSize??8*2**20,maxWorkerCount:2,prefetchProfile:bbe[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 bbe={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(n3(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+vbe),{start:t,end:e}}},V3=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=ft(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=ft(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}=Lh(),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(n3(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||n3(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=ft(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 BS=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 $a)))throw new TypeError("options.formats must be an array of InputFormat.");if(!(e.source instanceof df))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 j3(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 j3=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 Sv(s.bytes,s.view,s.offset,e,n):null):i?new Sv(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,Vj(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,Vj(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)}}},Sv=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++),Lv=(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},lf=t=>{let e=CS(t.view,t.bufferPos,!1);return t.bufferPos+=3,e},AS=t=>{let e=t.view.getInt16(t.bufferPos,!1);return t.bufferPos+=2,e},su=(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},Vh=t=>{let e=t.view.getUint32(t.bufferPos,!0);return t.bufferPos+=4,e},tu=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},o$=(t,e)=>{let r,n;return e?(r=su(t,!0),n=su(t,!0)):(n=su(t,!1),r=su(t,!1)),n*4294967296+r},Xs=t=>{let e=ie(t),r=ie(t);return e*4294967296+r},Nve=t=>{let e=tu(t),r=ie(t);return e*4294967296+r},ebe=t=>{let e=Vh(t);return uXe(t)*4294967296+e},Vve=t=>{let e=t.view.getFloat32(t.bufferPos,!1);return t.bufferPos+=4,e},g3=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 ff=require("obsidian");var VS=class extends FS{fileHandle=null;constructor(e,r={}){super({getSize:async()=>(this.fileHandle=await ia().open(e,"r"),(await this.fileHandle.stat()).size),read:async(n,i)=>{GQ(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 $3=class{app;constructor(e){this.app=e.app}loadCoverResourceUri(e){return e instanceof ff.TFile?this.app.vault.getResourcePath(e):Bt(e)?ff.Platform.isDesktopApp?jL(e).toString():null:e.toString()}canExtractMetadata(e){return e.type==="file"||e.type==="url:direct"&&!(Bt(e.url)&&!ff.Platform.isDesktopApp)}async#e(e){if(e.type==="url:hosted")return null;try{if(e.type==="file"){if(this.app.vault.adapter instanceof ff.FileSystemAdapter){let n=this.app.vault.adapter.getFullPath(e.file.path);return new VS(n)}let r=await this.app.vault.readBinary(e.file);return new DS(r)}if(e.type==="url:direct"){if(Bt(e.url)){if(!ff.Platform.isDesktopApp)return null;let r=Vi().fileURLToPath(e.url);return new VS(r)}return new NS(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 BS({formats:d$,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 jS(n):null}},jS=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,${lve(this.data)}`}get blob(){return new Blob([this.data],{type:this.type})}name;description};var f$=require("obsidian");var U3=class{app;trackInfoParser;mediaParser;constructor(e){this.app=e.app,this.trackInfoParser=e.trackInfoParser,this.mediaParser=e.mediaParser}getMediaFromMeta(e,r){let n=yA(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?.[Do];if(!n||typeof n!="string")return null;let i={sourcePath:e.path},s=yA(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,f$.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,f$.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 Tbe=require("obsidian");var z3=require("obsidian");var au=class extends z3.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 z3.ButtonComponent(o).setButtonText("Continue").onClick(()=>{Xd.open(e)})}),n)}};var xbe=require("obsidian");var pf=Z(Ge(),1),fXe=["clip","title","type","autoPlay","loop","muted","volume","audioGain","playbackRate","preservePitch","aspectRatio","flip","crossOrigin"],q3=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)?EL(r):void 0;return{...Qf(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&&IL(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=TL(e);return(0,pf.jsx)(()=>{let s=CL({resolver:dv(KA),defaultValues:r});return(0,pf.jsx)(XA,{form:s,defaultValues:r,fallbackValues:n,onSubmit:a=>{this.resolveWith(this.#n(a))},onError:()=>{new xbe.Notice("Failed to save changes, fix errors before confirm")},settingItems:fXe,description:(0,pf.jsxs)(pf.Fragment,{children:["Configure media metadata.",(0,pf.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 wbe(t){return YT(t.map(pXe).filter(e=>e!==null),e=>e.toLocaleLowerCase()).slice(0,15)}function kbe(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 Sbe(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 Cbe(t){let e=Pn(C1,t);return e.success?e.output:null}var G3=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 q3(e,r).requestInput()}supportUpdate(e){return da(e)&&Ao()||this.extractor.canExtractMetadata(e)}async updateImageCache(e,r){let n=r.cover;n instanceof jS&&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:Sbe(r.thumbnails),metadata:{title:r.title||void 0,description:kbe(r.description)||void 0,mediaDate:new Date(r.published_at),creator:r.uploader_name,duration:Cbe(r.duration),view_count:r.view_count,like_count:r.like_count,language:r.language||null,tags:wbe(r.tags)}}}async#r(e,r){let n=await this.#t(e),i=H3(n);await this.app.fileManager.processFrontMatter(r,s=>{Object.assign(s,o0(i,["tags"])),p$(s,n.type)})}async#n(e,r){return await dt(this.#r(e,r),{loading:"Fetching YouTube metadata...",success:`YouTube metadata updated successfully: ${r.path}`,error:(n,i)=>{if(i instanceof Lo){new au(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=H3(n);await this.app.fileManager.processFrontMatter(r,s=>{Object.assign(s,i),p$(s,n.type)}),await this.updateImageCache(r.path,n)}async#a(e,r){return await dt(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)?da(e)?await dt(this.#t(e.vid.vid),{loading:"Fetching YouTube metadata...",error:(r,n)=>{if(n instanceof Lo){new au(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 dt(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=o0(H3({metadata:{...r.metadata,cover:n},control:r.control}),[Do,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 Tbe.Notice("Metadata update not supported for this media.");return}let{note:r}=await this.mediaNote.ensureMediaNote(e);if(da(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=H3(i);await this.app.fileManager.processFrontMatter(r,a=>{Object.assign(a,s),p$(a,i.type)})}};function H3(t){return Hn({...b8(t.metadata),...y8(t.control)},r=>r??void 0)}function p$(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 Ebe=Z(Cj(),1);var W3=class{app;metaParser;constructor(e){this.app=e.app,this.metaParser=e.metadataParser}async migrate(){return await dt(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 pv(this.app.vault.getRoot())){let n=this.app.metadataCache.getFileCache(r);!n||n.frontmatter?.[Do]||!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=>{Do in r||(r[Do]=(0,Ebe.createId)())}),e}};var wxe=Z(yxe(),1);var KS=require("obsidian");function vxe(t){let e=new KS.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 KS.ButtonComponent(s).setButtonText("View Release Notes").setCta().onClick(()=>{window.open(`https://mx.aidenlx.site/changelog#v${t}`),e.hide()}),new KS.ButtonComponent(s).setButtonText("Dismiss").onClick(()=>{e.hide()}),e}var Nv="mx-welcome";var sM=require("obsidian");function Fv(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 bxe=Z(Ge(),1),YS=class extends sM.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 Nv}#i=null;getDisplayText(){return"Media Extended onboarding"}getIcon(){return"home"}async onOpen(){this.#i?.[Symbol.dispose](),this.#i=rv({children:(0,bxe.jsx)(zce,{docBaseUrl:"https://mx.aidenlx.site",onTryExample:e=>{let r=new sM.Menu;this.onTryExampleMenu(r),Fv(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=>h0(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 xxe(t){let{plugin:e}=t.cradle;e.registerView(Nv,r=>new YS(t,r))}var XS=class{plugin;settings;#e;constructor(e){this.plugin=e.plugin,this.settings=e.settings,this.#e=new DisposableStack,fm(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,wxe.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:Nv})}showReleaseNote(){vxe(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 aM=require("obsidian");var kxe="mx-open",oM=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 aM.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(`${kxe}/`)){r.#t(s);return}return n.call(this,s,...a)}}))}async#t(e){let r=this.#r(e,kxe);if(!r){new aM.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 M$(e),await this.workspace.openMedia(e,{newLeaf:"tab"})}},M$=class extends aM.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 _4t=new TextEncoder;var cJe="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),uJe=[];cJe.forEach((t,e)=>uJe[t.charCodeAt(0)]=e);var q4t="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split("");var X4t=new TextEncoder().encode("0123456789abcdef"),Q4t=new TextEncoder,Z4t=new TextDecoder;var Sxe=new ArrayBuffer(8),eFt=new Uint32Array(Sxe),tFt=new BigUint64Array(Sxe);async function Cxe(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 Txe(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 Vv=require("obsidian");async function Exe(t){await navigator.clipboard.write([new ClipboardItem({[t.type]:t})])}var Bv=class extends Error{constructor(e){super(`Failed to save file to ${e}: file already exists`)}},Ol=class extends Error{constructor(){super("No markdown editor is ready for insertion")}};var Ixe=Z(Ge(),1),cM=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,Ixe.jsx)(Dle,{imageBlob:this.#e,outputSpec:this.#t,onSave:(e,r)=>{this.resolveWith({action:"save",result:r})}})}};function Axe(t){let e=5381;for(let r=0;r<t.length;r++)e=(e<<5)+e^t.charCodeAt(r);return e>>>0}var uM=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,...Vv.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 Exe(n.blob)}catch(s){var a=s,o=!0}finally{var l=ee(i,a,o);l&&await l}}async saveScreenshot(e,{clip:r,sourcePath:n}){let i=await this.#e(e,{clip:r}),s=await this.#t(i,{comp:e,sourcePath:n});return{...i,file:s.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 cM(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:r.sourcePath}),u=e.rect.type==="clip"?`-${pJe(e.rect)}`:"",d=$se(e.timestamp).toLowerCase().replaceAll(".","_"),f=`mx-img-${a}-${d}${u}.${Txe(e.blob)}`;return{file:await this.#r((0,Vv.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 Vv.TFile)return await this.app.vault.modifyBinary(n,i),n;if(n!==null)throw new Bv(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 Axe(e).toString(36)}var hf=/^(?<lang>[a-z]{2})(?:-([A-Za-z]+))*$/;function Rxe(t){return hf.test(t)}function dM(t){if(!t)return null;let e=t.trim().match(hf);if(!e)return null;let[,r,...n]=e;return{lang:r,extlang:n}}var Pxe={"zh-Hans":["CN","SG","MY"],"zh-Hant":["TW","HK","MO"]};function _$(t){return t.toLowerCase()==="hans"||Pxe["zh-Hans"]?.includes(t.toUpperCase())?"zh-Hans":t.toLowerCase()==="hant"||Pxe["zh-Hant"]?.includes(t.toUpperCase())?"zh-Hant":"zh"}var fM=Zo([p0(),Qo(!1),Pt(["split-horizontal","tab","split","window"])]),Lxe=Pt(["image/png","image/jpeg","image/webp"]),hJe=Pt(["before-cursor","after-cursor"]),Mxe=Pt(["play","eager"]),mJe=Pt(["browser","iframe"]),gJe={__VERSION__:1},pM=An({__VERSION__:Qo(1),"release.previous-version":Vt(ks(we()),void 0),"release.show-release-notes":Vt(wr(),!0),"playback.default-volume":Vt(vo,100),"playback.speed-step":Vt(Ee(hr(),Qa(0),xs(1)),.1),"playback.preserve-pitch":Vt(wr(),!0),"playback.track.default-enabled":Vt(wr(),!1),"playback.track.folder-path":Vt(ks(we()),void 0),"playback.track.default-languages":Vt(Kl(Ee(we(),f0(hf,"Invalid language code"))),[]),"playback.screenshot.format":Vt(Lxe,"image/jpeg"),"playback.screenshot.quality":Vt(Ee(hr(),Qa(0),xs(1)),.8),"playback.screenshot.folder-path":Vt(ks(we()),void 0),"note.embed-load-strategy":Vt(Mxe,"eager"),"link.click-behavior":Vt(fM,"split"),"link.altclick-behavior":Vt(fM,"window"),"link.handle-hosted":Vt(wr(),!0),"link.handle-direct-url":Vt(wr(),!0),"link.hosted-prefer":Vt(mJe,"browser"),"note.template.timestamp":Vt(we(),`
|
|
- {{TIMESTAMP}} `),"note.template.timestamp-offset":Vt(hr(),0),"note.template.screenshot":Vt(we(),`
|
|
- !{{SCREENSHOT}} {{TIMESTAMP}} `),"note.template.screenshot-embed":Vt(we(),"{{TITLE}}{{DURATION}}|50"),"note.template.insert-at":Vt(hJe,"after-cursor"),"media-lib.folder-path":Vt(we(),"media-lib"),"cache.cover-image.max-size-mb":Vt(Ee(hr(),Qa(1),xs(1e3)),100)});function _xe(t){let e=t,r=Ja(pM,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(Lxe,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(Mxe,n)&&(r["note.embed-load-strategy"]=n)}if(e.defaultMxLinkClick?.click!==void 0){let n=e.defaultMxLinkClick.click;ws(fM,n)&&(r["link.click-behavior"]=n)}if(e.defaultMxLinkClick?.alt!==void 0){let n=e.defaultMxLinkClick.alt;ws(fM,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"),Ja(pM,r)}var Oxe=Zo([p0(),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"]),Dxe=An({__VERSION__:Qo(2),...rd({"release.previous-version":la(we()),"release.show-release-notes":wr(),"playback.default-volume":vo,"playback.speed-step":Ee(hr(),Qa(0),xs(1)),"playback.preserve-pitch":wr(),"playback.track.default-enabled":wr(),"playback.track.folder-path":la(we()),"playback.track.default-languages":Kl(Ee(we(),f0(hf,"Invalid language code"))),"playback.screenshot.format":yJe,"playback.screenshot.quality":Ee(hr(),Qa(0),xs(1)),"playback.screenshot.folder-path":la(we()),"note.embed.load-strategy":qp,"note.embed.handle-hosted":wr(),"note.embed.handle-direct-url":wr(),"link.click-behavior":Oxe,"link.altclick-behavior":Oxe,"link.handle-hosted":wr(),"link.handle-direct-url":wr(),"link.hosted-prefer":bJe,"note.template.timestamp":we(),"note.template.timestamp-offset":hr(),"note.template.timestamp-embed":we(),"note.template.timestamp-embed-linktext":we(),"note.template.screenshot":we(),"note.template.screenshot-embed":we(),"note.template.insert-at":vJe,"media-lib.folder-path":we(),"cache.cover-image.max-size-mb":Ee(hr(),Qa(1),xs(1e3))}).entries}),O$={__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.timestamp-embed":`
|
|
- !{{CLIP}} `,"note.template.timestamp-embed-linktext":"{{TIMESTAMP}}|400","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 Nxe(t){return{...O$,...XT(t,e=>e!==void 0)}}function Fxe(t){return Ja(Dxe,t)}function Bxe(){return{...O$,__VERSION__:2}}function Vxe(t){let e=Ja(pM,t),r={__VERSION__:2},n=fD(xJe,s=>{let[a,o]=s,l=e[a],c=O$[o];return l===void 0||Xl(l,c)?[o,void 0]:[o,l]});return Ja(Dxe,{...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:_xe,2:Vxe},jxe=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?Nxe(a):null},(s,a,o)=>{if(o===KQ){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=Bxe();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:Fxe(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 QS=class{plugin;settingsAtoms;store=Xf();#e;#t;constructor(e){this.plugin=e.plugin,this.settingsAtoms=jxe(this.plugin),this.loadSettings(),this.#e=new DisposableStack,this.#t=this.#e.use(new bu)}[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]:ou;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)}}},ou=Symbol("na");var hM=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 insertTimestampEmbed(e,r,{file:n,editor:i}){if(!i)return;let s=await this.settings.loaded,a=this.template.renderTimestampEmbedInsertion({currentTime:e,src:r.src,meta:{title:r.title}},{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:{title:r.title}},{sourcePath:n?.path||"",settings:s});this.#e(a,i,s)}#e(e,r,n){n["note.template.insert-at"]==="before-cursor"?fL(e,r):dL(e,r)}};var mM=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)}renderTimestampEmbedInsertion(e,r){let n=r.settings["note.template.timestamp-embed"],i=r.settings["note.template.timestamp-embed-linktext"],s=r.settings["note.template.timestamp-offset"],a={clip:this.renderTimestampEmbed(e,{sourcePath:r.sourcePath,timestampOffset:s,template:i})};return this.#t(n,a)}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=D$(r,i.timestampOffset),a=this.#r(i.template,{timestamp:s,title:n.title});return this.fileManager.generateMarkdownLink(e,i.sourcePath,"",a).replace(/^!/,"")}renderTimestampLink({currentTime:e,src:r},n){let i=D$(e,n.timestampOffset),s=lA(i),a=Cc({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})`}renderTimestampEmbed({currentTime:e,src:r,meta:n},i){let s=D$(e,i.timestampOffset),a=this.#n(i.template,{timestamp:s,title:n.title}),o=Cc({tempFragment:{start:s,end:Number.POSITIVE_INFINITY}}).toString();if(r.type==="file"){let{file:c}=r;return this.fileManager.generateMarkdownLink(c,i.sourcePath,o?`#${o}`:void 0,a).replace(/^!/,"")}let l=this.renderExternalLink(r,{tempFragment:{start:s,end:Number.POSITIVE_INFINITY}});return`[${a}](${l})`}renderExternalLink(e,r){if(e.type==="url:direct")return nS(e.url,r);if(e.type==="url:hosted")return Wd(e.vid,r);Be(e)}#t(e,r){let n=e;return r.timestamp&&(n=n.replaceAll("{{TIMESTAMP}}",r.timestamp)),r.clip&&(n=n.replaceAll("{{CLIP}}",r.clip)),r.screenshot&&(n=n.replaceAll("{{SCREENSHOT}}",r.screenshot)),n}#r(e,r){let n=r.timestamp>0?` - ${lA(r.timestamp)}`:"";return e.replaceAll("{{TITLE}}",r.title).replaceAll("{{DURATION}}",n)}#n(e,r){let n=lA(r.timestamp);return e.replaceAll("{{TIMESTAMP}}",n).replaceAll("{{TITLE}}",r.title)}};function D$(t,e){return Math.max(0,t+(e??0))}var yM=require("obsidian");var CJe=new Set(["file:","http:","https:"]);function $xe(t,e){return e.has(t)?e.get(t):[]}function Uxe(t,e){return((0,yM.parseFrontMatterStringArray)(e,t)??[]).map(r=>an(r)).filter(r=>r!==null&&CJe.has(r.protocol))}var gM=class{fileHelper;app;constructor(e){this.fileHelper=e.fileService,this.app=e.app}parseTextTrackFields(e){let r=e.frontmatter??{},n=Uxe(Vs,r),i=Uxe(js,r),s=Map.groupBy(e.frontmatterLinks??[],l=>l.key.split(".").at(0)),a=$xe(Vs,s);return[...$xe(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=Ja(Hce,{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(qce),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=Co(a.path,{sep:o});return{type:"file",basename:l.basename,src:l,meta:{...s,...n}}}catch(i){return i instanceof Pm?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,yM.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 Pm?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=yd(e,{sep:r,urlEncoded:n});if(!JT(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 Rxe(r)?{basename:e.join("."),language:r}:null}var jv=require("obsidian");var IJe=["vtt","srt","ssa","ass"];function N$(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*F$(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 Co(n.join(t,a.name),{sep:n.sep}))}var vM=class{parser;constructor(e){this.parser=e.trackInfoParser}async resolveLocalMediaForTrack(e){if(!jv.Platform.isDesktopApp)return null;let r=vs(),n=[];for await(let s of F$(r.dirname(e.src.path),[e.src.basename]))s.basename!==e.basename||!Yl(s)||n.push(s);let{pathToFileURL:i}=Vi();for(let s of eo){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 jv.TFile&&i.name!==e.src.name&&i.basename===e.basename&&Yl(i)?i:null).filter(i=>!!i);for(let i of eo){let s=n.find(a=>a.extension===i);if(s)return{type:"file",file:s}}return null}async resolveLocalFileTracks(e){if(!jv.Platform.isDesktopApp||!Bt(e.url))return[];let r=vs(),{fileURLToPath:n}=Vi(),i=n(e.url),s=Co(i,{sep:r.sep}),a=[];for await(let o of F$(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 N$(a)}resolveVaultTracks({file:e}){if(!e.parent)return[];let r=e.parent.children.map(n=>{if(!(n instanceof jv.TFile))return null;let i=this.parser.fileToTrack(n,{kind:"subtitles"});return!i||i.basename!==e.basename?null:i}).filter(n=>!!n);return N$(r)}};var zxe=require("obsidian");var bM=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(!zxe.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 $v=require("obsidian");var qxe=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 Hxe(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 Gxe=[["vtt","text/vtt"],["srt","application/x-subrip"],["ssa","application/x-ssa"],["ass","application/x-ass"]],PJe=new Map(Gxe),RJe=new Map(Gxe.map(([t,e])=>[e,t]));function Wxe(t){return RJe.get(t??"")}function Kxe(t){return PJe.get(t)}function Yxe(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":Kxe(t)}})}var LJe=require("obsidian");var Xxe={"&":"&","<":"<",">":">","=":"=",":":":"},N5t=new RegExp(`[${RegExp.escape(Object.keys(Xxe).join(""))}]`,"g"),Qxe=Object.fromEntries(Object.entries(Xxe).map(([t,e])=>[e,t])),MJe=new RegExp(`(${Object.keys(Qxe).map(t=>RegExp.escape(t)).join("|")})`,"g");function _Je(t){return t.replaceAll(MJe,e=>Qxe[e])}async function Zxe(t,e){let r=await l8(t,e);return r.metadata=Hn(r.metadata,n=>_Je(n)),r}var xM=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 $v.TFile)return await this.app.vault.cachedRead(e);if(!$v.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,$v.requestUrl)({url:e.toString(),method:"GET"})).text}async loadAndParseTrack(e){let r=await this.loadTrack(e);return await Zxe(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=>iP(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)=>qxe(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=>dM(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=dM(l);if(u?.lang==="zh"&&u.extlang[0]){let d=_$(u.extlang[0]),f=n.findIndex(p=>{let h=dM(p.meta.language);return h&&h.lang==="zh"&&h.extlang[0]&&_$(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:Hxe(o,a),language:o.language?.trim(),id:Aa(s),fetch:async()=>Yxe(o.format,()=>this.loadTrack(s))})}),trackInfo:n}}};var IM=require("obsidian");var kM=require("obsidian");var Jxe=require("obsidian");var twe=Z(Ge(),1),ewe=({onChange:t,onCancel:e,...r})=>{if(!Jxe.Platform.isDesktopApp)throw new Error("Not supported on this platform");return(0,twe.jsx)("button",{...r,type:"button",onClick:async()=>{let{dialog:n}=sa(),{basename:i}=vs();try{let s=await n.showOpenDialog({properties:["openFile","noResolveAliases"],message:"Select a subtitle file to import",filters:[{name:"Subtitle files",extensions:ZT}]}),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 Uv=Z(Ge(),1),wM=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,Uv.jsx)(Mce,{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(kM.moment.locale())?"subtitles":"captions"}:{}},renderFilePicker:({onChange:e,value:r,disabled:n})=>kM.Platform.isDesktopApp?(0,Uv.jsx)(ewe,{className:"contents",disabled:n,onChange:e,onCancel:()=>e(null),children:(0,Uv.jsx)(L9,{value:r})}):(0,Uv.jsx)(_ce,{className:"contents",disabled:n,onChange:e,onCancel:()=>e(null),children:(0,Uv.jsx)(L9,{value:r})})})}};var rwe=Z(Ge(),1),SM=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,rwe.jsx)(Oce,{onSubmit:e=>{this.resolveWith(e)}})}};async function nwe(t){return await new wM(t).requestInput()}async function iwe(t){return await new SM(t).requestInput()}var swe=require("obsidian"),TM=Z(Te(),1);var B$=Z(Ge(),1),CM=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,B$.jsx)(OJe,{subtitles:this.#e,onImport:this.#t,onOpen:this.#r})}};function OJe({subtitles:t,onImport:e,onOpen:r}){let[n,i]=(0,TM.useState)(t.map(a=>({data:a,state:{status:"idle"}}))),s=(0,TM.useMemo)(()=>{if(e)return a=>{e(a,o=>{i(l=>l.map(c=>c.data.id===a?{...c,state:o}:c))})}},[e]);return(0,B$.jsx)(Dce,{subtitles:n,userLanguage:(swe.moment.locale()||navigator.language).split("-")[0],onImport:s,onOpen:r,onRetry:s})}var EM=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 dt(this.youTubeApi.getSubtitlesList(s),{loading:n,error:(c,u)=>{if(u instanceof Lo){new au(this.auth,{content:"You need to login to import YouTube subtitles"});return}return`${r}: ${c}`},swallowError:!1}),o=new Map,l=new CM(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:VA(d.lang),label:M9(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(IM.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 iwe({app:this.app});if(r["should-download"]){let s=await(0,IM.requestUrl)(r.url),a=new URL(r.url),o=this.parser.inferFromPath(a,{urlEncoded:!0}),l=r.format||Wxe(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:awe()});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 nwe({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,awe(),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 j$(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 Bv(e);try{return await this.app.vault.create(e,r)}catch(i){throw new V$(e,{cause:i})}}};function awe(){return Xr(4)}var V$=class extends Error{constructor(e,r){super(`Failed to save text track in ${e}: ${r instanceof Error?r.message:r}`,{cause:r})}},j$=class extends Error{constructor(e,r){super(`Invalid track in ${e}: ${r instanceof Error?r.message:r}`,{cause:r})}};var VM=require("obsidian");var $$=re(),AM=re(t=>{let e=t($$),r=t(jt)?.flip,n=t(qt)?.flip;return e??r??n??"none"});var U$=re(),z$=re(t=>{let e=t(U$),r=t(Tt).settings.value?.["playback.preserve-pitch"],n=t(jt)?.preservePitch,i=t(qt)?.preservePitch;return e??n??i??r??!0}),Uh=fn(re(!1),(t,e)=>{if(!("preservesPitch"in HTMLMediaElement.prototype)){e(Uh,!1);return}let r=t(gt);if(!r){e(Uh,!1);return}return r.listen("provider-change",({detail:n})=>{e(Uh,mo(n)||ho(n))})}),owe=$i(t=>{let e=t(gt);if(!e)return;let r=t(z$),n=i=>{i&&(mo(i)||ho(i))&&(i.media.preservesPitch=r)};return n(e.provider),e.listen("provider-change",i=>{n(i.detail)})});var lwe=g0(qt,t=>t?.cover),mf=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(mf,a)}catch(l){var c=l,u=!0}finally{ee(o,c,u)}})().catch(s=>{console.warn("Failed to extract metadata",s),e(mf,null)}),()=>{e(mf,null),i.abort()}}),PM=fn(re(null),(t,e)=>{let r=t(mf);if(!r)return;let{metadataExtractor:n}=t(Tt),i=n.extractCover(r);if(!i)return;let s=URL.createObjectURL(i.blob);return e(PM,s),()=>{e(PM,null),URL.revokeObjectURL(s)}});var zv=re(t=>{let e=t(jt)?.title,r=t(qt)?.title,n=t(mf)?.title,i=t(Hd)?.title,s=t(Tt).mediaAttr.getFallbackTitle(t(Kt));return e??r??n??i??s??"Media"});var cwe='"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 uwe="toggle-pip:youtube-embed";var dwe="screenshot:youtube-embed";var fwe=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),pwe=t=>{throw TypeError(t)},hwe=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&pwe("Object expected");var n,i;r&&(n=e[fwe("asyncDispose")]),n===void 0&&(n=e[fwe("dispose")],r&&(i=n)),typeof n!="function"&&pwe("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},mwe=(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()},gwe={parse:NL,stringify:t=>t},RM=class{#e;constructor(e){this.#e=e}sendMessage(e,r){this.#e.postMessage(gwe.stringify(e),r)}#t=!1;addMessageHandler(e){var r=[];try{let s=hwe(r,new DisposableStack),a=o=>{let l=gwe.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{mwe(r,n,i)}}async invoke(e,{signal:r,...n}={}){var i=[];try{this.sendMessage(e,n);let o=hwe(i,new DisposableStack);return await Promise.race([new Promise(l=>{o.use(this.addMessageHandler(c=>{_L(e,c)&&l(c)}))}),FL(r,{taskId:e.taskId,stack:o})])}catch(o){var s=o,a=!0}finally{mwe(i,s,a)}}[Symbol.dispose]=()=>{this.#e.close()}};var ywe=require("obsidian");var H$=XQ(()=>Xr()),jo=fn(re({status:"pending"}),(t,e)=>{if(!ywe.Platform.isDesktopApp){e(jo,{status:"na"});return}let r=t(gt),n=t(H$);if(!r){e(jo,{status:"pending"});return}let i=null,s=async()=>{i?.abort(),i=new AbortController;let o=i.signal;try{if(!zu(r.provider)){e(jo,{status:"pending"});return}if(await BJe(r,{signal:o}),o.aborted)return;let l=sa().getCurrentWebContents().mainFrame.frames.find(p=>p.name===n);if(!l)throw new Error(`Frame ${n} not found`);let c=l.frameTreeNodeId,u=()=>{let p=sa().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 q$(d,u);if(o.aborted)return;e(jo,{status:"ready",connection:f})}catch(l){if(o.aborted)return;e(jo,{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(cwe.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 q$=class{#e;constructor(e,r){this.#e=r;let n=new RM(e),i=mS(n);this.captureScreenshot=i.createRemoteFn(dwe);let s=i.createRemoteFn(uwe);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 cu=require("obsidian");var vwe=re(t=>{let e=t(Kt);if(!e)return null;let r=t(G$);return t(Tt).mediaAttr.getMediaSrc(e,r)}),G$=re(t=>{let e=t(jt)?.type,r=t(qt)?.type;return e??r??void 0});var ZS=fn(re(),(t,e)=>{let r=t(gt);if(!r){e(ZS,void 0);return}let n=i=>{let s=i.target;s.videoHeight<=0||s.videoWidth<=0?e(ZS,"audio"):e(ZS,"video")};return r.listen("provider-change",i=>{if(e(ZS,void 0),!mo(i.detail))return;i.detail.video.addEventListener("loadedmetadata",n,{once:!0})})}),lu=re(t=>{let e=t(G$),r=t(Tt).mediaAttr.inferMediaType(t(Kt));return e??t(ZS)??r});var VJe=re(t=>{let e=t(jt)?.aspectRatio,r=t(qt)?.aspectRatio;return e??r??void 0}),LM=fn(re(null),(t,e)=>{let r=t(gt);if(!r){e(LM,null);return}let n=i=>{let s=i.target;e(LM,pl(s.videoWidth,s.videoHeight))};return r.listen("provider-change",i=>{if(e(LM,null),!mo(i.detail))return;i.detail.video.addEventListener("loadedmetadata",n,{once:!0})})}),MM=re(t=>{if(t(lu)!=="audio")return t(LM)??t(VJe)??void 0});var _M=re(t=>{let e=t(Kt);if(!e)return"lucide-file-video";if(e.type==="file")return`lucide-file-${t(lu)??"video"}`;if(e.type==="url:direct"){let r=t(lu);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 OM=require("obsidian"),JS=Z(Te(),1);var bwe=re(t=>{if(!t(Tt).plugin.loaded)return!1;let e=!t(Eu),r=t(jt)?.autoPlay,n=t(qt)?.autoPlay;return r??n??e}),xwe=re(t=>t(Eu)?t(jt)?.showControls??!0:!0),wwe=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}),kwe=re(t=>{let e=t(jt)?.muted,r=t(qt)?.muted;return e??r??!1}),Swe=re(t=>{let e=t(jt)?.loop,r=t(qt)?.loop;return e??r??!1}),Cwe=re(t=>{let e=t(jt)?.crossOrigin,r=t(qt)?.crossOrigin;return e??r??!1});var Twe=re(t=>{let e=t(lwe),{metadataExtractor:r}=t(Tt);if(e){let n=r.loadCoverResourceUri(e);if(n)return n}return t(PM)});var Ewe=re(t=>{let e=t(qt)?.creator,r=t(mf),n=r?.artist||r?.albumArtist,i=t(Hd)?.author;return(e??n??i)?.trim()||void 0});var Iwe=re(t=>{if(!t(Eu))return"eager";let r=t(jt)?.embedLoadStrategy,n=t(Tt).settings.value?.["note.embed.load-strategy"];return r??n??"eager"});var Awe=re(null),jJe=re(async t=>{let{transcriptLoader:e}=t(Tt),r=t(Kt);return r?await e.loadTracks(r):null}),Pwe=$i((t,e)=>{let r=t(gt);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(Awe,s)}).catch(s=>{kt.test(s)||console.error("error loading media tracks",s)}),()=>{i.abort(),e(Awe,null),r.textTracks.clear(),r.textTracks._defaults={}}});var Rwe=$i(t=>{let e=t(gt),r=t(Y1);if(!e||!r)return;let n=t(Jf);if(!n)return;let{autoPlay:i=!0,tempFragment:s}=n;if(s===void 0)return;let a=new rE(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=W$(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()}}),Lwe=re(t=>{let e=W$(t(jt)?.tempFragment),r=W$(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 W$(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 Mwe(){let t=St(Cwe),e=St(Lwe);return{title:St(zv),autoPlay:St(bwe),controls:St(xwe),volume:St(wwe),muted:St(kwe),loop:St(Swe),playbackRate:St(Yhe),crossOrigin:t===!1?void 0:t,load:St(Iwe),...e}}function _we(){return St(Twe)||void 0}function Owe(){return St(Ewe)}function Dwe(){aa(Ame),aa(Ime),aa(owe),aa(Pwe),aa(y0),aa(Rwe),aa(Uh)}function Nwe(){return{flip:St(AM),aspectRatio:St(MM)?.syntax}}function Fwe(){return St(vwe)}function K$(){return St(lu)??"unknown"}function Bwe(){return aa(jo),{iframeProps:{name:St(H$)}}}function Vwe(){let t=St(sE),e=Am(iE);if(t)return e}var jwe=require("obsidian"),$we=Z(Te(),1);function Uwe(){let t=Su(),e=St(Kt),r=(0,$we.useCallback)(()=>{dt(UJe(t),{swallowError:!0,loadingDelay:500,loading:"Toggling picture in picture...",error:n=>`Error toggling picture in picture: ${n}`})},[t]);if(zwe(e))return r}function zwe(t){return jwe.Platform.isDesktopApp&&da(t)}async function UJe(t){let e=t.get(Kt);if(!zwe(e))throw new Error("Not supported");let r=t.get(jo);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),qwe=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,JS.useRef)(null),e=(0,JS.useRef)(!1),[r,n]=(0,JS.useState)(!1);return{disabled:r,handleSourceChange:s=>{let a=t.current;t.current=s,a&&s&&!Xl(a,s)&&!qwe(a)&&!qwe(s)&&!e.current&&(e.current=!0,n(!0),sleep(100).then(()=>n(!1)).catch(()=>{}).finally(()=>{e.current=!1}))}}}function Gwe({checkInEditor:t,...e}){let r=hue(),n=zJe();Dwe();let i=Fwe(),s=K$(),{iframeProps:a}=Bwe(),{controls:o,...l}=Mwe(),c=_we(),u=Owe(),d=Nwe(),f=Uwe(),p=Vwe();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)(Yle,{keyDisabled:!0,className:"h-full",ref:r,onError:h=>{new OM.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)(yF,{iframeProps:a}),o&&(0,Oi.jsx)(ace,{utilsSlot:(0,Oi.jsx)(Hwe,{...e})}),o&&(0,Oi.jsx)(tce,{utilsSlot:(0,Oi.jsx)(Hwe,{...e})})]})]})}function Hwe({onEditClick:t,onPaneMenu:e}){let r=K1(),n=K$(),i=Su();return(0,Oi.jsxs)(Oi.Fragment,{children:[(0,Oi.jsx)(Wle,{variant:n==="audio"?"ghost":"controls",onClick:s=>{if(!r||!i.get(Kt))return;let o=new OM.Menu;o.addSections(["open","action","view","danger","system"]),e(o),Fv(s.nativeEvent,o)}}),t&&(0,Oi.jsx)(Gle,{type:"button",part:"edit-button",variant:"ghost",onClick:t,[Wwe]:""})]})}var Wwe="data-lp-passthrough";function qJe(t){if(!(t instanceof Element))return!1;let e=t.closest("button");return e?e.hasAttribute(Wwe):!1}function Kwe(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)dm(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 Ywe=Z(Ge(),1),DM=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=Kwe(this.remoter,e);return()=>r[Symbol.dispose]()}registerAspectRatioUpdater(e){return ua(r=>{let{width:n=16,height:i=9}=r(MM)??{};e.style.setProperty("--mx-ratio-w",n.toString()),e.style.setProperty("--mx-ratio-h",i.toString())},this.service.store)}registerViewTypeUpdater(e){return ua(r=>{let n=r(lu);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 rv({ctx:{store:this.store,isEmbed:r},shadowRootClassName:"mx-player-shadow-root",target:e,children:(0,Ywe.jsx)(Gwe,{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(_M)}registerHeaderUpdater(e,{disableTitleUpdate:r}={}){return r?ua(n=>{n(_M),e.leaf.updateHeader()},this.store):ua(n=>{n(_M);let i=n(zv);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 cu.Notice("No media is opened");return}if(!this.service.player){new cu.Notice("No media is playing");return}let l=this.workspaceFind.getMostRecentEditorLeaf();if(!l){new cu.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(ua(f=>{let p=f(gt);if(!p)return;let h=m=>{Y$(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})});Ao()&&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 cu.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 dt(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 dt(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}`})})),da(n)&&Ao()&&r.addItem(s=>s.setIcon("captions").setSection("action").setTitle("from YouTube").onClick(async()=>{try{await this.transcriptSaver.importYouTubeSubtitles(n,{onNotFound:()=>{new cu.Notice("Subtitle not found")},loadingText:"Fetching subtitles...",errorText:"Failed to load YouTube subtitles"})}catch(a){if(kt.test(a))return;new cu.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 cu.Notice(`Added to media library: ${a.note.path}`)})}),Fv(e,r)}};var NM=class{store;constructor(e){this.store=e.store}get#e(){let e=this.store.get(gt);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=Zwe(Xwe(n.volume+e));i.changeVolume(s,r)}volumeDown(e=.05,r){let{state:n,remoter:i}=this.#e,s=Zwe(Xwe(n.volume-e));i.changeVolume(s,r)}speedUp(e=.1,r){let{state:n,remoter:i}=this.#e,s=Qwe(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=Qwe(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 Xwe(t){return Math.round(t*100)/100}function Qwe(t){return Math.round(t*10)/10}function Zwe(t){return Math.max(0,Math.min(1,t))}var Jwe=require("obsidian");function uu(t){return t instanceof DOMException&&t.name==="SecurityError"&&/\btainted\b|\bcanvas/i.test(t.message)}var du=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 Jwe.ButtonComponent(e.createDiv({attr:{style:"margin-top: 10px"}})).setButtonText("Open guide").onClick(()=>{window.open("https://mx.pkmer.net/docs/faq/cors","_blank")})});var FM=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 dt(this.#e(),{loading:"Extracting text from screenshot...",success:"Text extracted from screenshot and copied to clipboard",error:(e,r)=>{if(r instanceof Lo){new au(this.auth,{content:"You need to login to extract text from screenshot"});return}return r instanceof lv?"No text found in the screenshot":uu(r)?du:`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 Ol;let{file:i,editor:s}=n;let a=this.service.media;let o=this.service.title;if(!a)throw new Error("No media is opened");await this.mediaNote.ensureMediaNote(a);let l=J(c,await this.screenshot.saveScreenshot(this.service,{clip:e,sourcePath:i?.path}),!0);await this.templateInsert.insertScreenshotEmbed(l,{src:a,title:o},{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 dt(this.#t({clip:e,note:r}),{loading:e?void 0:"Saving screenshot...",success:n=>`Screenshot saved in "${n.file.basename}"`,error:(n,i)=>uu(i)?du:i instanceof Ol?"Please open a note before taking screenshot":`Failed to insert screenshot embed: ${n}`})}async#r({clip:e,sourcePath:r}){var i=[];try{let n=J(i,await this.screenshot.saveScreenshot(this.service,{clip:e,sourcePath:r}),!0);return n}catch(s){var a=s,o=!0}finally{var l=ee(i,a,o);l&&await l}}async saveScreenshot({clip:e,sourcePath:r}){return await dt(this.#r({clip:e,sourcePath:r}),{loading:e?void 0:"Saving screenshot...",success:n=>`Screenshot saved in "${n.file.basename}"`,error:(n,i)=>uu(i)?du:`Failed to save screenshot: ${n}`})}async#n({clip:e,sourcePath:r}){var s=[];try{let n=this.service.media;if(!n)throw new Error("No media is opened");let i=J(s,await this.screenshot.saveScreenshot(this.service,{clip:e,sourcePath:r}),!0);this.mediaNote.setAsCover(n,i.file);return i}catch(a){var o=a,l=!0}finally{var c=ee(s,o,l);c&&await c}}async setAsCover({clip:e,sourcePath:r}){return await dt(this.#n({clip:e,sourcePath:r}),{loading:e?void 0:"Saving screenshot as cover...",success:"Screenshot saved and set as media cover",error:(n,i)=>uu(i)?du:`Failed to save screenshot as cover: ${n}`})}async copyScreenshot({clip:e}){return await dt(this.screenshot.copyScreenshot(this.service,{clip:e}),{loading:"Copying screenshot...",success:"Screenshot copied to clipboard",error:(r,n)=>uu(n)?du:`Failed to copy screenshot: ${r}`})}};var BM=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(!Zf(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 dt(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 Ol;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 dt(this.#t({note:e}),{loading:"Inserting timestamp...",loadingDelay:1e3,error:(r,n)=>uu(n)?du:n instanceof Ol?"Please open a note before taking timestamp":`Failed to insert screenshot embed: ${r}`})}async#r({note:e}){let r=e??this.app.workspace.activeEditor??this.workspaceFind.getMostRecentEditorLeaf()?.view;if(!r)throw new Ol;let n=this.service.media,i=this.service.title;if(!n)throw new Error("No media is opened");let s=this.service.player;if(!s)throw new Error("No player is opened");await this.templateInsert.insertTimestampEmbed(s.currentTime,{src:n,title:i},r)}async insertTimestampEmbed({note:e}){return await dt(this.#r({note:e}),{loading:"Inserting timestamp embed...",loadingDelay:1e3,error:(r,n)=>uu(n)?du:n instanceof Ol?"Please open a note before taking timestamp embed":`Failed to insert timestamp embed: ${r}`})}};function X$(t){return{mx:Oe.serialize(t)}}function Q$(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 Dl=class{workspace;store;app;mediaLib;settings;screenshotAction;timestampAction;remoter;helper;mediaParser;#e;constructor(e){let r=e.createScope();r.register({service:Yf(this),helper:ji(DM).scoped(),remoter:ji(NM).scoped(),screenshotAction:ji(FM).scoped(),timestampAction:ji(BM).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(Uh)?this.store.get(z$):null}set preservePitch(e){this.store.set(U$,e)}get speedOptions(){return this.store.get(Khe).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(gt)}get flip(){return this.store.get(AM)}set flip(e){this.store.set($$,e)}get title(){return this.store.get(zv)??""}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 X$({hash:this.#t()})}setFileState(e){let r=Q$(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(rZ,r)}#t(){let e=this.store.get(jt),r=this.store.get(Jf);return fl(r?.tempFragment)?{...e,tempFragment:r.tempFragment}:{...e}}getUrlState(){let e=this.store.get(Kt);return!e||!Zf(e)?{}:X$({media:e,hash:this.#t()})}setUrlState(e){let r=Q$(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(Jf,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?Y$(this.player.provider):!1}async captureScreenshot(e){let r=this.store.get(gt);if(!r)throw new Error("Load player with video first");if(mo(r.provider)){let n=await Cxe(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(zu(r.provider)){let n=this.store.get(jo);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(gt);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(iE)}canResetTimestamp(){if(!this.store.get(sE)||!this.player)return!1;let{clipStartTime:e,clipEndTime:r}=this.player.state;return e>0||r>0}};function Y$(t){return t?mo(t)||zu(t):!1}var gf=class extends VM.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 VM.Scope(this.app.scope),this.service=new Dl(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 Yl({extension:e})}};var jM=require("obsidian");var yf=class extends jM.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 jM.Scope(this.app.scope),this.service=new Dl(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 $M=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(l0).sort(ql(Xo)).at(0)}getPinnedMediaLeaves(){return this.getAllMediaLeaves().filter(e=>e.pinned)}getActiveMediaView(){return this.app.workspace.getActiveViewOfType(gf)??this.app.workspace.getActiveViewOfType(yf)??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=>fa(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 gf?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=mP(r.state);return n?{type:bs,leaf:e,view:e.view instanceof yf?e.view:void 0,pinned:r.pinned,active:r.active,activeTime:e.activeTime,state:n}:null}).filter(e=>e!==null)}};var UM=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=uy({src:i});await(r.newLeaf==="split"?n.workspace.getLeaf(r.newLeaf,r.direction):n.workspace.getLeaf(r.newLeaf)).setViewState({type:_m,state:s,active:!0})}else Be(e)}async openMedia(e,r={}){if(!r.newLeaf){let a=this.finder.getPinnedMediaLeaves().sort(ql(c0,Xo)).filter(l=>l.view);if(a.length>0){let l=a.filter(u=>fa(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(ql(c0,Xo)).at(0);if(o)return o.view||await this.app.workspace.revealLeaf(o.leaf),e.hash&&o.leaf.setEphemeralState(Ej(e.hash)),o}let n=await this.settings.loaded,i=Eme(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?Ej(e.hash):{};if(e.info.type==="file")return await pL.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(tZ(e.info))o={type:bs,state:uy({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:uy({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 e1e=require("obsidian");async function t1e(t){if(!e1e.Platform.isDesktopApp)throw new Error("Not supported in web");let e=await nQ().showOpenDialog({title:"Pick a media file",message:"Pick a media file to open",buttonLabel:"Pick",properties:["openFile"],filters:[{name:"Media files",extensions:eo}],defaultPath:t});if(e.canceled)return null;let r=e.filePaths[0]??null;return r?Cm(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 r1e(t){let e=null;return Fr.Platform.isDesktopApp?e=vs().isAbsolute(t)?Cm(t):an(t):e=an(t),!e||["http:","https:"].includes(e.protocol)&&!KJe.test(e.hostname)?null:e}var zM=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=r1e(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=r1e(`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 t1e();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=yd(m);return Yl(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 n1e({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 i1e(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 qa=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 o1e(t,e){return typeof t=="function"?t(e):t}function eC(t){return typeof t=="number"&&t>=0&&t!==1/0}function qM(t,e){return Math.max(t+(e||0)-Date.now(),0)}function vf(t,e){return typeof t=="function"?t(e):t}function Qs(t,e){return typeof t=="function"?t(e):t}function HM(t,e){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(n){if(e.queryHash!==tC(a,e.options))return!1}else if(!qv(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 GM(t,e){let{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(Nl(e.options.mutationKey)!==Nl(s))return!1}else if(!qv(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function tC(t,e){return(e?.queryKeyHashFn||Nl)(t)}function Nl(t){return JSON.stringify(t,(e,r)=>Z$(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function qv(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!qv(t[r],e[r])):!1}function J$(t,e){if(t===e)return t;let r=s1e(t)&&s1e(e);if(r||Z$(t)&&Z$(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]=J$(t[u],e[u]),o[u]===t[u]&&t[u]!==void 0&&l++)}return i===a&&l===i?t:o}return e}function Hv(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 s1e(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Z$(t){if(!a1e(t))return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(!a1e(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function a1e(t){return Object.prototype.toString.call(t)==="[object Object]"}function l1e(t){return new Promise(e=>{setTimeout(e,t)})}function rC(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?J$(t,e):e}function c1e(t,e,r=0){let n=[...t,e];return r&&n.length>r?n.slice(1):n}function u1e(t,e,r=0){let n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Gv=Symbol();function WM(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Gv?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var tet=class extends qa{#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"}},Wv=new tet;var ret=class extends qa{#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}},Kv=new ret;function nC(){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 eU(t){return(t??"online")==="online"?Kv.isOnline():!0}var d1e=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function KM(t){return t instanceof d1e}function YM(t){let e=!1,r=0,n=!1,i,s=nC(),a=m=>{n||(f(new d1e(m)),t.abort?.())},o=()=>{e=!0},l=()=>{e=!1},c=()=>Wv.isFocused()&&(t.networkMode==="always"||Kv.isOnline())&&t.canRun(),u=()=>eU(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),l1e(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 XM=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eC(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 f1e=class extends XM{#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=rC(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===Gv||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||!qM(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=WM(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=>{KM(o)&&o.silent||this.#o({type:"error",error:o}),KM(o)||(this.#r.config.onError?.(o,this),this.#r.config.onSettled?.(this.state.data,o,this)),this.scheduleGc()};return this.#i=YM({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,...tU(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 KM(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 tU(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eU(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 p1e=class extends qa{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,r){let n=e.queryKey,i=e.queryHash??tC(n,e),s=this.get(i);return s||(s=new f1e({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=>HM(e,r))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(r=>HM(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 h1e=class extends XM{#e;#t;#r;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||rU(),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=YM({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 rU(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var m1e=class extends qa{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 h1e({mutationCache:this,mutationId:++this.#r,options:t.defaultMutationOptions(e),state:r});return this.add(n),n}add(t){this.#e.add(t);let e=QM(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=QM(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=QM(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=QM(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=>GM(e,r))}findAll(t={}){return this.getAll().filter(e=>GM(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 QM(t){return t.options.scope?.id}function nU(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=WM(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?u1e:c1e;return{pages:w(h.pages,y,x),pageParams:w(h.pageParams,m,x)}};if(i&&s.length){let h=i==="backward",m=h?aet:g1e,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:g1e(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 g1e(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 iU=class{#e;#t;#r;#n;#i;#s;#a;#o;constructor(t={}){this.#e=t.queryCache||new p1e,this.#t=t.mutationCache||new m1e,this.#r=t.defaultOptions||{},this.#n=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=Wv.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Kv.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(vf(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=o1e(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(vf(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=nU(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(li).catch(li)}ensureInfiniteQueryData(t){return t.behavior=nU(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Kv.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(Nl(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#n.values()],r={};return e.forEach(n=>{qv(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){this.#i.set(Nl(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#i.values()],r={};return e.forEach(n=>{qv(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=tC(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===Gv&&(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 aU=class extends qa{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#a=nC(),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),y1e(this.#t,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return sU(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return sU(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&&!Hv(this.options,r)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});let i=this.hasListeners();i&&v1e(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)||vf(this.options.staleTime,this.#t)!==vf(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=vf(this.options.staleTime,this.#t);if(fs||this.#n.isStale||!eC(t))return;let r=qM(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||!eC(this.#p)||this.#p===0)&&(this.#d=setInterval(()=>{(this.options.refetchIntervalInBackground||Wv.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&&y1e(t,e),E=S&&v1e(t,r,e,n);(T||E)&&(u={...u,...tU(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=rC(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=rC(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:oU(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=nC();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),Hv(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 y1e(t,e){return oet(t,e)||t.state.data!==void 0&&sU(t,e,e.refetchOnMount)}function sU(t,e,r){if(Qs(e.enabled,t)!==!1){let n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&oU(t,e)}return!1}function v1e(t,e,r,n){return(t!==e||Qs(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&oU(t,r)}function oU(t,e){return Qs(e.enabled,t)!==!1&&t.isStaleByTime(vf(e.staleTime,t))}function cet(t,e){return!Hv(t.getCurrentResult(),e)}var lU=class extends qa{#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),Hv(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),e?.mutationKey&&this.options.mutationKey&&Nl(e.mutationKey)!==Nl(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??rU();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 Yv=Z(Te(),1),b1e=Z(Ge(),1),cU=Yv.createContext(void 0),bf=t=>{let e=Yv.useContext(cU);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},uU=({client:t,children:e})=>(Yv.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,b1e.jsx)(cU.Provider,{value:t,children:e}));var ZM=Z(Te(),1),x1e=ZM.createContext(!1),w1e=()=>ZM.useContext(x1e),m$t=x1e.Provider;var iC=Z(Te(),1),uet=Z(Ge(),1);function det(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var fet=iC.createContext(det()),k1e=()=>iC.useContext(fet);var S1e=Z(Te(),1);function JM(t,e){return typeof t=="function"?t(...e):!!t}function sC(){}var C1e=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},T1e=t=>{S1e.useEffect(()=>{t.clearReset()},[t])},E1e=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(i&&t.data===void 0||JM(r,[t.error,n]));var I1e=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)))},A1e=(t,e)=>t.isLoading&&t.isFetching&&!e,P1e=(t,e)=>t?.suspense&&e.isPending,dU=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});var xf=Z(Te(),1);function R1e(t,e,r){let n=bf(r),i=w1e(),s=k1e(),a=n.defaultQueryOptions(t);n.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=i?"isRestoring":"optimistic",I1e(a),C1e(a,s),T1e(s);let o=!n.getQueryCache().get(a.queryHash),[l]=xf.useState(()=>new e(n,a)),c=l.getOptimisticResult(a),u=!i&&t.subscribed!==!1;if(xf.useSyncExternalStore(xf.useCallback(d=>{let f=u?l.subscribe(_t.batchCalls(d)):sC;return l.updateResult(),f},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),xf.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),P1e(a,c))throw dU(a,l,s);if(E1e({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&&A1e(c,i)&&(o?dU(a,l,s):n.getQueryCache().get(a.queryHash)?.promise)?.catch(sC).finally(()=>{l.updateResult()}),a.notifyOnChangeProps?c:l.trackResult(c)}function fU(t,e){return R1e(t,aU,e)}var fu=Z(Te(),1);function e_(t,e){let r=bf(e),[n]=fu.useState(()=>new lU(r,t));fu.useEffect(()=>{n.setOptions(t)},[n,t]);let i=fu.useSyncExternalStore(fu.useCallback(a=>n.subscribe(_t.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=fu.useCallback((a,o)=>{n.mutate(a,o).catch(sC)},[n]);if(i.error&&JM(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var ci=require("obsidian"),V1e=Z(HR(),1);var L1e=An({id:Ee(we(),Lm(1,"ID is required")),pattern:Ee(we(),Za(),Lm(1,"Pattern/URL is required"),Rm(t=>{try{return new URLPattern(t),!0}catch{return!1}},"Invalid URL pattern")),username:Ee(we(),Za(),Lm(1,"Username is required")),password:Ee(we(),Za(),Lm(1,"Password is required"))}),M1e=Ee(we(),d0(),Kl(L1e),Rm(t=>YT(t,e=>e.id).length===t.length,"Credentials must have unique IDs")),pet=NQ(L1e,["id"]),_1e=dv(pet);var t_=Z(Te(),1),pU=(0,t_.createContext)(null);function aC(){let t=(0,t_.use)(pU);if(!t)throw new Error("PasswordManager must be used within a PasswordManagerProvider");return t}function O1e(){let{manager:t}=aC();return fU({queryKey:["credentials"],queryFn:()=>t.getAll()})}function D1e(){let{manager:t,requestEditCredential:e}=aC(),r=bf();return e_({mutationFn:n=>e(n).then(()=>t.update(n)).catch(i=>{if(!kt.test(i))throw i}),onSuccess:()=>{r.invalidateQueries({queryKey:["credentials"]})}})}function N1e(){let{manager:t}=aC(),e=bf();return e_({mutationFn:r=>t.delete(r),onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}var r_=Z(Ge(),1);function F1e(){let{addCredential:t}=aC(),{data:e,isLoading:r}=O1e(),{mutate:n,isPending:i}=D1e(),{mutate:s,isPending:a}=N1e();return r||!e?(0,r_.jsx)(dce,{}):e.length===0?(0,r_.jsx)(uce,{onAdd:t}):e.map(o=>(0,r_.jsx)(lce,{username:o.username,password:o.password,pattern:o.pattern,onEdit:()=>{n(o)},onDelete:()=>{s(o.id)},disabled:i||a},o.id))}var n_=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 B1e=Z(Ge(),1),oC=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,B1e.jsx)(oce,{resolver:_1e,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 Xv=Z(Ge(),1),i_=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 n_(e.mainPs),this.#t=new iU,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=V1e.default.createRoot(n);this.#e=()=>i.unmount(),i.render((0,Xv.jsx)(pU.Provider,{value:{manager:this.#r,requestEditCredential:s=>this.requestEditCredential(s),addCredential:()=>this.addCredential()},children:(0,Xv.jsx)(uU,{client:this.#t,children:(0,Xv.jsx)(Mf,{children:(0,Xv.jsx)(cce,{children:(0,Xv.jsx)(F1e,{})})})})}))}async importCredentials(){try{let e=await n1e({accept:[{description:"Password Export JSON",accept:{"application/json":[".json"]}}]}),r=e.type==="file-handle"?await e.systemHandle.getFile():e.file,n=Ja(M1e,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 Pm?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();i1e(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 oC({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 oC({app:this.app},e).requestInput(),id:e.id}}#n(){this.#t.invalidateQueries({queryKey:["credentials"]})}onClose(){this.#e?.()}};var l_=require("obsidian");var s_=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===ou?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===ou?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===ou?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===ou?null:s))}}};var j1e=()=>window.localStorage.getItem("mx:browser-flag")==="1";var hU=require("obsidian");function $1e(t){var n=[];try{let e=J(n,new DisposableStack);let r=t.settings.optionalString("playback.screenshot.folder-path");new hU.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 hU.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 Fl=require("obsidian");function U1e(t){var n=[];try{let e=J(n,new DisposableStack);let r=t.containerEl.createDiv("auth-section");new Fl.Setting(r).setName("Account").setHeading();Ao()&&e.use(het(t,r));new Fl.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"),Fl.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(!Fl.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 Fl.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 Fl.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 Fl.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 Xd.open(t.service)})})}}catch(l){var c=l,u=!0}finally{ee(o,c,u)}}var lC=require("obsidian");function z1e(t){var r=[];try{let e=J(r,new DisposableStack);new lC.Setting(t.containerEl).setHeading().setName("Embed");new lC.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 lC.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 lC.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 cC=require("obsidian");function q1e(t,{enableBrowser:e}={}){var n=[];try{let r=J(n,new DisposableStack);new cC.Setting(t.containerEl).setHeading().setName("Link");new cC.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 cC.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 cC.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 wf=require("obsidian");function G1e(t){var i=[];try{let e=J(i,new DisposableStack);new wf.Setting(t.containerEl).setName("Link behavior").setHeading().setDesc("Configure how links to media are opened");let r=H1e(t.settings,"link.click-behavior");let n=H1e(t.settings,"link.altclick-behavior");new wf.Setting(t.containerEl).setName("Click").setDesc("Behavior when clicking on a link").addDropdown(l=>l.addOptions(Hn(a_,c=>c.description)).setValue(r.value).onChange(c=>r.set(c)).then(()=>e.use(r.sub(c=>l.setValue(c)))));new wf.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(a_,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 H1e(t,e){let{value:r,set:n,sub:i}=t.create(e);return{value:mU(r),valueRaw:r,set:s=>n(met(s)),sub:s=>i((a,o)=>s(mU(a),o===ou?null:mU(o))),subRaw:s=>i((a,o)=>s(a,o===ou?null:o))}}var a_={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 mU(t){let e=Object.values(a_).find(r=>r.value===t);if(!e)throw new Error(`Unknown pane behavior: ${t}`);return e.key}function met(t){let e=a_[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 wf.Platform.isMacOS?"click holding \u2318+\u2325":"click holding Ctrl+Alt";case"window":return wf.Platform.isMacOS?"click holding \u2318+\u2325+\u21E7":"click holding Ctrl+Alt+Shift";case"tab":return wf.Platform.isMacOS?"click holding \u2318 or middle-click":"click holding Ctrl or middle-click";default:Be(t)}}var gU=require("obsidian");function W1e(t){var r=[];try{let e=J(r,new DisposableStack);new gU.Setting(t.containerEl).setHeading().setName("Media Library");new gU.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 pu=require("obsidian");function uC(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 K1e(t){var d=[];try{let e=J(d,new DisposableStack);let{containerEl:r}=t;new pu.Setting(r).setHeading().setName("Note taking");let n=t.settings.create("note.template.insert-at");new pu.Setting(r).setDesc("Configure where timestamps and screenshots are inserted").setName("Insert location").addDropdown(m=>{let v={"before-cursor":"Latest content on top (Before cursor)","after-cursor":"Latest content at end (After cursor)"};m.addOptions(v).setValue(n.value).onChange(b=>n.set(b)).then(()=>e.use(n.sub(b=>m.setValue(b))))});let i=t.settings.string("note.template.timestamp");new pu.Setting(r).setName("Timestamp template").setDesc("The template used to insert timestamps. Supported placeholders: {{TIMESTAMP}}").addTextArea(m=>{m.setValue(i.value).onChange(i.set),m.inputEl.rows=5,m.inputEl.cols=40,e.use(i.sub(v=>m.setValue(v)))});let s=t.settings.number("note.template.timestamp-offset");let a=t.settings.inputNumber("note.template.timestamp-offset");new pu.Setting(r).setName("Timestamp offset").setDesc("Offset in seconds to add to the timestamp").addSlider(m=>m.setLimits(-10,10,.01).setValue(s.value).setDynamicTooltip().onChange(s.set).then(v=>{e.use(s.sub(b=>v.setValue(b)))})).addText(m=>m.setValue(a.value).onChange(a.set).then(uC(-10,10,.01)).then(v=>{e.use(a.sub(b=>v.setValue(b)))})).then(m=>m.controlEl.appendText("s"));let o=t.settings.string("note.template.timestamp-embed");new pu.Setting(r).setName("Timestamp embed template").setDesc("The template used to insert a media clip embed starting from current timestamp. Supported placeholders: {{CLIP}}").addTextArea(m=>{m.setValue(o.value).onChange(o.set),m.inputEl.rows=5,m.inputEl.cols=40,e.use(o.sub(v=>m.setValue(v)))});let l=t.settings.string("note.template.timestamp-embed-linktext");new pu.Setting(r).setName("Timestamp embed linktext template").setDesc("The template used to create timestamp embed linktext. Supported placeholders: {{TIMESTAMP}}, {{TITLE}}.").addTextArea(m=>{m.setValue(l.value).onChange(l.set),m.inputEl.rows=5,m.inputEl.cols=40,e.use(l.sub(v=>m.setValue(v)))});let c=t.settings.string("note.template.screenshot-embed");new pu.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(m=>{m.setValue(c.value).onChange(c.set),m.inputEl.rows=5,m.inputEl.cols=40,e.use(c.sub(v=>m.setValue(v)))});let u=t.settings.string("note.template.screenshot");new pu.Setting(r).setName("Screenshot template").setDesc("The template used to insert screenshot. Supported placeholders: {{TIMESTAMP}}, {{SCREENSHOT}} (add `!` prefix to insert as image embed).").addTextArea(m=>{m.setValue(u.value).onChange(u.set),m.inputEl.rows=5,m.inputEl.cols=40,e.use(u.sub(v=>m.setValue(v)))});return e.move()}catch(f){var p=f,h=!0}finally{ee(d,p,h)}}var dC=require("obsidian");function Y1e(t){var r=[];try{let e=J(r,new DisposableStack);new dC.Setting(t.containerEl).setHeading().setName("Playback");new dC.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(uC(0,100,1)).then(u=>{e.use(l.sub(d=>u.setValue(d)))}))});new dC.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 dC.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(uC(.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 X1e=require("obsidian");function Q1e(t){var r=[];try{let e=J(r,new DisposableStack);new X1e.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 $o=require("obsidian");function Z1e(t){var r=[];try{let e=J(r,new DisposableStack);new $o.Setting(t.containerEl).setHeading().setName("Text tracks");new $o.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 $o.Notice("Invalid value");return}if(o=o.trim(),!o){r.set([]),new $o.Notice("Languages cleared");return}let l=o.split(`
|
|
`).map(u=>u.trim()),c=l.reduce((u,d,f)=>(hf.test(d)||u.push(`Invalid language code at line ${f+1}: ${d}`),u),[]);if(c.length>0){new $o.Notice(c.join(`
|
|
`));return}r.set(l),new $o.Notice("Languages saved")};let i=new $o.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 $o.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 $o.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 o_=class extends l_.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=j1e();this.settings.loaded.then(()=>{var i=[];try{let r=J(i,new DisposableStack);let n={containerEl:this.containerEl,settings:new s_({settings:this.settings})};r.use(U1e({...n,service:this.auth}));r.use(Y1e(n));r.use(Z1e(n));r.use(z1e(n));r.use(q1e(n,{enableBrowser:e}));r.use(G1e(n));r.use(K1e(n));new l_.Setting(this.containerEl).setHeading().setName("Screenshot");r.use($1e(n));r.use(Q1e(n));r.use(W1e(n));this.#e=r.move()}catch(s){var a=s,o=!0}finally{ee(i,a,o)}})}};function eke(t){let e=iD({injectionMode:Kf.PROXY,strict:!0});return e.register({plugin:Yf(t),app:Yf(t.app),settings:ot(QS),linkHandler:ot(OL),mediaLib:ot(zL),recorderNote:ot(hL),obsidianProtocol:ot(oM),auth:ot(gL),command:ot(XR),menu:ot(aL),mainPs:ot(gS),hashEditor:ot(PL),workspaceOpen:ot(UM),workspaceFind:ot($M),mediaNote:ot(YL),transcriptLoader:ot(xM),template:ot(mM),templateInsertion:ot(hM),fileService:ot(yL),imageCache:ot(ML),trackInfoParser:ot(gM),trackInfoResolver:ot(vM),trackInfoEncoder:ot(bM),metadataParser:ot(U3),metadataUpdater:ot(G3),youTubeApi:ot(oS),textExtractionApi:ot(aS),transcriptSaver:ot(EM),attachement:ot(cL),screenshot:ot(uM),mediaUidMigrator:ot(W3),mediaAttr:ot($L),mediaParser:ot(XL),newRelease:ot(XS),metadataExtractor:ot($3),passwordManagerModal:ji(i_),mediaSwitcherModal:ji(zM),settingTab:ji(o_),store:qT(Xf,{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"),J1e.Platform.isDesktopApp&&e.cradle.mainPs.initialize().catch(r=>{console.error("Failed to initialize main process service",r)}),e}var bet="open-media-switcher";function tke(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 rke(t){let e=Number.parseInt(t,10);return Number.isNaN(e)?-1:e}function nke(t){let e=t?.match(xet)?.groups;if(!e)return null;let r=rke(e.xOnly??e.x??""),n=rke(e.y??"");return[r,n]}function c_(t){let e=t.lastIndexOf("|"),r=null,n=t;return e===-1?(r=nke(t),r&&(n="")):(r=nke(n.substring(e+1)),r&&(n=n.substring(0,e))),{title:n,size:r}}function Qv(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 u_(t,e){e?t.setAttr("alt",e):t.removeAttribute("alt")}var oke=require("@codemirror/state"),Jv=require("@codemirror/view"),eb=require("obsidian");var ake=require("@codemirror/language"),xU=require("@codemirror/view");var ike=t=>!(!t.startsWith("./")&&!t.startsWith("../"))||t.indexOf(":")===-1;var vU=require("@codemirror/view"),bU=require("obsidian");var ske=require("obsidian");var Zv=class extends ske.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 Dl(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 yU=class extends Zv{constructor(e,r,n){super(e,r,n),e.addClasses(["mx-external-media-embed"])}},d_=class t extends vU.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 bU.Platform.isMobile&&(a=s),r.dispatch({selection:{head:s,anchor:a}}),r.focus()}catch{}}},fC=class extends vU.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 bU.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 fa(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 fa(this.media.info,r.media.info)&&this.title===r.title}setDOM(r,n){n.tabIndex=-1,this.applyTitle(n);let i=new yU(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}=c_(this.title);Qv(r,n),u_(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(fC.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,ake.syntaxTree)(e).iterate({from:n,to:i,enter:({type:f,from:p,to:h})=>{let m=FV(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,ike(y))return;let x=o.parseUrl(y);if(!x)return;let w=new fC(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 d_(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(xU.Decoration.widget({widget:f,block:!0,side:-1}).range(v)):r.push(xU.Decoration.widget({widget:f,side:-1}).range(p))}},wU=wet;var ket=(t,e)=>f_(t,e[0])||f_(t,e[1]),f_=(t,e)=>t[0]<e&&t[1]>e,Cet=(t,e)=>{let r=f_(t,e[0])?t[0]:e[0],n=f_(t,e[1])?t[1]:e[1];return[r,n]};function kU(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(eb.editorLivePreviewField))return Jv.Decoration.none;let n=[];return wU(t,r,n),Jv.Decoration.set(n)};return oke.StateField.define({create:e,update:(r,n)=>{let i=r,s=n.startState.field(eb.editorLivePreviewField),a=n.state.field(eb.editorLivePreviewField);if(s!==a)return e(n.state);if(!a)return Jv.Decoration.none;if(!n.docChanged)return i;if(n.state.field(eb.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 kU(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}),wU(t,n.state,l,d,f)}return i.update({add:l,sort:!0})},provide:r=>Jv.EditorView.decorations.from(r)})},lke=Tet;function SU(t){var o=[];try{let{plugin:e,settings:r}=t.cradle;let n=[];e.registerEditorExtension(n);let i=d=>{n.length=0,n.push(lke({deps:t,settings:d}))};r.loaded.then(d=>{i(d),document.body.toggleClass("mx-disable-hosted-embed",!d["note.embed.handle-hosted"])});r.subscribe("note.embed.handle-hosted",(d,f,p)=>{document.body.toggleClass("mx-disable-hosted-embed",!p["note.embed.handle-hosted"])});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"],cke="mxError";function uke(t){if(!t.parentElement)return!1;let e=t.parentElement;return Eet.some(r=>e.classList.contains(r))}function dke(){uke(this)&&(this.dataset[cke]="",this.removeEventListener("load",fke))}function fke(){uke(this)&&(delete this.dataset[cke],this.removeEventListener("error",dke))}function Iet(t){t.register(pr(window,{createEl:e=>function(){let r=e.apply(this,arguments);return r instanceof HTMLImageElement&&(r.addEventListener("error",dke,{once:!0}),r.addEventListener("load",fke,{once:!0})),r}}))}var pke=require("obsidian");var p_=class extends pke.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 Dl(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");Qv(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 TU(t){Aet(t.cradle.plugin,(e,r,n)=>new p_(e,r,n,t)),Pet(t),SU(t)}function Aet(t,e){let{app:r}=t,n=a(eo),i=s(eo,e);t.register(()=>{i(),n()}),I6(r.workspace),t.register(()=>{I6(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 CU=class extends Zv{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}});Qv(d,l.size),u_(d,l.title),c.replaceWith(d);let f=new CU(u,d,t);a.addChild(f)}},-10)}function Ret(t){let e=t.src;if(!e)return null;let r=t.alt,n=c_(r);if(n.size)return{url:e,...n};let i=n.title,s=hke(t.getAttribute("width")),a=hke(t.getAttribute("height"));return s>0||a>0?{url:e,title:i,size:[s,a]}:{url:e,title:i,size:null}}var hke=t=>{let e=Number.parseFloat(t||"-1");return Number.isNaN(e)||e<=0?-1:e};function EU(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 mke(t){let{plugin:e}=t.cradle;EU(e,Yo,r=>new gf(r,t),eo),e.registerView(bs,r=>new yf(r,t)),TU(t)}var gke=require("obsidian");function yke({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,gke.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 vke(t){let{plugin:e}=t.cradle;e.registerView(m0,r=>new Sh(r,t)),e.registerView(_m,r=>new Ch(r,t)),e.registerExtensions(ZT,m0),e.registerEvent(yke(t.cradle))}var h_=class extends bke.Plugin{container=null;loaded=!1;onload(){super.onload(),fm(this).then(()=>sleep(500)).then(()=>{this.loaded=!0}),bT();let e=eke(this);this.container=e,YY(this),mke(e),vke(e),xxe(e),this.addSettingTab(e.cradle.settingTab),tke(e.cradle),ZY(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 */ |