var kx=Object.defineProperty;var Ux=($n,rn,pe)=>rn in $n?kx($n,rn,{enumerable:!0,configurable:!0,writable:!0,value:pe}):$n[rn]=pe;var Ie=($n,rn,pe)=>Ux($n,typeof rn!="symbol"?rn+"":rn,pe);(function(){"use strict";function $n(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var rn={exports:{}},pe={};var af;function Fv(){if(af)return pe;af=1;var r=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),C=Symbol.iterator;function T(E){return E===null||typeof E!="object"?null:(E=C&&E[C]||E["@@iterator"],typeof E=="function"?E:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,B={};function V(E,q,Z){this.props=E,this.context=q,this.refs=B,this.updater=Z||z}V.prototype.isReactComponent={},V.prototype.setState=function(E,q){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,q,"setState")},V.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function G(){}G.prototype=V.prototype;function U(E,q,Z){this.props=E,this.context=q,this.refs=B,this.updater=Z||z}var j=U.prototype=new G;j.constructor=U,M(j,V.prototype),j.isPureReactComponent=!0;var $=Array.isArray;function k(){}var L={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function W(E,q,Z){var I=Z.ref;return{$$typeof:r,type:E,key:q,ref:I!==void 0?I:null,props:Z}}function ee(E,q){return W(E.type,q,E.props)}function ue(E){return typeof E=="object"&&E!==null&&E.$$typeof===r}function ie(E){var q={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(Z){return q[Z]})}var de=/\/+/g;function ve(E,q){return typeof E=="object"&&E!==null&&E.key!=null?ie(""+E.key):q.toString(36)}function ge(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(k,k):(E.status="pending",E.then(function(q){E.status==="pending"&&(E.status="fulfilled",E.value=q)},function(q){E.status==="pending"&&(E.status="rejected",E.reason=q)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function R(E,q,Z,I,P){var le=typeof E;(le==="undefined"||le==="boolean")&&(E=null);var ae=!1;if(E===null)ae=!0;else switch(le){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(E.$$typeof){case r:case l:ae=!0;break;case x:return ae=E._init,R(ae(E._payload),q,Z,I,P)}}if(ae)return P=P(E),ae=I===""?"."+ve(E,0):I,$(P)?(Z="",ae!=null&&(Z=ae.replace(de,"$&/")+"/"),R(P,q,Z,"",function(Ge){return Ge})):P!=null&&(ue(P)&&(P=ee(P,Z+(P.key==null||E&&E.key===P.key?"":(""+P.key).replace(de,"$&/")+"/")+ae)),q.push(P)),1;ae=0;var Re=I===""?".":I+":";if($(E))for(var Ae=0;Ae>>1,he=R[te];if(0>>1;ted(Z,K))Id(P,Z)?(R[te]=P,R[I]=K,te=I):(R[te]=Z,R[q]=K,te=q);else if(Id(P,K))R[te]=P,R[I]=K,te=I;else break e}}return F}function d(R,F){var K=R.sortIndex-F.sortIndex;return K!==0?K:R.id-F.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;r.unstable_now=function(){return m.now()}}else{var g=Date,y=g.now();r.unstable_now=function(){return g.now()-y}}var p=[],h=[],x=1,w=null,C=3,T=!1,z=!1,M=!1,B=!1,V=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function j(R){for(var F=u(h);F!==null;){if(F.callback===null)s(h);else if(F.startTime<=R)s(h),F.sortIndex=F.expirationTime,l(p,F);else break;F=u(h)}}function $(R){if(M=!1,j(R),!z)if(u(p)!==null)z=!0,k||(k=!0,ie());else{var F=u(h);F!==null&&ge($,F.startTime-R)}}var k=!1,L=-1,J=5,W=-1;function ee(){return B?!0:!(r.unstable_now()-WR&&ee());){var te=w.callback;if(typeof te=="function"){w.callback=null,C=w.priorityLevel;var he=te(w.expirationTime<=R);if(R=r.unstable_now(),typeof he=="function"){w.callback=he,j(R),F=!0;break t}w===u(p)&&s(p),j(R)}else s(p);w=u(p)}if(w!==null)F=!0;else{var E=u(h);E!==null&&ge($,E.startTime-R),F=!1}}break e}finally{w=null,C=K,T=!1}F=void 0}}finally{F?ie():k=!1}}}var ie;if(typeof U=="function")ie=function(){U(ue)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,ve=de.port2;de.port1.onmessage=ue,ie=function(){ve.postMessage(null)}}else ie=function(){V(ue,0)};function ge(R,F){L=V(function(){R(r.unstable_now())},F)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(R){R.callback=null},r.unstable_forceFrameRate=function(R){0>R||125te?(R.sortIndex=K,l(h,R),u(p)===null&&R===u(h)&&(M?(G(L),L=-1):M=!0,ge($,K-te))):(R.sortIndex=he,l(p,R),z||T||(z=!0,k||(k=!0,ie()))),R},r.unstable_shouldYield=ee,r.unstable_wrapCallback=function(R){var F=C;return function(){var K=C;C=F;try{return R.apply(this,arguments)}finally{C=K}}}})($o)),$o}var of;function $v(){return of||(of=1,Yo.exports=Yv()),Yo.exports}var Go={exports:{}},pt={};var uf;function Gv(){if(uf)return pt;uf=1;var r=qo();function l(p){var h="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(l){console.error(l)}}return r(),Go.exports=Gv(),Go.exports}var ff;function Qv(){if(ff)return Zr;ff=1;var r=$v(),l=qo(),u=cf();function s(e){var t="https://react.dev/errors/"+e;if(1he||(e.current=te[he],te[he]=null,he--)}function Z(e,t){he++,te[he]=e.current,e.current=t}var I=E(null),P=E(null),le=E(null),ae=E(null);function Re(e,t){switch(Z(le,t),Z(P,e),Z(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fv(t),e=dv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(I),Z(I,e)}function Ae(){q(I),q(P),q(le)}function Ge(e){e.memoizedState!==null&&Z(ae,e);var t=I.current,n=dv(t,e.type);t!==n&&(Z(P,e),Z(I,n))}function nt(e){P.current===e&&(q(I),q(P)),ae.current===e&&(q(ae),Zi._currentValue=K)}var $t,Ot;function Et(e){if($t===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);$t=t&&t[1]||"",Ot=-1)":-1i||S[a]!==D[i]){var Y=` `+S[a].replace(" at new "," at ");return e.displayName&&Y.includes("")&&(Y=Y.replace("",e.displayName)),Y}while(1<=a&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Et(n):""}function on(e,t){switch(e.tag){case 26:case 27:case 5:return Et(e.type);case 16:return Et("Lazy");case 13:return e.child!==t&&t!==null?Et("Suspense Fallback"):Et("Suspense");case 19:return Et("SuspenseList");case 0:case 15:return se(e.type,!1);case 11:return se(e.type.render,!1);case 1:return se(e.type,!0);case 31:return Et("Activity");default:return""}}function mn(e){try{var t="",n=null;do t+=on(e,n),n=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var jt=Object.prototype.hasOwnProperty,Gt=r.unstable_scheduleCallback,Sn=r.unstable_cancelCallback,Qt=r.unstable_shouldYield,Ct=r.unstable_requestPaint,lt=r.unstable_now,hn=r.unstable_getCurrentPriorityLevel,En=r.unstable_ImmediatePriority,Kn=r.unstable_UserBlockingPriority,Xt=r.unstable_NormalPriority,Cn=r.unstable_LowPriority,un=r.unstable_IdlePriority,Jn=r.log,El=r.unstable_setDisableYieldValue,Tt=null,ct=null;function pn(e){if(typeof Jn=="function"&&El(e),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(Tt,e)}catch{}}var bt=Math.clz32?Math.clz32:$u,Cl=Math.log,Yu=Math.LN2;function $u(e){return e>>>=0,e===0?32:31-(Cl(e)/Yu|0)|0}var lr=256,or=262144,ur=4194304;function Tn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function sr(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var i=0,o=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var v=a&134217727;return v!==0?(a=v&~o,a!==0?i=Tn(a):(c&=v,c!==0?i=Tn(c):n||(n=v&~e,n!==0&&(i=Tn(n))))):(v=a&~o,v!==0?i=Tn(v):c!==0?i=Tn(c):n||(n=a&~e,n!==0&&(i=Tn(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function vn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function cr(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Tl(){var e=ur;return ur<<=1,(ur&62914560)===0&&(ur=4194304),e}function li(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Al(e,t,n,a,i,o){var c=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var v=e.entanglements,S=e.expirationTimes,D=e.hiddenUpdates;for(n=c&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var zw=/[\n"\\]/g;function Kt(e){return e.replace(zw,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Iu(e,t,n,a,i,o,c,v){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Wu(e,c,Zt(t)):n!=null?Wu(e,c,Zt(n)):a!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Zt(v):e.removeAttribute("name")}function im(e,t,n,a,i,o,c,v){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Ju(e);return}n=n!=null?""+Zt(n):"",t=t!=null?""+Zt(t):n,v||t===e.value||(e.value=t),e.defaultValue=t}a=a??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=v?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Ju(e)}function Wu(e,t,n){t==="number"&&zl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function pr(e,t,n,a){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),as=!1;if(Rn)try{var di={};Object.defineProperty(di,"passive",{get:function(){as=!0}}),window.addEventListener("test",di,di),window.removeEventListener("test",di,di)}catch{as=!1}var In=null,rs=null,Dl=null;function dm(){if(Dl)return Dl;var e,t=rs,n=t.length,a,i="value"in In?In.value:In.textContent,o=i.length;for(e=0;e=pi),ym=" ",bm=!1;function wm(e,t){switch(e){case"keyup":return r1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var br=!1;function l1(e,t){switch(e){case"compositionend":return xm(t);case"keypress":return t.which!==32?null:(bm=!0,ym);case"textInput":return e=t.data,e===ym&&bm?null:e;default:return null}}function o1(e,t){if(br)return e==="compositionend"||!ss&&wm(e,t)?(e=dm(),Dl=rs=In=null,br=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_m(n)}}function Nm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=zl(e.document)}return t}function ds(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var p1=Rn&&"documentMode"in document&&11>=document.documentMode,wr=null,ms=null,bi=null,hs=!1;function Om(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;hs||wr==null||wr!==zl(a)||(a=wr,"selectionStart"in a&&ds(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),bi&&yi(bi,a)||(bi=a,a=Ao(ms,"onSelect"),0>=c,i-=c,yn=1<<32-bt(t)+i|n<we?(Te=re,re=null):Te=re.sibling;var Ne=O(_,re,N[we],Q);if(Ne===null){re===null&&(re=Te);break}e&&re&&Ne.alternate===null&&t(_,re),A=o(Ne,A,we),ze===null?ce=Ne:ze.sibling=Ne,ze=Ne,re=Te}if(we===N.length)return n(_,re),Me&&zn(_,we),ce;if(re===null){for(;wewe?(Te=re,re=null):Te=re.sibling;var ba=O(_,re,Ne.value,Q);if(ba===null){re===null&&(re=Te);break}e&&re&&ba.alternate===null&&t(_,re),A=o(ba,A,we),ze===null?ce=ba:ze.sibling=ba,ze=ba,re=Te}if(Ne.done)return n(_,re),Me&&zn(_,we),ce;if(re===null){for(;!Ne.done;we++,Ne=N.next())Ne=X(_,Ne.value,Q),Ne!==null&&(A=o(Ne,A,we),ze===null?ce=Ne:ze.sibling=Ne,ze=Ne);return Me&&zn(_,we),ce}for(re=a(re);!Ne.done;we++,Ne=N.next())Ne=H(re,_,we,Ne.value,Q),Ne!==null&&(e&&Ne.alternate!==null&&re.delete(Ne.key===null?we:Ne.key),A=o(Ne,A,we),ze===null?ce=Ne:ze.sibling=Ne,ze=Ne);return e&&re.forEach(function(Vx){return t(_,Vx)}),Me&&zn(_,we),ce}function He(_,A,N,Q){if(typeof N=="object"&&N!==null&&N.type===M&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case T:e:{for(var ce=N.key;A!==null;){if(A.key===ce){if(ce=N.type,ce===M){if(A.tag===7){n(_,A.sibling),Q=i(A,N.props.children),Q.return=_,_=Q;break e}}else if(A.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===J&&Ha(ce)===A.type){n(_,A.sibling),Q=i(A,N.props),Ti(Q,N),Q.return=_,_=Q;break e}n(_,A);break}else t(_,A);A=A.sibling}N.type===M?(Q=ja(N.props.children,_.mode,Q,N.key),Q.return=_,_=Q):(Q=Fl(N.type,N.key,N.props,null,_.mode,Q),Ti(Q,N),Q.return=_,_=Q)}return c(_);case z:e:{for(ce=N.key;A!==null;){if(A.key===ce)if(A.tag===4&&A.stateNode.containerInfo===N.containerInfo&&A.stateNode.implementation===N.implementation){n(_,A.sibling),Q=i(A,N.children||[]),Q.return=_,_=Q;break e}else{n(_,A);break}else t(_,A);A=A.sibling}Q=xs(N,_.mode,Q),Q.return=_,_=Q}return c(_);case J:return N=Ha(N),He(_,A,N,Q)}if(ge(N))return ne(_,A,N,Q);if(ie(N)){if(ce=ie(N),typeof ce!="function")throw Error(s(150));return N=ce.call(N),me(_,A,N,Q)}if(typeof N.then=="function")return He(_,A,Kl(N),Q);if(N.$$typeof===U)return He(_,A,Gl(_,N),Q);Jl(_,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,A!==null&&A.tag===6?(n(_,A.sibling),Q=i(A,N),Q.return=_,_=Q):(n(_,A),Q=ws(N,_.mode,Q),Q.return=_,_=Q),c(_)):n(_,A)}return function(_,A,N,Q){try{Ci=0;var ce=He(_,A,N,Q);return Nr=null,ce}catch(re){if(re===zr||re===Xl)throw re;var ze=kt(29,re,null,_.mode);return ze.lanes=Q,ze.return=_,ze}}}var qa=nh(!0),ah=nh(!1),na=!1;function Os(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function js(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ra(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Oe&2)!==0){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,t=ql(e),Lm(e,null,n),t}return Ll(e,a,t,n),ql(e)}function Ai(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Qu(e,n)}}function Vs(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var c={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=c:o=o.next=c,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ks=!1;function Mi(){if(ks){var e=_r;if(e!==null)throw e}}function Ri(e,t,n,a){ks=!1;var i=e.updateQueue;na=!1;var o=i.firstBaseUpdate,c=i.lastBaseUpdate,v=i.shared.pending;if(v!==null){i.shared.pending=null;var S=v,D=S.next;S.next=null,c===null?o=D:c.next=D,c=S;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,v=Y.lastBaseUpdate,v!==c&&(v===null?Y.firstBaseUpdate=D:v.next=D,Y.lastBaseUpdate=S))}if(o!==null){var X=i.baseState;c=0,Y=D=S=null,v=o;do{var O=v.lane&-536870913,H=O!==v.lane;if(H?(Ce&O)===O:(a&O)===O){O!==0&&O===Rr&&(ks=!0),Y!==null&&(Y=Y.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var ne=e,me=v;O=t;var He=n;switch(me.tag){case 1:if(ne=me.payload,typeof ne=="function"){X=ne.call(He,X,O);break e}X=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=me.payload,O=typeof ne=="function"?ne.call(He,X,O):ne,O==null)break e;X=w({},X,O);break e;case 2:na=!0}}O=v.callback,O!==null&&(e.flags|=64,H&&(e.flags|=8192),H=i.callbacks,H===null?i.callbacks=[O]:H.push(O))}else H={lane:O,tag:v.tag,payload:v.payload,callback:v.callback,next:null},Y===null?(D=Y=H,S=X):Y=Y.next=H,c|=O;if(v=v.next,v===null){if(v=i.shared.pending,v===null)break;H=v,v=H.next,H.next=null,i.lastBaseUpdate=H,i.shared.pending=null}}while(!0);Y===null&&(S=X),i.baseState=S,i.firstBaseUpdate=D,i.lastBaseUpdate=Y,o===null&&(i.shared.lanes=0),sa|=c,e.lanes=c,e.memoizedState=X}}function rh(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function ih(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eo?o:8;var c=R.T,v={};R.T=v,tc(e,!1,t,n);try{var S=i(),D=R.S;if(D!==null&&D(v,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var Y=C1(S,a);Ni(e,t,Y,qt(e))}else Ni(e,t,a,qt(e))}catch(X){Ni(e,t,{then:function(){},status:"rejected",reason:X},qt())}finally{F.p=o,c!==null&&v.types!==null&&(c.types=v.types),R.T=c}}function z1(){}function Ps(e,t,n,a){if(e.tag!==5)throw Error(s(476));var i=Uh(e).queue;kh(e,i,t,K,n===null?z1:function(){return Bh(e),n(a)})}function Uh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:K},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bh(e){var t=Uh(e);t.next===null&&(t=e.alternate.memoizedState),Ni(e,t.next.queue,{},qt())}function ec(){return dt(Zi)}function Hh(){return Je().memoizedState}function Lh(){return Je().memoizedState}function N1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=qt();e=aa(n);var a=ra(t,e,n);a!==null&&(Nt(a,t,n),Ai(a,t,n)),t={cache:_s()},e.payload=t;return}t=t.return}}function D1(e,t,n){var a=qt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lo(e)?Fh(t,n):(n=ys(e,t,n,a),n!==null&&(Nt(n,e,a),Yh(n,t,a)))}function qh(e,t,n){var a=qt();Ni(e,t,n,a)}function Ni(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lo(e))Fh(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var c=t.lastRenderedState,v=o(c,n);if(i.hasEagerState=!0,i.eagerState=v,Vt(v,c))return Ll(e,t,i,0),Le===null&&Hl(),!1}catch{}if(n=ys(e,t,i,a),n!==null)return Nt(n,e,a),Yh(n,t,a),!0}return!1}function tc(e,t,n,a){if(a={lane:2,revertLane:Oc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},lo(e)){if(t)throw Error(s(479))}else t=ys(e,n,a,2),t!==null&&Nt(t,e,2)}function lo(e){var t=e.alternate;return e===be||t!==null&&t===be}function Fh(e,t){Or=Pl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yh(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Qu(e,n)}}var Di={readContext:dt,use:no,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};Di.useEffectEvent=Qe;var $h={readContext:dt,use:no,useCallback:function(e,t){return xt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:Mh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ro(4194308,4,Nh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){ro(4,2,e,t)},useMemo:function(e,t){var n=xt();t=t===void 0?null:t;var a=e();if(Fa){pn(!0);try{e()}finally{pn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=xt();if(n!==void 0){var i=n(t);if(Fa){pn(!0);try{n(t)}finally{pn(!1)}}}else i=t;return a.memoizedState=a.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},a.queue=e,e=e.dispatch=D1.bind(null,be,e),[a.memoizedState,e]},useRef:function(e){var t=xt();return e={current:e},t.memoizedState=e},useState:function(e){e=Zs(e);var t=e.queue,n=qh.bind(null,be,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Is,useDeferredValue:function(e,t){var n=xt();return Ws(n,e,t)},useTransition:function(){var e=Zs(!1);return e=kh.bind(null,be,e.queue,!0,!1),xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=be,i=xt();if(Me){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Le===null)throw Error(s(349));(Ce&127)!==0||fh(a,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Mh(mh.bind(null,a,o,e),[e]),a.flags|=2048,Vr(9,{destroy:void 0},dh.bind(null,a,o,n,t),null),n},useId:function(){var e=xt(),t=Le.identifierPrefix;if(Me){var n=bn,a=yn;n=(a&~(1<<32-bt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=eo++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is=="string"?c.createElement(i,{is:a.is}):c.createElement(i)}}o[je]=t,o[Ze]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)o.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=o;e:switch(ht(o,i,a),i){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&kn(t)}}return Fe(t),pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&kn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(s(166));if(e=le.current,Ar(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,i=ft,i!==null)switch(i.tag){case 27:case 5:a=i.memoizedProps}e[je]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||sv(e.nodeValue,n)),e||ea(t,!0)}else e=Mo(e).createTextNode(a),e[je]=t,t.stateNode=e}return Fe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ar(t),n!==null){if(e===null){if(!a)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[je]=t}else Va(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),e=!1}else n=Ts(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Bt(t),t):(Bt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Fe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ar(t),a!==null&&a.dehydrated!==null){if(e===null){if(!i)throw Error(s(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));i[je]=t}else Va(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),i=!1}else i=Ts(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Bt(t),t):(Bt(t),null)}return Bt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,i=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(i=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==i&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fo(t,t.updateQueue),Fe(t),null);case 4:return Ae(),e===null&&Uc(t.stateNode.containerInfo),Fe(t),null;case 10:return Dn(t.type),Fe(t),null;case 19:if(q(Ke),a=t.memoizedState,a===null)return Fe(t),null;if(i=(t.flags&128)!==0,o=a.rendering,o===null)if(i)ji(a,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Wl(e),o!==null){for(t.flags|=128,ji(a,!1),e=o.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)qm(n,e),n=n.sibling;return Z(Ke,Ke.current&1|2),Me&&zn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&<()>go&&(t.flags|=128,i=!0,ji(a,!1),t.lanes=4194304)}else{if(!i)if(e=Wl(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),ji(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Me)return Fe(t),null}else 2*lt()-a.renderingStartTime>go&&n!==536870912&&(t.flags|=128,i=!0,ji(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=lt(),e.sibling=null,n=Ke.current,Z(Ke,i?n&1|2:n&1),Me&&zn(t,a.treeForkCount),e):(Fe(t),null);case 22:case 23:return Bt(t),Bs(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),n=t.updateQueue,n!==null&&fo(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&q(Ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Dn(We),Fe(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function U1(e,t){switch(Es(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dn(We),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return nt(t),null;case 31:if(t.memoizedState!==null){if(Bt(t),t.alternate===null)throw Error(s(340));Va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ke),null;case 4:return Ae(),null;case 10:return Dn(t.type),null;case 22:case 23:return Bt(t),Bs(),e!==null&&q(Ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dn(We),null;case 25:return null;default:return null}}function hp(e,t){switch(Es(t),t.tag){case 3:Dn(We),Ae();break;case 26:case 27:case 5:nt(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Bt(t);break;case 13:Bt(t);break;case 19:q(Ke);break;case 10:Dn(t.type);break;case 22:case 23:Bt(t),Bs(),e!==null&&q(Ba);break;case 24:Dn(We)}}function Vi(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){a=void 0;var o=n.create,c=n.inst;a=o(),c.destroy=a}n=n.next}while(n!==i)}}catch(v){ke(t,t.return,v)}}function oa(e,t,n){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var o=i.next;a=o;do{if((a.tag&e)===e){var c=a.inst,v=c.destroy;if(v!==void 0){c.destroy=void 0,i=t;var S=n,D=v;try{D()}catch(Y){ke(i,S,Y)}}}a=a.next}while(a!==o)}}catch(Y){ke(t,t.return,Y)}}function pp(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ih(t,n)}catch(a){ke(e,e.return,a)}}}function vp(e,t,n){n.props=Ya(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){ke(e,t,a)}}function ki(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(i){ke(e,t,i)}}function wn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){ke(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){ke(e,t,i)}else n.current=null}function gp(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(i){ke(e,e.return,i)}}function vc(e,t,n){try{var a=e.stateNode;ix(a,e.type,n,t),a[Ze]=t}catch(i){ke(e,e.return,i)}}function yp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ha(e.type)||e.tag===4}function gc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ha(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yc(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Mn));else if(a!==4&&(a===27&&ha(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(yc(e,t,n),e=e.sibling;e!==null;)yc(e,t,n),e=e.sibling}function mo(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&ha(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(mo(e,t,n),e=e.sibling;e!==null;)mo(e,t,n),e=e.sibling}function bp(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ht(t,a,n),t[je]=e,t[Ze]=n}catch(o){ke(e,e.return,o)}}var Un=!1,tt=!1,bc=!1,wp=typeof WeakSet=="function"?WeakSet:Set,ut=null;function B1(e,t){if(e=e.containerInfo,Lc=jo,e=Dm(e),ds(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var i=a.anchorOffset,o=a.focusNode;a=a.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var c=0,v=-1,S=-1,D=0,Y=0,X=e,O=null;t:for(;;){for(var H;X!==n||i!==0&&X.nodeType!==3||(v=c+i),X!==o||a!==0&&X.nodeType!==3||(S=c+a),X.nodeType===3&&(c+=X.nodeValue.length),(H=X.firstChild)!==null;)O=X,X=H;for(;;){if(X===e)break t;if(O===n&&++D===i&&(v=c),O===o&&++Y===a&&(S=c),(H=X.nextSibling)!==null)break;X=O,O=X.parentNode}X=H}n=v===-1||S===-1?null:{start:v,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(qc={focusedElem:e,selectionRange:n},jo=!1,ut=t;ut!==null;)if(t=ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ut=e;else for(;ut!==null;){switch(t=ut,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),ht(o,a,n),o[je]=e,ot(o),a=o;break e;case"link":var c=Av("link","href",i).get(a+(n.href||""));if(c){for(var v=0;vHe&&(c=He,He=me,me=c);var _=zm(v,me),A=zm(v,He);if(_&&A&&(H.rangeCount!==1||H.anchorNode!==_.node||H.anchorOffset!==_.offset||H.focusNode!==A.node||H.focusOffset!==A.offset)){var N=X.createRange();N.setStart(_.node,_.offset),H.removeAllRanges(),me>He?(H.addRange(N),H.extend(A.node,A.offset)):(N.setEnd(A.node,A.offset),H.addRange(N))}}}}for(X=[],H=v;H=H.parentNode;)H.nodeType===1&&X.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;vn?32:n,R.T=null,n=Ac,Ac=null;var o=fa,c=Fn;if(at=0,Lr=fa=null,Fn=0,(Oe&6)!==0)throw Error(s(331));var v=Oe;if(Oe|=4,Np(o.current),Rp(o,o.current,c,n),Oe=v,Fi(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(Tt,o)}catch{}return!0}finally{F.p=i,R.T=a,Kp(e,t)}}function Ip(e,t,n){t=It(n,t),t=ic(e.stateNode,t,2),e=ra(e,t,2),e!==null&&(gn(e,2),xn(e))}function ke(e,t,n){if(e.tag===3)Ip(e,e,n);else for(;t!==null;){if(t.tag===3){Ip(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ca===null||!ca.has(a))){e=It(n,e),n=Wh(2),a=ra(t,n,2),a!==null&&(Ph(n,a,t,e),gn(a,2),xn(a));break}}t=t.return}}function zc(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new q1;var i=new Set;a.set(t,i)}else i=a.get(t),i===void 0&&(i=new Set,a.set(t,i));i.has(n)||(Sc=!0,i.add(n),e=Q1.bind(null,e,t,n),t.then(e,e))}function Q1(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Le===e&&(Ce&n)===n&&(Xe===4||Xe===3&&(Ce&62914560)===Ce&&300>lt()-vo?(Oe&2)===0&&qr(e,0):Ec|=n,Hr===Ce&&(Hr=0)),xn(e)}function Wp(e,t){t===0&&(t=Tl()),e=Oa(e,t),e!==null&&(gn(e,t),xn(e))}function X1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wp(e,n)}function Z1(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(s(314))}a!==null&&a.delete(t),Wp(e,n)}function K1(e,t){return Gt(e,t)}var Eo=null,Yr=null,Nc=!1,Co=!1,Dc=!1,ma=0;function xn(e){e!==Yr&&e.next===null&&(Yr===null?Eo=Yr=e:Yr=Yr.next=e),Co=!0,Nc||(Nc=!0,I1())}function Fi(e,t){if(!Dc&&Co){Dc=!0;do for(var n=!1,a=Eo;a!==null;){if(e!==0){var i=a.pendingLanes;if(i===0)var o=0;else{var c=a.suspendedLanes,v=a.pingedLanes;o=(1<<31-bt(42|e)+1)-1,o&=i&~(c&~v),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,nv(a,o))}else o=Ce,o=sr(a,a===Le?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||vn(a,o)||(n=!0,nv(a,o));a=a.next}while(n);Dc=!1}}function J1(){Pp()}function Pp(){Co=Nc=!1;var e=0;ma!==0&&ox()&&(e=ma);for(var t=lt(),n=null,a=Eo;a!==null;){var i=a.next,o=ev(a,t);o===0?(a.next=null,n===null?Eo=i:n.next=i,i===null&&(Yr=n)):(n=a,(e!==0||(o&3)!==0)&&(Co=!0)),a=i}at!==0&&at!==5||Fi(e),ma!==0&&(ma=0)}function ev(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0v)break;var Y=S.transferSize,X=S.initiatorType;Y&&cv(X)&&(S=S.responseEnd,c+=Y*(S"u"?null:document;function Sv(e,t,n){var a=$r;if(a&&typeof t=="string"&&t){var i=Kt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),xv.has(i)||(xv.add(i),e={rel:e,crossOrigin:n,href:t},a.querySelector(i)===null&&(t=a.createElement("link"),ht(t,"link",e),ot(t),a.head.appendChild(t)))}}function vx(e){Yn.D(e),Sv("dns-prefetch",e,null)}function gx(e,t){Yn.C(e,t),Sv("preconnect",e,t)}function yx(e,t,n){Yn.L(e,t,n);var a=$r;if(a&&e&&t){var i='link[rel="preload"][as="'+Kt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Kt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Kt(n.imageSizes)+'"]')):i+='[href="'+Kt(e)+'"]';var o=i;switch(t){case"style":o=Gr(e);break;case"script":o=Qr(e)}an.has(o)||(e=w({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),an.set(o,e),a.querySelector(i)!==null||t==="style"&&a.querySelector(Qi(o))||t==="script"&&a.querySelector(Xi(o))||(t=a.createElement("link"),ht(t,"link",e),ot(t),a.head.appendChild(t)))}}function bx(e,t){Yn.m(e,t);var n=$r;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Kt(a)+'"][href="'+Kt(e)+'"]',o=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Qr(e)}if(!an.has(o)&&(e=w({rel:"modulepreload",href:e},t),an.set(o,e),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Xi(o)))return}a=n.createElement("link"),ht(a,"link",e),ot(a),n.head.appendChild(a)}}}function wx(e,t,n){Yn.S(e,t,n);var a=$r;if(a&&e){var i=mr(a).hoistableStyles,o=Gr(e);t=t||"default";var c=i.get(o);if(!c){var v={loading:0,preload:null};if(c=a.querySelector(Qi(o)))v.loading=5;else{e=w({rel:"stylesheet",href:e,"data-precedence":t},n),(n=an.get(o))&&Zc(e,n);var S=c=a.createElement("link");ot(S),ht(S,"link",e),S._p=new Promise(function(D,Y){S.onload=D,S.onerror=Y}),S.addEventListener("load",function(){v.loading|=1}),S.addEventListener("error",function(){v.loading|=2}),v.loading|=4,_o(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:v},i.set(o,c)}}}function xx(e,t){Yn.X(e,t);var n=$r;if(n&&e){var a=mr(n).hoistableScripts,i=Qr(e),o=a.get(i);o||(o=n.querySelector(Xi(i)),o||(e=w({src:e,async:!0},t),(t=an.get(i))&&Kc(e,t),o=n.createElement("script"),ot(o),ht(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(i,o))}}function Sx(e,t){Yn.M(e,t);var n=$r;if(n&&e){var a=mr(n).hoistableScripts,i=Qr(e),o=a.get(i);o||(o=n.querySelector(Xi(i)),o||(e=w({src:e,async:!0,type:"module"},t),(t=an.get(i))&&Kc(e,t),o=n.createElement("script"),ot(o),ht(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(i,o))}}function Ev(e,t,n,a){var i=(i=le.current)?Ro(i):null;if(!i)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Gr(n.href),n=mr(i).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Gr(n.href);var o=mr(i).hoistableStyles,c=o.get(e);if(c||(i=i.ownerDocument||i,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,c),(o=i.querySelector(Qi(e)))&&!o._p&&(c.instance=o,c.state.loading=5),an.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},an.set(e,n),o||Ex(i,e,n,c.state))),t&&a===null)throw Error(s(528,""));return c}if(t&&a!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qr(n),n=mr(i).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Gr(e){return'href="'+Kt(e)+'"'}function Qi(e){return'link[rel="stylesheet"]['+e+"]"}function Cv(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Ex(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ht(t,"link",n),ot(t),e.head.appendChild(t))}function Qr(e){return'[src="'+Kt(e)+'"]'}function Xi(e){return"script[async]"+e}function Tv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Kt(n.href)+'"]');if(a)return t.instance=a,ot(a),a;var i=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ot(a),ht(a,"style",i),_o(a,n.precedence,e),t.instance=a;case"stylesheet":i=Gr(n.href);var o=e.querySelector(Qi(i));if(o)return t.state.loading|=4,t.instance=o,ot(o),o;a=Cv(n),(i=an.get(i))&&Zc(a,i),o=(e.ownerDocument||e).createElement("link"),ot(o);var c=o;return c._p=new Promise(function(v,S){c.onload=v,c.onerror=S}),ht(o,"link",a),t.state.loading|=4,_o(o,n.precedence,e),t.instance=o;case"script":return o=Qr(n.src),(i=e.querySelector(Xi(o)))?(t.instance=i,ot(i),i):(a=n,(i=an.get(o))&&(a=w({},n),Kc(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),ot(i),ht(i,"link",a),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,_o(a,n.precedence,e));return t.instance}function _o(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=a.length?a[a.length-1]:null,o=i,c=0;c title"):null)}function Cx(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Rv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tx(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Gr(a.href),o=t.querySelector(Qi(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=No.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,ot(o);return}o=t.ownerDocument||t,a=Cv(a),(i=an.get(i))&&Zc(a,i),o=o.createElement("link"),ot(o);var c=o;c._p=new Promise(function(v,S){c.onload=v,c.onerror=S}),ht(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=No.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Jc=0;function Ax(e,t){return e.stylesheets&&e.count===0&&Oo(e,e.stylesheets),0Jc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}:null}function No(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Oo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Do=null;function Oo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Do=new Map,t.forEach(Mx,e),Do=null,No.call(e))}function Mx(e,t){if(!(t.state.loading&4)){var n=Do.get(e);if(n)var a=n.get(null);else{n=new Map,Do.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(l){console.error(l)}}return r(),Fo.exports=Qv(),Fo.exports}var Zv=Xv(),Qo={exports:{}},Kr={};var mf;function Kv(){if(mf)return Kr;mf=1;var r=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function u(s,d,m){var g=null;if(m!==void 0&&(g=""+m),d.key!==void 0&&(g=""+d.key),"key"in d){m={};for(var y in d)y!=="key"&&(m[y]=d[y])}else m=d;return d=m.ref,{$$typeof:r,type:s,key:g,ref:d!==void 0?d:null,props:m}}return Kr.Fragment=l,Kr.jsx=u,Kr.jsxs=u,Kr}var hf;function Jv(){return hf||(hf=1,Qo.exports=Kv()),Qo.exports}var b=Jv();const pf=$n(b);var vf=cf(),Iv=Object.defineProperty,gf=(r,l)=>{for(var u in l)Iv(r,u,{get:l[u],enumerable:!0,configurable:!0,set:s=>l[u]=()=>s})};if(typeof f.createContext!="function"){const r=['Remotion requires React.createContext, but it is "undefined".','If you are in a React Server Component, turn it into a client component by adding "use client" at the top of the file.',"","Before:",' import {useCurrentFrame} from "remotion";',"","After:",' "use client";',' import {useCurrentFrame} from "remotion";'];throw new Error(r.join(` `))}function yf(){return["NOD","E_EN","V"].join("")}var bf=()=>["e","nv"].join(""),ln=()=>{const r=typeof window<"u"&&window.remotion_isPlayer,l=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[bf()][yf()]==="test"||window.process[bf()][yf()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u"),u=typeof window<"u"&&window.remotion_isStudio,s=typeof window<"u"&&window.remotion_isReadOnlyStudio;return{isStudio:u,isRendering:l,isPlayer:r,isReadOnlyStudio:s,isClientSideRendering:!1}},Wv=ye.createElement,Pv=pf.jsx,wf=[],xf=r=>new Proxy(r,{apply(l,u,s){if(wf.includes(s[0])){const[d,m,...g]=s,y=m.stack?m:{...m??{},stack:new Error().stack};return Reflect.apply(l,u,[d,y,...g])}return Reflect.apply(l,u,s)}}),Sf=()=>{ln().isStudio&&(ye.createElement=xf(Wv),pf.jsx=xf(Pv))},Qa=r=>{wf.push(r),Sf()},Ef=f.createContext(!1),eg=({children:r})=>b.jsx(Ef.Provider,{value:!0,children:r}),Xo=()=>f.useContext(Ef);function Jr(r){return!!r}var Ir="4.0.427",tg=()=>{if(typeof globalThis>"u")return;const r=()=>{globalThis.remotion_imported=Ir,typeof window<"u"&&(window.remotion_imported=Ir)},l=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(l){if(l===Ir)return;if(typeof l=="string"&&l.includes("webcodecs")){r();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[Ir,typeof l=="string"?l:"an older version"].filter(Jr).join(" and ")}. This will cause things to break in an unexpected way. Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`)}r()},Gn=({className:r,classPrefix:l,type:u})=>{if(!r)return!1;if(u==="exact"){const s=r.split(" ");return l.some(d=>s.some(m=>m.trim()===d||m.trim().endsWith(`:${d}`)||m.trim().endsWith(`!${d}`)))}return l.some(s=>r.startsWith(s)||r.includes(` ${s}`)||r.includes(`!${s}`)||r.includes(`:${s}`))},ng=(r,l)=>{const{style:u,...s}=r,d=f.useMemo(()=>({position:"absolute",top:Gn({className:s.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:Gn({className:s.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:Gn({className:s.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:Gn({className:s.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:Gn({className:s.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:Gn({className:s.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:Gn({className:s.className,classPrefix:["block","inline-block","inline","flex","inline-flex","flow-root","grid","inline-grid","contents","list-item","hidden"],type:"exact"})?void 0:"flex",flexDirection:Gn({className:s.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...u}),[s.className,u]);return b.jsx("div",{ref:l,style:d,...s})},Zo=f.forwardRef(ng),rt=f.createContext(null),Xa=ye.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),Wr=ye.createContext({hidden:{},setHidden:()=>{throw new Error("SequenceVisibilityToggle not initialized")}}),ag=({children:r})=>{const[l,u]=f.useState([]),[s,d]=f.useState({}),m=f.useCallback(h=>{u(x=>[...x,h])},[]),g=f.useCallback(h=>{u(x=>x.filter(w=>w.id!==h))},[]),y=f.useMemo(()=>({registerSequence:m,sequences:l,unregisterSequence:g}),[m,l,g]),p=f.useMemo(()=>({hidden:s,setHidden:d}),[s]);return b.jsx(Xa.Provider,{value:y,children:b.jsx(Wr.Provider,{value:p,children:r})})};function Cf(r){let l=r+1831565813;return l=Math.imul(l^l>>>15,l|1),l^=l+Math.imul(l^l>>>7,l|61),((l^l>>>14)>>>0)/4294967296}function rg(r){let l=0,u=0,s=0;for(l=0;l{if(r===null)return Math.random();if(typeof r=="string")return Cf(rg(r));if(typeof r=="number")return Cf(r*1e10);throw new Error("random() argument must be a number or a string")},Ko={};gf(Ko,{useTimelineSetFrame:()=>Vf,useTimelinePosition:()=>Qn,usePlayingState:()=>kf,persistCurrentFrame:()=>Df,getInitialFrameState:()=>Of,getFrameForComposition:()=>jf});var Tf=ye.createContext(null),it=()=>{const r=f.useContext(Tf),[l]=f.useState(()=>ln());return r??l},Za=f.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),Wi=f.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},updateCompositionDefaultProps:()=>{},onlyRenderComposition:null}),Jo=f.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")},resetUnsaved:()=>{throw new Error("Not implemented")}}),Af=ye.createRef(),ig=ye.createRef(),Mf=({children:r})=>{const[l,u]=ye.useState({}),s=f.useCallback(({defaultProps:g,id:y,newProps:p})=>{u(h=>({...h,[y]:typeof p=="function"?p(h[y]??g):p}))},[]),d=f.useCallback(g=>{u(y=>{if(y[g]){const p={...y};return delete p[g],p}return y})},[]);f.useImperativeHandle(Af,()=>({getProps:()=>l,setProps:u}),[l]);const m=f.useMemo(()=>({props:l,updateProps:s,resetUnsaved:d}),[l,d,s]);return b.jsx(Jo.Provider,{value:m,children:r})},Io=()=>"remotion_inputPropsOverride"+window.location.origin,Rf=()=>{if(typeof localStorage>"u")return null;const r=localStorage.getItem(Io());return r?JSON.parse(r):null},lg=r=>{if(!(typeof localStorage>"u")){if(r===null){localStorage.removeItem(Io());return}localStorage.setItem(Io(),JSON.stringify(r))}},Wo="remotion-date:",Po="remotion-file:",og=({data:r,indent:l,staticBase:u})=>{let s=!1,d=!1,m=!1,g=!1;try{return{serializedString:JSON.stringify(r,function(p,h){const x=this[p];return x instanceof Date?(s=!0,`${Wo}${x.toISOString()}`):x instanceof Map?(m=!0,h):x instanceof Set?(g=!0,h):typeof x=="string"&&u!==null&&x.startsWith(u)?(d=!0,`${Po}${x.replace(u+"/","")}`):h},l),customDateUsed:s,customFileUsed:d,mapUsed:m,setUsed:g}}catch(y){throw new Error("Could not serialize the passed input props to JSON: "+y.message)}},_f=r=>JSON.parse(r,(l,u)=>typeof u=="string"&&u.startsWith(Wo)?new Date(u.replace(Wo,"")):typeof u=="string"&&u.startsWith(Po)?`${window.remotion_staticBase}/${u.replace(Po,"")}`:u),ug=r=>_f(og({data:r,indent:2,staticBase:window.remotion_staticBase}).serializedString),xa=r=>ln().isStudio?ug(r):r,zf=!1,sg=()=>{zf||(zf=!0,console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object."),console.warn("To hide this warning, don't call this function on the server:"),console.warn(" typeof window === 'undefined' ? {} : getInputProps()"))},cg=()=>{if(typeof window>"u")return sg(),{};if(ln().isPlayer)throw new Error("You cannot call `getInputProps()` from a . Instead, the props are available as React props from component that you passed as `component` prop.");const r=Rf();if(r)return r;if(typeof window>"u"||typeof window.remotion_inputProps>"u")throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");const l=window.remotion_inputProps;return l?_f(l):{}};function Pi(r,l,u){if(typeof r!="number")throw new Error(`The "${l}" prop ${u} must be a number, but you passed a value of type ${typeof r}`);if(isNaN(r))throw new TypeError(`The "${l}" prop ${u} must not be NaN, but is NaN.`);if(!Number.isFinite(r))throw new TypeError(`The "${l}" prop ${u} must be finite, but is ${r}.`);if(r%1!==0)throw new TypeError(`The "${l}" prop ${u} must be an integer, but is ${r}.`);if(r<=0)throw new TypeError(`The "${l}" prop ${u} must be positive, but got ${r}.`)}function eu(r,l){const{allowFloats:u,component:s}=l;if(typeof r>"u")throw new Error(`The "durationInFrames" prop ${s} is missing.`);if(typeof r!="number")throw new Error(`The "durationInFrames" prop ${s} must be a number, but you passed a value of type ${typeof r}`);if(r<=0)throw new TypeError(`The "durationInFrames" prop ${s} must be positive, but got ${r}.`);if(!u&&r%1!==0)throw new TypeError(`The "durationInFrames" prop ${s} must be an integer, but got ${r}.`);if(!Number.isFinite(r))throw new TypeError(`The "durationInFrames" prop ${s} must be finite, but got ${r}.`)}function el(r,l,u){if(typeof r!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof r} ${l}`);if(!Number.isFinite(r))throw new Error(`"fps" must be a finite, but you passed ${r} ${l}`);if(isNaN(r))throw new Error(`"fps" must not be NaN, but got ${r} ${l}`);if(r<=0)throw new TypeError(`"fps" must be positive, but got ${r} ${l}`)}var tl=f.createContext(null),fg=f.createRef(),dg=r=>!!r.calculateMetadata,Nf="remotion.propsUpdatedExternally",tu=r=>{const l=f.useContext(tl),{props:u}=f.useContext(Jo),{compositions:s,canvasContent:d,currentCompositionMetadata:m}=f.useContext(Za),g=d?.type==="composition"?d.compositionId:null,y=r??g,p=s.find(w=>w.id===y),h=f.useMemo(()=>p?u[p.id]??{}:{},[u,p]),x=it();return f.useMemo(()=>p?m?{type:"success",result:{...m,id:p.id,defaultProps:p.defaultProps??{}}}:dg(p)?!l||!l[p.id]?null:l[p.id]:(eu(p.durationInFrames,{allowFloats:!1,component:`in `}),el(p.fps,`in `),Pi(p.width,"width",`in `),Pi(p.height,"height",`in `),{type:"success",result:{width:p.width,height:p.height,fps:p.fps,id:p.id,durationInFrames:p.durationInFrames,defaultProps:p.defaultProps??{},props:{...p.defaultProps??{},...h??{},...typeof window>"u"||x.isPlayer||!window.remotion_inputProps?{}:cg()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null}}):null,[p,l,m,h,x.isPlayer])},nl=()=>{const{canvasContent:r,compositions:l,currentCompositionMetadata:u}=f.useContext(Za),s=l.find(m=>r?.type==="composition"&&m.id===r.compositionId),d=tu(s?.id??null);return f.useMemo(()=>!d||d.type==="error"||d.type==="loading"||!s?null:{...d.result,defaultProps:s.defaultProps??{},id:s.id,...u??{},component:s.component},[u,d,s])},nu=()=>"remotion.time-all",Df=r=>{localStorage.setItem(nu(),JSON.stringify(r))},Of=()=>{const r=localStorage.getItem(nu())??"{}";return JSON.parse(r)},jf=r=>{const l=localStorage.getItem(nu())??"{}",u=JSON.parse(l);return u[r]!==void 0?Number(u[r]):typeof window>"u"?0:window.remotion_initialFrame??0},Qn=()=>{const r=nl(),l=f.useContext(Yt),u=it();if(!r)return typeof window>"u"?0:window.remotion_initialFrame??0;const s=l.frame[r.id]??(u.isPlayer?0:jf(r.id));return Math.min(r.durationInFrames-1,s)},Vf=()=>{const{setFrame:r}=f.useContext(Ja);return r},kf=()=>{const{playing:r,imperativePlaying:l}=f.useContext(Yt),{setPlaying:u}=f.useContext(Ja);return f.useMemo(()=>[r,u,l],[l,r,u])},Uf=r=>{const l=r.stack??"";return l.startsWith("Error:")?l:`${r.message} ${l}`},mg=r=>r instanceof Error?!0:!(r===null||typeof r!="object"||!("stack"in r)||typeof r.stack!="string"||!("message"in r)||typeof r.message!="string");function au(r,l){let u;throw mg(l)?(u=l,u.stack||(u.stack=new Error(u.message).stack)):typeof l=="string"?u=Error(l):u=Error("Rendering was cancelled"),r&&(r.remotion_cancelledError=Uf(u)),u}function Ka(r){return au(typeof window<"u"?window:void 0,r)}var hg=["trace","verbose","info","warn","error"],Bf=r=>hg.indexOf(r),al=(r,l)=>Bf(r)<=Bf(l),Pr=({args:r,logLevel:l,tag:u})=>{const s=[...r];return ln().isRendering&&!ln().isClientSideRendering&&s.unshift(Symbol.for(`__remotion_level_${l}`)),u&&ln().isRendering&&!ln().isClientSideRendering&&s.unshift(Symbol.for(`__remotion_tag_${u}`)),s},pg=(r,...l)=>{if(al(r.logLevel,"verbose"))return console.debug(...Pr({args:l,logLevel:"verbose",tag:r.tag}))},vg=(r,...l)=>{if(al(r.logLevel,"trace"))return console.debug(...Pr({args:l,logLevel:"trace",tag:r.tag}))},gg=(r,...l)=>{if(al(r.logLevel,"info"))return console.log(...Pr({args:l,logLevel:"info",tag:r.tag}))},yg=(r,...l)=>{if(al(r.logLevel,"warn"))return console.warn(...Pr({args:l,logLevel:"warn",tag:r.tag}))},bg=(r,...l)=>console.error(...Pr({args:l,logLevel:"error",tag:r.tag})),Ft={trace:vg,verbose:pg,info:gg,warn:yg,error:bg};typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var wg="The delayRender was called:",xg="Retries left: ",Sg="- Rendering the frame will be retried.",Eg="handle was cleared after",Cg=3e4,Tg=({scope:r,environment:l,label:u,options:s})=>{if(typeof u!="string"&&u!==null)throw new Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(u));const d=Math.random();r.remotion_delayRenderHandles.push(d);const m=Error().stack?.replace(/^Error/g,"")??"";if(l.isRendering){const g=(s?.timeoutInMilliseconds??r.remotion_puppeteerTimeout??Cg)-2e3,y=(s?.retries??0)-(r.remotion_attempt-1);r.remotion_delayRenderTimeouts[d]={label:u??null,startTime:Date.now(),timeout:setTimeout(()=>{const p=["A delayRender()",u?`"${u}"`:null,`was called but not cleared after ${g}ms. See https://remotion.dev/docs/timeout for help.`,y>0?xg+y:null,y>0?Sg:null,wg,m].filter(Jr).join(" ");l.isClientSideRendering?r.remotion_cancelledError=Uf(Error(p)):au(r,Error(p))},g)}}return r.remotion_renderReady=!1,d},Ag=({scope:r,handle:l,environment:u,logLevel:s})=>{if(typeof l>"u")throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");if(typeof l!="number")throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(l));r.remotion_delayRenderHandles=r.remotion_delayRenderHandles.filter(d=>{if(d===l){if(u.isRendering&&r!==void 0){if(!r.remotion_delayRenderTimeouts[l])return!1;const{label:m,startTime:g,timeout:y}=r.remotion_delayRenderTimeouts[l];clearTimeout(y);const p=[m?`"${m}"`:"A handle",Eg,`${Date.now()-g}ms`].filter(Jr).join(" ");Ft.verbose({logLevel:s,tag:"delayRender()"},p),delete r.remotion_delayRenderTimeouts[l]}return!1}return!0}),r.remotion_delayRenderHandles.length===0&&(r.remotion_renderReady=!0)},Sa=f.createContext({logLevel:"info",mountTime:0}),Xn=()=>{const{logLevel:r}=f.useContext(Sa);if(r===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return r},ei=()=>{const{mountTime:r}=f.useContext(Sa);if(r===null)throw new Error("useMountTime must be used within a LogLevelProvider");return r},Hf=f.createContext(null),Zn=()=>{const r=it(),l=f.useContext(Hf)??(typeof window<"u"?window:void 0),u=Xn(),s=f.useCallback((g,y)=>l?Tg({scope:l,environment:r,label:g??null,options:y??{}}):Math.random(),[r,l]),d=f.useCallback(g=>{l&&Ag({scope:l,handle:g,environment:r,logLevel:u})},[r,u,l]),m=f.useCallback(g=>au(l??(typeof window<"u"?window:void 0),g),[l]);return{delayRender:s,continueRender:d,cancelRender:m}},Ja=f.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),Yt=f.createContext({frame:{},playing:!1,playbackRate:1,rootId:"",imperativePlaying:{current:!1},setPlaybackRate:()=>{throw new Error("default")},audioAndVideoTags:{current:[]}}),Mg=({children:r,frameState:l})=>{const[u,s]=f.useState(!1),d=f.useRef(!1),[m,g]=f.useState(1),y=f.useRef([]),[p]=f.useState(()=>String(wa(null))),[h,x]=f.useState(()=>Of()),w=l??h,{delayRender:C,continueRender:T}=Zn();typeof window<"u"&&f.useLayoutEffect(()=>{window.remotion_setFrame=(B,V,G)=>{window.remotion_attempt=G;const U=C(`Setting the current frame to ${B}`);let j=!0;x($=>($[V]??window.remotion_initialFrame)===B?(j=!1,$):{...$,[V]:B}),j?requestAnimationFrame(()=>T(U)):T(U)},window.remotion_isPlayer=!1},[T,C]);const z=f.useMemo(()=>({frame:w,playing:u,imperativePlaying:d,rootId:p,playbackRate:m,setPlaybackRate:g,audioAndVideoTags:y}),[w,m,u,p]),M=f.useMemo(()=>({setFrame:x,setPlaying:s}),[]);return b.jsx(Yt.Provider,{value:z,children:b.jsx(Ja.Provider,{value:M,children:r})})},ti=f.createContext({getNonce:()=>0}),ru=()=>{const r=f.useContext(ti),[l,u]=f.useState(()=>r.getNonce()),s=f.useRef(r);return f.useEffect(()=>{s.current!==r&&(s.current=r,u(r.getNonce))},[r]),l},Ea=f.createContext(!1),iu=({children:r})=>b.jsx(Ea.Provider,{value:!0,children:r}),rl=()=>{const r=f.useContext(rt),l=r?.width??null,u=r?.height??null,s=r?.durationInFrames??null,d=nl();return f.useMemo(()=>{if(!d)return null;const{id:m,durationInFrames:g,fps:y,height:p,width:h,defaultProps:x,props:w,defaultCodec:C,defaultOutName:T,defaultVideoImageFormat:z,defaultPixelFormat:M,defaultProResProfile:B}=d;return{id:m,width:l??h,height:u??p,fps:y,durationInFrames:s??g,defaultProps:x,props:w,defaultCodec:C,defaultOutName:T,defaultVideoImageFormat:z,defaultPixelFormat:M,defaultProResProfile:B}},[s,u,l,d])},wt=()=>{const r=rl(),l=f.useContext(Ea),u=Xo();if(!r)throw typeof window<"u"&&window.remotion_isPlayer||u?new Error(["No video config found. Likely reasons:","- You are probably calling useVideoConfig() from outside the component passed to . See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.","- You have multiple versions of Remotion installed which causes the React context to get lost."].join("-")):new Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a . See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");if(!l)throw new Error("Called useVideoConfig() outside a Remotion composition.");return r},St=()=>{const r=f.useContext(Ea),l=it();if(!r)throw l.isPlayer?new Error("useCurrentFrame can only be called inside a component that was passed to . See: https://www.remotion.dev/docs/player/examples"):new Error("useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions");const u=Qn(),s=f.useContext(rt),d=s?s.cumulatedFrom+s.relativeFrom:0;return u-d},Rg=({frame:r,children:l,active:u=!0})=>{const s=St(),d=wt();if(typeof r>"u")throw new Error("The component requires a 'frame' prop, but none was passed.");if(typeof r!="number")throw new Error(`The 'frame' prop of must be a number, but is of type ${typeof r}`);if(Number.isNaN(r))throw new Error("The 'frame' prop of must be a real number, but it is NaN.");if(!Number.isFinite(r))throw new Error(`The 'frame' prop of must be a finite number, but it is ${r}.`);const m=f.useMemo(()=>{if(typeof u=="boolean")return u;if(typeof u=="function")return u(s)},[u,s]),g=f.useContext(Yt),y=f.useContext(rt),p=y?.relativeFrom??0,h=f.useMemo(()=>m?{...g,playing:!1,imperativePlaying:{current:!1},frame:{[d.id]:r+p}}:g,[m,g,d.id,r,p]),x=f.useMemo(()=>y?m?{...y,cumulatedFrom:0}:y:null,[y,m]);return b.jsx(Yt.Provider,{value:h,children:b.jsx(rt.Provider,{value:x,children:l})})},_g=({from:r=0,durationInFrames:l=1/0,children:u,name:s,height:d,width:m,showInTimeline:g=!0,_remotionInternalLoopDisplay:y,_remotionInternalStack:p,_remotionInternalPremountDisplay:h,_remotionInternalPostmountDisplay:x,...w},C)=>{const{layout:T="absolute-fill"}=w,[z]=f.useState(()=>String(Math.random())),M=f.useContext(rt),{rootId:B}=f.useContext(Yt),V=M?M.cumulatedFrom+M.relativeFrom:0,G=ru();if(T!=="absolute-fill"&&T!=="none")throw new TypeError(`The layout prop of expects either "absolute-fill" or "none", but you passed: ${T}`);if(T==="none"&&typeof w.style<"u")throw new TypeError('If layout="none", you may not pass a style.');if(typeof l!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof l}, but it must be a number.`);if(l<=0)throw new TypeError(`durationInFrames must be positive, but got ${l}`);if(typeof r!="number")throw new TypeError(`You passed to the "from" props of your an argument of type ${typeof r}, but it must be a number.`);if(!Number.isFinite(r))throw new TypeError(`The "from" prop of a sequence must be finite, but got ${r}.`);const U=Qn(),j=wt(),$=M?Math.min(M.durationInFrames-r,l):l,k=Math.max(0,Math.min(j.durationInFrames-r,$)),{registerSequence:L,unregisterSequence:J}=f.useContext(Xa),{hidden:W}=f.useContext(Wr),ee=f.useMemo(()=>M?.premounting||!!w._remotionInternalIsPremounting,[w._remotionInternalIsPremounting,M?.premounting]),ue=f.useMemo(()=>M?.postmounting||!!w._remotionInternalIsPostmounting,[w._remotionInternalIsPostmounting,M?.postmounting]),ie=f.useMemo(()=>({cumulatedFrom:V,relativeFrom:r,durationInFrames:k,parentFrom:M?.relativeFrom??0,id:z,height:d??M?.height??null,width:m??M?.width??null,premounting:ee,postmounting:ue,premountDisplay:h??null,postmountDisplay:x??null}),[V,r,k,M,z,d,m,ee,ue,h,x]),de=f.useMemo(()=>s??"",[s]),ve=it();f.useEffect(()=>{if(ve.isStudio)return L({from:r,duration:k,id:z,displayName:de,parent:M?.id??null,type:"sequence",rootId:B,showInTimeline:g,nonce:G,loopDisplay:y,stack:p??null,premountDisplay:h??null,postmountDisplay:x??null}),()=>{J(z)}},[l,z,s,L,de,J,M?.id,k,B,r,g,G,y,p,h,x,ve.isStudio]);const ge=Math.ceil(V+r+l-1),R=Uge?null:u,F=w.layout==="none"?void 0:w.style,K=f.useMemo(()=>({flexDirection:void 0,...m?{width:m}:{},...d?{height:d}:{},...F??{}}),[d,F,m]);if(C!==null&&T==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to .');return W[z]??!1?null:b.jsx(rt.Provider,{value:ie,children:R===null?null:w.layout==="none"?R:b.jsx(Zo,{ref:C,style:K,className:w.className,children:R})})},zg=f.forwardRef(_g),Ng=(r,l)=>{const u=St();if(r.layout==="none")throw new Error('`` with `premountFor` and `postmountFor` props does not support layout="none"');const{style:s,from:d=0,durationInFrames:m=1/0,premountFor:g=0,postmountFor:y=0,styleWhilePremounted:p,styleWhilePostmounted:h,...x}=r,w=Math.ceil(d+m-1),C=u=d-g,T=u>w&&u<=w+y,z=C?d:T?d+m-1:0,M=C||T,B=f.useMemo(()=>({...s,opacity:C||T?0:1,pointerEvents:C||T?"none":s?.pointerEvents??void 0,...C?p:{},...T?h:{}}),[s,C,T,p,h]);return b.jsx(Rg,{frame:z,active:M,children:b.jsx(Ia,{ref:l,from:d,durationInFrames:m,style:B,_remotionInternalPremountDisplay:g,_remotionInternalPostmountDisplay:y,_remotionInternalIsPremounting:C,_remotionInternalIsPostmounting:T,...x})})},Dg=f.forwardRef(Ng),Og=(r,l)=>{const u=it(),{fps:s}=wt();if(r.layout!=="none"&&!u.isRendering){const d=r.premountFor;if(d||r.postmountFor)return b.jsx(Dg,{ref:l,...r,premountFor:d})}return b.jsx(zg,{...r,ref:l})},Ia=f.forwardRef(Og),jg=(r,l,u)=>{switch(r){case"fill":return[0,0,l.width,l.height,0,0,u.width,u.height];case"contain":{const s=Math.min(u.width/l.width,u.height/l.height),d=(u.width-l.width*s)/2,m=(u.height-l.height*s)/2;return[0,0,l.width,l.height,d,m,l.width*s,l.height*s]}case"cover":{const s=Math.max(u.width/l.width,u.height/l.height),d=(u.width-l.width*s)/2,m=(u.height-l.height*s)/2;return[0,0,l.width,l.height,d,m,l.width*s,l.height*s]}default:throw new Error("Unknown fit: "+r)}},Vg=({width:r,height:l,fit:u,className:s,style:d},m)=>{const g=f.useRef(null),y=f.useCallback(p=>{const h=g.current,x=r??p.displayWidth,w=l??p.displayHeight;if(!h)throw new Error("Canvas ref is not set");const C=g.current?.getContext("2d");if(!C)throw new Error("Could not get 2d context");h.width=x,h.height=w,C.drawImage(p,...jg(u,{height:p.displayHeight,width:p.displayWidth},{width:x,height:w}))},[u,l,r]);return f.useImperativeHandle(m,()=>({draw:y,getCanvas:()=>{if(!g.current)throw new Error("Canvas ref is not set");return g.current},clear:()=>{const p=g.current?.getContext("2d");if(!p)throw new Error("Could not get 2d context");p.clearRect(0,0,g.current.width,g.current.height)}}),[y]),b.jsx("canvas",{ref:g,className:s,style:d})},kg=ye.forwardRef(Vg),Ug=5,Lf=({loopBehavior:r,durationFound:l,timeInSec:u})=>r==="loop"?l?u%l:u:Math.min(u,l||1/0),Bg=async({resolvedSrc:r,signal:l,currentTime:u,initialLoopBehavior:s})=>{if(typeof ImageDecoder>"u")throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");const d=await fetch(r,{signal:l}),{body:m}=d;if(!m)throw new Error("Got no body");const g=new ImageDecoder({data:m,type:d.headers.get("Content-Type")||"image/gif"});await g.completed;const{selectedTrack:y}=g.tracks;if(!y)throw new Error("No selected track");const p=[];let h=null;const x=async z=>{const M=p.find(V=>V.frameIndex===z);if(M&&M.frame)return M;const B=await g.decode({frameIndex:z,completeFramesOnly:!0});return M?M.frame=B.image:p.push({frame:B.image,frameIndex:z,timeInSeconds:B.image.timestamp/1e6}),{frame:B.image,frameIndex:z,timeInSeconds:B.image.timestamp/1e6}},w=z=>{const B=p.filter(V=>V.frame).sort((V,G)=>{const U=Math.abs(V.timeInSeconds-z),j=Math.abs(G.timeInSeconds-z);return U-j});for(let V=0;V{const B=Lf({durationFound:h,loopBehavior:M,timeInSec:z}),G=p.filter(j=>j.timeInSeconds<=B).map(j=>j.frameIndex).reduce((j,$)=>Math.max(j,$),0);let U=G;for(;;){const j=await x(U);if(U++,!j.frame)throw new Error("No frame found");if(!j.frame.duration||(U===y.frameCount&&h===null&&(h=(j.frame.timestamp+j.frame.duration)/1e6),j.timeInSeconds>B||U===y.frameCount))break}y.frameCount-G<3&&M==="loop"&&await x(0),w(B)};return await C({timeInSec:u,loopBehavior:s}),await C({timeInSec:u,loopBehavior:s}),{getFrame:async(z,M)=>{if(h!==null&&z>h&&M==="clear-after-finish")return null;const B=Lf({loopBehavior:M,durationFound:h,timeInSec:z});await C({timeInSec:B,loopBehavior:M});const G=p.filter(U=>U.frame).reduce((U,j)=>{const $=Math.abs(U.timeInSeconds-B),k=Math.abs(j.timeInSeconds-B);return $typeof window>"u"?r:new URL(r,window.origin).href;f.forwardRef(({src:r,width:l,height:u,onError:s,loopBehavior:d="loop",playbackRate:m=1,fit:g="fill",...y},p)=>{const h=f.useRef({isMounted:!0});f.useEffect(()=>{const{current:k}=h;return k.isMounted=!0,()=>{k.isMounted=!1}},[]);const x=Hg(r),[w,C]=f.useState(null),{delayRender:T,continueRender:z}=Zn(),[M]=f.useState(()=>T(`Rendering with src="${x}"`)),B=St(),{fps:V}=wt(),G=B/m/V,U=f.useRef(G);U.current=G;const j=f.useRef(null);f.useImperativeHandle(p,()=>{const k=j.current?.getCanvas();if(!k)throw new Error("Canvas ref is not set");return k},[]);const[$]=f.useState(()=>d);return f.useEffect(()=>{const k=new AbortController;return Bg({resolvedSrc:x,signal:k.signal,currentTime:U.current,initialLoopBehavior:$}).then(L=>{C(L),z(M)}).catch(L=>{if(L.name==="AbortError"){z(M);return}s?(s?.(L),z(M)):Ka(L)}),()=>{k.abort()}},[x,M,s,$,z]),f.useLayoutEffect(()=>{if(!w)return;const k=T(`Rendering frame at ${G} of `);w.getFrame(G,d).then(L=>{h.current.isMounted&&(L===null?j.current?.clear():j.current?.draw(L.frame)),z(k)}).catch(L=>{s?(s(L),z(k)):Ka(L)})},[G,w,d,s,r,z,T]),b.jsx(kg,{ref:j,width:l,height:u,fit:g,...y})});var Lg=r=>{if(typeof r!="string")throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof r}`);if(r.trim()==="")throw new Error("The `filename` must not be empty");if(!r.match(/^([0-9a-zA-Z-!_.*'()/:&$@=;+,?]+)/g))throw new Error('The `filename` must match "/^([0-9a-zA-Z-!_.*\'()/:&$@=;+,?]+)/g". Use forward slashes only, even on Windows.')},qg=r=>{if(typeof r!="string"&&!(r instanceof Uint8Array))throw new TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof r}`);if(typeof r=="string"&&r.trim()==="")throw new Error("The `content` must not be empty")},qf=r=>{r.type==="artifact"&&(Lg(r.filename),r.contentType!=="thumbnail"&&qg(r.content))},Ca=f.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),Fg=({children:r,collectAssets:l})=>{const[u,s]=f.useState([]),d=f.useRef([]),m=f.useCallback(p=>{qf(p),d.current=[...d.current,p],s(d.current)},[]);l&&f.useImperativeHandle(l,()=>({collectAssets:()=>{const p=d.current;return d.current=[],s([]),p}}),[]);const g=f.useCallback(p=>{d.current=d.current.filter(h=>h.id!==p),s(d.current)},[]);f.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const p=d.current;return d.current=[],s([]),p})},[]);const y=f.useMemo(()=>({registerRenderAsset:m,unregisterRenderAsset:g,renderAssets:u}),[u,m,g]);return b.jsx(Ca.Provider,{value:y,children:r})},dn=r=>typeof window>"u"||r.startsWith("http://")||r.startsWith("https://")||r.startsWith("file://")||r.startsWith("blob:")||r.startsWith("data:")?r:new URL(r,window.origin).href,il=({trimAfter:r,mediaDurationInFrames:l,playbackRate:u,trimBefore:s})=>{let d=l;typeof r<"u"&&(d=r),typeof s<"u"&&(d-=s);const m=d/u;return Math.floor(m)},Ff=f.createContext(null),Yg=()=>ye.useContext(Ff),ll=({durationInFrames:r,times:l=1/0,children:u,name:s,...d})=>{const m=St(),{durationInFrames:g}=wt();if(eu(r,{component:"of the component",allowFloats:!0}),typeof l!="number")throw new TypeError(`You passed to "times" an argument of type ${typeof l}, but it must be a number.`);if(l!==1/0&&l%1!==0)throw new TypeError(`The "times" prop of a loop must be an integer, but got ${l}.`);if(l<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${l}`);const y=Math.ceil(g/r),p=Math.min(y,l),h=d.layout==="none"?void 0:d.style,x=r*(p-1),C=Math.floor(m/r)*r,T=Math.min(C,x),z=f.useMemo(()=>({numberOfTimes:Math.min(g/r,l),startOffset:-T,durationInFrames:r}),[g,r,T,l]),M=f.useMemo(()=>({iteration:Math.floor(m/r),durationInFrames:r}),[m,r]);return b.jsx(Ff.Provider,{value:M,children:b.jsx(Ia,{durationInFrames:r,from:T,name:s??"",_remotionInternalLoopDisplay:z,layout:d.layout,style:h,children:u})})};ll.useLoop=Yg;var vt=({logLevel:r,tag:l,message:u,mountTime:s})=>{const d=[s?Date.now()-s+"ms ":null,l].filter(Boolean).join(" ");Ft.trace({logLevel:r,tag:null},`[${d}]`,u)},ol=f.createContext({}),Yf={},lu=[],$f=({children:r})=>{const[l,u]=f.useState(()=>Yf);return f.useEffect(()=>{const s=()=>{u(Yf)};return lu.push(s),()=>{lu=lu.filter(d=>d!==s)}},[]),b.jsx(ol.Provider,{value:l,children:r})},Gf=r=>{const l=r.indexOf("#");return l===-1?null:l},$g=r=>{const l=Gf(r);return l===null?r:r.slice(0,l)},Wa=r=>{const l=f.useContext(ol),u=Gf(r),s=$g(r);return l[s]?u!==null?l[s]+r.slice(u):l[s]:r},ul=(r,l)=>{if(typeof r.volume!="number"&&typeof r.volume!="function"&&typeof r.volume<"u")throw new TypeError(`You have passed a volume of type ${typeof r.volume} to your <${l} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if(typeof r.volume=="number"&&r.volume<0)throw new TypeError(`You have passed a volume below 0 to your <${l} /> component. Volume must be between 0 and 1`);if(typeof r.playbackRate!="number"&&typeof r.playbackRate<"u")throw new TypeError(`You have passed a playbackRate of type ${typeof r.playbackRate} to your <${l} /> component. Playback rate must a real number or undefined.`);if(typeof r.playbackRate=="number"&&(isNaN(r.playbackRate)||!Number.isFinite(r.playbackRate)||r.playbackRate<=0))throw new TypeError(`You have passed a playbackRate of ${r.playbackRate} to your <${l} /> component. Playback rate must be a real number above 0.`)},Gg=(r,l)=>{if(typeof r<"u"){if(typeof r!="number")throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof r}.`);if(isNaN(r)||r===1/0)throw new TypeError("startFrom prop can not be NaN or Infinity.");if(r<0)throw new TypeError(`startFrom must be greater than equal to 0 instead got ${r}.`)}if(typeof l<"u"){if(typeof l!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof l}.`);if(isNaN(l))throw new TypeError("endAt prop can not be NaN.");if(l<=0)throw new TypeError(`endAt must be a positive number, instead got ${l}.`)}if(l{if(typeof r<"u"){if(typeof r!="number")throw new TypeError(`type of trimBefore prop must be a number, instead got type ${typeof r}.`);if(isNaN(r)||r===1/0)throw new TypeError("trimBefore prop can not be NaN or Infinity.");if(r<0)throw new TypeError(`trimBefore must be greater than equal to 0 instead got ${r}.`)}if(typeof l<"u"){if(typeof l!="number")throw new TypeError(`type of trimAfter prop must be a number, instead got type ${typeof l}.`);if(isNaN(l))throw new TypeError("trimAfter prop can not be NaN.");if(l<=0)throw new TypeError(`trimAfter must be a positive number, instead got ${l}.`)}if(l<=r)throw new TypeError("trimAfter prop must be greater than trimBefore prop.")},sl=({startFrom:r,endAt:l,trimBefore:u,trimAfter:s})=>{if(typeof r<"u"&&typeof u<"u")throw new TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof l<"u"&&typeof s<"u")throw new TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");typeof u<"u"||typeof s<"u"?Qg(u,s):(typeof r<"u"||typeof l<"u")&&Gg(r,l)},cl=({startFrom:r,endAt:l,trimBefore:u,trimAfter:s})=>({trimBeforeValue:u??r??void 0,trimAfterValue:s??l??void 0}),Xg=(r,l)=>{if(l.type==="got-duration"){const u=dn(l.src);return r[u]===l.durationInSeconds?r:{...r,[u]:l.durationInSeconds}}else return r},ou=f.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),Qf=({children:r})=>{const[l,u]=f.useReducer(Xg,{}),s=f.useMemo(()=>({durations:l,setDurations:u}),[l]);return b.jsx(ou.Provider,{value:s,children:r})},uu=({crossOrigin:r,requestsVideoFrame:l,isClientSideRendering:u})=>{if(r!=null)return r;if(u||l)return"anonymous"},fl=({mediaRef:r,mediaType:l,onAutoPlayError:u,logLevel:s,mountTime:d,reason:m,isPlayer:g})=>{const{current:y}=r;if(!y)return;vt({logLevel:s,tag:"play",message:`Attempting to play ${y.src}. Reason: ${m}`,mountTime:d});const p=y.play();p.catch&&p.catch(h=>{if(y&&!h.message.includes("request was interrupted by a call to pause")&&!h.message.includes("The operation was aborted.")&&!h.message.includes("The fetching process for the media resource was aborted by the user agent")&&!h.message.includes("request was interrupted by a new load request")&&!h.message.includes("because the media was removed from the document")&&!(h.message.includes("user didn't interact with the document")&&y.muted)&&(console.log(`Could not play ${l} due to following error: `,h),!y.muted)){if(u){u();return}l==="video"&&g&&(Ft.info({logLevel:s,tag:"<"+l+">"},"The video will be muted and we'll retry playing it."),Ft.info({logLevel:s,tag:"<"+l+">"},"Use onAutoPlayError() to handle this error yourself."),y.muted=!0,y.play())}})},su=({audioContext:r,ref:l})=>{let u=null,s=!1;return{attemptToConnect:()=>{if(s)throw new Error("SharedElementSourceNode has been disposed");!u&&l.current&&(u=r.createMediaElementSource(l.current))},get:()=>{if(!u)throw new Error("Audio element not connected");return u},cleanup:()=>{u&&(u.disconnect(),u=null),s=!0}}},Xf=!1,Zg=r=>{Xf||(Xf=!0,typeof window<"u"&&Ft.warn({logLevel:r,tag:null},"AudioContext is not supported in this browser"))},Kg=({logLevel:r,latencyHint:l,audioEnabled:u})=>{const s=it();return f.useMemo(()=>s.isRendering||!u?null:typeof AudioContext>"u"?(Zg(r),null):new AudioContext({latencyHint:l,sampleRate:48e3}),[r,l,s.isRendering,u])},Zf="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",Jg=(r,l)=>{const u=Object.keys(r).sort(),s=Object.keys(l).sort();if(u.length!==s.length)return!1;for(let d=0;dr==="src"&&!u.startsWith("data:")&&!l.startsWith("data:")?new URL(u,window.origin).toString()!==new URL(l,window.origin).toString():u!==l,Pa=f.createContext(null),Kf=({children:r,numberOfAudioTags:l,audioLatencyHint:u,audioEnabled:s})=>{const d=f.useRef([]),[m]=f.useState(l);if(l!==m)throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");const g=Xn(),y=Kg({logLevel:g,latencyHint:u,audioEnabled:s}),p=f.useMemo(()=>new Array(l).fill(!0).map(()=>{const U=f.createRef();return{id:Math.random(),ref:U,mediaElementSourceNode:y?su({audioContext:y,ref:U}):null}}),[y,l]);(ye.useInsertionEffect??ye.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{p.forEach(({mediaElementSourceNode:U})=>{U?.cleanup()})})},[p]);const x=f.useRef(new Array(l).fill(!1)),w=f.useCallback(()=>{p.forEach(({ref:U,id:j})=>{const $=d.current?.find(L=>L.id===j),{current:k}=U;if(k){if($===void 0){k.src=Zf;return}if(!$)throw new TypeError("Expected audio data to be there");Object.keys($.props).forEach(L=>{Ig(L,$.props[L],k[L])&&(k[L]=$.props[L])})}})},[p]),C=f.useCallback(U=>{const{aud:j,audioId:$,premounting:k,postmounting:L}=U,J=d.current?.find(ge=>ge.audioId===$);if(J)return J;const W=x.current.findIndex(ge=>ge===!1);if(W===-1)throw new Error(`Tried to simultaneously mount ${l+1} tags at the same time. With the current settings, the maximum amount of tags is limited to ${l} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop for more information on how to increase this limit.`);const{id:ee,ref:ue,mediaElementSourceNode:ie}=p[W],de=[...x.current];de[W]=ee,x.current=de;const ve={props:j,id:ee,el:ue,audioId:$,mediaElementSourceNode:ie,premounting:k,audioMounted:!!ue.current,postmounting:L,cleanupOnMediaTagUnmount:()=>{}};return d.current?.push(ve),w(),ve},[l,p,w]),T=f.useCallback(U=>{const j=[...x.current],$=p.findIndex(k=>k.id===U);if($===-1)throw new TypeError("Error occured in ");j[$]=!1,x.current=j,d.current=d.current?.filter(k=>k.id!==U),w()},[p,w]),z=f.useCallback(({aud:U,audioId:j,id:$,premounting:k,postmounting:L})=>{let J=!1;d.current=d.current?.map(W=>{const ee=!!W.el.current;return W.audioMounted!==ee&&(J=!0),W.id===$?Jg(U,W.props)&&W.premounting===k&&W.postmounting===L?W:(J=!0,{...W,props:U,premounting:k,postmounting:L,audioId:j,audioMounted:ee}):W}),J&&w()},[w]),M=ei(),B=it(),V=f.useCallback(()=>{p.forEach(U=>{d.current.find($=>$.el===U.ref)?.premounting||fl({mediaRef:U.ref,mediaType:"audio",onAutoPlayError:null,logLevel:g,mountTime:M,reason:"playing all audios",isPlayer:B.isPlayer})}),y?.resume()},[y,g,M,p,B.isPlayer]),G=f.useMemo(()=>({registerAudio:C,unregisterAudio:T,updateAudio:z,playAllAudios:V,numberOfAudioTags:l,audioContext:y}),[l,V,C,T,z,y]);return b.jsxs(Pa.Provider,{value:G,children:[p.map(({id:U,ref:j})=>b.jsx("audio",{ref:j,preload:"metadata",src:Zf},U)),r]})},Wg=({aud:r,audioId:l,premounting:u,postmounting:s})=>{const d=f.useContext(Pa),[m]=f.useState(()=>{if(d&&d.numberOfAudioTags>0)return d.registerAudio({aud:r,audioId:l,premounting:u,postmounting:s});const y=ye.createRef(),p=d?.audioContext?su({audioContext:d.audioContext,ref:y}):null;return{el:y,id:Math.random(),props:r,audioId:l,mediaElementSourceNode:p,premounting:u,audioMounted:!!y.current,postmounting:s,cleanupOnMediaTagUnmount:()=>{p?.cleanup()}}}),g=ye.useInsertionEffect??ye.useLayoutEffect;return typeof document<"u"&&(g(()=>{d&&d.numberOfAudioTags>0&&d.updateAudio({id:m.id,aud:r,audioId:l,premounting:u,postmounting:s})},[r,d,m.id,l,u,s]),g(()=>()=>{d&&d.numberOfAudioTags>0&&d.unregisterAudio(m.id)},[d,m.id])),m},Pg=1e-5,dl=(r,l)=>Math.abs(r-l)Math.round(r/l*100)/100,cu=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),ml=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&cu(),ey=r=>ml()&&r.startsWith("blob:"),fu=({actualFrom:r,fps:l})=>Jf(Math.max(0,-r),l),du=({duration:r,fps:l})=>Jf(r,l),ty=({actualSrc:r,actualFrom:l,duration:u,fps:s})=>{if(ey(r)||r.startsWith("data:")||!!new URL(r,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(l))return r;const m=`${r}#t=${fu({actualFrom:l,fps:s})}`;return Number.isFinite(u)?`${m},${du({duration:u,fps:s})}`:m},ny=({prevStartFrom:r,newStartFrom:l,prevDuration:u,newDuration:s,fps:d})=>{const m=fu({actualFrom:r,fps:d}),g=fu({actualFrom:l,fps:d}),y=du({duration:u,fps:d}),p=du({duration:s,fps:d});return!(gy)},ay=({actualSrc:r,actualFrom:l,duration:u,fps:s})=>{const d=f.useRef(l),m=f.useRef(u),g=f.useRef(r);return(!ny({prevStartFrom:d.current,newStartFrom:l,prevDuration:m.current,newDuration:u,fps:s})||r!==g.current)&&(d.current=l,m.current=u,g.current=r),ty({actualSrc:g.current,actualFrom:d.current,duration:m.current,fps:s})},If=!1,ry=r=>{If||(If=!0,Ft.warn({logLevel:r,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),Ft.warn({logLevel:r,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),Ft.warn({logLevel:r,tag:null},r,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},Wf=({mediaRef:r,volume:l,logLevel:u,source:s,shouldUseWebAudioApi:d})=>{const m=f.useRef(null),g=f.useRef(l);g.current=l;const y=f.useContext(Pa);if(!y)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:p}=y;if(typeof window<"u"&&f.useLayoutEffect(()=>{if(!p||!r.current||!d)return;if(r.current.playbackRate!==1&&cu()){ry(u);return}if(!s)return;const w=new GainNode(p,{gain:g.current});return s.attemptToConnect(),s.get().connect(w),w.connect(p.destination),m.current={gainNode:w},Ft.trace({logLevel:u,tag:null},`Starting to amplify ${r.current?.src}. Gain = ${g.current}, playbackRate = ${r.current?.playbackRate}`),()=>{m.current=null,w.disconnect(),s.get().disconnect()}},[u,r,p,s,d]),m.current){const w=l;dl(m.current.gainNode.gain.value,w)||(m.current.gainNode.gain.value=w,Ft.trace({logLevel:u,tag:null},`Setting gain to ${w} for ${r.current?.src}`))}return(cu()&&r.current&&r.current?.playbackRate!==1||!d)&&r.current&&!dl(l,r.current?.volume)&&(r.current.volume=Math.min(l,1)),m},Ta=()=>{const r=f.useContext(rt);return Math.min(0,r?.relativeFrom??0)},er=r=>{const l=ll.useLoop(),u=St(),s=Ta();return r==="repeat"||l===null?u+s:u+s+l.durationInFrames*l.iteration},iy=r=>{if(/data:|blob:/.test(r.substring(0,5)))return"Data URL";const l=r.split("/").map(u=>u.split("\\")).flat(1);return l[l.length-1]},Aa=({frame:r,volume:l,mediaVolume:u=1})=>{if(typeof l=="number")return l*u;if(typeof l>"u")return Number(u);const s=l(r)*u;if(typeof s!="number")throw new TypeError(`You passed in a a function to the volume prop but it did not return a number but a value of type ${typeof s} for frame ${r}`);if(Number.isNaN(s))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${r}.`);if(!Number.isFinite(s))throw new TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${r}.`);return Math.max(0,s)},Pf={},ly=r=>{Pf[r]||(console.warn(r),Pf[r]=!0)},ed=({volume:r,mediaVolume:l,mediaType:u,src:s,displayName:d,trimBefore:m,trimAfter:g,playbackRate:y})=>{if(!s)throw new Error("No src passed");const p=Ta(),h=f.useContext(rt),x=wt(),[w]=f.useState(()=>r),C=il({mediaDurationInFrames:x.durationInFrames,playbackRate:y,trimBefore:m,trimAfter:g}),T=h?Math.min(h.durationInFrames,C):C,z=f.useMemo(()=>typeof r=="number"?r:new Array(Math.floor(Math.max(0,T+p))).fill(!0).map((U,j)=>Aa({frame:j+p,volume:r,mediaVolume:l})).join(","),[T,p,r,l]);f.useEffect(()=>{typeof r=="number"&&r!==w&&ly(`Remotion: The ${u} with src ${s} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`)},[w,u,s,r]);const M=typeof r=="function",B=ru(),{rootId:V}=f.useContext(Yt),G=it();return{volumes:z,duration:T,doesVolumeChange:M,nonce:B,rootId:V,isStudio:G.isStudio,finalDisplayName:d??iy(s)}},mu=({volume:r,mediaVolume:l,src:u,mediaType:s,playbackRate:d,displayName:m,id:g,stack:y,showInTimeline:p,premountDisplay:h,postmountDisplay:x,loopDisplay:w})=>{const C=f.useContext(rt),T=Ta(),{registerSequence:z,unregisterSequence:M}=f.useContext(Xa),{volumes:B,duration:V,doesVolumeChange:G,nonce:U,rootId:j,isStudio:$,finalDisplayName:k}=ed({volume:r,mediaVolume:l,mediaType:s,src:u,displayName:m,trimAfter:void 0,trimBefore:void 0,playbackRate:d});f.useEffect(()=>{if(!u)throw new Error("No src passed");if(!(!$&&window.process?.env?.NODE_ENV!=="test")&&p)return z({type:s,src:u,id:g,duration:V,from:0,parent:C?.id??null,displayName:k,rootId:j,volume:B,showInTimeline:!0,nonce:U,startMediaFrom:0-T,doesVolumeChange:G,loopDisplay:w,playbackRate:d,stack:y,premountDisplay:h,postmountDisplay:x}),()=>{M(g)}},[V,g,C,u,z,M,B,G,U,s,T,d,y,p,h,x,$,w,j,k])},oy=(r,l)=>{const[u,s]=f.useState([]),[d,m]=f.useState([]),[g,y]=f.useState([]),h=it().isRendering,x=f.useRef(!1),w=f.useCallback(z=>h?{unblock:()=>{}}:(s(M=>[...M,z]),{unblock:()=>{s(M=>{const B=M.filter(V=>V!==z);return B.length===M.length?M:B})}}),[h]),C=f.useCallback(z=>(m(M=>[...M,z]),{remove:()=>{m(M=>M.filter(B=>B!==z))}}),[]),T=f.useCallback(z=>(y(M=>[...M,z]),{remove:()=>{y(M=>M.filter(B=>B!==z))}}),[]);return f.useEffect(()=>{h||u.length>0&&(d.forEach(z=>z()),vt({logLevel:r,message:"Player is entering buffer state",mountTime:l,tag:"player"}))},[u]),typeof window<"u"&&f.useLayoutEffect(()=>{h||u.length===0&&(g.forEach(z=>z()),vt({logLevel:r,message:"Player is exiting buffer state",mountTime:l,tag:"player"}))},[u]),f.useMemo(()=>({addBlock:w,listenForBuffering:C,listenForResume:T,buffering:x}),[w,x,C,T])},tr=ye.createContext(null),td=({children:r})=>{const{logLevel:l,mountTime:u}=f.useContext(Sa),s=oy(l??"info",u);return b.jsx(tr.Provider,{value:s,children:r})},nd=r=>{const[l,u]=f.useState(r.buffering.current);return f.useEffect(()=>{const s=()=>{u(!0)},d=()=>{u(!1)};return r.listenForBuffering(s),r.listenForResume(d),()=>{r.listenForBuffering(()=>{}),r.listenForResume(()=>{})}},[r]),l},hu=()=>{const r=f.useContext(tr),l=r?r.addBlock:null;return f.useMemo(()=>({delayPlayback:()=>{if(!l)throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a . Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");const{unblock:u}=l({id:String(Math.random())});return{unblock:u}}}),[l])},uy=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),sy=({mediaRef:r,mediaType:l,onVariableFpsVideoDetected:u,pauseWhenBuffering:s,logLevel:d,mountTime:m})=>{const g=f.useRef(!1),{delayPlayback:y}=hu(),p=f.useCallback(h=>{if(l!=="video"||!s)return;const x=r.current;if(!x)return;if(x.readyState>=x.HAVE_FUTURE_DATA&&!uy()){vt({logLevel:d,message:`Not using buffer until first frame, because readyState is ${x.readyState} and is not Safari or Desktop Chrome`,mountTime:m,tag:"buffer"});return}if(!x.requestVideoFrameCallback){vt({logLevel:d,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:m,tag:"buffer"});return}g.current=!0,vt({logLevel:d,message:`Buffering ${r.current?.src} until the first frame is received`,mountTime:m,tag:"buffer"});const w=y(),C=()=>{w.unblock(),x.removeEventListener("ended",C,{once:!0}),x.removeEventListener("pause",C,{once:!0}),g.current=!1},T=()=>{C()};x.requestVideoFrameCallback((z,M)=>{Math.abs(M.mediaTime-h)>.5&&u(),C()}),x.addEventListener("ended",T,{once:!0}),x.addEventListener("pause",T,{once:!0}),x.addEventListener("canplay",T,{once:!0})},[y,d,r,l,m,u,s]);return f.useMemo(()=>({isBuffering:()=>g.current,bufferUntilFirstFrame:p}),[p])},cy=r=>{const l=ye.useRef({time:r.current?.currentTime??0,lastUpdate:performance.now()}),u=r.current?.currentTime??null;return u!==null&&l.current.time!==u&&(l.current.time=u,l.current.lastUpdate=performance.now()),l},hl=({mediaRef:r,time:l,logLevel:u,why:s,mountTime:d})=>{const m=ml()?Number(l.toFixed(1)):l;return vt({logLevel:u,tag:"seek",message:`Seeking from ${r.currentTime} to ${m}. src= ${r.src} Reason: ${s}`,mountTime:d}),r.currentTime=m,m},fy=({element:r,shouldBuffer:l,isPremounting:u,isPostmounting:s,logLevel:d,mountTime:m,src:g})=>{const y=hu(),[p,h]=f.useState(!1);return f.useEffect(()=>{let x=[];const{current:w}=r;if(!w||!l)return;if(u||s){if((u||s)&&w.readyState{let B=!1;x.forEach(V=>{V(M),B=!0}),x=[],h(V=>(V&&(B=!0),!1)),B&&vt({logLevel:d,message:`Unmarking as buffering: ${w.src}. Reason: ${M}`,tag:"buffer",mountTime:m})},T=M=>{h(!0),vt({logLevel:d,message:`Marking as buffering: ${w.src}. Reason: ${M}`,tag:"buffer",mountTime:m});const{unblock:B}=y.delayPlayback(),V=()=>{C('"canplay" was fired'),z()},G=()=>{C('"error" event was occurred'),z()};w.addEventListener("canplay",V,{once:!0}),x.push(()=>{w.removeEventListener("canplay",V)}),w.addEventListener("error",G,{once:!0}),x.push(()=>{w.removeEventListener("error",G)}),x.push(U=>{vt({logLevel:d,message:`Unblocking ${w.src} from buffer. Reason: ${U}`,tag:"buffer",mountTime:m}),B()})},z=()=>{if(w.readyState{T('"waiting" event was fired')};w.addEventListener("waiting",M),x.push(()=>{w.removeEventListener("waiting",M)})}};return z(),()=>{C("element was unmounted or prop changed")}},[y,g,r,u,s,d,l,m]),p},dy=({mediaRef:r,mediaType:l,lastSeek:u,onVariableFpsVideoDetected:s})=>{const d=f.useRef(null);return f.useEffect(()=>{const{current:m}=r;if(m)d.current={time:m.currentTime,lastUpdate:performance.now()};else{d.current=null;return}if(l!=="video"){d.current=null;return}const g=m;if(!g.requestVideoFrameCallback)return;let y=()=>{};const p=()=>{if(!g)return;const h=g.requestVideoFrameCallback((x,w)=>{if(d.current!==null){const C=Math.abs(d.current.time-w.mediaTime),T=Math.abs(u.current===null?1/0:w.mediaTime-u.current);C>.5&&T>.5&&w.mediaTime>d.current.time&&s()}d.current={time:w.mediaTime,lastUpdate:performance.now()},p()});y=()=>{g.cancelVideoFrameCallback(h),y=()=>{}}};return p(),()=>{y()}},[u,r,l,s]),d};function my(r,l,u,s){const{extrapolateLeft:d,extrapolateRight:m,easing:g}=s;let y=r;const[p,h]=l,[x,w]=u;if(yh){if(m==="identity")return y;if(m==="clamp")y=h;else if(m==="wrap"){const C=h-p;y=((y-p)%C+C)%C+p}}return x===w?x:(y=(y-p)/(h-p),y=g(y),y=y*(w-x)+x,y)}function hy(r,l){let u;for(u=1;u=r);++u);return u-1}function py(r){for(let l=1;lr[l-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${r.join(",")}]`)}function ad(r,l){if(l.length<2)throw new Error(r+" must have at least 2 elements");for(const u of l){if(typeof u!="number")throw new Error(`${r} must contain only numbers`);if(!Number.isFinite(u))throw new Error(`${r} must contain only finite numbers, but got [${l.join(",")}]`)}}function $e(r,l,u,s){if(typeof r>"u")throw new Error("input can not be undefined");if(typeof l>"u")throw new Error("inputRange can not be undefined");if(typeof u>"u")throw new Error("outputRange can not be undefined");if(l.length!==u.length)throw new Error("inputRange ("+l.length+") and outputRange ("+u.length+") must have the same length");ad("inputRange",l),ad("outputRange",u),py(l);const d=s?.easing??(p=>p);let m="extend";s?.extrapolateLeft!==void 0&&(m=s.extrapolateLeft);let g="extend";if(s?.extrapolateRight!==void 0&&(g=s.extrapolateRight),typeof r!="number")throw new TypeError("Cannot interpolate an input which is not a number");const y=hy(r,l);return my(r,[l[y],l[y+1]],[u[y],u[y+1]],{easing:d,extrapolateLeft:m,extrapolateRight:g})}var rd=({frame:r,playbackRate:l,startFrom:u})=>$e(r,[-1,u,u+1],[-1,u,u+l]),id=({fps:r,frame:l,playbackRate:u,startFrom:s})=>{const d=rd({frame:l,playbackRate:u,startFrom:s}),m=1e3/r;return d*m/1e3},ld={},vy=(r,l)=>{if(r===null||r.seekable.length===0||r.seekable.length>1||ld[r.src])return;const u={start:r.seekable.start(0),end:r.seekable.end(0)};if(u.start===0&&u.end===0){const s=[`The media ${r.src} cannot be seeked. This could be one of few reasons:`,"1) The media resource was replaced while the video is playing but it was not loaded yet.","2) The media does not support seeking.","3) The media was loaded with security headers prventing it from being included.","Please see https://remotion.dev/docs/non-seekable-media for assistance."].join(` `);if(l==="console-error")console.error(s);else if(l==="console-warning")console.warn(`The media ${r.src} does not support seeking. The video will render fine, but may not play correctly in the Remotion Studio and in the . See https://remotion.dev/docs/non-seekable-media for an explanation.`);else throw new Error(s);ld[r.src]=!0}},od=({mediaRef:r,src:l,mediaType:u,playbackRate:s,onlyWarnForMediaSeekingError:d,acceptableTimeshift:m,pauseWhenBuffering:g,isPremounting:y,isPostmounting:p,onAutoPlayError:h})=>{const{playbackRate:x}=f.useContext(Yt),w=St(),C=Qn(),[T]=kf(),z=f.useContext(tr),{fps:M}=wt(),B=Ta(),V=f.useRef(null),G=f.useRef(null),U=Xn(),j=ei();if(!z)throw new Error("useMediaPlayback must be used inside a ");const $=f.useRef({}),k=f.useCallback(()=>{l&&($.current[l]||(Ft.verbose({logLevel:U,tag:null},`Detected ${l} as a variable FPS video. Disabling buffering while seeking.`),$.current[l]=!0))},[U,l]),L=dy({mediaRef:r,mediaType:u,lastSeek:G,onVariableFpsVideoDetected:k}),J=cy(r),W=id({frame:w,playbackRate:s,startFrom:-B,fps:M}),ee=fy({element:r,shouldBuffer:g,isPremounting:y,isPostmounting:p,logLevel:U,mountTime:j,src:l??null}),{bufferUntilFirstFrame:ue,isBuffering:ie}=sy({mediaRef:r,mediaType:u,onVariableFpsVideoDetected:k,pauseWhenBuffering:g,logLevel:U,mountTime:j}),de=s*x,ve=r.current?.duration?Math.min(r.current.duration,m??.65):m??.65,ge=nd(z);f.useEffect(()=>{if(r.current?.paused)return;if(!T){vt({logLevel:U,tag:"pause",message:`Pausing ${r.current?.src} because ${y?"media is premounting":p?"media is postmounting":"Player is not playing"}`,mountTime:j}),r.current?.pause();return}const F=ee||ie();z.buffering.current&&!F&&(vt({logLevel:U,tag:"pause",message:`Pausing ${r.current?.src} because player is buffering but media tag is not`,mountTime:j}),r.current?.pause())},[ie,ee,z,ge,y,U,r,u,j,T,p]);const R=it();f.useLayoutEffect(()=>{const F=Math.max(0,de);r.current&&r.current.playbackRate!==F&&(r.current.playbackRate=F)},[r,de]),f.useEffect(()=>{const F=u==="audio"?"":"";if(!r.current)throw new Error(`No ${u} ref found`);if(!l)throw new Error(`No 'src' attribute was passed to the ${F} element.`);const{duration:K}=r.current,te=!Number.isNaN(K)&&Number.isFinite(K)?Math.min(K,W):W,he=J.current.time,E=L.current?.time??null,q=$.current[l],Z=Math.abs(te-he),I=E?Math.abs(te-E):null,P=L.current?.lastUpdate&&L.current.time>J.current.lastUpdate?I:Z,le=I&&!q?P:Z;if(le>ve&&V.current!==te){G.current=hl({mediaRef:r.current,time:te,logLevel:U,why:`because time shift is too big. shouldBeTime = ${te}, isTime = ${he}, requestVideoCallbackTime = ${E}, timeShift = ${le}${q?", isVariableFpsVideo = true":""}, isPremounting = ${y}, isPostmounting = ${p}, pauseWhenBuffering = ${g}`,mountTime:j}),V.current=G.current,T&&(de>0&&ue(te),r.current.paused&&fl({mediaRef:r,mediaType:u,onAutoPlayError:h,logLevel:U,mountTime:j,reason:"player is playing but media tag is paused, and just seeked",isPlayer:R.isPlayer})),d||vy(r.current,d?"console-warning":"console-error");return}const ae=T?.15:.01,Re=Math.abs(r.current.currentTime-te)>ae,Ae=ee||ie(),Ge=z.buffering.current&&!Ae;if(!T||Ge){Re&&(G.current=hl({mediaRef:r.current,time:te,logLevel:U,why:`not playing or something else is buffering. time offset is over seek threshold (${ae})`,mountTime:j}));return}if(!T||z.buffering.current)return;const nt=r.current.paused&&!r.current.ended;if(nt||C===0){const Ot=nt?"media tag is paused":"absolute frame is 0";Re&&(G.current=hl({mediaRef:r.current,time:te,logLevel:U,why:`is over timeshift threshold (threshold = ${ae}) and ${Ot}`,mountTime:j})),fl({mediaRef:r,mediaType:u,onAutoPlayError:h,logLevel:U,mountTime:j,reason:`player is playing and ${Ot}`,isPlayer:R.isPlayer}),!q&&de>0&&ue(te)}},[C,ve,ue,z.buffering,L,U,W,ie,ee,r,u,d,de,T,l,h,y,p,g,j,J,R.isPlayer])},ud=({mediaRef:r,id:l,mediaType:u,onAutoPlayError:s,isPremounting:d,isPostmounting:m})=>{const{audioAndVideoTags:g,imperativePlaying:y}=f.useContext(Yt),p=Xn(),h=ei(),x=it();f.useEffect(()=>{const w={id:l,play:C=>{if(y.current&&!(d||m))return fl({mediaRef:r,mediaType:u,onAutoPlayError:s,logLevel:p,mountTime:h,reason:C,isPlayer:x.isPlayer})}};return g.current.push(w),()=>{g.current=g.current.filter(C=>C.id!==l)}},[g,l,r,u,s,y,d,m,p,h,x.isPlayer])},pu=f.createContext({mediaMuted:!1,mediaVolume:1}),vu=f.createContext({setMediaMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),gu=()=>{const{mediaVolume:r}=f.useContext(pu),{setMediaVolume:l}=f.useContext(vu);return f.useMemo(()=>[r,l],[r,l])},yu=()=>{const{mediaMuted:r}=f.useContext(pu),{setMediaMuted:l}=f.useContext(vu);return f.useMemo(()=>[r,l],[r,l])},nr=r=>{if(r>=100)throw new Error(`Volume was set to ${r}, but regular volume is 1, not 100. Did you forget to divide by 100? Set a volume of less than 100 to dismiss this error.`)},gy=(r,l)=>{const[u]=f.useState(r.shouldPreMountAudioTags);if(r.shouldPreMountAudioTags!==u)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const s=Xn(),{volume:d,muted:m,playbackRate:g,shouldPreMountAudioTags:y,src:p,onDuration:h,acceptableTimeShiftInSeconds:x,_remotionInternalNeedsDurationCalculation:w,_remotionInternalNativeLoopPassed:C,_remotionInternalStack:T,allowAmplificationDuringRender:z,name:M,pauseWhenBuffering:B,showInTimeline:V,loopVolumeCurveBehavior:G,stack:U,crossOrigin:j,delayRenderRetries:$,delayRenderTimeoutInMilliseconds:k,toneFrequency:L,useWebAudioApi:J,onError:W,onNativeError:ee,audioStreamIndex:ue,...ie}=r,[de]=gu(),[ve]=yu(),ge=er(G??"repeat"),{hidden:R}=f.useContext(Wr);if(!p)throw new TypeError("No 'src' was passed to .");const F=Wa(p),K=f.useContext(rt),[te]=f.useState(()=>String(Math.random())),he=R[te]??!1,E=Aa({frame:ge,volume:d,mediaVolume:de});nr(E);const q=uu({crossOrigin:j,requestsVideoFrame:!1,isClientSideRendering:!1}),Z=f.useMemo(()=>({muted:m||ve||he||E<=0,src:F,loop:C,crossOrigin:q,...ie}),[C,he,ve,m,ie,F,E,q]),I=f.useMemo(()=>`audio-${wa(p??"")}-${K?.relativeFrom}-${K?.cumulatedFrom}-${K?.durationInFrames}-muted:${r.muted}-loop:${r.loop}`,[p,K?.relativeFrom,K?.cumulatedFrom,K?.durationInFrames,r.muted,r.loop]),{el:P,mediaElementSourceNode:le,cleanupOnMediaTagUnmount:ae}=Wg({aud:Z,audioId:I,premounting:!!K?.premounting,postmounting:!!K?.postmounting});mu({volume:d,mediaVolume:de,src:p,mediaType:"audio",playbackRate:g??1,displayName:M??null,id:te,stack:T,showInTimeline:V,premountDisplay:K?.premountDisplay??null,postmountDisplay:K?.postmountDisplay??null,loopDisplay:void 0}),od({mediaRef:P,src:p,mediaType:"audio",playbackRate:g??1,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:x??null,isPremounting:!!K?.premounting,isPostmounting:!!K?.postmounting,pauseWhenBuffering:B,onAutoPlayError:null}),ud({id:te,isPostmounting:!!K?.postmounting,isPremounting:!!K?.premounting,mediaRef:P,mediaType:"audio",onAutoPlayError:null}),Wf({logLevel:s,mediaRef:P,source:le,volume:E,shouldUseWebAudioApi:J??!1}),(ye.useInsertionEffect??ye.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{ae()})},[ae]),f.useImperativeHandle(l,()=>P.current,[P]);const Ae=f.useRef(h);return Ae.current=h,f.useEffect(()=>{const{current:Ge}=P;if(!Ge)return;if(Ge.duration){Ae.current?.(Ge.src,Ge.duration);return}const nt=()=>{Ae.current?.(Ge.src,Ge.duration)};return Ge.addEventListener("loadedmetadata",nt),()=>{Ge.removeEventListener("loadedmetadata",nt)}},[P,p]),u?null:b.jsx("audio",{ref:P,preload:"metadata",crossOrigin:q,...Z})},sd=f.forwardRef(gy),yy=(r,l)=>{const u=f.useRef(null),{volume:s,playbackRate:d,allowAmplificationDuringRender:m,onDuration:g,toneFrequency:y,_remotionInternalNeedsDurationCalculation:p,_remotionInternalNativeLoopPassed:h,acceptableTimeShiftInSeconds:x,name:w,onNativeError:C,delayRenderRetries:T,delayRenderTimeoutInMilliseconds:z,loopVolumeCurveBehavior:M,pauseWhenBuffering:B,audioStreamIndex:V,...G}=r,U=Qn(),j=er(M??"repeat"),$=St(),k=f.useContext(rt),{registerRenderAsset:L,unregisterRenderAsset:J}=f.useContext(Ca),{delayRender:W,continueRender:ee}=Zn(),ue=f.useMemo(()=>`audio-${wa(r.src??"")}-${k?.relativeFrom}-${k?.cumulatedFrom}-${k?.durationInFrames}`,[r.src,k?.relativeFrom,k?.cumulatedFrom,k?.durationInFrames]),ie=Aa({volume:s,frame:j,mediaVolume:1});nr(ie),f.useImperativeHandle(l,()=>u.current,[]),f.useEffect(()=>{if(!r.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!r.muted&&!(ie<=0))return L({type:"audio",src:dn(r.src),id:ue,frame:U,volume:ie,mediaFrame:$,playbackRate:r.playbackRate??1,toneFrequency:y??1,audioStartFrame:Math.max(0,-(k?.relativeFrom??0)),audioStreamIndex:V??0}),()=>J(ue)},[r.muted,r.src,L,U,ue,J,ie,j,$,d,r.playbackRate,y,k?.relativeFrom,V]);const{src:de}=r,ve=l||p;return f.useLayoutEffect(()=>{if(window.process?.env?.NODE_ENV==="test"||!ve)return;const ge=W("Loading duration with src="+de,{retries:T??void 0,timeoutInMilliseconds:z??void 0}),{current:R}=u,F=()=>{R?.duration&&g(R.src,R.duration),ee(ge)};return R?.duration?(g(R.src,R.duration),ee(ge)):R?.addEventListener("loadedmetadata",F,{once:!0}),()=>{R?.removeEventListener("loadedmetadata",F),ee(ge)}},[de,g,ve,T,z,ee,W]),ve?b.jsx("audio",{ref:u,...G,onError:C}):null},by=f.forwardRef(yy),wy=(r,l)=>{const u=f.useContext(Pa),{startFrom:s,endAt:d,trimBefore:m,trimAfter:g,name:y,stack:p,pauseWhenBuffering:h,showInTimeline:x,onError:w,...C}=r,{loop:T,...z}=r,{fps:M}=wt(),B=it();if(B.isClientSideRendering)throw new Error(" is not supported in @remotion/web-renderer. Use