var Ox=Object.defineProperty;var Dx=(Yn,an,he)=>an in Yn?Ox(Yn,an,{enumerable:!0,configurable:!0,writable:!0,value:he}):Yn[an]=he;var Pe=(Yn,an,he)=>Dx(Yn,typeof an!="symbol"?an+"":an,he);(function(){"use strict";function Yn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var an={exports:{}},he={};var af;function Fv(){if(af)return he;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"),w=Symbol.for("react.lazy"),b=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,D={};function V(E,q,Z){this.props=E,this.context=q,this.refs=D,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 $(){}$.prototype=V.prototype;function k(E,q,Z){this.props=E,this.context=q,this.refs=D,this.updater=Z||z}var U=k.prototype=new $;U.constructor=k,M(U,V.prototype),U.isPureReactComponent=!0;var G=Array.isArray;function B(){}var H={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function P(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 P(E.type,q,E.props)}function oe(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 fe=/\/+/g;function pe(E,q){return typeof E=="object"&&E!==null&&E.key!=null?ie(""+E.key):q.toString(36)}function ve(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(B,B):(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,W){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 w:return ae=E._init,R(ae(E._payload),q,Z,I,W)}}if(ae)return W=W(E),ae=I===""?"."+pe(E,0):I,G(W)?(Z="",ae!=null&&(Z=ae.replace(fe,"$&/")+"/"),R(W,q,Z,"",function(Xe){return Xe})):W!=null&&(oe(W)&&(W=ee(W,Z+(W.key==null||E&&E.key===W.key?"":(""+W.key).replace(fe,"$&/")+"/")+ae)),q.push(W)),1;ae=0;var _e=I===""?".":I+":";if(G(E))for(var Re=0;Re>>1,me=R[te];if(0>>1;ted(Z,K))Id(W,Z)?(R[te]=W,R[I]=K,te=I):(R[te]=Z,R[q]=K,te=q);else if(Id(W,K))R[te]=W,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=[],w=1,b=null,C=3,T=!1,z=!1,M=!1,D=!1,V=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function U(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 G(R){if(M=!1,U(R),!z)if(u(p)!==null)z=!0,B||(B=!0,ie());else{var F=u(h);F!==null&&ve(G,F.startTime-R)}}var B=!1,H=-1,J=5,P=-1;function ee(){return D?!0:!(r.unstable_now()-PR&&ee());){var te=b.callback;if(typeof te=="function"){b.callback=null,C=b.priorityLevel;var me=te(b.expirationTime<=R);if(R=r.unstable_now(),typeof me=="function"){b.callback=me,U(R),F=!0;break t}b===u(p)&&s(p),U(R)}else s(p);b=u(p)}if(b!==null)F=!0;else{var E=u(h);E!==null&&ve(G,E.startTime-R),F=!1}}break e}finally{b=null,C=K,T=!1}F=void 0}}finally{F?ie():B=!1}}}var ie;if(typeof k=="function")ie=function(){k(oe)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,pe=fe.port2;fe.port1.onmessage=oe,ie=function(){pe.postMessage(null)}}else ie=function(){V(oe,0)};function ve(R,F){H=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?($(H),H=-1):M=!0,ve(G,K-te))):(R.sortIndex=me,l(p,R),z||T||(z=!0,B||(B=!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}}}})(Go)),Go}var of;function $v(){return of||(of=1,$o.exports=Yv()),$o.exports}var Xo={exports:{}},vt={};var uf;function Gv(){if(uf)return vt;uf=1;var r=Fo();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(),Xo.exports=Gv(),Xo.exports}var ff;function Xv(){if(ff)return Jr;ff=1;var r=$v(),l=Fo(),u=cf();function s(e){var t="https://react.dev/errors/"+e;if(1me||(e.current=te[me],te[me]=null,me--)}function Z(e,t){me++,te[me]=e.current,e.current=t}var I=E(null),W=E(null),le=E(null),ae=E(null);function _e(e,t){switch(Z(le,t),Z(W,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 Re(){q(I),q(W),q(le)}function Xe(e){e.memoizedState!==null&&Z(ae,e);var t=I.current,n=dv(t,e.type);t!==n&&(Z(W,e),Z(I,n))}function at(e){W.current===e&&(q(I),q(W)),ae.current===e&&(q(ae),Ji._currentValue=K)}var Yt,Ot;function St(e){if(Yt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Yt=t&&t[1]||"",Ot=-1)":-1i||S[a]!==O[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{je=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?St(n):""}function ln(e,t){switch(e.tag){case 26:case 27:case 5:return St(e.type);case 16:return St("Lazy");case 13:return e.child!==t&&t!==null?St("Suspense Fallback"):St("Suspense");case 19:return St("SuspenseList");case 0:case 15:return ue(e.type,!1);case 11:return ue(e.type.render,!1);case 1:return ue(e.type,!0);case 31:return St("Activity");default:return""}}function dn(e){try{var t="",n=null;do t+=ln(e,n),n=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var Dt=Object.prototype.hasOwnProperty,$t=r.unstable_scheduleCallback,xn=r.unstable_cancelCallback,Gt=r.unstable_shouldYield,Et=r.unstable_requestPaint,ot=r.unstable_now,mn=r.unstable_getCurrentPriorityLevel,Sn=r.unstable_ImmediatePriority,Jn=r.unstable_UserBlockingPriority,Xt=r.unstable_NormalPriority,En=r.unstable_LowPriority,on=r.unstable_IdlePriority,In=r.log,Cl=r.unstable_setDisableYieldValue,Ct=null,ft=null;function hn(e){if(typeof In=="function"&&Cl(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Ct,e)}catch{}}var yt=Math.clz32?Math.clz32:$u,Tl=Math.log,Yu=Math.LN2;function $u(e){return e>>>=0,e===0?32:31-(Tl(e)/Yu|0)|0}var ur=256,sr=262144,cr=4194304;function Cn(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 fr(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=Cn(a):(c&=v,c!==0?i=Cn(c):n||(n=v&~e,n!==0&&(i=Cn(n))))):(v=a&~o,v!==0?i=Cn(v):c!==0?i=Cn(c):n||(n=a&~e,n!==0&&(i=Cn(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 pn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dr(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 Al(){var e=cr;return cr<<=1,(cr&62914560)===0&&(cr=4194304),e}function ui(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ml(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,O=e.hiddenUpdates;for(n=c&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ab=/[\n"\\]/g;function Zt(e){return e.replace(Ab,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=""+Qt(t)):e.value!==""+Qt(t)&&(e.value=""+Qt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Pu(e,c,Qt(t)):n!=null?Pu(e,c,Qt(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=""+Qt(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?""+Qt(n):"",t=t!=null?""+Qt(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 Pu(e,t,n){t==="number"&&Nl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function gr(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(Mn)try{var hi={};Object.defineProperty(hi,"passive",{get:function(){as=!0}}),window.addEventListener("test",hi,hi),window.removeEventListener("test",hi,hi)}catch{as=!1}var Pn=null,rs=null,Dl=null;function dm(){if(Dl)return Dl;var e,t=rs,n=t.length,a,i="value"in Pn?Pn.value:Pn.textContent,o=i.length;for(e=0;e=gi),ym=" ",bm=!1;function wm(e,t){switch(e){case"keyup":return ew.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 xr=!1;function nw(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 aw(e,t){if(xr)return e==="compositionend"||!ss&&wm(e,t)?(e=dm(),Dl=rs=Pn=null,xr=!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=zm(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 Om(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nl(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=Nl(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 fw=Mn&&"documentMode"in document&&11>=document.documentMode,Sr=null,ms=null,xi=null,hs=!1;function Dm(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;hs||Sr==null||Sr!==Nl(a)||(a=Sr,"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}),xi&&wi(xi,a)||(xi=a,a=Mo(ms,"onSelect"),0>=c,i-=c,gn=1<<32-yt(t)+i|n<be?(Me=re,re=null):Me=re.sibling;var De=j(_,re,N[be],X);if(De===null){re===null&&(re=Me);break}e&&re&&De.alternate===null&&t(_,re),A=o(De,A,be),Oe===null?se=De:Oe.sibling=De,Oe=De,re=Me}if(be===N.length)return n(_,re),ze&&zn(_,be),se;if(re===null){for(;bebe?(Me=re,re=null):Me=re.sibling;var wa=j(_,re,De.value,X);if(wa===null){re===null&&(re=Me);break}e&&re&&wa.alternate===null&&t(_,re),A=o(wa,A,be),Oe===null?se=wa:Oe.sibling=wa,Oe=wa,re=Me}if(De.done)return n(_,re),ze&&zn(_,be),se;if(re===null){for(;!De.done;be++,De=N.next())De=Q(_,De.value,X),De!==null&&(A=o(De,A,be),Oe===null?se=De:Oe.sibling=De,Oe=De);return ze&&zn(_,be),se}for(re=a(re);!De.done;be++,De=N.next())De=L(re,_,be,De.value,X),De!==null&&(e&&De.alternate!==null&&re.delete(De.key===null?be:De.key),A=o(De,A,be),Oe===null?se=De:Oe.sibling=De,Oe=De);return e&&re.forEach(function(Nx){return t(_,Nx)}),ze&&zn(_,be),se}function qe(_,A,N,X){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 se=N.key;A!==null;){if(A.key===se){if(se=N.type,se===M){if(A.tag===7){n(_,A.sibling),X=i(A,N.props.children),X.return=_,_=X;break e}}else if(A.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===J&&Fa(se)===A.type){n(_,A.sibling),X=i(A,N.props),Mi(X,N),X.return=_,_=X;break e}n(_,A);break}else t(_,A);A=A.sibling}N.type===M?(X=ka(N.props.children,_.mode,X,N.key),X.return=_,_=X):(X=Yl(N.type,N.key,N.props,null,_.mode,X),Mi(X,N),X.return=_,_=X)}return c(_);case z:e:{for(se=N.key;A!==null;){if(A.key===se)if(A.tag===4&&A.stateNode.containerInfo===N.containerInfo&&A.stateNode.implementation===N.implementation){n(_,A.sibling),X=i(A,N.children||[]),X.return=_,_=X;break e}else{n(_,A);break}else t(_,A);A=A.sibling}X=xs(N,_.mode,X),X.return=_,_=X}return c(_);case J:return N=Fa(N),qe(_,A,N,X)}if(ve(N))return ne(_,A,N,X);if(ie(N)){if(se=ie(N),typeof se!="function")throw Error(s(150));return N=se.call(N),de(_,A,N,X)}if(typeof N.then=="function")return qe(_,A,Jl(N),X);if(N.$$typeof===k)return qe(_,A,Xl(_,N),X);Il(_,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,A!==null&&A.tag===6?(n(_,A.sibling),X=i(A,N),X.return=_,_=X):(n(_,A),X=ws(N,_.mode,X),X.return=_,_=X),c(_)):n(_,A)}return function(_,A,N,X){try{Ai=0;var se=qe(_,A,N,X);return Dr=null,se}catch(re){if(re===Or||re===Zl)throw re;var Oe=Vt(29,re,null,_.mode);return Oe.lanes=X,Oe.return=_,Oe}}}var $a=nh(!0),ah=nh(!1),aa=!1;function Ds(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 ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ia(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ve&2)!==0){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,t=Fl(e),Hm(e,null,n),t}return ql(e,a,t,n),Fl(e)}function Ri(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,Xu(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 Us=!1;function zi(){if(Us){var e=Nr;if(e!==null)throw e}}function _i(e,t,n,a){Us=!1;var i=e.updateQueue;aa=!1;var o=i.firstBaseUpdate,c=i.lastBaseUpdate,v=i.shared.pending;if(v!==null){i.shared.pending=null;var S=v,O=S.next;S.next=null,c===null?o=O:c.next=O,c=S;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,v=Y.lastBaseUpdate,v!==c&&(v===null?Y.firstBaseUpdate=O:v.next=O,Y.lastBaseUpdate=S))}if(o!==null){var Q=i.baseState;c=0,Y=O=S=null,v=o;do{var j=v.lane&-536870913,L=j!==v.lane;if(L?(Ae&j)===j:(a&j)===j){j!==0&&j===_r&&(Us=!0),Y!==null&&(Y=Y.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var ne=e,de=v;j=t;var qe=n;switch(de.tag){case 1:if(ne=de.payload,typeof ne=="function"){Q=ne.call(qe,Q,j);break e}Q=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=de.payload,j=typeof ne=="function"?ne.call(qe,Q,j):ne,j==null)break e;Q=b({},Q,j);break e;case 2:aa=!0}}j=v.callback,j!==null&&(e.flags|=64,L&&(e.flags|=8192),L=i.callbacks,L===null?i.callbacks=[j]:L.push(j))}else L={lane:j,tag:v.tag,payload:v.payload,callback:v.callback,next:null},Y===null?(O=Y=L,S=Q):Y=Y.next=L,c|=j;if(v=v.next,v===null){if(v=i.shared.pending,v===null)break;L=v,v=L.next,L.next=null,i.lastBaseUpdate=L,i.shared.pending=null}}while(!0);Y===null&&(S=Q),i.baseState=S,i.firstBaseUpdate=O,i.lastBaseUpdate=Y,o===null&&(i.shared.lanes=0),ca|=c,e.lanes=c,e.memoizedState=Q}}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(),O=R.S;if(O!==null&&O(v,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var Y=ww(S,a);Di(e,t,Y,Ht(e))}else Di(e,t,a,Ht(e))}catch(Q){Di(e,t,{then:function(){},status:"rejected",reason:Q},Ht())}finally{F.p=o,c!==null&&v.types!==null&&(c.types=v.types),R.T=c}}function Aw(){}function Ws(e,t,n,a){if(e.tag!==5)throw Error(s(476));var i=kh(e).queue;Uh(e,i,t,K,n===null?Aw:function(){return Bh(e),n(a)})}function kh(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:Dn,lastRenderedState:K},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bh(e){var t=kh(e);t.next===null&&(t=e.alternate.memoizedState),Di(e,t.next.queue,{},Ht())}function ec(){return mt(Ji)}function Lh(){return Ie().memoizedState}function Hh(){return Ie().memoizedState}function Mw(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ht();e=ra(n);var a=ia(t,e,n);a!==null&&(_t(a,t,n),Ri(a,t,n)),t={cache:zs()},e.payload=t;return}t=t.return}}function Rw(e,t,n){var a=Ht();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oo(e)?Fh(t,n):(n=ys(e,t,n,a),n!==null&&(_t(n,e,a),Yh(n,t,a)))}function qh(e,t,n){var a=Ht();Di(e,t,n,a)}function Di(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(oo(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,jt(v,c))return ql(e,t,i,0),Fe===null&&Hl(),!1}catch{}if(n=ys(e,t,i,a),n!==null)return _t(n,e,a),Yh(n,t,a),!0}return!1}function tc(e,t,n,a){if(a={lane:2,revertLane:Dc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},oo(e)){if(t)throw Error(s(479))}else t=ys(e,n,a,2),t!==null&&_t(t,e,2)}function oo(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Fh(e,t){Vr=eo=!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,Xu(e,n)}}var ji={readContext:mt,use:ao,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};ji.useEffectEvent=Qe;var $h={readContext:mt,use:ao,useCallback:function(e,t){return wt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Mh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,io(4194308,4,Nh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return io(4194308,4,e,t)},useInsertionEffect:function(e,t){io(4,2,e,t)},useMemo:function(e,t){var n=wt();t=t===void 0?null:t;var a=e();if(Ga){hn(!0);try{e()}finally{hn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=wt();if(n!==void 0){var i=n(t);if(Ga){hn(!0);try{n(t)}finally{hn(!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=Rw.bind(null,ye,e),[a.memoizedState,e]},useRef:function(e){var t=wt();return e={current:e},t.memoizedState=e},useState:function(e){e=Zs(e);var t=e.queue,n=qh.bind(null,ye,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Is,useDeferredValue:function(e,t){var n=wt();return Ps(n,e,t)},useTransition:function(){var e=Zs(!1);return e=Uh.bind(null,ye,e.queue,!0,!1),wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ye,i=wt();if(ze){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Fe===null)throw Error(s(349));(Ae&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,kr(9,{destroy:void 0},dh.bind(null,a,o,n,t),null),n},useId:function(){var e=wt(),t=Fe.identifierPrefix;if(ze){var n=yn,a=gn;n=(a&~(1<<32-yt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=to++,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[Ue]=t,o[Ke]=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(pt(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&&Vn(t)}}return $e(t),pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Vn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(s(166));if(e=le.current,Rr(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,i=dt,i!==null)switch(i.tag){case 27:case 5:a=i.memoizedProps}e[Ue]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||sv(e.nodeValue,n)),e||ta(t,!0)}else e=Ro(e).createTextNode(a),e[Ue]=t,t.stateNode=e}return $e(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Rr(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[Ue]=t}else Ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else n=Ts(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(kt(t),t):(kt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return $e(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Rr(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[Ue]=t}else Ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),i=!1}else i=Ts(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(kt(t),t):(kt(t),null)}return kt(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),mo(t,t.updateQueue),$e(t),null);case 4:return Re(),e===null&&kc(t.stateNode.containerInfo),$e(t),null;case 10:return Nn(t.type),$e(t),null;case 19:if(q(Je),a=t.memoizedState,a===null)return $e(t),null;if(i=(t.flags&128)!==0,o=a.rendering,o===null)if(i)Ui(a,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Wl(e),o!==null){for(t.flags|=128,Ui(a,!1),e=o.updateQueue,t.updateQueue=e,mo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)qm(n,e),n=n.sibling;return Z(Je,Je.current&1|2),ze&&zn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ot()>yo&&(t.flags|=128,i=!0,Ui(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,mo(t,e),Ui(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ze)return $e(t),null}else 2*ot()-a.renderingStartTime>yo&&n!==536870912&&(t.flags|=128,i=!0,Ui(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=ot(),e.sibling=null,n=Je.current,Z(Je,i?n&1|2:n&1),ze&&zn(t,a.treeForkCount),e):($e(t),null);case 22:case 23:return kt(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&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),n=t.updateQueue,n!==null&&mo(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(qa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Nn(We),$e(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function Dw(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 Nn(We),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return at(t),null;case 31:if(t.memoizedState!==null){if(kt(t),t.alternate===null)throw Error(s(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(kt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Je),null;case 4:return Re(),null;case 10:return Nn(t.type),null;case 22:case 23:return kt(t),Bs(),e!==null&&q(qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Nn(We),null;case 25:return null;default:return null}}function hp(e,t){switch(Es(t),t.tag){case 3:Nn(We),Re();break;case 26:case 27:case 5:at(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&kt(t);break;case 13:kt(t);break;case 19:q(Je);break;case 10:Nn(t.type);break;case 22:case 23:kt(t),Bs(),e!==null&&q(qa);break;case 24:Nn(We)}}function ki(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){Be(t,t.return,v)}}function ua(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,O=v;try{O()}catch(Y){Be(i,S,Y)}}}a=a.next}while(a!==o)}}catch(Y){Be(t,t.return,Y)}}function pp(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ih(t,n)}catch(a){Be(e,e.return,a)}}}function vp(e,t,n){n.props=Xa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Be(e,t,a)}}function Bi(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){Be(e,t,i)}}function bn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){Be(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){Be(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){Be(e,e.return,i)}}function vc(e,t,n){try{var a=e.stateNode;tx(a,e.type,n,t),a[Ke]=t}catch(i){Be(e,e.return,i)}}function yp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pa(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&&pa(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=An));else if(a!==4&&(a===27&&pa(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 ho(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&&pa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ho(e,t,n),e=e.sibling;e!==null;)ho(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]);pt(t,a,n),t[Ue]=e,t[Ke]=n}catch(o){Be(e,e.return,o)}}var Un=!1,nt=!1,bc=!1,wp=typeof WeakSet=="function"?WeakSet:Set,st=null;function jw(e,t){if(e=e.containerInfo,Hc=Vo,e=Om(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,O=0,Y=0,Q=e,j=null;t:for(;;){for(var L;Q!==n||i!==0&&Q.nodeType!==3||(v=c+i),Q!==o||a!==0&&Q.nodeType!==3||(S=c+a),Q.nodeType===3&&(c+=Q.nodeValue.length),(L=Q.firstChild)!==null;)j=Q,Q=L;for(;;){if(Q===e)break t;if(j===n&&++O===i&&(v=c),j===o&&++Y===a&&(S=c),(L=Q.nextSibling)!==null)break;Q=j,j=Q.parentNode}Q=L}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},Vo=!1,st=t;st!==null;)if(t=st,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,st=e;else for(;st!==null;){switch(t=st,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"))),pt(o,a,n),o[Ue]=e,ut(o),a=o;break e;case"link":var c=Av("link","href",i).get(a+(n.href||""));if(c){for(var v=0;vqe&&(c=qe,qe=de,de=c);var _=_m(v,de),A=_m(v,qe);if(_&&A&&(L.rangeCount!==1||L.anchorNode!==_.node||L.anchorOffset!==_.offset||L.focusNode!==A.node||L.focusOffset!==A.offset)){var N=Q.createRange();N.setStart(_.node,_.offset),L.removeAllRanges(),de>qe?(L.addRange(N),L.extend(A.node,A.offset)):(N.setEnd(A.node,A.offset),L.addRange(N))}}}}for(Q=[],L=v;L=L.parentNode;)L.nodeType===1&&Q.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;vn?32:n,R.T=null,n=Ac,Ac=null;var o=da,c=qn;if(rt=0,Fr=da=null,qn=0,(Ve&6)!==0)throw Error(s(331));var v=Ve;if(Ve|=4,Np(o.current),Rp(o,o.current,c,n),Ve=v,$i(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Ct,o)}catch{}return!0}finally{F.p=i,R.T=a,Kp(e,t)}}function Ip(e,t,n){t=Jt(n,t),t=ic(e.stateNode,t,2),e=ia(e,t,2),e!==null&&(vn(e,2),wn(e))}function Be(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"&&(fa===null||!fa.has(a))){e=Jt(n,e),n=Ph(2),a=ia(t,n,2),a!==null&&(Wh(n,a,t,e),vn(a,2),wn(a));break}}t=t.return}}function _c(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new kw;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=Fw.bind(null,e,t,n),t.then(e,e))}function Fw(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fe===e&&(Ae&n)===n&&(Ze===4||Ze===3&&(Ae&62914560)===Ae&&300>ot()-go?(Ve&2)===0&&Yr(e,0):Ec|=n,qr===Ae&&(qr=0)),wn(e)}function Pp(e,t){t===0&&(t=Al()),e=Ua(e,t),e!==null&&(vn(e,t),wn(e))}function Yw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Pp(e,n)}function $w(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),Pp(e,n)}function Gw(e,t){return $t(e,t)}var Co=null,Gr=null,Nc=!1,To=!1,Oc=!1,ha=0;function wn(e){e!==Gr&&e.next===null&&(Gr===null?Co=Gr=e:Gr=Gr.next=e),To=!0,Nc||(Nc=!0,Qw())}function $i(e,t){if(!Oc&&To){Oc=!0;do for(var n=!1,a=Co;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-yt(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=Ae,o=fr(a,a===Fe?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||pn(a,o)||(n=!0,nv(a,o));a=a.next}while(n);Oc=!1}}function Xw(){Wp()}function Wp(){To=Nc=!1;var e=0;ha!==0&&ax()&&(e=ha);for(var t=ot(),n=null,a=Co;a!==null;){var i=a.next,o=ev(a,t);o===0?(a.next=null,n===null?Co=i:n.next=i,i===null&&(Gr=n)):(n=a,(e!==0||(o&3)!==0)&&(To=!0)),a=i}rt!==0&&rt!==5||$i(e),ha!==0&&(ha=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,Q=S.initiatorType;Y&&cv(Q)&&(S=S.responseEnd,c+=Y*(S"u"?null:document;function Sv(e,t,n){var a=Xr;if(a&&typeof t=="string"&&t){var i=Zt(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"),pt(t,"link",e),ut(t),a.head.appendChild(t)))}}function dx(e){Fn.D(e),Sv("dns-prefetch",e,null)}function mx(e,t){Fn.C(e,t),Sv("preconnect",e,t)}function hx(e,t,n){Fn.L(e,t,n);var a=Xr;if(a&&e&&t){var i='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Zt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Zt(n.imageSizes)+'"]')):i+='[href="'+Zt(e)+'"]';var o=i;switch(t){case"style":o=Qr(e);break;case"script":o=Zr(e)}nn.has(o)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),nn.set(o,e),a.querySelector(i)!==null||t==="style"&&a.querySelector(Zi(o))||t==="script"&&a.querySelector(Ki(o))||(t=a.createElement("link"),pt(t,"link",e),ut(t),a.head.appendChild(t)))}}function px(e,t){Fn.m(e,t);var n=Xr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Zt(a)+'"][href="'+Zt(e)+'"]',o=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Zr(e)}if(!nn.has(o)&&(e=b({rel:"modulepreload",href:e},t),nn.set(o,e),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ki(o)))return}a=n.createElement("link"),pt(a,"link",e),ut(a),n.head.appendChild(a)}}}function vx(e,t,n){Fn.S(e,t,n);var a=Xr;if(a&&e){var i=pr(a).hoistableStyles,o=Qr(e);t=t||"default";var c=i.get(o);if(!c){var v={loading:0,preload:null};if(c=a.querySelector(Zi(o)))v.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=nn.get(o))&&Zc(e,n);var S=c=a.createElement("link");ut(S),pt(S,"link",e),S._p=new Promise(function(O,Y){S.onload=O,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 gx(e,t){Fn.X(e,t);var n=Xr;if(n&&e){var a=pr(n).hoistableScripts,i=Zr(e),o=a.get(i);o||(o=n.querySelector(Ki(i)),o||(e=b({src:e,async:!0},t),(t=nn.get(i))&&Kc(e,t),o=n.createElement("script"),ut(o),pt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(i,o))}}function yx(e,t){Fn.M(e,t);var n=Xr;if(n&&e){var a=pr(n).hoistableScripts,i=Zr(e),o=a.get(i);o||(o=n.querySelector(Ki(i)),o||(e=b({src:e,async:!0,type:"module"},t),(t=nn.get(i))&&Kc(e,t),o=n.createElement("script"),ut(o),pt(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)?zo(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=Qr(n.href),n=pr(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=Qr(n.href);var o=pr(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(Zi(e)))&&!o._p&&(c.instance=o,c.state.loading=5),nn.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},nn.set(e,n),o||bx(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=Zr(n),n=pr(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 Qr(e){return'href="'+Zt(e)+'"'}function Zi(e){return'link[rel="stylesheet"]['+e+"]"}function Cv(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function bx(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}),pt(t,"link",n),ut(t),e.head.appendChild(t))}function Zr(e){return'[src="'+Zt(e)+'"]'}function Ki(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~="'+Zt(n.href)+'"]');if(a)return t.instance=a,ut(a),a;var i=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),ut(a),pt(a,"style",i),_o(a,n.precedence,e),t.instance=a;case"stylesheet":i=Qr(n.href);var o=e.querySelector(Zi(i));if(o)return t.state.loading|=4,t.instance=o,ut(o),o;a=Cv(n),(i=nn.get(i))&&Zc(a,i),o=(e.ownerDocument||e).createElement("link"),ut(o);var c=o;return c._p=new Promise(function(v,S){c.onload=v,c.onerror=S}),pt(o,"link",a),t.state.loading|=4,_o(o,n.precedence,e),t.instance=o;case"script":return o=Zr(n.src),(i=e.querySelector(Ki(o)))?(t.instance=i,ut(i),i):(a=n,(i=nn.get(o))&&(a=b({},n),Kc(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),ut(i),pt(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 wx(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 xx(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=Qr(a.href),o=t.querySelector(Zi(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Oo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,ut(o);return}o=t.ownerDocument||t,a=Cv(a),(i=nn.get(i))&&Zc(a,i),o=o.createElement("link"),ut(o);var c=o;c._p=new Promise(function(v,S){c.onload=v,c.onerror=S}),pt(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=Oo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Jc=0;function Sx(e,t){return e.stylesheets&&e.count===0&&jo(e,e.stylesheets),0Jc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}:null}function Oo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Do=null;function jo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Do=new Map,t.forEach(Ex,e),Do=null,Oo.call(e))}function Ex(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(),Yo.exports=Xv(),Yo.exports}var Zv=Qv(),Qo={exports:{}},Ir={};var mf;function Kv(){if(mf)return Ir;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 Ir.Fragment=l,Ir.jsx=u,Ir.jsxs=u,Ir}var hf;function Jv(){return hf||(hf=1,Qo.exports=Kv()),Qo.exports}var x=Jv();const pf=Yn(x);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(""),rn=()=>{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}},Pv=ge.createElement,Wv=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=()=>{rn().isStudio&&(ge.createElement=xf(Pv),pf.jsx=xf(Wv))},Ka=r=>{wf.push(r),Sf()},Ef=f.createContext(!1),eg=({children:r})=>x.jsx(Ef.Provider,{value:!0,children:r}),Zo=()=>f.useContext(Ef);function Pr(r){return!!r}var Wr="4.0.427",tg=()=>{if(typeof globalThis>"u")return;const r=()=>{globalThis.remotion_imported=Wr,typeof window<"u"&&(window.remotion_imported=Wr)},l=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(l){if(l===Wr)return;if(typeof l=="string"&&l.includes("webcodecs")){r();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[Wr,typeof l=="string"?l:"an older version"].filter(Pr).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()},$n=({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:$n({className:s.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:$n({className:s.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:$n({className:s.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:$n({className:s.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:$n({className:s.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:$n({className:s.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:$n({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:$n({className:s.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...u}),[s.className,u]);return x.jsx("div",{ref:l,style:d,...s})},Ko=f.forwardRef(ng),it=f.createContext(null),Ja=ge.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),ei=ge.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(w=>[...w,h])},[]),g=f.useCallback(h=>{u(w=>w.filter(b=>b.id!==h))},[]),y=f.useMemo(()=>({registerSequence:m,sequences:l,unregisterSequence:g}),[m,l,g]),p=f.useMemo(()=>({hidden:s,setHidden:d}),[s]);return x.jsx(Ja.Provider,{value:y,children:x.jsx(ei.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")},Jo={};gf(Jo,{useTimelineSetFrame:()=>Vf,useTimelinePosition:()=>Gn,usePlayingState:()=>Uf,persistCurrentFrame:()=>Of,getInitialFrameState:()=>Df,getFrameForComposition:()=>jf});var Tf=ge.createContext(null),lt=()=>{const r=f.useContext(Tf),[l]=f.useState(()=>rn());return r??l},Ia=f.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),el=f.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},updateCompositionDefaultProps:()=>{},onlyRenderComposition:null}),Io=f.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")},resetUnsaved:()=>{throw new Error("Not implemented")}}),Af=ge.createRef(),ig=ge.createRef(),Mf=({children:r})=>{const[l,u]=ge.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 x.jsx(Io.Provider,{value:m,children:r})},Po=()=>"remotion_inputPropsOverride"+window.location.origin,Rf=()=>{if(typeof localStorage>"u")return null;const r=localStorage.getItem(Po());return r?JSON.parse(r):null},lg=r=>{if(!(typeof localStorage>"u")){if(r===null){localStorage.removeItem(Po());return}localStorage.setItem(Po(),JSON.stringify(r))}},Wo="remotion-date:",eu="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 w=this[p];return w instanceof Date?(s=!0,`${Wo}${w.toISOString()}`):w instanceof Map?(m=!0,h):w instanceof Set?(g=!0,h):typeof w=="string"&&u!==null&&w.startsWith(u)?(d=!0,`${eu}${w.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)}},zf=r=>JSON.parse(r,(l,u)=>typeof u=="string"&&u.startsWith(Wo)?new Date(u.replace(Wo,"")):typeof u=="string"&&u.startsWith(eu)?`${window.remotion_staticBase}/${u.replace(eu,"")}`:u),ug=r=>zf(og({data:r,indent:2,staticBase:window.remotion_staticBase}).serializedString),Sa=r=>rn().isStudio?ug(r):r,_f=!1,sg=()=>{_f||(_f=!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(rn().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?zf(l):{}};function tl(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 tu(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 nl(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 al=f.createContext(null),fg=f.createRef(),dg=r=>!!r.calculateMetadata,Nf="remotion.propsUpdatedExternally",nu=r=>{const l=f.useContext(al),{props:u}=f.useContext(Io),{compositions:s,canvasContent:d,currentCompositionMetadata:m}=f.useContext(Ia),g=d?.type==="composition"?d.compositionId:null,y=r??g,p=s.find(b=>b.id===y),h=f.useMemo(()=>p?u[p.id]??{}:{},[u,p]),w=lt();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]:(tu(p.durationInFrames,{allowFloats:!1,component:`in `}),nl(p.fps,`in `),tl(p.width,"width",`in `),tl(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"||w.isPlayer||!window.remotion_inputProps?{}:cg()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null}}):null,[p,l,m,h,w.isPlayer])},rl=()=>{const{canvasContent:r,compositions:l,currentCompositionMetadata:u}=f.useContext(Ia),s=l.find(m=>r?.type==="composition"&&m.id===r.compositionId),d=nu(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])},au=()=>"remotion.time-all",Of=r=>{localStorage.setItem(au(),JSON.stringify(r))},Df=()=>{const r=localStorage.getItem(au())??"{}";return JSON.parse(r)},jf=r=>{const l=localStorage.getItem(au())??"{}",u=JSON.parse(l);return u[r]!==void 0?Number(u[r]):typeof window>"u"?0:window.remotion_initialFrame??0},Gn=()=>{const r=rl(),l=f.useContext(Ft),u=lt();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(Wa);return r},Uf=()=>{const{playing:r,imperativePlaying:l}=f.useContext(Ft),{setPlaying:u}=f.useContext(Wa);return f.useMemo(()=>[r,u,l],[l,r,u])},kf=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 ru(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=kf(u)),u}function Pa(r){return ru(typeof window<"u"?window:void 0,r)}var hg=["trace","verbose","info","warn","error"],Bf=r=>hg.indexOf(r),il=(r,l)=>Bf(r)<=Bf(l),ti=({args:r,logLevel:l,tag:u})=>{const s=[...r];return rn().isRendering&&!rn().isClientSideRendering&&s.unshift(Symbol.for(`__remotion_level_${l}`)),u&&rn().isRendering&&!rn().isClientSideRendering&&s.unshift(Symbol.for(`__remotion_tag_${u}`)),s},pg=(r,...l)=>{if(il(r.logLevel,"verbose"))return console.debug(...ti({args:l,logLevel:"verbose",tag:r.tag}))},vg=(r,...l)=>{if(il(r.logLevel,"trace"))return console.debug(...ti({args:l,logLevel:"trace",tag:r.tag}))},gg=(r,...l)=>{if(il(r.logLevel,"info"))return console.log(...ti({args:l,logLevel:"info",tag:r.tag}))},yg=(r,...l)=>{if(il(r.logLevel,"warn"))return console.warn(...ti({args:l,logLevel:"warn",tag:r.tag}))},bg=(r,...l)=>console.error(...ti({args:l,logLevel:"error",tag:r.tag})),qt={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(Pr).join(" ");l.isClientSideRendering?r.remotion_cancelledError=kf(Error(p)):ru(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(Pr).join(" ");qt.verbose({logLevel:s,tag:"delayRender()"},p),delete r.remotion_delayRenderTimeouts[l]}return!1}return!0}),r.remotion_delayRenderHandles.length===0&&(r.remotion_renderReady=!0)},Ea=f.createContext({logLevel:"info",mountTime:0}),Xn=()=>{const{logLevel:r}=f.useContext(Ea);if(r===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return r},ni=()=>{const{mountTime:r}=f.useContext(Ea);if(r===null)throw new Error("useMountTime must be used within a LogLevelProvider");return r},Lf=f.createContext(null),Qn=()=>{const r=lt(),l=f.useContext(Lf)??(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=>ru(l??(typeof window<"u"?window:void 0),g),[l]);return{delayRender:s,continueRender:d,cancelRender:m}},Wa=f.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),Ft=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(xa(null))),[h,w]=f.useState(()=>Df()),b=l??h,{delayRender:C,continueRender:T}=Qn();typeof window<"u"&&f.useLayoutEffect(()=>{window.remotion_setFrame=(D,V,$)=>{window.remotion_attempt=$;const k=C(`Setting the current frame to ${D}`);let U=!0;w(G=>(G[V]??window.remotion_initialFrame)===D?(U=!1,G):{...G,[V]:D}),U?requestAnimationFrame(()=>T(k)):T(k)},window.remotion_isPlayer=!1},[T,C]);const z=f.useMemo(()=>({frame:b,playing:u,imperativePlaying:d,rootId:p,playbackRate:m,setPlaybackRate:g,audioAndVideoTags:y}),[b,m,u,p]),M=f.useMemo(()=>({setFrame:w,setPlaying:s}),[]);return x.jsx(Ft.Provider,{value:z,children:x.jsx(Wa.Provider,{value:M,children:r})})},ai=f.createContext({getNonce:()=>0}),iu=()=>{const r=f.useContext(ai),[l,u]=f.useState(()=>r.getNonce()),s=f.useRef(r);return f.useEffect(()=>{s.current!==r&&(s.current=r,u(r.getNonce))},[r]),l},Ca=f.createContext(!1),lu=({children:r})=>x.jsx(Ca.Provider,{value:!0,children:r}),ll=()=>{const r=f.useContext(it),l=r?.width??null,u=r?.height??null,s=r?.durationInFrames??null,d=rl();return f.useMemo(()=>{if(!d)return null;const{id:m,durationInFrames:g,fps:y,height:p,width:h,defaultProps:w,props:b,defaultCodec:C,defaultOutName:T,defaultVideoImageFormat:z,defaultPixelFormat:M,defaultProResProfile:D}=d;return{id:m,width:l??h,height:u??p,fps:y,durationInFrames:s??g,defaultProps:w,props:b,defaultCodec:C,defaultOutName:T,defaultVideoImageFormat:z,defaultPixelFormat:M,defaultProResProfile:D}},[s,u,l,d])},bt=()=>{const r=ll(),l=f.useContext(Ca),u=Zo();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},xt=()=>{const r=f.useContext(Ca),l=lt();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=Gn(),s=f.useContext(it),d=s?s.cumulatedFrom+s.relativeFrom:0;return u-d},Rg=({frame:r,children:l,active:u=!0})=>{const s=xt(),d=bt();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(Ft),y=f.useContext(it),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]),w=f.useMemo(()=>y?m?{...y,cumulatedFrom:0}:y:null,[y,m]);return x.jsx(Ft.Provider,{value:h,children:x.jsx(it.Provider,{value:w,children:l})})},zg=({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:w,...b},C)=>{const{layout:T="absolute-fill"}=b,[z]=f.useState(()=>String(Math.random())),M=f.useContext(it),{rootId:D}=f.useContext(Ft),V=M?M.cumulatedFrom+M.relativeFrom:0,$=iu();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 b.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 k=Gn(),U=bt(),G=M?Math.min(M.durationInFrames-r,l):l,B=Math.max(0,Math.min(U.durationInFrames-r,G)),{registerSequence:H,unregisterSequence:J}=f.useContext(Ja),{hidden:P}=f.useContext(ei),ee=f.useMemo(()=>M?.premounting||!!b._remotionInternalIsPremounting,[b._remotionInternalIsPremounting,M?.premounting]),oe=f.useMemo(()=>M?.postmounting||!!b._remotionInternalIsPostmounting,[b._remotionInternalIsPostmounting,M?.postmounting]),ie=f.useMemo(()=>({cumulatedFrom:V,relativeFrom:r,durationInFrames:B,parentFrom:M?.relativeFrom??0,id:z,height:d??M?.height??null,width:m??M?.width??null,premounting:ee,postmounting:oe,premountDisplay:h??null,postmountDisplay:w??null}),[V,r,B,M,z,d,m,ee,oe,h,w]),fe=f.useMemo(()=>s??"",[s]),pe=lt();f.useEffect(()=>{if(pe.isStudio)return H({from:r,duration:B,id:z,displayName:fe,parent:M?.id??null,type:"sequence",rootId:D,showInTimeline:g,nonce:$,loopDisplay:y,stack:p??null,premountDisplay:h??null,postmountDisplay:w??null}),()=>{J(z)}},[l,z,s,H,fe,J,M?.id,B,D,r,g,$,y,p,h,w,pe.isStudio]);const ve=Math.ceil(V+r+l-1),R=kve?null:u,F=b.layout==="none"?void 0:b.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 P[z]??!1?null:x.jsx(it.Provider,{value:ie,children:R===null?null:b.layout==="none"?R:x.jsx(Ko,{ref:C,style:K,className:b.className,children:R})})},_g=f.forwardRef(zg),Ng=(r,l)=>{const u=xt();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,...w}=r,b=Math.ceil(d+m-1),C=u=d-g,T=u>b&&u<=b+y,z=C?d:T?d+m-1:0,M=C||T,D=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 x.jsx(Rg,{frame:z,active:M,children:x.jsx(er,{ref:l,from:d,durationInFrames:m,style:D,_remotionInternalPremountDisplay:g,_remotionInternalPostmountDisplay:y,_remotionInternalIsPremounting:C,_remotionInternalIsPostmounting:T,...w})})},Og=f.forwardRef(Ng),Dg=(r,l)=>{const u=lt(),{fps:s}=bt();if(r.layout!=="none"&&!u.isRendering){const d=r.premountFor;if(d||r.postmountFor)return x.jsx(Og,{ref:l,...r,premountFor:d})}return x.jsx(_g,{...r,ref:l})},er=f.forwardRef(Dg),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,w=r??p.displayWidth,b=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=w,h.height=b,C.drawImage(p,...jg(u,{height:p.displayHeight,width:p.displayWidth},{width:w,height:b}))},[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]),x.jsx("canvas",{ref:g,className:s,style:d})},Ug=ge.forwardRef(Vg),kg=5,Hf=({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 w=async z=>{const M=p.find(V=>V.frameIndex===z);if(M&&M.frame)return M;const D=await g.decode({frameIndex:z,completeFramesOnly:!0});return M?M.frame=D.image:p.push({frame:D.image,frameIndex:z,timeInSeconds:D.image.timestamp/1e6}),{frame:D.image,frameIndex:z,timeInSeconds:D.image.timestamp/1e6}},b=z=>{const D=p.filter(V=>V.frame).sort((V,$)=>{const k=Math.abs(V.timeInSeconds-z),U=Math.abs($.timeInSeconds-z);return k-U});for(let V=0;V{const D=Hf({durationFound:h,loopBehavior:M,timeInSec:z}),$=p.filter(U=>U.timeInSeconds<=D).map(U=>U.frameIndex).reduce((U,G)=>Math.max(U,G),0);let k=$;for(;;){const U=await w(k);if(k++,!U.frame)throw new Error("No frame found");if(!U.frame.duration||(k===y.frameCount&&h===null&&(h=(U.frame.timestamp+U.frame.duration)/1e6),U.timeInSeconds>D||k===y.frameCount))break}y.frameCount-$<3&&M==="loop"&&await w(0),b(D)};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 D=Hf({loopBehavior:M,durationFound:h,timeInSec:z});await C({timeInSec:D,loopBehavior:M});const $=p.filter(k=>k.frame).reduce((k,U)=>{const G=Math.abs(k.timeInSeconds-D),B=Math.abs(U.timeInSeconds-D);return Gtypeof 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:B}=h;return B.isMounted=!0,()=>{B.isMounted=!1}},[]);const w=Lg(r),[b,C]=f.useState(null),{delayRender:T,continueRender:z}=Qn(),[M]=f.useState(()=>T(`Rendering with src="${w}"`)),D=xt(),{fps:V}=bt(),$=D/m/V,k=f.useRef($);k.current=$;const U=f.useRef(null);f.useImperativeHandle(p,()=>{const B=U.current?.getCanvas();if(!B)throw new Error("Canvas ref is not set");return B},[]);const[G]=f.useState(()=>d);return f.useEffect(()=>{const B=new AbortController;return Bg({resolvedSrc:w,signal:B.signal,currentTime:k.current,initialLoopBehavior:G}).then(H=>{C(H),z(M)}).catch(H=>{if(H.name==="AbortError"){z(M);return}s?(s?.(H),z(M)):Pa(H)}),()=>{B.abort()}},[w,M,s,G,z]),f.useLayoutEffect(()=>{if(!b)return;const B=T(`Rendering frame at ${$} of `);b.getFrame($,d).then(H=>{h.current.isMounted&&(H===null?U.current?.clear():U.current?.draw(H.frame)),z(B)}).catch(H=>{s?(s(H),z(B)):Pa(H)})},[$,b,d,s,r,z,T]),x.jsx(Ug,{ref:U,width:l,height:u,fit:g,...y})});var Hg=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"&&(Hg(r.filename),r.contentType!=="thumbnail"&&qg(r.content))},Ta=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 x.jsx(Ta.Provider,{value:y,children:r})},fn=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,ol=({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=()=>ge.useContext(Ff),ul=({durationInFrames:r,times:l=1/0,children:u,name:s,...d})=>{const m=xt(),{durationInFrames:g}=bt();if(tu(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,w=r*(p-1),C=Math.floor(m/r)*r,T=Math.min(C,w),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 x.jsx(Ff.Provider,{value:M,children:x.jsx(er,{durationInFrames:r,from:T,name:s??"",_remotionInternalLoopDisplay:z,layout:d.layout,style:h,children:u})})};ul.useLoop=Yg;var gt=({logLevel:r,tag:l,message:u,mountTime:s})=>{const d=[s?Date.now()-s+"ms ":null,l].filter(Boolean).join(" ");qt.trace({logLevel:r,tag:null},`[${d}]`,u)},sl=f.createContext({}),Yf={},ou=[],$f=({children:r})=>{const[l,u]=f.useState(()=>Yf);return f.useEffect(()=>{const s=()=>{u(Yf)};return ou.push(s),()=>{ou=ou.filter(d=>d!==s)}},[]),x.jsx(sl.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)},tr=r=>{const l=f.useContext(sl),u=Gf(r),s=$g(r);return l[s]?u!==null?l[s]+r.slice(u):l[s]:r},cl=(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.")},fl=({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"?Xg(u,s):(typeof r<"u"||typeof l<"u")&&Gg(r,l)},dl=({startFrom:r,endAt:l,trimBefore:u,trimAfter:s})=>({trimBeforeValue:u??r??void 0,trimAfterValue:s??l??void 0}),Qg=(r,l)=>{if(l.type==="got-duration"){const u=fn(l.src);return r[u]===l.durationInSeconds?r:{...r,[u]:l.durationInSeconds}}else return r},uu=f.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),Xf=({children:r})=>{const[l,u]=f.useReducer(Qg,{}),s=f.useMemo(()=>({durations:l,setDurations:u}),[l]);return x.jsx(uu.Provider,{value:s,children:r})},su=({crossOrigin:r,requestsVideoFrame:l,isClientSideRendering:u})=>{if(r!=null)return r;if(u||l)return"anonymous"},ml=({mediaRef:r,mediaType:l,onAutoPlayError:u,logLevel:s,mountTime:d,reason:m,isPlayer:g})=>{const{current:y}=r;if(!y)return;gt({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&&(qt.info({logLevel:s,tag:"<"+l+">"},"The video will be muted and we'll retry playing it."),qt.info({logLevel:s,tag:"<"+l+">"},"Use onAutoPlayError() to handle this error yourself."),y.muted=!0,y.play())}})},cu=({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}}},Qf=!1,Zg=r=>{Qf||(Qf=!0,typeof window<"u"&&qt.warn({logLevel:r,tag:null},"AudioContext is not supported in this browser"))},Kg=({logLevel:r,latencyHint:l,audioEnabled:u})=>{const s=lt();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,nr=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 k=f.createRef();return{id:Math.random(),ref:k,mediaElementSourceNode:y?cu({audioContext:y,ref:k}):null}}),[y,l]);(ge.useInsertionEffect??ge.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{p.forEach(({mediaElementSourceNode:k})=>{k?.cleanup()})})},[p]);const w=f.useRef(new Array(l).fill(!1)),b=f.useCallback(()=>{p.forEach(({ref:k,id:U})=>{const G=d.current?.find(H=>H.id===U),{current:B}=k;if(B){if(G===void 0){B.src=Zf;return}if(!G)throw new TypeError("Expected audio data to be there");Object.keys(G.props).forEach(H=>{Ig(H,G.props[H],B[H])&&(B[H]=G.props[H])})}})},[p]),C=f.useCallback(k=>{const{aud:U,audioId:G,premounting:B,postmounting:H}=k,J=d.current?.find(ve=>ve.audioId===G);if(J)return J;const P=w.current.findIndex(ve=>ve===!1);if(P===-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:oe,mediaElementSourceNode:ie}=p[P],fe=[...w.current];fe[P]=ee,w.current=fe;const pe={props:U,id:ee,el:oe,audioId:G,mediaElementSourceNode:ie,premounting:B,audioMounted:!!oe.current,postmounting:H,cleanupOnMediaTagUnmount:()=>{}};return d.current?.push(pe),b(),pe},[l,p,b]),T=f.useCallback(k=>{const U=[...w.current],G=p.findIndex(B=>B.id===k);if(G===-1)throw new TypeError("Error occured in ");U[G]=!1,w.current=U,d.current=d.current?.filter(B=>B.id!==k),b()},[p,b]),z=f.useCallback(({aud:k,audioId:U,id:G,premounting:B,postmounting:H})=>{let J=!1;d.current=d.current?.map(P=>{const ee=!!P.el.current;return P.audioMounted!==ee&&(J=!0),P.id===G?Jg(k,P.props)&&P.premounting===B&&P.postmounting===H?P:(J=!0,{...P,props:k,premounting:B,postmounting:H,audioId:U,audioMounted:ee}):P}),J&&b()},[b]),M=ni(),D=lt(),V=f.useCallback(()=>{p.forEach(k=>{d.current.find(G=>G.el===k.ref)?.premounting||ml({mediaRef:k.ref,mediaType:"audio",onAutoPlayError:null,logLevel:g,mountTime:M,reason:"playing all audios",isPlayer:D.isPlayer})}),y?.resume()},[y,g,M,p,D.isPlayer]),$=f.useMemo(()=>({registerAudio:C,unregisterAudio:T,updateAudio:z,playAllAudios:V,numberOfAudioTags:l,audioContext:y}),[l,V,C,T,z,y]);return x.jsxs(nr.Provider,{value:$,children:[p.map(({id:k,ref:U})=>x.jsx("audio",{ref:U,preload:"metadata",src:Zf},k)),r]})},Pg=({aud:r,audioId:l,premounting:u,postmounting:s})=>{const d=f.useContext(nr),[m]=f.useState(()=>{if(d&&d.numberOfAudioTags>0)return d.registerAudio({aud:r,audioId:l,premounting:u,postmounting:s});const y=ge.createRef(),p=d?.audioContext?cu({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=ge.useInsertionEffect??ge.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},Wg=1e-5,hl=(r,l)=>Math.abs(r-l)Math.round(r/l*100)/100,fu=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),pl=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&fu(),ey=r=>pl()&&r.startsWith("blob:"),du=({actualFrom:r,fps:l})=>Jf(Math.max(0,-r),l),mu=({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=${du({actualFrom:l,fps:s})}`;return Number.isFinite(u)?`${m},${mu({duration:u,fps:s})}`:m},ny=({prevStartFrom:r,newStartFrom:l,prevDuration:u,newDuration:s,fps:d})=>{const m=du({actualFrom:r,fps:d}),g=du({actualFrom:l,fps:d}),y=mu({duration:u,fps:d}),p=mu({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,qt.warn({logLevel:r,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),qt.warn({logLevel:r,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),qt.warn({logLevel:r,tag:null},r,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},Pf=({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(nr);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&&fu()){ry(u);return}if(!s)return;const b=new GainNode(p,{gain:g.current});return s.attemptToConnect(),s.get().connect(b),b.connect(p.destination),m.current={gainNode:b},qt.trace({logLevel:u,tag:null},`Starting to amplify ${r.current?.src}. Gain = ${g.current}, playbackRate = ${r.current?.playbackRate}`),()=>{m.current=null,b.disconnect(),s.get().disconnect()}},[u,r,p,s,d]),m.current){const b=l;hl(m.current.gainNode.gain.value,b)||(m.current.gainNode.gain.value=b,qt.trace({logLevel:u,tag:null},`Setting gain to ${b} for ${r.current?.src}`))}return(fu()&&r.current&&r.current?.playbackRate!==1||!d)&&r.current&&!hl(l,r.current?.volume)&&(r.current.volume=Math.min(l,1)),m},Aa=()=>{const r=f.useContext(it);return Math.min(0,r?.relativeFrom??0)},ar=r=>{const l=ul.useLoop(),u=xt(),s=Aa();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]},Ma=({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)},Wf={},ly=r=>{Wf[r]||(console.warn(r),Wf[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=Aa(),h=f.useContext(it),w=bt(),[b]=f.useState(()=>r),C=ol({mediaDurationInFrames:w.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((k,U)=>Ma({frame:U+p,volume:r,mediaVolume:l})).join(","),[T,p,r,l]);f.useEffect(()=>{typeof r=="number"&&r!==b&&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`)},[b,u,s,r]);const M=typeof r=="function",D=iu(),{rootId:V}=f.useContext(Ft),$=lt();return{volumes:z,duration:T,doesVolumeChange:M,nonce:D,rootId:V,isStudio:$.isStudio,finalDisplayName:d??iy(s)}},hu=({volume:r,mediaVolume:l,src:u,mediaType:s,playbackRate:d,displayName:m,id:g,stack:y,showInTimeline:p,premountDisplay:h,postmountDisplay:w,loopDisplay:b})=>{const C=f.useContext(it),T=Aa(),{registerSequence:z,unregisterSequence:M}=f.useContext(Ja),{volumes:D,duration:V,doesVolumeChange:$,nonce:k,rootId:U,isStudio:G,finalDisplayName:B}=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(!(!G&&window.process?.env?.NODE_ENV!=="test")&&p)return z({type:s,src:u,id:g,duration:V,from:0,parent:C?.id??null,displayName:B,rootId:U,volume:D,showInTimeline:!0,nonce:k,startMediaFrom:0-T,doesVolumeChange:$,loopDisplay:b,playbackRate:d,stack:y,premountDisplay:h,postmountDisplay:w}),()=>{M(g)}},[V,g,C,u,z,M,D,$,k,s,T,d,y,p,h,w,G,b,U,B])},oy=(r,l)=>{const[u,s]=f.useState([]),[d,m]=f.useState([]),[g,y]=f.useState([]),h=lt().isRendering,w=f.useRef(!1),b=f.useCallback(z=>h?{unblock:()=>{}}:(s(M=>[...M,z]),{unblock:()=>{s(M=>{const D=M.filter(V=>V!==z);return D.length===M.length?M:D})}}),[h]),C=f.useCallback(z=>(m(M=>[...M,z]),{remove:()=>{m(M=>M.filter(D=>D!==z))}}),[]),T=f.useCallback(z=>(y(M=>[...M,z]),{remove:()=>{y(M=>M.filter(D=>D!==z))}}),[]);return f.useEffect(()=>{h||u.length>0&&(d.forEach(z=>z()),gt({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()),gt({logLevel:r,message:"Player is exiting buffer state",mountTime:l,tag:"player"}))},[u]),f.useMemo(()=>({addBlock:b,listenForBuffering:C,listenForResume:T,buffering:w}),[b,w,C,T])},rr=ge.createContext(null),td=({children:r})=>{const{logLevel:l,mountTime:u}=f.useContext(Ea),s=oy(l??"info",u);return x.jsx(rr.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},pu=()=>{const r=f.useContext(rr),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}=pu(),p=f.useCallback(h=>{if(l!=="video"||!s)return;const w=r.current;if(!w)return;if(w.readyState>=w.HAVE_FUTURE_DATA&&!uy()){gt({logLevel:d,message:`Not using buffer until first frame, because readyState is ${w.readyState} and is not Safari or Desktop Chrome`,mountTime:m,tag:"buffer"});return}if(!w.requestVideoFrameCallback){gt({logLevel:d,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:m,tag:"buffer"});return}g.current=!0,gt({logLevel:d,message:`Buffering ${r.current?.src} until the first frame is received`,mountTime:m,tag:"buffer"});const b=y(),C=()=>{b.unblock(),w.removeEventListener("ended",C,{once:!0}),w.removeEventListener("pause",C,{once:!0}),g.current=!1},T=()=>{C()};w.requestVideoFrameCallback((z,M)=>{Math.abs(M.mediaTime-h)>.5&&u(),C()}),w.addEventListener("ended",T,{once:!0}),w.addEventListener("pause",T,{once:!0}),w.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=ge.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},vl=({mediaRef:r,time:l,logLevel:u,why:s,mountTime:d})=>{const m=pl()?Number(l.toFixed(1)):l;return gt({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=pu(),[p,h]=f.useState(!1);return f.useEffect(()=>{let w=[];const{current:b}=r;if(!b||!l)return;if(u||s){if((u||s)&&b.readyState{let D=!1;w.forEach(V=>{V(M),D=!0}),w=[],h(V=>(V&&(D=!0),!1)),D&>({logLevel:d,message:`Unmarking as buffering: ${b.src}. Reason: ${M}`,tag:"buffer",mountTime:m})},T=M=>{h(!0),gt({logLevel:d,message:`Marking as buffering: ${b.src}. Reason: ${M}`,tag:"buffer",mountTime:m});const{unblock:D}=y.delayPlayback(),V=()=>{C('"canplay" was fired'),z()},$=()=>{C('"error" event was occurred'),z()};b.addEventListener("canplay",V,{once:!0}),w.push(()=>{b.removeEventListener("canplay",V)}),b.addEventListener("error",$,{once:!0}),w.push(()=>{b.removeEventListener("error",$)}),w.push(k=>{gt({logLevel:d,message:`Unblocking ${b.src} from buffer. Reason: ${k}`,tag:"buffer",mountTime:m}),D()})},z=()=>{if(b.readyState{T('"waiting" event was fired')};b.addEventListener("waiting",M),w.push(()=>{b.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((w,b)=>{if(d.current!==null){const C=Math.abs(d.current.time-b.mediaTime),T=Math.abs(u.current===null?1/0:b.mediaTime-u.current);C>.5&&T>.5&&b.mediaTime>d.current.time&&s()}d.current={time:b.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,[w,b]=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 w===b?w:(y=(y-p)/(h-p),y=g(y),y=y*(b-w)+w,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 Ee(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})=>Ee(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:w}=f.useContext(Ft),b=xt(),C=Gn(),[T]=Uf(),z=f.useContext(rr),{fps:M}=bt(),D=Aa(),V=f.useRef(null),$=f.useRef(null),k=Xn(),U=ni();if(!z)throw new Error("useMediaPlayback must be used inside a ");const G=f.useRef({}),B=f.useCallback(()=>{l&&(G.current[l]||(qt.verbose({logLevel:k,tag:null},`Detected ${l} as a variable FPS video. Disabling buffering while seeking.`),G.current[l]=!0))},[k,l]),H=dy({mediaRef:r,mediaType:u,lastSeek:$,onVariableFpsVideoDetected:B}),J=cy(r),P=id({frame:b,playbackRate:s,startFrom:-D,fps:M}),ee=fy({element:r,shouldBuffer:g,isPremounting:y,isPostmounting:p,logLevel:k,mountTime:U,src:l??null}),{bufferUntilFirstFrame:oe,isBuffering:ie}=sy({mediaRef:r,mediaType:u,onVariableFpsVideoDetected:B,pauseWhenBuffering:g,logLevel:k,mountTime:U}),fe=s*w,pe=r.current?.duration?Math.min(r.current.duration,m??.65):m??.65,ve=nd(z);f.useEffect(()=>{if(r.current?.paused)return;if(!T){gt({logLevel:k,tag:"pause",message:`Pausing ${r.current?.src} because ${y?"media is premounting":p?"media is postmounting":"Player is not playing"}`,mountTime:U}),r.current?.pause();return}const F=ee||ie();z.buffering.current&&!F&&(gt({logLevel:k,tag:"pause",message:`Pausing ${r.current?.src} because player is buffering but media tag is not`,mountTime:U}),r.current?.pause())},[ie,ee,z,ve,y,k,r,u,U,T,p]);const R=lt();f.useLayoutEffect(()=>{const F=Math.max(0,fe);r.current&&r.current.playbackRate!==F&&(r.current.playbackRate=F)},[r,fe]),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,P):P,me=J.current.time,E=H.current?.time??null,q=G.current[l],Z=Math.abs(te-me),I=E?Math.abs(te-E):null,W=H.current?.lastUpdate&&H.current.time>J.current.lastUpdate?I:Z,le=I&&!q?W:Z;if(le>pe&&V.current!==te){$.current=vl({mediaRef:r.current,time:te,logLevel:k,why:`because time shift is too big. shouldBeTime = ${te}, isTime = ${me}, requestVideoCallbackTime = ${E}, timeShift = ${le}${q?", isVariableFpsVideo = true":""}, isPremounting = ${y}, isPostmounting = ${p}, pauseWhenBuffering = ${g}`,mountTime:U}),V.current=$.current,T&&(fe>0&&oe(te),r.current.paused&&ml({mediaRef:r,mediaType:u,onAutoPlayError:h,logLevel:k,mountTime:U,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,_e=Math.abs(r.current.currentTime-te)>ae,Re=ee||ie(),Xe=z.buffering.current&&!Re;if(!T||Xe){_e&&($.current=vl({mediaRef:r.current,time:te,logLevel:k,why:`not playing or something else is buffering. time offset is over seek threshold (${ae})`,mountTime:U}));return}if(!T||z.buffering.current)return;const at=r.current.paused&&!r.current.ended;if(at||C===0){const Ot=at?"media tag is paused":"absolute frame is 0";_e&&($.current=vl({mediaRef:r.current,time:te,logLevel:k,why:`is over timeshift threshold (threshold = ${ae}) and ${Ot}`,mountTime:U})),ml({mediaRef:r,mediaType:u,onAutoPlayError:h,logLevel:k,mountTime:U,reason:`player is playing and ${Ot}`,isPlayer:R.isPlayer}),!q&&fe>0&&oe(te)}},[C,pe,oe,z.buffering,H,k,P,ie,ee,r,u,d,fe,T,l,h,y,p,g,U,J,R.isPlayer])},ud=({mediaRef:r,id:l,mediaType:u,onAutoPlayError:s,isPremounting:d,isPostmounting:m})=>{const{audioAndVideoTags:g,imperativePlaying:y}=f.useContext(Ft),p=Xn(),h=ni(),w=lt();f.useEffect(()=>{const b={id:l,play:C=>{if(y.current&&!(d||m))return ml({mediaRef:r,mediaType:u,onAutoPlayError:s,logLevel:p,mountTime:h,reason:C,isPlayer:w.isPlayer})}};return g.current.push(b),()=>{g.current=g.current.filter(C=>C.id!==l)}},[g,l,r,u,s,y,d,m,p,h,w.isPlayer])},vu=f.createContext({mediaMuted:!1,mediaVolume:1}),gu=f.createContext({setMediaMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),yu=()=>{const{mediaVolume:r}=f.useContext(vu),{setMediaVolume:l}=f.useContext(gu);return f.useMemo(()=>[r,l],[r,l])},bu=()=>{const{mediaMuted:r}=f.useContext(vu),{setMediaMuted:l}=f.useContext(gu);return f.useMemo(()=>[r,l],[r,l])},ir=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:w,_remotionInternalNeedsDurationCalculation:b,_remotionInternalNativeLoopPassed:C,_remotionInternalStack:T,allowAmplificationDuringRender:z,name:M,pauseWhenBuffering:D,showInTimeline:V,loopVolumeCurveBehavior:$,stack:k,crossOrigin:U,delayRenderRetries:G,delayRenderTimeoutInMilliseconds:B,toneFrequency:H,useWebAudioApi:J,onError:P,onNativeError:ee,audioStreamIndex:oe,...ie}=r,[fe]=yu(),[pe]=bu(),ve=ar($??"repeat"),{hidden:R}=f.useContext(ei);if(!p)throw new TypeError("No 'src' was passed to .");const F=tr(p),K=f.useContext(it),[te]=f.useState(()=>String(Math.random())),me=R[te]??!1,E=Ma({frame:ve,volume:d,mediaVolume:fe});ir(E);const q=su({crossOrigin:U,requestsVideoFrame:!1,isClientSideRendering:!1}),Z=f.useMemo(()=>({muted:m||pe||me||E<=0,src:F,loop:C,crossOrigin:q,...ie}),[C,me,pe,m,ie,F,E,q]),I=f.useMemo(()=>`audio-${xa(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:W,mediaElementSourceNode:le,cleanupOnMediaTagUnmount:ae}=Pg({aud:Z,audioId:I,premounting:!!K?.premounting,postmounting:!!K?.postmounting});hu({volume:d,mediaVolume:fe,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:W,src:p,mediaType:"audio",playbackRate:g??1,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:w??null,isPremounting:!!K?.premounting,isPostmounting:!!K?.postmounting,pauseWhenBuffering:D,onAutoPlayError:null}),ud({id:te,isPostmounting:!!K?.postmounting,isPremounting:!!K?.premounting,mediaRef:W,mediaType:"audio",onAutoPlayError:null}),Pf({logLevel:s,mediaRef:W,source:le,volume:E,shouldUseWebAudioApi:J??!1}),(ge.useInsertionEffect??ge.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{ae()})},[ae]),f.useImperativeHandle(l,()=>W.current,[W]);const Re=f.useRef(h);return Re.current=h,f.useEffect(()=>{const{current:Xe}=W;if(!Xe)return;if(Xe.duration){Re.current?.(Xe.src,Xe.duration);return}const at=()=>{Re.current?.(Xe.src,Xe.duration)};return Xe.addEventListener("loadedmetadata",at),()=>{Xe.removeEventListener("loadedmetadata",at)}},[W,p]),u?null:x.jsx("audio",{ref:W,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:w,name:b,onNativeError:C,delayRenderRetries:T,delayRenderTimeoutInMilliseconds:z,loopVolumeCurveBehavior:M,pauseWhenBuffering:D,audioStreamIndex:V,...$}=r,k=Gn(),U=ar(M??"repeat"),G=xt(),B=f.useContext(it),{registerRenderAsset:H,unregisterRenderAsset:J}=f.useContext(Ta),{delayRender:P,continueRender:ee}=Qn(),oe=f.useMemo(()=>`audio-${xa(r.src??"")}-${B?.relativeFrom}-${B?.cumulatedFrom}-${B?.durationInFrames}`,[r.src,B?.relativeFrom,B?.cumulatedFrom,B?.durationInFrames]),ie=Ma({volume:s,frame:U,mediaVolume:1});ir(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 H({type:"audio",src:fn(r.src),id:oe,frame:k,volume:ie,mediaFrame:G,playbackRate:r.playbackRate??1,toneFrequency:y??1,audioStartFrame:Math.max(0,-(B?.relativeFrom??0)),audioStreamIndex:V??0}),()=>J(oe)},[r.muted,r.src,H,k,oe,J,ie,U,G,d,r.playbackRate,y,B?.relativeFrom,V]);const{src:fe}=r,pe=l||p;return f.useLayoutEffect(()=>{if(window.process?.env?.NODE_ENV==="test"||!pe)return;const ve=P("Loading duration with src="+fe,{retries:T??void 0,timeoutInMilliseconds:z??void 0}),{current:R}=u,F=()=>{R?.duration&&g(R.src,R.duration),ee(ve)};return R?.duration?(g(R.src,R.duration),ee(ve)):R?.addEventListener("loadedmetadata",F,{once:!0}),()=>{R?.removeEventListener("loadedmetadata",F),ee(ve)}},[fe,g,pe,T,z,ee,P]),pe?x.jsx("audio",{ref:u,...$,onError:C}):null},by=f.forwardRef(yy),wy=(r,l)=>{const u=f.useContext(nr),{startFrom:s,endAt:d,trimBefore:m,trimAfter:g,name:y,stack:p,pauseWhenBuffering:h,showInTimeline:w,onError:b,...C}=r,{loop:T,...z}=r,{fps:M}=bt(),D=lt();if(D.isClientSideRendering)throw new Error(" is not supported in @remotion/web-renderer. Use