ossclip 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,159 @@
1
+ var i1=Object.defineProperty;var s1=(e,t,n)=>t in e?i1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>s1(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function a1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yh={exports:{}},nl={},Kh={exports:{}},fe={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Qi=Symbol.for("react.element"),l1=Symbol.for("react.portal"),u1=Symbol.for("react.fragment"),c1=Symbol.for("react.strict_mode"),d1=Symbol.for("react.profiler"),f1=Symbol.for("react.provider"),p1=Symbol.for("react.context"),m1=Symbol.for("react.forward_ref"),h1=Symbol.for("react.suspense"),g1=Symbol.for("react.memo"),v1=Symbol.for("react.lazy"),qf=Symbol.iterator;function y1(e){return e===null||typeof e!="object"?null:(e=qf&&e[qf]||e["@@iterator"],typeof e=="function"?e:null)}var Xh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Gh=Object.assign,qh={};function jo(e,t,n){this.props=e,this.context=t,this.refs=qh,this.updater=n||Xh}jo.prototype.isReactComponent={};jo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};jo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qh(){}Qh.prototype=jo.prototype;function pd(e,t,n){this.props=e,this.context=t,this.refs=qh,this.updater=n||Xh}var md=pd.prototype=new Qh;md.constructor=pd;Gh(md,jo.prototype);md.isPureReactComponent=!0;var Qf=Array.isArray,Jh=Object.prototype.hasOwnProperty,hd={current:null},eg={key:!0,ref:!0,__self:!0,__source:!0};function tg(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Jh.call(t,r)&&!eg.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Qi,type:e,key:i,ref:s,props:o,_owner:hd.current}}function w1(e,t){return{$$typeof:Qi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function gd(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qi}function x1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Jf=/\/+/g;function Ql(e,t){return typeof e=="object"&&e!==null&&e.key!=null?x1(""+e.key):t.toString(36)}function ra(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Qi:case l1:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Ql(s,0):r,Qf(o)?(n="",e!=null&&(n=e.replace(Jf,"$&/")+"/"),ra(o,t,n,"",function(u){return u})):o!=null&&(gd(o)&&(o=w1(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Jf,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Qf(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Ql(i,a);s+=ra(i,t,n,l,o)}else if(l=y1(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Ql(i,a++),s+=ra(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function xs(e,t,n){if(e==null)return e;var r=[],o=0;return ra(e,r,"","",function(i){return t.call(n,i,o++)}),r}function b1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var wt={current:null},oa={transition:null},S1={ReactCurrentDispatcher:wt,ReactCurrentBatchConfig:oa,ReactCurrentOwner:hd};function ng(){throw Error("act(...) is not supported in production builds of React.")}fe.Children={map:xs,forEach:function(e,t,n){xs(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return xs(e,function(){t++}),t},toArray:function(e){return xs(e,function(t){return t})||[]},only:function(e){if(!gd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};fe.Component=jo;fe.Fragment=u1;fe.Profiler=d1;fe.PureComponent=pd;fe.StrictMode=c1;fe.Suspense=h1;fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S1;fe.act=ng;fe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Gh({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=hd.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Jh.call(t,l)&&!eg.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Qi,type:e.type,key:o,ref:i,props:r,_owner:s}};fe.createContext=function(e){return e={$$typeof:p1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:f1,_context:e},e.Consumer=e};fe.createElement=tg;fe.createFactory=function(e){var t=tg.bind(null,e);return t.type=e,t};fe.createRef=function(){return{current:null}};fe.forwardRef=function(e){return{$$typeof:m1,render:e}};fe.isValidElement=gd;fe.lazy=function(e){return{$$typeof:v1,_payload:{_status:-1,_result:e},_init:b1}};fe.memo=function(e,t){return{$$typeof:g1,type:e,compare:t===void 0?null:t}};fe.startTransition=function(e){var t=oa.transition;oa.transition={};try{e()}finally{oa.transition=t}};fe.unstable_act=ng;fe.useCallback=function(e,t){return wt.current.useCallback(e,t)};fe.useContext=function(e){return wt.current.useContext(e)};fe.useDebugValue=function(){};fe.useDeferredValue=function(e){return wt.current.useDeferredValue(e)};fe.useEffect=function(e,t){return wt.current.useEffect(e,t)};fe.useId=function(){return wt.current.useId()};fe.useImperativeHandle=function(e,t,n){return wt.current.useImperativeHandle(e,t,n)};fe.useInsertionEffect=function(e,t){return wt.current.useInsertionEffect(e,t)};fe.useLayoutEffect=function(e,t){return wt.current.useLayoutEffect(e,t)};fe.useMemo=function(e,t){return wt.current.useMemo(e,t)};fe.useReducer=function(e,t,n){return wt.current.useReducer(e,t,n)};fe.useRef=function(e){return wt.current.useRef(e)};fe.useState=function(e){return wt.current.useState(e)};fe.useSyncExternalStore=function(e,t,n){return wt.current.useSyncExternalStore(e,t,n)};fe.useTransition=function(){return wt.current.useTransition()};fe.version="18.3.1";Kh.exports=fe;var c=Kh.exports;const J=a1(c);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var E1=c,k1=Symbol.for("react.element"),C1=Symbol.for("react.fragment"),I1=Object.prototype.hasOwnProperty,T1=E1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_1={key:!0,ref:!0,__self:!0,__source:!0};function rg(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)I1.call(t,r)&&!_1.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:k1,type:e,key:i,ref:s,props:o,_owner:T1.current}}nl.Fragment=C1;nl.jsx=rg;nl.jsxs=rg;Yh.exports=nl;var f=Yh.exports,qu={},og={exports:{}},At={},ig={exports:{}},sg={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(T,z){var R=T.length;T.push(z);e:for(;0<R;){var $=R-1>>>1,B=T[$];if(0<o(B,z))T[$]=z,T[R]=B,R=$;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var z=T[0],R=T.pop();if(R!==z){T[0]=R;e:for(var $=0,B=T.length,W=B>>>1;$<W;){var M=2*($+1)-1,D=T[M],K=M+1,G=T[K];if(0>o(D,R))K<B&&0>o(G,D)?(T[$]=G,T[K]=R,$=K):(T[$]=D,T[M]=R,$=M);else if(K<B&&0>o(G,R))T[$]=G,T[K]=R,$=K;else break e}}return z}function o(T,z){var R=T.sortIndex-z.sortIndex;return R!==0?R:T.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,p=null,m=3,h=!1,w=!1,v=!1,E=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(T){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=T)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function b(T){if(v=!1,x(T),!w)if(n(l)!==null)w=!0,O(k);else{var z=n(u);z!==null&&N(b,z.startTime-T)}}function k(T,z){w=!1,v&&(v=!1,g(I),I=-1),h=!0;var R=m;try{for(x(z),p=n(l);p!==null&&(!(p.expirationTime>z)||T&&!P());){var $=p.callback;if(typeof $=="function"){p.callback=null,m=p.priorityLevel;var B=$(p.expirationTime<=z);z=e.unstable_now(),typeof B=="function"?p.callback=B:p===n(l)&&r(l),x(z)}else r(l);p=n(l)}if(p!==null)var W=!0;else{var M=n(u);M!==null&&N(b,M.startTime-z),W=!1}return W}finally{p=null,m=R,h=!1}}var S=!1,C=null,I=-1,F=5,j=-1;function P(){return!(e.unstable_now()-j<F)}function A(){if(C!==null){var T=e.unstable_now();j=T;var z=!0;try{z=C(!0,T)}finally{z?V():(S=!1,C=null)}}else S=!1}var V;if(typeof y=="function")V=function(){y(A)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,L=_.port2;_.port1.onmessage=A,V=function(){L.postMessage(null)}}else V=function(){E(A,0)};function O(T){C=T,S||(S=!0,V())}function N(T,z){I=E(function(){T(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){w||h||(w=!0,O(k))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(T){switch(m){case 1:case 2:case 3:var z=3;break;default:z=m}var R=m;m=z;try{return T()}finally{m=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,z){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var R=m;m=T;try{return z()}finally{m=R}},e.unstable_scheduleCallback=function(T,z,R){var $=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?$+R:$):R=$,T){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=R+B,T={id:d++,callback:z,priorityLevel:T,startTime:R,expirationTime:B,sortIndex:-1},R>$?(T.sortIndex=R,t(u,T),n(l)===null&&T===n(u)&&(v?(g(I),I=-1):v=!0,N(b,R-$))):(T.sortIndex=B,t(l,T),w||h||(w=!0,O(k))),T},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(T){var z=m;return function(){var R=m;m=z;try{return T.apply(this,arguments)}finally{m=R}}}})(sg);ig.exports=sg;var R1=ig.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var P1=c,$t=R1;function Y(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ag=new Set,Pi={};function Ar(e,t){ko(e,t),ko(e+"Capture",t)}function ko(e,t){for(Pi[e]=t,e=0;e<t.length;e++)ag.add(t[e])}var Pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qu=Object.prototype.hasOwnProperty,F1=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ep={},tp={};function M1(e){return Qu.call(tp,e)?!0:Qu.call(ep,e)?!1:F1.test(e)?tp[e]=!0:(ep[e]=!0,!1)}function j1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $1(e,t,n,r){if(t===null||typeof t>"u"||j1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function xt(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var st={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){st[e]=new xt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];st[t]=new xt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){st[e]=new xt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){st[e]=new xt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){st[e]=new xt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){st[e]=new xt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){st[e]=new xt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){st[e]=new xt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){st[e]=new xt(e,5,!1,e.toLowerCase(),null,!1,!1)});var vd=/[\-:]([a-z])/g;function yd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(vd,yd);st[t]=new xt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vd,yd);st[t]=new xt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vd,yd);st[t]=new xt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){st[e]=new xt(e,1,!1,e.toLowerCase(),null,!1,!1)});st.xlinkHref=new xt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){st[e]=new xt(e,1,!1,e.toLowerCase(),null,!0,!0)});function wd(e,t,n,r){var o=st.hasOwnProperty(t)?st[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($1(t,n,o,r)&&(n=null),r||o===null?M1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var $n=P1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,bs=Symbol.for("react.element"),Jr=Symbol.for("react.portal"),eo=Symbol.for("react.fragment"),xd=Symbol.for("react.strict_mode"),Ju=Symbol.for("react.profiler"),lg=Symbol.for("react.provider"),ug=Symbol.for("react.context"),bd=Symbol.for("react.forward_ref"),ec=Symbol.for("react.suspense"),tc=Symbol.for("react.suspense_list"),Sd=Symbol.for("react.memo"),Vn=Symbol.for("react.lazy"),cg=Symbol.for("react.offscreen"),np=Symbol.iterator;function Xo(e){return e===null||typeof e!="object"?null:(e=np&&e[np]||e["@@iterator"],typeof e=="function"?e:null)}var Ae=Object.assign,Jl;function fi(e){if(Jl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Jl=t&&t[1]||""}return`
34
+ `+Jl+e}var eu=!1;function tu(e,t){if(!e||eu)return"";eu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
35
+ `),i=r.stack.split(`
36
+ `),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
37
+ `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{eu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fi(e):""}function A1(e){switch(e.tag){case 5:return fi(e.type);case 16:return fi("Lazy");case 13:return fi("Suspense");case 19:return fi("SuspenseList");case 0:case 2:case 15:return e=tu(e.type,!1),e;case 11:return e=tu(e.type.render,!1),e;case 1:return e=tu(e.type,!0),e;default:return""}}function nc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case eo:return"Fragment";case Jr:return"Portal";case Ju:return"Profiler";case xd:return"StrictMode";case ec:return"Suspense";case tc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ug:return(e.displayName||"Context")+".Consumer";case lg:return(e._context.displayName||"Context")+".Provider";case bd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sd:return t=e.displayName||null,t!==null?t:nc(e.type)||"Memo";case Vn:t=e._payload,e=e._init;try{return nc(e(t))}catch{}}return null}function N1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nc(t);case 8:return t===xd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function rr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function dg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function L1(e){var t=dg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ss(e){e._valueTracker||(e._valueTracker=L1(e))}function fg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=dg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function rc(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function rp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=rr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function pg(e,t){t=t.checked,t!=null&&wd(e,"checked",t,!1)}function oc(e,t){pg(e,t);var n=rr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ic(e,t.type,n):t.hasOwnProperty("defaultValue")&&ic(e,t.type,rr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function op(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ic(e,t,n){(t!=="number"||wa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pi=Array.isArray;function ho(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+rr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function sc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Y(91));return Ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ip(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Y(92));if(pi(n)){if(1<n.length)throw Error(Y(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:rr(n)}}function mg(e,t){var n=rr(t.value),r=rr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function sp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function hg(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ac(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?hg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Es,gg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Es=Es||document.createElement("div"),Es.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Es.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},z1=["Webkit","ms","Moz","O"];Object.keys(yi).forEach(function(e){z1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),yi[t]=yi[e]})});function vg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||yi.hasOwnProperty(e)&&yi[e]?(""+t).trim():t+"px"}function yg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=vg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var D1=Ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lc(e,t){if(t){if(D1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Y(62))}}function uc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cc=null;function Ed(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dc=null,go=null,vo=null;function ap(e){if(e=ts(e)){if(typeof dc!="function")throw Error(Y(280));var t=e.stateNode;t&&(t=al(t),dc(e.stateNode,e.type,t))}}function wg(e){go?vo?vo.push(e):vo=[e]:go=e}function xg(){if(go){var e=go,t=vo;if(vo=go=null,ap(e),t)for(e=0;e<t.length;e++)ap(t[e])}}function bg(e,t){return e(t)}function Sg(){}var nu=!1;function Eg(e,t,n){if(nu)return e(t,n);nu=!0;try{return bg(e,t,n)}finally{nu=!1,(go!==null||vo!==null)&&(Sg(),xg())}}function Mi(e,t){var n=e.stateNode;if(n===null)return null;var r=al(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Y(231,t,typeof n));return n}var fc=!1;if(Pn)try{var Go={};Object.defineProperty(Go,"passive",{get:function(){fc=!0}}),window.addEventListener("test",Go,Go),window.removeEventListener("test",Go,Go)}catch{fc=!1}function O1(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var wi=!1,xa=null,ba=!1,pc=null,V1={onError:function(e){wi=!0,xa=e}};function B1(e,t,n,r,o,i,s,a,l){wi=!1,xa=null,O1.apply(V1,arguments)}function W1(e,t,n,r,o,i,s,a,l){if(B1.apply(this,arguments),wi){if(wi){var u=xa;wi=!1,xa=null}else throw Error(Y(198));ba||(ba=!0,pc=u)}}function Nr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function kg(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function lp(e){if(Nr(e)!==e)throw Error(Y(188))}function U1(e){var t=e.alternate;if(!t){if(t=Nr(e),t===null)throw Error(Y(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return lp(o),e;if(i===r)return lp(o),t;i=i.sibling}throw Error(Y(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(Y(189))}}if(n.alternate!==r)throw Error(Y(190))}if(n.tag!==3)throw Error(Y(188));return n.stateNode.current===n?e:t}function Cg(e){return e=U1(e),e!==null?Ig(e):null}function Ig(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ig(e);if(t!==null)return t;e=e.sibling}return null}var Tg=$t.unstable_scheduleCallback,up=$t.unstable_cancelCallback,H1=$t.unstable_shouldYield,Z1=$t.unstable_requestPaint,Oe=$t.unstable_now,Y1=$t.unstable_getCurrentPriorityLevel,kd=$t.unstable_ImmediatePriority,_g=$t.unstable_UserBlockingPriority,Sa=$t.unstable_NormalPriority,K1=$t.unstable_LowPriority,Rg=$t.unstable_IdlePriority,rl=null,gn=null;function X1(e){if(gn&&typeof gn.onCommitFiberRoot=="function")try{gn.onCommitFiberRoot(rl,e,void 0,(e.current.flags&128)===128)}catch{}}var rn=Math.clz32?Math.clz32:Q1,G1=Math.log,q1=Math.LN2;function Q1(e){return e>>>=0,e===0?32:31-(G1(e)/q1|0)|0}var ks=64,Cs=4194304;function mi(e){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ea(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=mi(a):(i&=s,i!==0&&(r=mi(i)))}else s=n&~o,s!==0?r=mi(s):i!==0&&(r=mi(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-rn(t),o=1<<n,r|=e[n],t&=~o;return r}function J1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ex(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-rn(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=J1(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function mc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Pg(){var e=ks;return ks<<=1,!(ks&4194240)&&(ks=64),e}function ru(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ji(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rn(t),e[t]=n}function tx(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-rn(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Cd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rn(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var be=0;function Fg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Mg,Id,jg,$g,Ag,hc=!1,Is=[],Kn=null,Xn=null,Gn=null,ji=new Map,$i=new Map,Wn=[],nx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function cp(e,t){switch(e){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":Xn=null;break;case"mouseover":case"mouseout":Gn=null;break;case"pointerover":case"pointerout":ji.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$i.delete(t.pointerId)}}function qo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=ts(t),t!==null&&Id(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function rx(e,t,n,r,o){switch(t){case"focusin":return Kn=qo(Kn,e,t,n,r,o),!0;case"dragenter":return Xn=qo(Xn,e,t,n,r,o),!0;case"mouseover":return Gn=qo(Gn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ji.set(i,qo(ji.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,$i.set(i,qo($i.get(i)||null,e,t,n,r,o)),!0}return!1}function Ng(e){var t=wr(e.target);if(t!==null){var n=Nr(t);if(n!==null){if(t=n.tag,t===13){if(t=kg(n),t!==null){e.blockedOn=t,Ag(e.priority,function(){jg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ia(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cc=r,n.target.dispatchEvent(r),cc=null}else return t=ts(n),t!==null&&Id(t),e.blockedOn=n,!1;t.shift()}return!0}function dp(e,t,n){ia(e)&&n.delete(t)}function ox(){hc=!1,Kn!==null&&ia(Kn)&&(Kn=null),Xn!==null&&ia(Xn)&&(Xn=null),Gn!==null&&ia(Gn)&&(Gn=null),ji.forEach(dp),$i.forEach(dp)}function Qo(e,t){e.blockedOn===t&&(e.blockedOn=null,hc||(hc=!0,$t.unstable_scheduleCallback($t.unstable_NormalPriority,ox)))}function Ai(e){function t(o){return Qo(o,e)}if(0<Is.length){Qo(Is[0],e);for(var n=1;n<Is.length;n++){var r=Is[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Kn!==null&&Qo(Kn,e),Xn!==null&&Qo(Xn,e),Gn!==null&&Qo(Gn,e),ji.forEach(t),$i.forEach(t),n=0;n<Wn.length;n++)r=Wn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wn.length&&(n=Wn[0],n.blockedOn===null);)Ng(n),n.blockedOn===null&&Wn.shift()}var yo=$n.ReactCurrentBatchConfig,ka=!0;function ix(e,t,n,r){var o=be,i=yo.transition;yo.transition=null;try{be=1,Td(e,t,n,r)}finally{be=o,yo.transition=i}}function sx(e,t,n,r){var o=be,i=yo.transition;yo.transition=null;try{be=4,Td(e,t,n,r)}finally{be=o,yo.transition=i}}function Td(e,t,n,r){if(ka){var o=gc(e,t,n,r);if(o===null)pu(e,t,r,Ca,n),cp(e,r);else if(rx(o,e,t,n,r))r.stopPropagation();else if(cp(e,r),t&4&&-1<nx.indexOf(e)){for(;o!==null;){var i=ts(o);if(i!==null&&Mg(i),i=gc(e,t,n,r),i===null&&pu(e,t,r,Ca,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else pu(e,t,r,null,n)}}var Ca=null;function gc(e,t,n,r){if(Ca=null,e=Ed(r),e=wr(e),e!==null)if(t=Nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=kg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ca=e,null}function Lg(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Y1()){case kd:return 1;case _g:return 4;case Sa:case K1:return 16;case Rg:return 536870912;default:return 16}default:return 16}}var Zn=null,_d=null,sa=null;function zg(){if(sa)return sa;var e,t=_d,n=t.length,r,o="value"in Zn?Zn.value:Zn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return sa=o.slice(e,1<r?1-r:void 0)}function aa(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ts(){return!0}function fp(){return!1}function Nt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ts:fp,this.isPropagationStopped=fp,this}return Ae(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ts)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ts)},persist:function(){},isPersistent:Ts}),t}var $o={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rd=Nt($o),es=Ae({},$o,{view:0,detail:0}),ax=Nt(es),ou,iu,Jo,ol=Ae({},es,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Jo&&(Jo&&e.type==="mousemove"?(ou=e.screenX-Jo.screenX,iu=e.screenY-Jo.screenY):iu=ou=0,Jo=e),ou)},movementY:function(e){return"movementY"in e?e.movementY:iu}}),pp=Nt(ol),lx=Ae({},ol,{dataTransfer:0}),ux=Nt(lx),cx=Ae({},es,{relatedTarget:0}),su=Nt(cx),dx=Ae({},$o,{animationName:0,elapsedTime:0,pseudoElement:0}),fx=Nt(dx),px=Ae({},$o,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mx=Nt(px),hx=Ae({},$o,{data:0}),mp=Nt(hx),gx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yx[e])?!!t[e]:!1}function Pd(){return wx}var xx=Ae({},es,{key:function(e){if(e.key){var t=gx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=aa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pd,charCode:function(e){return e.type==="keypress"?aa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?aa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bx=Nt(xx),Sx=Ae({},ol,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hp=Nt(Sx),Ex=Ae({},es,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pd}),kx=Nt(Ex),Cx=Ae({},$o,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ix=Nt(Cx),Tx=Ae({},ol,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_x=Nt(Tx),Rx=[9,13,27,32],Fd=Pn&&"CompositionEvent"in window,xi=null;Pn&&"documentMode"in document&&(xi=document.documentMode);var Px=Pn&&"TextEvent"in window&&!xi,Dg=Pn&&(!Fd||xi&&8<xi&&11>=xi),gp=" ",vp=!1;function Og(e,t){switch(e){case"keyup":return Rx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var to=!1;function Fx(e,t){switch(e){case"compositionend":return Vg(t);case"keypress":return t.which!==32?null:(vp=!0,gp);case"textInput":return e=t.data,e===gp&&vp?null:e;default:return null}}function Mx(e,t){if(to)return e==="compositionend"||!Fd&&Og(e,t)?(e=zg(),sa=_d=Zn=null,to=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dg&&t.locale!=="ko"?null:t.data;default:return null}}var jx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function yp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!jx[e.type]:t==="textarea"}function Bg(e,t,n,r){wg(r),t=Ia(t,"onChange"),0<t.length&&(n=new Rd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var bi=null,Ni=null;function $x(e){Jg(e,0)}function il(e){var t=oo(e);if(fg(t))return e}function Ax(e,t){if(e==="change")return t}var Wg=!1;if(Pn){var au;if(Pn){var lu="oninput"in document;if(!lu){var wp=document.createElement("div");wp.setAttribute("oninput","return;"),lu=typeof wp.oninput=="function"}au=lu}else au=!1;Wg=au&&(!document.documentMode||9<document.documentMode)}function xp(){bi&&(bi.detachEvent("onpropertychange",Ug),Ni=bi=null)}function Ug(e){if(e.propertyName==="value"&&il(Ni)){var t=[];Bg(t,Ni,e,Ed(e)),Eg($x,t)}}function Nx(e,t,n){e==="focusin"?(xp(),bi=t,Ni=n,bi.attachEvent("onpropertychange",Ug)):e==="focusout"&&xp()}function Lx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return il(Ni)}function zx(e,t){if(e==="click")return il(t)}function Dx(e,t){if(e==="input"||e==="change")return il(t)}function Ox(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sn=typeof Object.is=="function"?Object.is:Ox;function Li(e,t){if(sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Qu.call(t,o)||!sn(e[o],t[o]))return!1}return!0}function bp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sp(e,t){var n=bp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=bp(n)}}function Hg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zg(){for(var e=window,t=wa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wa(e.document)}return t}function Md(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")}function Vx(e){var t=Zg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Hg(n.ownerDocument.documentElement,n)){if(r!==null&&Md(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Sp(n,i);var s=Sp(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Bx=Pn&&"documentMode"in document&&11>=document.documentMode,no=null,vc=null,Si=null,yc=!1;function Ep(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yc||no==null||no!==wa(r)||(r=no,"selectionStart"in r&&Md(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Si&&Li(Si,r)||(Si=r,r=Ia(vc,"onSelect"),0<r.length&&(t=new Rd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=no)))}function _s(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ro={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionend:_s("Transition","TransitionEnd")},uu={},Yg={};Pn&&(Yg=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function sl(e){if(uu[e])return uu[e];if(!ro[e])return e;var t=ro[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yg)return uu[e]=t[n];return e}var Kg=sl("animationend"),Xg=sl("animationiteration"),Gg=sl("animationstart"),qg=sl("transitionend"),Qg=new Map,kp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function cr(e,t){Qg.set(e,t),Ar(t,[e])}for(var cu=0;cu<kp.length;cu++){var du=kp[cu],Wx=du.toLowerCase(),Ux=du[0].toUpperCase()+du.slice(1);cr(Wx,"on"+Ux)}cr(Kg,"onAnimationEnd");cr(Xg,"onAnimationIteration");cr(Gg,"onAnimationStart");cr("dblclick","onDoubleClick");cr("focusin","onFocus");cr("focusout","onBlur");cr(qg,"onTransitionEnd");ko("onMouseEnter",["mouseout","mouseover"]);ko("onMouseLeave",["mouseout","mouseover"]);ko("onPointerEnter",["pointerout","pointerover"]);ko("onPointerLeave",["pointerout","pointerover"]);Ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ar("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Hx=new Set("cancel close invalid load scroll toggle".split(" ").concat(hi));function Cp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,W1(r,t,void 0,e),e.currentTarget=null}function Jg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Cp(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Cp(o,a,u),i=l}}}if(ba)throw e=pc,ba=!1,pc=null,e}function Ie(e,t){var n=t[Ec];n===void 0&&(n=t[Ec]=new Set);var r=e+"__bubble";n.has(r)||(ev(t,e,2,!1),n.add(r))}function fu(e,t,n){var r=0;t&&(r|=4),ev(n,e,r,t)}var Rs="_reactListening"+Math.random().toString(36).slice(2);function zi(e){if(!e[Rs]){e[Rs]=!0,ag.forEach(function(n){n!=="selectionchange"&&(Hx.has(n)||fu(n,!1,e),fu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Rs]||(t[Rs]=!0,fu("selectionchange",!1,t))}}function ev(e,t,n,r){switch(Lg(t)){case 1:var o=ix;break;case 4:o=sx;break;default:o=Td}n=o.bind(null,t,n,e),o=void 0,!fc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function pu(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=wr(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Eg(function(){var u=i,d=Ed(n),p=[];e:{var m=Qg.get(e);if(m!==void 0){var h=Rd,w=e;switch(e){case"keypress":if(aa(n)===0)break e;case"keydown":case"keyup":h=bx;break;case"focusin":w="focus",h=su;break;case"focusout":w="blur",h=su;break;case"beforeblur":case"afterblur":h=su;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=pp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=ux;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=kx;break;case Kg:case Xg:case Gg:h=fx;break;case qg:h=Ix;break;case"scroll":h=ax;break;case"wheel":h=_x;break;case"copy":case"cut":case"paste":h=mx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=hp}var v=(t&4)!==0,E=!v&&e==="scroll",g=v?m!==null?m+"Capture":null:m;v=[];for(var y=u,x;y!==null;){x=y;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,g!==null&&(b=Mi(y,g),b!=null&&v.push(Di(y,b,x)))),E)break;y=y.return}0<v.length&&(m=new h(m,w,null,n,d),p.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",m&&n!==cc&&(w=n.relatedTarget||n.fromElement)&&(wr(w)||w[Fn]))break e;if((h||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,h?(w=n.relatedTarget||n.toElement,h=u,w=w?wr(w):null,w!==null&&(E=Nr(w),w!==E||w.tag!==5&&w.tag!==6)&&(w=null)):(h=null,w=u),h!==w)){if(v=pp,b="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=hp,b="onPointerLeave",g="onPointerEnter",y="pointer"),E=h==null?m:oo(h),x=w==null?m:oo(w),m=new v(b,y+"leave",h,n,d),m.target=E,m.relatedTarget=x,b=null,wr(d)===u&&(v=new v(g,y+"enter",w,n,d),v.target=x,v.relatedTarget=E,b=v),E=b,h&&w)t:{for(v=h,g=w,y=0,x=v;x;x=Zr(x))y++;for(x=0,b=g;b;b=Zr(b))x++;for(;0<y-x;)v=Zr(v),y--;for(;0<x-y;)g=Zr(g),x--;for(;y--;){if(v===g||g!==null&&v===g.alternate)break t;v=Zr(v),g=Zr(g)}v=null}else v=null;h!==null&&Ip(p,m,h,v,!1),w!==null&&E!==null&&Ip(p,E,w,v,!0)}}e:{if(m=u?oo(u):window,h=m.nodeName&&m.nodeName.toLowerCase(),h==="select"||h==="input"&&m.type==="file")var k=Ax;else if(yp(m))if(Wg)k=Dx;else{k=Lx;var S=Nx}else(h=m.nodeName)&&h.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(k=zx);if(k&&(k=k(e,u))){Bg(p,k,n,d);break e}S&&S(e,m,u),e==="focusout"&&(S=m._wrapperState)&&S.controlled&&m.type==="number"&&ic(m,"number",m.value)}switch(S=u?oo(u):window,e){case"focusin":(yp(S)||S.contentEditable==="true")&&(no=S,vc=u,Si=null);break;case"focusout":Si=vc=no=null;break;case"mousedown":yc=!0;break;case"contextmenu":case"mouseup":case"dragend":yc=!1,Ep(p,n,d);break;case"selectionchange":if(Bx)break;case"keydown":case"keyup":Ep(p,n,d)}var C;if(Fd)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else to?Og(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(Dg&&n.locale!=="ko"&&(to||I!=="onCompositionStart"?I==="onCompositionEnd"&&to&&(C=zg()):(Zn=d,_d="value"in Zn?Zn.value:Zn.textContent,to=!0)),S=Ia(u,I),0<S.length&&(I=new mp(I,e,null,n,d),p.push({event:I,listeners:S}),C?I.data=C:(C=Vg(n),C!==null&&(I.data=C)))),(C=Px?Fx(e,n):Mx(e,n))&&(u=Ia(u,"onBeforeInput"),0<u.length&&(d=new mp("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:u}),d.data=C))}Jg(p,t)})}function Di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ia(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Mi(e,n),i!=null&&r.unshift(Di(e,i,o)),i=Mi(e,t),i!=null&&r.push(Di(e,i,o))),e=e.return}return r}function Zr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ip(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=Mi(n,i),l!=null&&s.unshift(Di(n,l,a))):o||(l=Mi(n,i),l!=null&&s.push(Di(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Zx=/\r\n?/g,Yx=/\u0000|\uFFFD/g;function Tp(e){return(typeof e=="string"?e:""+e).replace(Zx,`
38
+ `).replace(Yx,"")}function Ps(e,t,n){if(t=Tp(t),Tp(e)!==t&&n)throw Error(Y(425))}function Ta(){}var wc=null,xc=null;function bc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sc=typeof setTimeout=="function"?setTimeout:void 0,Kx=typeof clearTimeout=="function"?clearTimeout:void 0,_p=typeof Promise=="function"?Promise:void 0,Xx=typeof queueMicrotask=="function"?queueMicrotask:typeof _p<"u"?function(e){return _p.resolve(null).then(e).catch(Gx)}:Sc;function Gx(e){setTimeout(function(){throw e})}function mu(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Ai(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Ai(t)}function qn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Rp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ao=Math.random().toString(36).slice(2),pn="__reactFiber$"+Ao,Oi="__reactProps$"+Ao,Fn="__reactContainer$"+Ao,Ec="__reactEvents$"+Ao,qx="__reactListeners$"+Ao,Qx="__reactHandles$"+Ao;function wr(e){var t=e[pn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fn]||n[pn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Rp(e);e!==null;){if(n=e[pn])return n;e=Rp(e)}return t}e=n,n=e.parentNode}return null}function ts(e){return e=e[pn]||e[Fn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function oo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Y(33))}function al(e){return e[Oi]||null}var kc=[],io=-1;function dr(e){return{current:e}}function Te(e){0>io||(e.current=kc[io],kc[io]=null,io--)}function ke(e,t){io++,kc[io]=e.current,e.current=t}var or={},mt=dr(or),It=dr(!1),Tr=or;function Co(e,t){var n=e.type.contextTypes;if(!n)return or;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Tt(e){return e=e.childContextTypes,e!=null}function _a(){Te(It),Te(mt)}function Pp(e,t,n){if(mt.current!==or)throw Error(Y(168));ke(mt,t),ke(It,n)}function tv(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(Y(108,N1(e)||"Unknown",o));return Ae({},n,r)}function Ra(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||or,Tr=mt.current,ke(mt,e),ke(It,It.current),!0}function Fp(e,t,n){var r=e.stateNode;if(!r)throw Error(Y(169));n?(e=tv(e,t,Tr),r.__reactInternalMemoizedMergedChildContext=e,Te(It),Te(mt),ke(mt,e)):Te(It),ke(It,n)}var kn=null,ll=!1,hu=!1;function nv(e){kn===null?kn=[e]:kn.push(e)}function Jx(e){ll=!0,nv(e)}function fr(){if(!hu&&kn!==null){hu=!0;var e=0,t=be;try{var n=kn;for(be=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}kn=null,ll=!1}catch(o){throw kn!==null&&(kn=kn.slice(e+1)),Tg(kd,fr),o}finally{be=t,hu=!1}}return null}var so=[],ao=0,Pa=null,Fa=0,Bt=[],Wt=0,_r=null,In=1,Tn="";function vr(e,t){so[ao++]=Fa,so[ao++]=Pa,Pa=e,Fa=t}function rv(e,t,n){Bt[Wt++]=In,Bt[Wt++]=Tn,Bt[Wt++]=_r,_r=e;var r=In;e=Tn;var o=32-rn(r)-1;r&=~(1<<o),n+=1;var i=32-rn(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,In=1<<32-rn(t)+o|n<<o|r,Tn=i+e}else In=1<<i|n<<o|r,Tn=e}function jd(e){e.return!==null&&(vr(e,1),rv(e,1,0))}function $d(e){for(;e===Pa;)Pa=so[--ao],so[ao]=null,Fa=so[--ao],so[ao]=null;for(;e===_r;)_r=Bt[--Wt],Bt[Wt]=null,Tn=Bt[--Wt],Bt[Wt]=null,In=Bt[--Wt],Bt[Wt]=null}var jt=null,Mt=null,_e=!1,nn=null;function ov(e,t){var n=Ht(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Mp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,jt=e,Mt=qn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,jt=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=_r!==null?{id:In,overflow:Tn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ht(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,jt=e,Mt=null,!0):!1;default:return!1}}function Cc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ic(e){if(_e){var t=Mt;if(t){var n=t;if(!Mp(e,t)){if(Cc(e))throw Error(Y(418));t=qn(n.nextSibling);var r=jt;t&&Mp(e,t)?ov(r,n):(e.flags=e.flags&-4097|2,_e=!1,jt=e)}}else{if(Cc(e))throw Error(Y(418));e.flags=e.flags&-4097|2,_e=!1,jt=e}}}function jp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;jt=e}function Fs(e){if(e!==jt)return!1;if(!_e)return jp(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!bc(e.type,e.memoizedProps)),t&&(t=Mt)){if(Cc(e))throw iv(),Error(Y(418));for(;t;)ov(e,t),t=qn(t.nextSibling)}if(jp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Y(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Mt=qn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=jt?qn(e.stateNode.nextSibling):null;return!0}function iv(){for(var e=Mt;e;)e=qn(e.nextSibling)}function Io(){Mt=jt=null,_e=!1}function Ad(e){nn===null?nn=[e]:nn.push(e)}var eb=$n.ReactCurrentBatchConfig;function ei(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Y(309));var r=n.stateNode}if(!r)throw Error(Y(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(Y(284));if(!n._owner)throw Error(Y(290,e))}return e}function Ms(e,t){throw e=Object.prototype.toString.call(t),Error(Y(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $p(e){var t=e._init;return t(e._payload)}function sv(e){function t(g,y){if(e){var x=g.deletions;x===null?(g.deletions=[y],g.flags|=16):x.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function o(g,y){return g=tr(g,y),g.index=0,g.sibling=null,g}function i(g,y,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<y?(g.flags|=2,y):x):(g.flags|=2,y)):(g.flags|=1048576,y)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,y,x,b){return y===null||y.tag!==6?(y=Su(x,g.mode,b),y.return=g,y):(y=o(y,x),y.return=g,y)}function l(g,y,x,b){var k=x.type;return k===eo?d(g,y,x.props.children,b,x.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Vn&&$p(k)===y.type)?(b=o(y,x.props),b.ref=ei(g,y,x),b.return=g,b):(b=ma(x.type,x.key,x.props,null,g.mode,b),b.ref=ei(g,y,x),b.return=g,b)}function u(g,y,x,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=Eu(x,g.mode,b),y.return=g,y):(y=o(y,x.children||[]),y.return=g,y)}function d(g,y,x,b,k){return y===null||y.tag!==7?(y=Ir(x,g.mode,b,k),y.return=g,y):(y=o(y,x),y.return=g,y)}function p(g,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Su(""+y,g.mode,x),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case bs:return x=ma(y.type,y.key,y.props,null,g.mode,x),x.ref=ei(g,null,y),x.return=g,x;case Jr:return y=Eu(y,g.mode,x),y.return=g,y;case Vn:var b=y._init;return p(g,b(y._payload),x)}if(pi(y)||Xo(y))return y=Ir(y,g.mode,x,null),y.return=g,y;Ms(g,y)}return null}function m(g,y,x,b){var k=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return k!==null?null:a(g,y,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case bs:return x.key===k?l(g,y,x,b):null;case Jr:return x.key===k?u(g,y,x,b):null;case Vn:return k=x._init,m(g,y,k(x._payload),b)}if(pi(x)||Xo(x))return k!==null?null:d(g,y,x,b,null);Ms(g,x)}return null}function h(g,y,x,b,k){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(x)||null,a(y,g,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case bs:return g=g.get(b.key===null?x:b.key)||null,l(y,g,b,k);case Jr:return g=g.get(b.key===null?x:b.key)||null,u(y,g,b,k);case Vn:var S=b._init;return h(g,y,x,S(b._payload),k)}if(pi(b)||Xo(b))return g=g.get(x)||null,d(y,g,b,k,null);Ms(y,b)}return null}function w(g,y,x,b){for(var k=null,S=null,C=y,I=y=0,F=null;C!==null&&I<x.length;I++){C.index>I?(F=C,C=null):F=C.sibling;var j=m(g,C,x[I],b);if(j===null){C===null&&(C=F);break}e&&C&&j.alternate===null&&t(g,C),y=i(j,y,I),S===null?k=j:S.sibling=j,S=j,C=F}if(I===x.length)return n(g,C),_e&&vr(g,I),k;if(C===null){for(;I<x.length;I++)C=p(g,x[I],b),C!==null&&(y=i(C,y,I),S===null?k=C:S.sibling=C,S=C);return _e&&vr(g,I),k}for(C=r(g,C);I<x.length;I++)F=h(C,g,I,x[I],b),F!==null&&(e&&F.alternate!==null&&C.delete(F.key===null?I:F.key),y=i(F,y,I),S===null?k=F:S.sibling=F,S=F);return e&&C.forEach(function(P){return t(g,P)}),_e&&vr(g,I),k}function v(g,y,x,b){var k=Xo(x);if(typeof k!="function")throw Error(Y(150));if(x=k.call(x),x==null)throw Error(Y(151));for(var S=k=null,C=y,I=y=0,F=null,j=x.next();C!==null&&!j.done;I++,j=x.next()){C.index>I?(F=C,C=null):F=C.sibling;var P=m(g,C,j.value,b);if(P===null){C===null&&(C=F);break}e&&C&&P.alternate===null&&t(g,C),y=i(P,y,I),S===null?k=P:S.sibling=P,S=P,C=F}if(j.done)return n(g,C),_e&&vr(g,I),k;if(C===null){for(;!j.done;I++,j=x.next())j=p(g,j.value,b),j!==null&&(y=i(j,y,I),S===null?k=j:S.sibling=j,S=j);return _e&&vr(g,I),k}for(C=r(g,C);!j.done;I++,j=x.next())j=h(C,g,I,j.value,b),j!==null&&(e&&j.alternate!==null&&C.delete(j.key===null?I:j.key),y=i(j,y,I),S===null?k=j:S.sibling=j,S=j);return e&&C.forEach(function(A){return t(g,A)}),_e&&vr(g,I),k}function E(g,y,x,b){if(typeof x=="object"&&x!==null&&x.type===eo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case bs:e:{for(var k=x.key,S=y;S!==null;){if(S.key===k){if(k=x.type,k===eo){if(S.tag===7){n(g,S.sibling),y=o(S,x.props.children),y.return=g,g=y;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Vn&&$p(k)===S.type){n(g,S.sibling),y=o(S,x.props),y.ref=ei(g,S,x),y.return=g,g=y;break e}n(g,S);break}else t(g,S);S=S.sibling}x.type===eo?(y=Ir(x.props.children,g.mode,b,x.key),y.return=g,g=y):(b=ma(x.type,x.key,x.props,null,g.mode,b),b.ref=ei(g,y,x),b.return=g,g=b)}return s(g);case Jr:e:{for(S=x.key;y!==null;){if(y.key===S)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(g,y.sibling),y=o(y,x.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=Eu(x,g.mode,b),y.return=g,g=y}return s(g);case Vn:return S=x._init,E(g,y,S(x._payload),b)}if(pi(x))return w(g,y,x,b);if(Xo(x))return v(g,y,x,b);Ms(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(g,y.sibling),y=o(y,x),y.return=g,g=y):(n(g,y),y=Su(x,g.mode,b),y.return=g,g=y),s(g)):n(g,y)}return E}var To=sv(!0),av=sv(!1),Ma=dr(null),ja=null,lo=null,Nd=null;function Ld(){Nd=lo=ja=null}function zd(e){var t=Ma.current;Te(Ma),e._currentValue=t}function Tc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function wo(e,t){ja=e,Nd=lo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ct=!0),e.firstContext=null)}function Yt(e){var t=e._currentValue;if(Nd!==e)if(e={context:e,memoizedValue:t,next:null},lo===null){if(ja===null)throw Error(Y(308));lo=e,ja.dependencies={lanes:0,firstContext:e}}else lo=lo.next=e;return t}var xr=null;function Dd(e){xr===null?xr=[e]:xr.push(e)}function lv(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Dd(t)):(n.next=o.next,o.next=n),t.interleaved=n,Mn(e,r)}function Mn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Bn=!1;function Od(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,he&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Mn(e,n)}return o=r.interleaved,o===null?(t.next=t,Dd(r)):(t.next=o.next,o.next=t),r.interleaved=t,Mn(e,n)}function la(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cd(e,n)}}function Ap(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function $a(e,t,n,r){var o=e.updateQueue;Bn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var p=o.baseState;s=0,d=u=l=null,a=i;do{var m=a.lane,h=a.eventTime;if((r&m)===m){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,v=a;switch(m=t,h=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){p=w.call(h,p,m);break e}p=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,m=typeof w=="function"?w.call(h,p,m):w,m==null)break e;p=Ae({},p,m);break e;case 2:Bn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[a]:m.push(a))}else h={eventTime:h,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=h,l=p):d=d.next=h,s|=m;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;m=a,a=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(!0);if(d===null&&(l=p),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Pr|=s,e.lanes=s,e.memoizedState=p}}function Np(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(Y(191,o));o.call(r)}}}var ns={},vn=dr(ns),Vi=dr(ns),Bi=dr(ns);function br(e){if(e===ns)throw Error(Y(174));return e}function Vd(e,t){switch(ke(Bi,t),ke(Vi,e),ke(vn,ns),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ac(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ac(t,e)}Te(vn),ke(vn,t)}function _o(){Te(vn),Te(Vi),Te(Bi)}function cv(e){br(Bi.current);var t=br(vn.current),n=ac(t,e.type);t!==n&&(ke(Vi,e),ke(vn,n))}function Bd(e){Vi.current===e&&(Te(vn),Te(Vi))}var je=dr(0);function Aa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var gu=[];function Wd(){for(var e=0;e<gu.length;e++)gu[e]._workInProgressVersionPrimary=null;gu.length=0}var ua=$n.ReactCurrentDispatcher,vu=$n.ReactCurrentBatchConfig,Rr=0,$e=null,He=null,Qe=null,Na=!1,Ei=!1,Wi=0,tb=0;function ct(){throw Error(Y(321))}function Ud(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sn(e[n],t[n]))return!1;return!0}function Hd(e,t,n,r,o,i){if(Rr=i,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ua.current=e===null||e.memoizedState===null?ib:sb,e=n(r,o),Ei){i=0;do{if(Ei=!1,Wi=0,25<=i)throw Error(Y(301));i+=1,Qe=He=null,t.updateQueue=null,ua.current=ab,e=n(r,o)}while(Ei)}if(ua.current=La,t=He!==null&&He.next!==null,Rr=0,Qe=He=$e=null,Na=!1,t)throw Error(Y(300));return e}function Zd(){var e=Wi!==0;return Wi=0,e}function fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?$e.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Kt(){if(He===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=Qe===null?$e.memoizedState:Qe.next;if(t!==null)Qe=t,He=e;else{if(e===null)throw Error(Y(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},Qe===null?$e.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function Ui(e,t){return typeof t=="function"?t(e):t}function yu(e){var t=Kt(),n=t.queue;if(n===null)throw Error(Y(311));n.lastRenderedReducer=e;var r=He,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var d=u.lane;if((Rr&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var p={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=p,s=r):l=l.next=p,$e.lanes|=d,Pr|=d}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,sn(r,t.memoizedState)||(Ct=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,$e.lanes|=i,Pr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function wu(e){var t=Kt(),n=t.queue;if(n===null)throw Error(Y(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);sn(i,t.memoizedState)||(Ct=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function dv(){}function fv(e,t){var n=$e,r=Kt(),o=t(),i=!sn(r.memoizedState,o);if(i&&(r.memoizedState=o,Ct=!0),r=r.queue,Yd(hv.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Qe!==null&&Qe.memoizedState.tag&1){if(n.flags|=2048,Hi(9,mv.bind(null,n,r,o,t),void 0,null),Je===null)throw Error(Y(349));Rr&30||pv(n,t,o)}return o}function pv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function mv(e,t,n,r){t.value=n,t.getSnapshot=r,gv(t)&&vv(e)}function hv(e,t,n){return n(function(){gv(t)&&vv(e)})}function gv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sn(e,n)}catch{return!0}}function vv(e){var t=Mn(e,1);t!==null&&on(t,e,1,-1)}function Lp(e){var t=fn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:e},t.queue=e,e=e.dispatch=ob.bind(null,$e,e),[t.memoizedState,e]}function Hi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function yv(){return Kt().memoizedState}function ca(e,t,n,r){var o=fn();$e.flags|=e,o.memoizedState=Hi(1|t,n,void 0,r===void 0?null:r)}function ul(e,t,n,r){var o=Kt();r=r===void 0?null:r;var i=void 0;if(He!==null){var s=He.memoizedState;if(i=s.destroy,r!==null&&Ud(r,s.deps)){o.memoizedState=Hi(t,n,i,r);return}}$e.flags|=e,o.memoizedState=Hi(1|t,n,i,r)}function zp(e,t){return ca(8390656,8,e,t)}function Yd(e,t){return ul(2048,8,e,t)}function wv(e,t){return ul(4,2,e,t)}function xv(e,t){return ul(4,4,e,t)}function bv(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Sv(e,t,n){return n=n!=null?n.concat([e]):null,ul(4,4,bv.bind(null,t,e),n)}function Kd(){}function Ev(e,t){var n=Kt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ud(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function kv(e,t){var n=Kt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ud(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Cv(e,t,n){return Rr&21?(sn(n,t)||(n=Pg(),$e.lanes|=n,Pr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ct=!0),e.memoizedState=n)}function nb(e,t){var n=be;be=n!==0&&4>n?n:4,e(!0);var r=vu.transition;vu.transition={};try{e(!1),t()}finally{be=n,vu.transition=r}}function Iv(){return Kt().memoizedState}function rb(e,t,n){var r=er(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Tv(e))_v(t,n);else if(n=lv(e,t,n,r),n!==null){var o=yt();on(n,e,r,o),Rv(n,t,r)}}function ob(e,t,n){var r=er(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Tv(e))_v(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,sn(a,s)){var l=t.interleaved;l===null?(o.next=o,Dd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=lv(e,t,o,r),n!==null&&(o=yt(),on(n,e,r,o),Rv(n,t,r))}}function Tv(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function _v(e,t){Ei=Na=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cd(e,n)}}var La={readContext:Yt,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},ib={readContext:Yt,useCallback:function(e,t){return fn().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:zp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ca(4194308,4,bv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ca(4194308,4,e,t)},useInsertionEffect:function(e,t){return ca(4,2,e,t)},useMemo:function(e,t){var n=fn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=rb.bind(null,$e,e),[r.memoizedState,e]},useRef:function(e){var t=fn();return e={current:e},t.memoizedState=e},useState:Lp,useDebugValue:Kd,useDeferredValue:function(e){return fn().memoizedState=e},useTransition:function(){var e=Lp(!1),t=e[0];return e=nb.bind(null,e[1]),fn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$e,o=fn();if(_e){if(n===void 0)throw Error(Y(407));n=n()}else{if(n=t(),Je===null)throw Error(Y(349));Rr&30||pv(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,zp(hv.bind(null,r,i,e),[e]),r.flags|=2048,Hi(9,mv.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=fn(),t=Je.identifierPrefix;if(_e){var n=Tn,r=In;n=(r&~(1<<32-rn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Wi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=tb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sb={readContext:Yt,useCallback:Ev,useContext:Yt,useEffect:Yd,useImperativeHandle:Sv,useInsertionEffect:wv,useLayoutEffect:xv,useMemo:kv,useReducer:yu,useRef:yv,useState:function(){return yu(Ui)},useDebugValue:Kd,useDeferredValue:function(e){var t=Kt();return Cv(t,He.memoizedState,e)},useTransition:function(){var e=yu(Ui)[0],t=Kt().memoizedState;return[e,t]},useMutableSource:dv,useSyncExternalStore:fv,useId:Iv,unstable_isNewReconciler:!1},ab={readContext:Yt,useCallback:Ev,useContext:Yt,useEffect:Yd,useImperativeHandle:Sv,useInsertionEffect:wv,useLayoutEffect:xv,useMemo:kv,useReducer:wu,useRef:yv,useState:function(){return wu(Ui)},useDebugValue:Kd,useDeferredValue:function(e){var t=Kt();return He===null?t.memoizedState=e:Cv(t,He.memoizedState,e)},useTransition:function(){var e=wu(Ui)[0],t=Kt().memoizedState;return[e,t]},useMutableSource:dv,useSyncExternalStore:fv,useId:Iv,unstable_isNewReconciler:!1};function en(e,t){if(e&&e.defaultProps){t=Ae({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _c(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var cl={isMounted:function(e){return(e=e._reactInternals)?Nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yt(),o=er(e),i=Rn(r,o);i.payload=t,n!=null&&(i.callback=n),t=Qn(e,i,o),t!==null&&(on(t,e,o,r),la(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yt(),o=er(e),i=Rn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Qn(e,i,o),t!==null&&(on(t,e,o,r),la(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yt(),r=er(e),o=Rn(n,r);o.tag=2,t!=null&&(o.callback=t),t=Qn(e,o,r),t!==null&&(on(t,e,r,n),la(t,e,r))}};function Dp(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Li(n,r)||!Li(o,i):!0}function Pv(e,t,n){var r=!1,o=or,i=t.contextType;return typeof i=="object"&&i!==null?i=Yt(i):(o=Tt(t)?Tr:mt.current,r=t.contextTypes,i=(r=r!=null)?Co(e,o):or),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=cl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Op(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&cl.enqueueReplaceState(t,t.state,null)}function Rc(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Od(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Yt(i):(i=Tt(t)?Tr:mt.current,o.context=Co(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(_c(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&cl.enqueueReplaceState(o,o.state,null),$a(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ro(e,t){try{var n="",r=t;do n+=A1(r),r=r.return;while(r);var o=n}catch(i){o=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function xu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Pc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var lb=typeof WeakMap=="function"?WeakMap:Map;function Fv(e,t,n){n=Rn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Da||(Da=!0,Oc=r),Pc(e,t)},n}function Mv(e,t,n){n=Rn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Pc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Pc(e,t),typeof r!="function"&&(Jn===null?Jn=new Set([this]):Jn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Vp(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new lb;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Sb.bind(null,e,t,n),t.then(e,e))}function Bp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Wp(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Rn(-1,1),t.tag=2,Qn(n,t,1))),n.lanes|=1),e)}var ub=$n.ReactCurrentOwner,Ct=!1;function gt(e,t,n,r){t.child=e===null?av(t,null,n,r):To(t,e.child,n,r)}function Up(e,t,n,r,o){n=n.render;var i=t.ref;return wo(t,o),r=Hd(e,t,n,r,i,o),n=Zd(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,jn(e,t,o)):(_e&&n&&jd(t),t.flags|=1,gt(e,t,r,o),t.child)}function Hp(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!nf(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,jv(e,t,i,r,o)):(e=ma(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Li,n(s,r)&&e.ref===t.ref)return jn(e,t,o)}return t.flags|=1,e=tr(i,r),e.ref=t.ref,e.return=t,t.child=e}function jv(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Li(i,r)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Ct=!0);else return t.lanes=e.lanes,jn(e,t,o)}return Fc(e,t,n,r,o)}function $v(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ke(co,Ft),Ft|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ke(co,Ft),Ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ke(co,Ft),Ft|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ke(co,Ft),Ft|=r;return gt(e,t,o,n),t.child}function Av(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fc(e,t,n,r,o){var i=Tt(n)?Tr:mt.current;return i=Co(t,i),wo(t,o),n=Hd(e,t,n,r,i,o),r=Zd(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,jn(e,t,o)):(_e&&r&&jd(t),t.flags|=1,gt(e,t,n,o),t.child)}function Zp(e,t,n,r,o){if(Tt(n)){var i=!0;Ra(t)}else i=!1;if(wo(t,o),t.stateNode===null)da(e,t),Pv(t,n,r),Rc(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Yt(u):(u=Tt(n)?Tr:mt.current,u=Co(t,u));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Op(t,s,r,u),Bn=!1;var m=t.memoizedState;s.state=m,$a(t,r,s,o),l=t.memoizedState,a!==r||m!==l||It.current||Bn?(typeof d=="function"&&(_c(t,n,d,r),l=t.memoizedState),(a=Bn||Dp(t,n,a,r,m,l,u))?(p||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,uv(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:en(t.type,a),s.props=u,p=t.pendingProps,m=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Yt(l):(l=Tt(n)?Tr:mt.current,l=Co(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==p||m!==l)&&Op(t,s,r,l),Bn=!1,m=t.memoizedState,s.state=m,$a(t,r,s,o);var w=t.memoizedState;a!==p||m!==w||It.current||Bn?(typeof h=="function"&&(_c(t,n,h,r),w=t.memoizedState),(u=Bn||Dp(t,n,u,r,m,w,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,w,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,w,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),s.props=r,s.state=w,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Mc(e,t,n,r,i,o)}function Mc(e,t,n,r,o,i){Av(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Fp(t,n,!1),jn(e,t,i);r=t.stateNode,ub.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=To(t,e.child,null,i),t.child=To(t,null,a,i)):gt(e,t,a,i),t.memoizedState=r.state,o&&Fp(t,n,!0),t.child}function Nv(e){var t=e.stateNode;t.pendingContext?Pp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Pp(e,t.context,!1),Vd(e,t.containerInfo)}function Yp(e,t,n,r,o){return Io(),Ad(o),t.flags|=256,gt(e,t,n,r),t.child}var jc={dehydrated:null,treeContext:null,retryLane:0};function $c(e){return{baseLanes:e,cachePool:null,transitions:null}}function Lv(e,t,n){var r=t.pendingProps,o=je.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ke(je,o&1),e===null)return Ic(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=pl(s,r,0,null),e=Ir(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=$c(n),t.memoizedState=jc,e):Xd(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return cb(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=tr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=tr(a,i):(i=Ir(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?$c(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=jc,r}return i=e.child,e=i.sibling,r=tr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Xd(e,t){return t=pl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function js(e,t,n,r){return r!==null&&Ad(r),To(t,e.child,null,n),e=Xd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cb(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=xu(Error(Y(422))),js(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=pl({mode:"visible",children:r.children},o,0,null),i=Ir(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&To(t,e.child,null,s),t.child.memoizedState=$c(s),t.memoizedState=jc,i);if(!(t.mode&1))return js(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(Y(419)),r=xu(i,r,void 0),js(e,t,s,r)}if(a=(s&e.childLanes)!==0,Ct||a){if(r=Je,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Mn(e,o),on(r,e,o,-1))}return tf(),r=xu(Error(Y(421))),js(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Eb.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Mt=qn(o.nextSibling),jt=t,_e=!0,nn=null,e!==null&&(Bt[Wt++]=In,Bt[Wt++]=Tn,Bt[Wt++]=_r,In=e.id,Tn=e.overflow,_r=t),t=Xd(t,r.children),t.flags|=4096,t)}function Kp(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Tc(e.return,t,n)}function bu(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function zv(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(gt(e,t,r.children,n),r=je.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Kp(e,n,t);else if(e.tag===19)Kp(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ke(je,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Aa(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),bu(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Aa(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}bu(t,!0,n,null,i);break;case"together":bu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function da(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function jn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Pr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Y(153));if(t.child!==null){for(e=t.child,n=tr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=tr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function db(e,t,n){switch(t.tag){case 3:Nv(t),Io();break;case 5:cv(t);break;case 1:Tt(t.type)&&Ra(t);break;case 4:Vd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ke(Ma,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ke(je,je.current&1),t.flags|=128,null):n&t.child.childLanes?Lv(e,t,n):(ke(je,je.current&1),e=jn(e,t,n),e!==null?e.sibling:null);ke(je,je.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return zv(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ke(je,je.current),r)break;return null;case 22:case 23:return t.lanes=0,$v(e,t,n)}return jn(e,t,n)}var Dv,Ac,Ov,Vv;Dv=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ac=function(){};Ov=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,br(vn.current);var i=null;switch(n){case"input":o=rc(e,o),r=rc(e,r),i=[];break;case"select":o=Ae({},o,{value:void 0}),r=Ae({},r,{value:void 0}),i=[];break;case"textarea":o=sc(e,o),r=sc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ta)}lc(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Pi.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Pi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ie("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Vv=function(e,t,n,r){n!==r&&(t.flags|=4)};function ti(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function fb(e,t,n){var r=t.pendingProps;switch($d(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return Tt(t.type)&&_a(),dt(t),null;case 3:return r=t.stateNode,_o(),Te(It),Te(mt),Wd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Fs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,nn!==null&&(Wc(nn),nn=null))),Ac(e,t),dt(t),null;case 5:Bd(t);var o=br(Bi.current);if(n=t.type,e!==null&&t.stateNode!=null)Ov(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Y(166));return dt(t),null}if(e=br(vn.current),Fs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[pn]=t,r[Oi]=i,e=(t.mode&1)!==0,n){case"dialog":Ie("cancel",r),Ie("close",r);break;case"iframe":case"object":case"embed":Ie("load",r);break;case"video":case"audio":for(o=0;o<hi.length;o++)Ie(hi[o],r);break;case"source":Ie("error",r);break;case"img":case"image":case"link":Ie("error",r),Ie("load",r);break;case"details":Ie("toggle",r);break;case"input":rp(r,i),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ie("invalid",r);break;case"textarea":ip(r,i),Ie("invalid",r)}lc(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ps(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ps(r.textContent,a,e),o=["children",""+a]):Pi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Ie("scroll",r)}switch(n){case"input":Ss(r),op(r,i,!0);break;case"textarea":Ss(r),sp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Ta)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=hg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[pn]=t,e[Oi]=r,Dv(e,t,!1,!1),t.stateNode=e;e:{switch(s=uc(n,r),n){case"dialog":Ie("cancel",e),Ie("close",e),o=r;break;case"iframe":case"object":case"embed":Ie("load",e),o=r;break;case"video":case"audio":for(o=0;o<hi.length;o++)Ie(hi[o],e);o=r;break;case"source":Ie("error",e),o=r;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=r;break;case"details":Ie("toggle",e),o=r;break;case"input":rp(e,r),o=rc(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ae({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":ip(e,r),o=sc(e,r),Ie("invalid",e);break;default:o=r}lc(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?yg(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&gg(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Fi(e,l):typeof l=="number"&&Fi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Pi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ie("scroll",e):l!=null&&wd(e,i,l,s))}switch(n){case"input":Ss(e),op(e,r,!1);break;case"textarea":Ss(e),sp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+rr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?ho(e,!!r.multiple,i,!1):r.defaultValue!=null&&ho(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ta)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return dt(t),null;case 6:if(e&&t.stateNode!=null)Vv(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Y(166));if(n=br(Bi.current),br(vn.current),Fs(t)){if(r=t.stateNode,n=t.memoizedProps,r[pn]=t,(i=r.nodeValue!==n)&&(e=jt,e!==null))switch(e.tag){case 3:Ps(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ps(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[pn]=t,t.stateNode=r}return dt(t),null;case 13:if(Te(je),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&Mt!==null&&t.mode&1&&!(t.flags&128))iv(),Io(),t.flags|=98560,i=!1;else if(i=Fs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Y(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Y(317));i[pn]=t}else Io(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dt(t),i=!1}else nn!==null&&(Wc(nn),nn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||je.current&1?Ze===0&&(Ze=3):tf())),t.updateQueue!==null&&(t.flags|=4),dt(t),null);case 4:return _o(),Ac(e,t),e===null&&zi(t.stateNode.containerInfo),dt(t),null;case 10:return zd(t.type._context),dt(t),null;case 17:return Tt(t.type)&&_a(),dt(t),null;case 19:if(Te(je),i=t.memoizedState,i===null)return dt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ti(i,!1);else{if(Ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Aa(e),s!==null){for(t.flags|=128,ti(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ke(je,je.current&1|2),t.child}e=e.sibling}i.tail!==null&&Oe()>Po&&(t.flags|=128,r=!0,ti(i,!1),t.lanes=4194304)}else{if(!r)if(e=Aa(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ti(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!_e)return dt(t),null}else 2*Oe()-i.renderingStartTime>Po&&n!==1073741824&&(t.flags|=128,r=!0,ti(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Oe(),t.sibling=null,n=je.current,ke(je,r?n&1|2:n&1),t):(dt(t),null);case 22:case 23:return ef(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ft&1073741824&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),null;case 24:return null;case 25:return null}throw Error(Y(156,t.tag))}function pb(e,t){switch($d(t),t.tag){case 1:return Tt(t.type)&&_a(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _o(),Te(It),Te(mt),Wd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bd(t),null;case 13:if(Te(je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Y(340));Io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(je),null;case 4:return _o(),null;case 10:return zd(t.type._context),null;case 22:case 23:return ef(),null;case 24:return null;default:return null}}var $s=!1,ft=!1,mb=typeof WeakSet=="function"?WeakSet:Set,te=null;function uo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ze(e,t,r)}else n.current=null}function Nc(e,t,n){try{n()}catch(r){ze(e,t,r)}}var Xp=!1;function hb(e,t){if(wc=ka,e=Zg(),Md(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,p=e,m=null;t:for(;;){for(var h;p!==n||o!==0&&p.nodeType!==3||(a=s+o),p!==i||r!==0&&p.nodeType!==3||(l=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(h=p.firstChild)!==null;)m=p,p=h;for(;;){if(p===e)break t;if(m===n&&++u===o&&(a=s),m===i&&++d===r&&(l=s),(h=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(xc={focusedElem:e,selectionRange:n},ka=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,E=w.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:en(t.type,v),E);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Y(163))}}catch(b){ze(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return w=Xp,Xp=!1,w}function ki(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Nc(t,n,i)}o=o.next}while(o!==r)}}function dl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Lc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Bv(e){var t=e.alternate;t!==null&&(e.alternate=null,Bv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pn],delete t[Oi],delete t[Ec],delete t[qx],delete t[Qx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Wv(e){return e.tag===5||e.tag===3||e.tag===4}function Gp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wv(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.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 zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ta));else if(r!==4&&(e=e.child,e!==null))for(zc(e,t,n),e=e.sibling;e!==null;)zc(e,t,n),e=e.sibling}function Dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Dc(e,t,n),e=e.sibling;e!==null;)Dc(e,t,n),e=e.sibling}var rt=null,tn=!1;function Ln(e,t,n){for(n=n.child;n!==null;)Uv(e,t,n),n=n.sibling}function Uv(e,t,n){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(rl,n)}catch{}switch(n.tag){case 5:ft||uo(n,t);case 6:var r=rt,o=tn;rt=null,Ln(e,t,n),rt=r,tn=o,rt!==null&&(tn?(e=rt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):rt.removeChild(n.stateNode));break;case 18:rt!==null&&(tn?(e=rt,n=n.stateNode,e.nodeType===8?mu(e.parentNode,n):e.nodeType===1&&mu(e,n),Ai(e)):mu(rt,n.stateNode));break;case 4:r=rt,o=tn,rt=n.stateNode.containerInfo,tn=!0,Ln(e,t,n),rt=r,tn=o;break;case 0:case 11:case 14:case 15:if(!ft&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Nc(n,t,s),o=o.next}while(o!==r)}Ln(e,t,n);break;case 1:if(!ft&&(uo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ze(n,t,a)}Ln(e,t,n);break;case 21:Ln(e,t,n);break;case 22:n.mode&1?(ft=(r=ft)||n.memoizedState!==null,Ln(e,t,n),ft=r):Ln(e,t,n);break;default:Ln(e,t,n)}}function qp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mb),t.forEach(function(r){var o=kb.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function qt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:rt=a.stateNode,tn=!1;break e;case 3:rt=a.stateNode.containerInfo,tn=!0;break e;case 4:rt=a.stateNode.containerInfo,tn=!0;break e}a=a.return}if(rt===null)throw Error(Y(160));Uv(i,s,o),rt=null,tn=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){ze(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Hv(t,e),t=t.sibling}function Hv(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qt(t,e),un(e),r&4){try{ki(3,e,e.return),dl(3,e)}catch(v){ze(e,e.return,v)}try{ki(5,e,e.return)}catch(v){ze(e,e.return,v)}}break;case 1:qt(t,e),un(e),r&512&&n!==null&&uo(n,n.return);break;case 5:if(qt(t,e),un(e),r&512&&n!==null&&uo(n,n.return),e.flags&32){var o=e.stateNode;try{Fi(o,"")}catch(v){ze(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&pg(o,i),uc(a,s);var u=uc(a,i);for(s=0;s<l.length;s+=2){var d=l[s],p=l[s+1];d==="style"?yg(o,p):d==="dangerouslySetInnerHTML"?gg(o,p):d==="children"?Fi(o,p):wd(o,d,p,u)}switch(a){case"input":oc(o,i);break;case"textarea":mg(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?ho(o,!!i.multiple,h,!1):m!==!!i.multiple&&(i.defaultValue!=null?ho(o,!!i.multiple,i.defaultValue,!0):ho(o,!!i.multiple,i.multiple?[]:"",!1))}o[Oi]=i}catch(v){ze(e,e.return,v)}}break;case 6:if(qt(t,e),un(e),r&4){if(e.stateNode===null)throw Error(Y(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){ze(e,e.return,v)}}break;case 3:if(qt(t,e),un(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ai(t.containerInfo)}catch(v){ze(e,e.return,v)}break;case 4:qt(t,e),un(e);break;case 13:qt(t,e),un(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Qd=Oe())),r&4&&qp(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(ft=(u=ft)||d,qt(t,e),ft=u):qt(t,e),un(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(te=e,d=e.child;d!==null;){for(p=te=d;te!==null;){switch(m=te,h=m.child,m.tag){case 0:case 11:case 14:case 15:ki(4,m,m.return);break;case 1:uo(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(v){ze(r,n,v)}}break;case 5:uo(m,m.return);break;case 22:if(m.memoizedState!==null){Jp(p);continue}}h!==null?(h.return=m,te=h):Jp(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=p.stateNode,l=p.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=vg("display",s))}catch(v){ze(e,e.return,v)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(v){ze(e,e.return,v)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:qt(t,e),un(e),r&4&&qp(e);break;case 21:break;default:qt(t,e),un(e)}}function un(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Wv(n)){var r=n;break e}n=n.return}throw Error(Y(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Fi(o,""),r.flags&=-33);var i=Gp(e);Dc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Gp(e);zc(e,a,s);break;default:throw Error(Y(161))}}catch(l){ze(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gb(e,t,n){te=e,Zv(e)}function Zv(e,t,n){for(var r=(e.mode&1)!==0;te!==null;){var o=te,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||$s;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||ft;a=$s;var u=ft;if($s=s,(ft=l)&&!u)for(te=o;te!==null;)s=te,l=s.child,s.tag===22&&s.memoizedState!==null?em(o):l!==null?(l.return=s,te=l):em(o);for(;i!==null;)te=i,Zv(i),i=i.sibling;te=o,$s=a,ft=u}Qp(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,te=i):Qp(e)}}function Qp(e){for(;te!==null;){var t=te;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ft||dl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ft)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:en(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Np(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Np(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&Ai(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Y(163))}ft||t.flags&512&&Lc(t)}catch(m){ze(t,t.return,m)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function Jp(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}function em(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{dl(4,t)}catch(l){ze(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){ze(t,o,l)}}var i=t.return;try{Lc(t)}catch(l){ze(t,i,l)}break;case 5:var s=t.return;try{Lc(t)}catch(l){ze(t,s,l)}}}catch(l){ze(t,t.return,l)}if(t===e){te=null;break}var a=t.sibling;if(a!==null){a.return=t.return,te=a;break}te=t.return}}var vb=Math.ceil,za=$n.ReactCurrentDispatcher,Gd=$n.ReactCurrentOwner,Zt=$n.ReactCurrentBatchConfig,he=0,Je=null,Ue=null,ot=0,Ft=0,co=dr(0),Ze=0,Zi=null,Pr=0,fl=0,qd=0,Ci=null,kt=null,Qd=0,Po=1/0,En=null,Da=!1,Oc=null,Jn=null,As=!1,Yn=null,Oa=0,Ii=0,Vc=null,fa=-1,pa=0;function yt(){return he&6?Oe():fa!==-1?fa:fa=Oe()}function er(e){return e.mode&1?he&2&&ot!==0?ot&-ot:eb.transition!==null?(pa===0&&(pa=Pg()),pa):(e=be,e!==0||(e=window.event,e=e===void 0?16:Lg(e.type)),e):1}function on(e,t,n,r){if(50<Ii)throw Ii=0,Vc=null,Error(Y(185));Ji(e,n,r),(!(he&2)||e!==Je)&&(e===Je&&(!(he&2)&&(fl|=n),Ze===4&&Un(e,ot)),_t(e,r),n===1&&he===0&&!(t.mode&1)&&(Po=Oe()+500,ll&&fr()))}function _t(e,t){var n=e.callbackNode;ex(e,t);var r=Ea(e,e===Je?ot:0);if(r===0)n!==null&&up(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&up(n),t===1)e.tag===0?Jx(tm.bind(null,e)):nv(tm.bind(null,e)),Xx(function(){!(he&6)&&fr()}),n=null;else{switch(Fg(r)){case 1:n=kd;break;case 4:n=_g;break;case 16:n=Sa;break;case 536870912:n=Rg;break;default:n=Sa}n=ey(n,Yv.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Yv(e,t){if(fa=-1,pa=0,he&6)throw Error(Y(327));var n=e.callbackNode;if(xo()&&e.callbackNode!==n)return null;var r=Ea(e,e===Je?ot:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Va(e,r);else{t=r;var o=he;he|=2;var i=Xv();(Je!==e||ot!==t)&&(En=null,Po=Oe()+500,Cr(e,t));do try{xb();break}catch(a){Kv(e,a)}while(!0);Ld(),za.current=i,he=o,Ue!==null?t=0:(Je=null,ot=0,t=Ze)}if(t!==0){if(t===2&&(o=mc(e),o!==0&&(r=o,t=Bc(e,o))),t===1)throw n=Zi,Cr(e,0),Un(e,r),_t(e,Oe()),n;if(t===6)Un(e,r);else{if(o=e.current.alternate,!(r&30)&&!yb(o)&&(t=Va(e,r),t===2&&(i=mc(e),i!==0&&(r=i,t=Bc(e,i))),t===1))throw n=Zi,Cr(e,0),Un(e,r),_t(e,Oe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(Y(345));case 2:yr(e,kt,En);break;case 3:if(Un(e,r),(r&130023424)===r&&(t=Qd+500-Oe(),10<t)){if(Ea(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){yt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Sc(yr.bind(null,e,kt,En),t);break}yr(e,kt,En);break;case 4:if(Un(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-rn(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Oe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vb(r/1960))-r,10<r){e.timeoutHandle=Sc(yr.bind(null,e,kt,En),r);break}yr(e,kt,En);break;case 5:yr(e,kt,En);break;default:throw Error(Y(329))}}}return _t(e,Oe()),e.callbackNode===n?Yv.bind(null,e):null}function Bc(e,t){var n=Ci;return e.current.memoizedState.isDehydrated&&(Cr(e,t).flags|=256),e=Va(e,t),e!==2&&(t=kt,kt=n,t!==null&&Wc(t)),e}function Wc(e){kt===null?kt=e:kt.push.apply(kt,e)}function yb(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!sn(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Un(e,t){for(t&=~qd,t&=~fl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rn(t),r=1<<n;e[n]=-1,t&=~r}}function tm(e){if(he&6)throw Error(Y(327));xo();var t=Ea(e,0);if(!(t&1))return _t(e,Oe()),null;var n=Va(e,t);if(e.tag!==0&&n===2){var r=mc(e);r!==0&&(t=r,n=Bc(e,r))}if(n===1)throw n=Zi,Cr(e,0),Un(e,t),_t(e,Oe()),n;if(n===6)throw Error(Y(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,yr(e,kt,En),_t(e,Oe()),null}function Jd(e,t){var n=he;he|=1;try{return e(t)}finally{he=n,he===0&&(Po=Oe()+500,ll&&fr())}}function Fr(e){Yn!==null&&Yn.tag===0&&!(he&6)&&xo();var t=he;he|=1;var n=Zt.transition,r=be;try{if(Zt.transition=null,be=1,e)return e()}finally{be=r,Zt.transition=n,he=t,!(he&6)&&fr()}}function ef(){Ft=co.current,Te(co)}function Cr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Kx(n)),Ue!==null)for(n=Ue.return;n!==null;){var r=n;switch($d(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_a();break;case 3:_o(),Te(It),Te(mt),Wd();break;case 5:Bd(r);break;case 4:_o();break;case 13:Te(je);break;case 19:Te(je);break;case 10:zd(r.type._context);break;case 22:case 23:ef()}n=n.return}if(Je=e,Ue=e=tr(e.current,null),ot=Ft=t,Ze=0,Zi=null,qd=fl=Pr=0,kt=Ci=null,xr!==null){for(t=0;t<xr.length;t++)if(n=xr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}xr=null}return e}function Kv(e,t){do{var n=Ue;try{if(Ld(),ua.current=La,Na){for(var r=$e.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Na=!1}if(Rr=0,Qe=He=$e=null,Ei=!1,Wi=0,Gd.current=null,n===null||n.return===null){Ze=1,Zi=t,Ue=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=ot,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Bp(s);if(h!==null){h.flags&=-257,Wp(h,s,a,i,t),h.mode&1&&Vp(i,u,t),t=h,l=u;var w=t.updateQueue;if(w===null){var v=new Set;v.add(l),t.updateQueue=v}else w.add(l);break e}else{if(!(t&1)){Vp(i,u,t),tf();break e}l=Error(Y(426))}}else if(_e&&a.mode&1){var E=Bp(s);if(E!==null){!(E.flags&65536)&&(E.flags|=256),Wp(E,s,a,i,t),Ad(Ro(l,a));break e}}i=l=Ro(l,a),Ze!==4&&(Ze=2),Ci===null?Ci=[i]:Ci.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=Fv(i,l,t);Ap(i,g);break e;case 1:a=l;var y=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Jn===null||!Jn.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Mv(i,a,t);Ap(i,b);break e}}i=i.return}while(i!==null)}qv(n)}catch(k){t=k,Ue===n&&n!==null&&(Ue=n=n.return);continue}break}while(!0)}function Xv(){var e=za.current;return za.current=La,e===null?La:e}function tf(){(Ze===0||Ze===3||Ze===2)&&(Ze=4),Je===null||!(Pr&268435455)&&!(fl&268435455)||Un(Je,ot)}function Va(e,t){var n=he;he|=2;var r=Xv();(Je!==e||ot!==t)&&(En=null,Cr(e,t));do try{wb();break}catch(o){Kv(e,o)}while(!0);if(Ld(),he=n,za.current=r,Ue!==null)throw Error(Y(261));return Je=null,ot=0,Ze}function wb(){for(;Ue!==null;)Gv(Ue)}function xb(){for(;Ue!==null&&!H1();)Gv(Ue)}function Gv(e){var t=Jv(e.alternate,e,Ft);e.memoizedProps=e.pendingProps,t===null?qv(e):Ue=t,Gd.current=null}function qv(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=pb(n,t),n!==null){n.flags&=32767,Ue=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ze=6,Ue=null;return}}else if(n=fb(n,t,Ft),n!==null){Ue=n;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);Ze===0&&(Ze=5)}function yr(e,t,n){var r=be,o=Zt.transition;try{Zt.transition=null,be=1,bb(e,t,n,r)}finally{Zt.transition=o,be=r}return null}function bb(e,t,n,r){do xo();while(Yn!==null);if(he&6)throw Error(Y(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Y(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(tx(e,i),e===Je&&(Ue=Je=null,ot=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||As||(As=!0,ey(Sa,function(){return xo(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Zt.transition,Zt.transition=null;var s=be;be=1;var a=he;he|=4,Gd.current=null,hb(e,n),Hv(n,e),Vx(xc),ka=!!wc,xc=wc=null,e.current=n,gb(n),Z1(),he=a,be=s,Zt.transition=i}else e.current=n;if(As&&(As=!1,Yn=e,Oa=o),i=e.pendingLanes,i===0&&(Jn=null),X1(n.stateNode),_t(e,Oe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Da)throw Da=!1,e=Oc,Oc=null,e;return Oa&1&&e.tag!==0&&xo(),i=e.pendingLanes,i&1?e===Vc?Ii++:(Ii=0,Vc=e):Ii=0,fr(),null}function xo(){if(Yn!==null){var e=Fg(Oa),t=Zt.transition,n=be;try{if(Zt.transition=null,be=16>e?16:e,Yn===null)var r=!1;else{if(e=Yn,Yn=null,Oa=0,he&6)throw Error(Y(331));var o=he;for(he|=4,te=e.current;te!==null;){var i=te,s=i.child;if(te.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(te=u;te!==null;){var d=te;switch(d.tag){case 0:case 11:case 15:ki(8,d,i)}var p=d.child;if(p!==null)p.return=d,te=p;else for(;te!==null;){d=te;var m=d.sibling,h=d.return;if(Bv(d),d===u){te=null;break}if(m!==null){m.return=h,te=m;break}te=h}}}var w=i.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var E=v.sibling;v.sibling=null,v=E}while(v!==null)}}te=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,te=s;else e:for(;te!==null;){if(i=te,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ki(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,te=g;break e}te=i.return}}var y=e.current;for(te=y;te!==null;){s=te;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,te=x;else e:for(s=y;te!==null;){if(a=te,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:dl(9,a)}}catch(k){ze(a,a.return,k)}if(a===s){te=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,te=b;break e}te=a.return}}if(he=o,fr(),gn&&typeof gn.onPostCommitFiberRoot=="function")try{gn.onPostCommitFiberRoot(rl,e)}catch{}r=!0}return r}finally{be=n,Zt.transition=t}}return!1}function nm(e,t,n){t=Ro(n,t),t=Fv(e,t,1),e=Qn(e,t,1),t=yt(),e!==null&&(Ji(e,1,t),_t(e,t))}function ze(e,t,n){if(e.tag===3)nm(e,e,n);else for(;t!==null;){if(t.tag===3){nm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Jn===null||!Jn.has(r))){e=Ro(n,e),e=Mv(t,e,1),t=Qn(t,e,1),e=yt(),t!==null&&(Ji(t,1,e),_t(t,e));break}}t=t.return}}function Sb(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=yt(),e.pingedLanes|=e.suspendedLanes&n,Je===e&&(ot&n)===n&&(Ze===4||Ze===3&&(ot&130023424)===ot&&500>Oe()-Qd?Cr(e,0):qd|=n),_t(e,t)}function Qv(e,t){t===0&&(e.mode&1?(t=Cs,Cs<<=1,!(Cs&130023424)&&(Cs=4194304)):t=1);var n=yt();e=Mn(e,t),e!==null&&(Ji(e,t,n),_t(e,n))}function Eb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qv(e,n)}function kb(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Y(314))}r!==null&&r.delete(t),Qv(e,n)}var Jv;Jv=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||It.current)Ct=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ct=!1,db(e,t,n);Ct=!!(e.flags&131072)}else Ct=!1,_e&&t.flags&1048576&&rv(t,Fa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;da(e,t),e=t.pendingProps;var o=Co(t,mt.current);wo(t,n),o=Hd(null,t,r,e,o,n);var i=Zd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tt(r)?(i=!0,Ra(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Od(t),o.updater=cl,t.stateNode=o,o._reactInternals=t,Rc(t,r,e,n),t=Mc(null,t,r,!0,i,n)):(t.tag=0,_e&&i&&jd(t),gt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(da(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Ib(r),e=en(r,e),o){case 0:t=Fc(null,t,r,e,n);break e;case 1:t=Zp(null,t,r,e,n);break e;case 11:t=Up(null,t,r,e,n);break e;case 14:t=Hp(null,t,r,en(r.type,e),n);break e}throw Error(Y(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:en(r,o),Fc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:en(r,o),Zp(e,t,r,o,n);case 3:e:{if(Nv(t),e===null)throw Error(Y(387));r=t.pendingProps,i=t.memoizedState,o=i.element,uv(e,t),$a(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ro(Error(Y(423)),t),t=Yp(e,t,r,n,o);break e}else if(r!==o){o=Ro(Error(Y(424)),t),t=Yp(e,t,r,n,o);break e}else for(Mt=qn(t.stateNode.containerInfo.firstChild),jt=t,_e=!0,nn=null,n=av(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Io(),r===o){t=jn(e,t,n);break e}gt(e,t,r,n)}t=t.child}return t;case 5:return cv(t),e===null&&Ic(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,bc(r,o)?s=null:i!==null&&bc(r,i)&&(t.flags|=32),Av(e,t),gt(e,t,s,n),t.child;case 6:return e===null&&Ic(t),null;case 13:return Lv(e,t,n);case 4:return Vd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=To(t,null,r,n):gt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:en(r,o),Up(e,t,r,o,n);case 7:return gt(e,t,t.pendingProps,n),t.child;case 8:return gt(e,t,t.pendingProps.children,n),t.child;case 12:return gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ke(Ma,r._currentValue),r._currentValue=s,i!==null)if(sn(i.value,s)){if(i.children===o.children&&!It.current){t=jn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Rn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Tc(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Y(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Tc(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}gt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,wo(t,n),o=Yt(o),r=r(o),t.flags|=1,gt(e,t,r,n),t.child;case 14:return r=t.type,o=en(r,t.pendingProps),o=en(r.type,o),Hp(e,t,r,o,n);case 15:return jv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:en(r,o),da(e,t),t.tag=1,Tt(r)?(e=!0,Ra(t)):e=!1,wo(t,n),Pv(t,r,o),Rc(t,r,o,n),Mc(null,t,r,!0,e,n);case 19:return zv(e,t,n);case 22:return $v(e,t,n)}throw Error(Y(156,t.tag))};function ey(e,t){return Tg(e,t)}function Cb(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,n,r){return new Cb(e,t,n,r)}function nf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ib(e){if(typeof e=="function")return nf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bd)return 11;if(e===Sd)return 14}return 2}function tr(e,t){var n=e.alternate;return n===null?(n=Ht(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ma(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")nf(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case eo:return Ir(n.children,o,i,t);case xd:s=8,o|=8;break;case Ju:return e=Ht(12,n,t,o|2),e.elementType=Ju,e.lanes=i,e;case ec:return e=Ht(13,n,t,o),e.elementType=ec,e.lanes=i,e;case tc:return e=Ht(19,n,t,o),e.elementType=tc,e.lanes=i,e;case cg:return pl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lg:s=10;break e;case ug:s=9;break e;case bd:s=11;break e;case Sd:s=14;break e;case Vn:s=16,r=null;break e}throw Error(Y(130,e==null?e:typeof e,""))}return t=Ht(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ir(e,t,n,r){return e=Ht(7,e,r,t),e.lanes=n,e}function pl(e,t,n,r){return e=Ht(22,e,r,t),e.elementType=cg,e.lanes=n,e.stateNode={isHidden:!1},e}function Su(e,t,n){return e=Ht(6,e,null,t),e.lanes=n,e}function Eu(e,t,n){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tb(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ru(0),this.expirationTimes=ru(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ru(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function rf(e,t,n,r,o,i,s,a,l){return e=new Tb(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ht(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Od(i),e}function _b(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ty(e){if(!e)return or;e=e._reactInternals;e:{if(Nr(e)!==e||e.tag!==1)throw Error(Y(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Y(171))}if(e.tag===1){var n=e.type;if(Tt(n))return tv(e,n,t)}return t}function ny(e,t,n,r,o,i,s,a,l){return e=rf(n,r,!0,e,o,i,s,a,l),e.context=ty(null),n=e.current,r=yt(),o=er(n),i=Rn(r,o),i.callback=t??null,Qn(n,i,o),e.current.lanes=o,Ji(e,o,r),_t(e,r),e}function ml(e,t,n,r){var o=t.current,i=yt(),s=er(o);return n=ty(n),t.context===null?t.context=n:t.pendingContext=n,t=Rn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Qn(o,t,s),e!==null&&(on(e,o,s,i),la(e,o,s)),s}function Ba(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function rm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function of(e,t){rm(e,t),(e=e.alternate)&&rm(e,t)}function Rb(){return null}var ry=typeof reportError=="function"?reportError:function(e){console.error(e)};function sf(e){this._internalRoot=e}hl.prototype.render=sf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Y(409));ml(e,t,null,null)};hl.prototype.unmount=sf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fr(function(){ml(null,e,null,null)}),t[Fn]=null}};function hl(e){this._internalRoot=e}hl.prototype.unstable_scheduleHydration=function(e){if(e){var t=$g();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wn.length&&t!==0&&t<Wn[n].priority;n++);Wn.splice(n,0,e),n===0&&Ng(e)}};function af(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function gl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function om(){}function Pb(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ba(s);i.call(u)}}var s=ny(t,r,e,0,null,!1,!1,"",om);return e._reactRootContainer=s,e[Fn]=s.current,zi(e.nodeType===8?e.parentNode:e),Fr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=Ba(l);a.call(u)}}var l=rf(e,0,!1,null,null,!1,!1,"",om);return e._reactRootContainer=l,e[Fn]=l.current,zi(e.nodeType===8?e.parentNode:e),Fr(function(){ml(t,l,n,r)}),l}function vl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ba(s);a.call(l)}}ml(t,s,e,o)}else s=Pb(n,t,e,o,r);return Ba(s)}Mg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=mi(t.pendingLanes);n!==0&&(Cd(t,n|1),_t(t,Oe()),!(he&6)&&(Po=Oe()+500,fr()))}break;case 13:Fr(function(){var r=Mn(e,1);if(r!==null){var o=yt();on(r,e,1,o)}}),of(e,1)}};Id=function(e){if(e.tag===13){var t=Mn(e,134217728);if(t!==null){var n=yt();on(t,e,134217728,n)}of(e,134217728)}};jg=function(e){if(e.tag===13){var t=er(e),n=Mn(e,t);if(n!==null){var r=yt();on(n,e,t,r)}of(e,t)}};$g=function(){return be};Ag=function(e,t){var n=be;try{return be=e,t()}finally{be=n}};dc=function(e,t,n){switch(t){case"input":if(oc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=al(r);if(!o)throw Error(Y(90));fg(r),oc(r,o)}}}break;case"textarea":mg(e,n);break;case"select":t=n.value,t!=null&&ho(e,!!n.multiple,t,!1)}};bg=Jd;Sg=Fr;var Fb={usingClientEntryPoint:!1,Events:[ts,oo,al,wg,xg,Jd]},ni={findFiberByHostInstance:wr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Mb={bundleType:ni.bundleType,version:ni.version,rendererPackageName:ni.rendererPackageName,rendererConfig:ni.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$n.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Cg(e),e===null?null:e.stateNode},findFiberByHostInstance:ni.findFiberByHostInstance||Rb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ns=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ns.isDisabled&&Ns.supportsFiber)try{rl=Ns.inject(Mb),gn=Ns}catch{}}At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fb;At.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!af(t))throw Error(Y(200));return _b(e,t,null,n)};At.createRoot=function(e,t){if(!af(e))throw Error(Y(299));var n=!1,r="",o=ry;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=rf(e,1,!1,null,null,n,!1,r,o),e[Fn]=t.current,zi(e.nodeType===8?e.parentNode:e),new sf(t)};At.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Y(188)):(e=Object.keys(e).join(","),Error(Y(268,e)));return e=Cg(t),e=e===null?null:e.stateNode,e};At.flushSync=function(e){return Fr(e)};At.hydrate=function(e,t,n){if(!gl(t))throw Error(Y(200));return vl(null,e,t,!0,n)};At.hydrateRoot=function(e,t,n){if(!af(e))throw Error(Y(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=ry;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=ny(t,null,e,1,n??null,o,!1,i,s),e[Fn]=t.current,zi(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new hl(t)};At.render=function(e,t,n){if(!gl(t))throw Error(Y(200));return vl(null,e,t,!1,n)};At.unmountComponentAtNode=function(e){if(!gl(e))throw Error(Y(40));return e._reactRootContainer?(Fr(function(){vl(null,null,e,!1,function(){e._reactRootContainer=null,e[Fn]=null})}),!0):!1};At.unstable_batchedUpdates=Jd;At.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!gl(n))throw Error(Y(200));if(e==null||e._reactInternals===void 0)throw Error(Y(38));return vl(e,t,n,!1,r)};At.version="18.3.1-next-f1338f8080-20240426";function oy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oy)}catch(e){console.error(e)}}oy(),og.exports=At;var Uc=og.exports,im=Uc;qu.createRoot=im.createRoot,qu.hydrateRoot=im.hydrateRoot;var jb=Object.defineProperty,iy=(e,t)=>{for(var n in t)jb(e,n,{get:t[n],enumerable:!0,configurable:!0,set:r=>t[n]=()=>r})};if(typeof c.createContext!="function"){const e=['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(e.join(`
41
+ `))}var Lr=c.createContext(!1),Hc=({children:e})=>f.jsx(Lr.Provider,{value:!0,children:e}),sy=c.createContext({setError:()=>{},clearError:()=>{}}),sm=()=>{try{return typeof __webpack_module__>"u"?null:__webpack_module__.hot??null}catch{return null}};class $b extends J.Component{constructor(){super(...arguments);Se(this,"state",{hasError:!1});Se(this,"hmrStatusHandler",null)}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){this.props.onError(n),this.subscribeToHmrReset()}componentDidMount(){this.state.hasError||this.props.onClear()}componentDidUpdate(n,r){r.hasError&&!this.state.hasError&&this.props.onClear()}componentWillUnmount(){this.unsubscribeFromHmrReset()}subscribeToHmrReset(){if(this.hmrStatusHandler)return;const n=sm();if(!n)return;const r=o=>{o==="idle"&&(this.unsubscribeFromHmrReset(),this.setState({hasError:!1}))};this.hmrStatusHandler=r,n.addStatusHandler(r)}unsubscribeFromHmrReset(){const n=this.hmrStatusHandler;if(!n)return;this.hmrStatusHandler=null;const r=sm();r&&r.removeStatusHandler(n)}render(){return this.state.hasError?null:this.props.children}}var No=c.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),rs=c.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},onlyRenderComposition:null}),os=c.createContext({getNonce:()=>0}),ha=0;try{typeof __webpack_module__<"u"&&__webpack_module__.hot&&__webpack_module__.hot.addStatusHandler(e=>{e==="idle"&&ha++})}catch{}var yl=()=>{const t=c.useContext(os).getNonce(),n=c.useRef(t);n.current=t;const r=c.useRef([[ha,t]]),o=c.useCallback(()=>(ha!==r.current[r.current.length-1][0]&&(r.current=[...r.current,[ha,n.current]]),r.current),[r]);return c.useMemo(()=>({get:o}),[o])};function Lo(e){return!!e}var ay=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,ly=e=>e.match(ay()),Ab=e=>{if(e==null)throw new TypeError("You must pass a name to a <Folder />.");if(typeof e!="string")throw new TypeError(`The "name" you pass into <Folder /> must be a string. Got: ${typeof e}`);if(!ly(e))throw new Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${e}`)},Nb=`Folder name must match ${String(ay())}`,Zc=c.createContext({folderName:null,parentName:null}),Lb=e=>{const{name:t,children:n}=e,r=c.useContext(Zc),{registerFolder:o,unregisterFolder:i}=c.useContext(rs),s=yl(),a=e.stack??null;Ab(t);const l=[r.parentName,r.folderName].filter(Lo),u=l.length===0?null:l.join("/"),d=c.useMemo(()=>({folderName:t,parentName:u}),[t,u]);return c.useEffect(()=>(o(t,u,s.get(),a),()=>{i(t,u)}),[t,r.folderName,u,o,i,s,a]),f.jsx(Zc.Provider,{value:d,children:n})};function am(){return["NOD","E_EN","V"].join("")}var lm=()=>["e","nv"].join(""),mn=()=>{const e=typeof window<"u"&&window.remotion_isPlayer,t=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[lm()][am()]==="test"||window.process[lm()][am()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u"),n=typeof window<"u"&&window.remotion_isStudio,r=typeof window<"u"&&window.remotion_isReadOnlyStudio;return{isStudio:n,isRendering:t,isPlayer:e,isReadOnlyStudio:r,isClientSideRendering:!1}},Yc="remotion-date:",Yi="remotion-file:",zb=({data:e,indent:t,staticBase:n})=>{let r=!1,o=!1,i=!1,s=!1;try{return{serializedString:JSON.stringify(e,function(l,u){const d=this[l];return d instanceof Date?(r=!0,`${Yc}${d.toISOString()}`):d instanceof Map?(i=!0,u):d instanceof Set?(s=!0,u):typeof d=="string"&&n!==null&&d.startsWith(n)?(o=!0,`${Yi}${d.replace(n+"/","")}`):u},t),customDateUsed:r,customFileUsed:o,mapUsed:i,setUsed:s}}catch(a){throw new Error("Could not serialize the passed input props to JSON: "+a.message)}},uy=e=>JSON.parse(e,(t,n)=>typeof n=="string"&&n.startsWith(Yc)?new Date(n.replace(Yc,"")):typeof n=="string"&&n.startsWith(Yi)?`${window.remotion_staticBase}/${n.replace(Yi,"")}`:n),Db=e=>uy(zb({data:e,indent:2,staticBase:window.remotion_staticBase}).serializedString),Kc=e=>mn().isStudio?Db(e):e,cy=c.createContext(!1),Ob=({children:e})=>f.jsx(cy.Provider,{value:!0,children:e}),lf=()=>c.useContext(cy),zn=({className:e,classPrefix:t,type:n})=>{if(!e)return!1;if(n==="exact"){const r=e.split(" ");return t.some(o=>r.some(i=>i.trim()===o||i.trim().endsWith(`:${o}`)||i.trim().endsWith(`!${o}`)))}return t.some(r=>e.startsWith(r)||e.includes(` ${r}`)||e.includes(`!${r}`)||e.includes(`:${r}`))},Vb=(e,t)=>{const{style:n,...r}=e,o=c.useMemo(()=>({position:"absolute",top:zn({className:r.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:zn({className:r.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:zn({className:r.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:zn({className:r.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:zn({className:r.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:zn({className:r.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:zn({className:r.className,classPrefix:["block","inline-block","inline","flex","inline-flex","flow-root","grid","inline-grid","contents","list-item","hidden"],type:"exact"})?void 0:"flex",flexDirection:zn({className:r.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...n}),[r.className,n]);return f.jsx("div",{ref:t,style:o,...r})},an=c.forwardRef(Vb),Bb={transform:"rotate(90deg)"},um=40,Wb={color:"white",fontSize:14,fontFamily:"sans-serif"},Ub={justifyContent:"center",alignItems:"center"},Hb=()=>f.jsxs(an,{style:Ub,id:"remotion-comp-loading",children:[f.jsx("style",{type:"text/css",children:`
42
+ @keyframes anim {
43
+ from {
44
+ opacity: 0
45
+ }
46
+ to {
47
+ opacity: 1
48
+ }
49
+ }
50
+ #remotion-comp-loading {
51
+ animation: anim 2s;
52
+ animation-fill-mode: forwards;
53
+ }
54
+ `}),f.jsx("svg",{width:um,height:um,viewBox:"-100 -100 400 400",style:Bb,children:f.jsx("path",{fill:"#555",stroke:"#555",strokeWidth:"100",strokeLinejoin:"round",d:"M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z"})}),f.jsxs("p",{style:Wb,children:["Resolving ","<Suspense>","..."]})]}),Pt=null,Xc=()=>{if(!Pt){if(typeof document>"u")throw new Error("Tried to call an API that only works in the browser from outside the browser");Pt=document.createElement("div"),Pt.style.position="absolute",Pt.style.top="0px",Pt.style.left="0px",Pt.style.right="0px",Pt.style.bottom="0px",Pt.style.width="100%",Pt.style.height="100%",Pt.style.display="flex",Pt.style.flexDirection="column";const e=document.createElement("div");e.style.position="fixed",e.style.top="-999999px",e.appendChild(Pt),document.body.appendChild(e)}return Pt},Gc=()=>"remotion_inputPropsOverride"+window.location.origin,dy=()=>{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Gc());return e?JSON.parse(e):null},Zb=e=>{if(!(typeof localStorage>"u")){if(e===null){localStorage.removeItem(Gc());return}localStorage.setItem(Gc(),JSON.stringify(e))}},cm=!1,Yb=()=>{cm||(cm=!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()"))},Kb=()=>{if(typeof window>"u")return Yb(),{};if(mn().isPlayer)throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");const e=dy();if(e)return e;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 t=window.remotion_inputProps;return t?uy(t):{}},uf=c.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")}}),Xb=J.createRef(),fy=({children:e})=>{const[t,n]=J.useState({}),r=c.useCallback(({defaultProps:i,id:s,newProps:a})=>{n(l=>({...l,[s]:typeof a=="function"?a(l[s]??i):a}))},[]),o=c.useMemo(()=>({props:t,updateProps:r}),[t,r]);return f.jsx(uf.Provider,{value:o,children:e})},py=J.createContext(null),Ve=()=>{const e=c.useContext(py),[t]=c.useState(()=>mn());return e??t};function Wa(e,t,n){if(typeof e!="number")throw new Error(`The "${t}" prop ${n} must be a number, but you passed a value of type ${typeof e}`);if(isNaN(e))throw new TypeError(`The "${t}" prop ${n} must not be NaN, but is NaN.`);if(!Number.isFinite(e))throw new TypeError(`The "${t}" prop ${n} must be finite, but is ${e}.`);if(e%1!==0)throw new TypeError(`The "${t}" prop ${n} must be an integer, but is ${e}.`);if(e<=0)throw new TypeError(`The "${t}" prop ${n} must be positive, but got ${e}.`)}function wl(e,t){const{allowFloats:n,component:r}=t;if(typeof e>"u")throw new Error(`The "durationInFrames" prop ${r} is missing.`);if(typeof e!="number")throw new Error(`The "durationInFrames" prop ${r} must be a number, but you passed a value of type ${typeof e}`);if(e<=0)throw new TypeError(`The "durationInFrames" prop ${r} must be positive, but got ${e}.`);if(!n&&e%1!==0)throw new TypeError(`The "durationInFrames" prop ${r} must be an integer, but got ${e}.`);if(!Number.isFinite(e))throw new TypeError(`The "durationInFrames" prop ${r} must be finite, but got ${e}.`)}function xl(e,t,n){if(typeof e!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof e} ${t}`);if(!Number.isFinite(e))throw new Error(`"fps" must be a finite, but you passed ${e} ${t}`);if(isNaN(e))throw new Error(`"fps" must not be NaN, but got ${e} ${t}`);if(e<=0)throw new TypeError(`"fps" must be positive, but got ${e} ${t}`)}var bl=c.createContext(null),Gb=c.createRef(),qb=e=>!!e.calculateMetadata,cf=e=>{const t=c.useContext(bl),{props:n}=c.useContext(uf),{compositions:r,canvasContent:o,currentCompositionMetadata:i}=c.useContext(No),s=(o==null?void 0:o.type)==="composition"?o.compositionId:null,a=e??s,l=r.find(p=>p.id===a),u=c.useMemo(()=>l?n[l.id]??{}:{},[n,l]),d=Ve();return c.useMemo(()=>l?i?{type:"success",metadataSource:null,result:{...i,id:l.id,defaultProps:l.defaultProps??{}}}:qb(l)?!t||!t[l.id]?null:t[l.id]:(wl(l.durationInFrames,{allowFloats:!1,component:`in <Composition id="${l.id}">`}),xl(l.fps,`in <Composition id="${l.id}">`),Wa(l.width,"width",`in <Composition id="${l.id}">`),Wa(l.height,"height",`in <Composition id="${l.id}">`),{type:"success",metadataSource:null,result:{width:l.width,height:l.height,fps:l.fps,id:l.id,durationInFrames:l.durationInFrames,defaultProps:l.defaultProps??{},props:{...l.defaultProps??{},...u??{},...typeof window>"u"||d.isPlayer||!window.remotion_inputProps?{}:Kb()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null}}):null,[l,t,i,u,d.isPlayer])},my=e=>{const t=e.stack??"";return t.startsWith("Error:")?t:`${e.message}
55
+ ${t}`},Qb=e=>e instanceof Error?!0:!(e===null||typeof e!="object"||!("stack"in e)||typeof e.stack!="string"||!("message"in e)||typeof e.message!="string");function df(e,t){let n;throw Qb(t)?(n=t,n.stack||(n.stack=new Error(n.message).stack)):typeof t=="string"?n=Error(t):n=Error("Rendering was cancelled"),e&&(e.remotion_cancelledError=my(n)),n}function Ki(e){return df(typeof window<"u"?window:void 0,e)}var Jb=["trace","verbose","info","warn","error"],dm=e=>Jb.indexOf(e),Sl=(e,t)=>dm(e)<=dm(t),is=({args:e,logLevel:t,tag:n})=>{const r=[...e];return mn().isRendering&&!mn().isClientSideRendering&&r.unshift(Symbol.for(`__remotion_level_${t}`)),n&&mn().isRendering&&!mn().isClientSideRendering&&r.unshift(Symbol.for(`__remotion_tag_${n}`)),r},eS=(e,...t)=>{if(Sl(e.logLevel,"verbose"))return console.debug(...is({args:t,logLevel:"verbose",tag:e.tag}))},tS=(e,...t)=>{if(Sl(e.logLevel,"trace"))return console.debug(...is({args:t,logLevel:"trace",tag:e.tag}))},nS=(e,...t)=>{if(Sl(e.logLevel,"info"))return console.log(...is({args:t,logLevel:"info",tag:e.tag}))},rS=(e,...t)=>{if(Sl(e.logLevel,"warn"))return console.warn(...is({args:t,logLevel:"warn",tag:e.tag}))},oS=(e,...t)=>console.error(...is({args:t,logLevel:"error",tag:e.tag})),et={trace:tS,verbose:eS,info:nS,warn:rS,error:oS};typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var iS="The delayRender was called:",sS="Retries left: ",aS="- Rendering the frame will be retried.",lS="handle was cleared after",uS=3e4,cS=({scope:e,environment:t,label:n,options:r})=>{var s;if(typeof n!="string"&&n!==null)throw new Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(n));const o=Math.random();e.remotion_delayRenderHandles.push(o);const i=((s=Error().stack)==null?void 0:s.replace(/^Error/g,""))??"";if(t.isRendering){const a=((r==null?void 0:r.timeoutInMilliseconds)??e.remotion_puppeteerTimeout??uS)-2e3,l=((r==null?void 0:r.retries)??0)-(e.remotion_attempt-1);e.remotion_delayRenderTimeouts[o]={label:n??null,startTime:Date.now(),timeout:setTimeout(()=>{const u=["A delayRender()",n?`"${n}"`:null,`was called but not cleared after ${a}ms. See https://remotion.dev/docs/timeout for help.`,l>0?sS+l:null,l>0?aS:null,iS,i].filter(Lo).join(" ");t.isClientSideRendering?e.remotion_cancelledError=my(Error(u)):df(e,Error(u))},a)}}return e.remotion_renderReady=!1,o},dS=({scope:e,handle:t,environment:n,logLevel:r})=>{if(typeof t>"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 t!="number")throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(t));const o=e.remotion_delayRenderHandles.includes(t),i=e.remotion_delayRenderTimeouts[t];if(o&&n.isRendering&&i){const{label:s,startTime:a,timeout:l}=i;clearTimeout(l);const u=[s?`"${s}"`:"A handle",lS,`${Date.now()-a}ms`].filter(Lo).join(" ");et.verbose({logLevel:r,tag:"delayRender()"},u),delete e.remotion_delayRenderTimeouts[t]}e.remotion_delayRenderHandles=e.remotion_delayRenderHandles.filter(s=>s!==t),e.remotion_delayRenderHandles.length===0&&(e.remotion_renderReady=!0)},zr=c.createContext({logLevel:"info",mountTime:0}),wn=()=>{const{logLevel:e}=c.useContext(zr);if(e===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return e},ss=()=>{const{mountTime:e}=c.useContext(zr);if(e===null)throw new Error("useMountTime must be used within a LogLevelProvider");return e},hy=c.createContext(null),ln=()=>{const e=Ve(),t=c.useContext(hy)??(typeof window<"u"?window:void 0),n=wn(),r=c.useCallback((s,a)=>t?cS({scope:t,environment:e,label:s??null,options:a??{}}):Math.random(),[e,t]),o=c.useCallback(s=>{t&&dS({scope:t,handle:s,environment:e,logLevel:n})},[e,n,t]),i=c.useCallback(s=>df(t??(typeof window<"u"?window:void 0),s),[t]);return{delayRender:r,continueRender:o,cancelRender:i}},gy=({compProps:e,componentName:t,noSuspense:n})=>{const r=c.useRef(null);return"component"in e&&(r.current=e.component),c.useMemo(()=>{if("component"in e){if(typeof document>"u"||n)return e.component;if(typeof e.component>"u")throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${t}/> component.`);return s=>{const a=r.current;return J.createElement(a,s)}}if("lazyComponent"in e&&typeof e.lazyComponent<"u"){if(typeof e.lazyComponent>"u")throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${t}/> component.`);return J.lazy(e.lazyComponent)}throw new Error("You must pass either 'component' or 'lazyComponent'")},[e.lazyComponent])},El=()=>{const{canvasContent:e,compositions:t,currentCompositionMetadata:n}=c.useContext(No),r=t.find(i=>(e==null?void 0:e.type)==="composition"&&i.id===e.compositionId),o=cf((r==null?void 0:r.id)??null);return c.useMemo(()=>!o||o.type==="error"||o.type==="loading"||!r?null:{...o.result,defaultProps:r.defaultProps??{},id:r.id,...n??{},component:r.component},[n,o,r])},vy=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,yy=e=>e.match(vy()),fS=e=>{if(!yy(e))throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${e}`)},pS=`Composition ID must match ${String(vy())}`,mS=(e,t,n)=>{if(e){if(typeof e!="object")throw new Error(`"${t}" must be an object, but you passed a value of type ${typeof e}`);if(Array.isArray(e))throw new Error(`"${t}" must be an object, an array was passed ${n?`for composition "${n}"`:""}`)}},hS=()=>{const{continueRender:e,delayRender:t}=ln();return c.useEffect(()=>{const n=t("Waiting for Root component to unsuspend");return()=>e(n)},[e,t]),null},gS=({width:e,height:t,fps:n,durationInFrames:r,id:o,defaultProps:i,schema:s,...a})=>{const l=c.useContext(rs),{registerComposition:u,unregisterComposition:d}=l,p=El(),m=gy({compProps:a,componentName:"Composition",noSuspense:!1}),h=yl(),w=lf(),v=Ve(),E=c.useContext(Lr);if(typeof window<"u"&&(window.remotion_seenCompositionIds=Array.from(new Set([...window.remotion_seenCompositionIds??[],o]))),E)throw w?new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help."):new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");const{folderName:g,parentName:y}=c.useContext(Zc),x=a.stack??null,b="component"in a?a.component:null;c.useEffect(()=>{if(!o)throw new Error("No id for composition passed.");return fS(o),mS(i,"defaultProps",o),u({durationInFrames:r??void 0,fps:n??void 0,height:t??void 0,width:e??void 0,id:o,folderName:g,component:m,defaultProps:Kc(i??{}),nonce:h.get(),parentFolderName:y,componentFromProps:b,schema:s??null,calculateMetadata:a.calculateMetadata??null,stack:x}),()=>{d(o)}},[r,n,t,m,o,g,i,e,h,y,b,s,a.calculateMetadata,x,u,d]);const k=cf(o),{setError:S,clearError:C}=c.useContext(sy),I=c.useCallback(j=>{S(j)},[S]),F=c.useCallback(()=>{C()},[C]);if(v.isStudio&&p&&p.component===m&&p.id===o){const j=m;return k===null||k.type!=="success"&&k.type!=="success-and-refreshing"?null:Uc.createPortal(f.jsx(Hc,{children:f.jsx($b,{onError:I,onClear:F,children:f.jsx(c.Suspense,{fallback:f.jsx(Hb,{}),children:f.jsx(j,{...k.result.props??{}})})})}),Xc())}if(v.isRendering&&p&&p.component===m&&p.id===o){const j=m;return k===null||k.type!=="success"&&k.type!=="success-and-refreshing"?null:Uc.createPortal(f.jsx(Hc,{children:f.jsx(c.Suspense,{fallback:f.jsx(hS,{}),children:f.jsx(j,{...k.result.props??{}})})}),Xc())}return null},Ua=e=>{const{onlyRenderComposition:t}=c.useContext(rs);return t&&t!==e.id?null:f.jsx(gS,{...e})},wy=[],xy=null,vS=()=>wy,bt=e=>{wy.push(e)},yS=e=>{xy=e},wS=()=>xy,xS=e=>{const t=J.Children.toArray(e);if(t.length!==1)return null;const n=t[0];return!J.isValidElement(n)||typeof n.type!="function"&&typeof n.type!="object"?null:n.type},gi="4.0.499",bS=()=>{if(typeof globalThis>"u")return;const e=()=>{globalThis.remotion_imported=gi,typeof window<"u"&&(window.remotion_imported=gi)},t=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(t){if(t===gi)return;if(typeof t=="string"&&t.includes("webcodecs")){e();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[gi,typeof t=="string"?t:"an older version"].filter(Lo).join(" and ")}. This will cause things to break in an unexpected way.
56
+ 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.`)}e()},Ke=c.createContext(null),qc={};iy(qc,{useTimelineSetFrame:()=>Ty,useTimelinePosition:()=>mr,useTimelineContext:()=>pr,usePlayingState:()=>_y,usePlaybackRate:()=>hf,useAbsoluteTimelinePosition:()=>Iy,persistCurrentFrame:()=>by,getInitialFrameState:()=>Sy,getFrameForComposition:()=>Ey,clampFrameToCompositionRange:()=>ky});function fm(e){let t=e+1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function SS(e){let t=0,n=0,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r}var Dr=(e,t)=>{if(e===null)return Math.random();if(typeof e=="string")return fm(SS(e));if(typeof e=="number")return fm(e*1e10);throw new Error("random() argument must be a number or a string")},zo=c.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),Do=c.createContext(null),ff=c.createContext(null),pf=c.createContext(null),ES=({children:e,frameState:t})=>{const[n,r]=c.useState(!1),o=c.useRef(!1),[i,s]=c.useState(1),a=c.useRef([]),[l]=c.useState(()=>String(Dr(null))),[u,d]=c.useState(()=>Sy()),p=t??u,{delayRender:m,continueRender:h}=ln();typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_setFrame=(g,y,x)=>{window.remotion_attempt=x;const b=m(`Setting the current frame to ${g}`);let k=!0;d(S=>(S[y]??window.remotion_initialFrame)===g?(k=!1,S):{...S,[y]:g}),k?requestAnimationFrame(()=>h(b)):h(b)},window.remotion_isPlayer=!1},[h,m]);const w=c.useMemo(()=>({frame:p,playing:n,imperativePlaying:o,rootId:l,audioAndVideoTags:a}),[p,n,l]),v=c.useMemo(()=>({playbackRate:i,setPlaybackRate:s}),[i]),E=c.useMemo(()=>({setFrame:d,setPlaying:r}),[]);return f.jsx(pf.Provider,{value:w,children:f.jsx(ff.Provider,{value:v,children:f.jsx(Do.Provider,{value:w,children:f.jsx(zo.Provider,{value:E,children:e})})})})},mf=()=>"remotion.time-all",by=e=>{localStorage.setItem(mf(),JSON.stringify(e))},Sy=()=>{const e=localStorage.getItem(mf())??"{}";return JSON.parse(e)},Ey=e=>{const t=localStorage.getItem(mf())??"{}",n=JSON.parse(t);return n[e]!==void 0?Number(n[e]):typeof window>"u"?0:window.remotion_initialFrame??0},ky=(e,t)=>Math.max(0,Math.min(Math.max(0,t-1),e)),Cy=e=>{const t=El(),n=Ve();if(!t)return typeof window>"u"?0:window.remotion_initialFrame??0;const r=e.frame[t.id]??(n.isPlayer?0:Ey(t.id));return ky(r,t.durationInFrames)},pr=()=>{const e=c.useContext(Do);if(e===null)throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},hf=()=>{const e=c.useContext(ff);if(e===null)throw new Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},mr=()=>{const e=pr();return Cy(e)},Iy=()=>{const e=c.useContext(pf);if(e===null)throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return Cy(e)},Ty=()=>{const{setFrame:e}=c.useContext(zo);return e},_y=()=>{const{playing:e,imperativePlaying:t}=pr(),{setPlaying:n}=c.useContext(zo);return c.useMemo(()=>[e,n,t],[t,e,n])},ht=()=>{const e=c.useContext(Lr),t=Ve();if(!e)throw t.isPlayer?new Error("useCurrentFrame can only be called inside a component that was passed to <Player>. 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 n=mr(),r=c.useContext(Ke),o=r?r.cumulatedFrom+r.relativeFrom:0;return n-o},kl=()=>{const e=c.useContext(Ke),t=(e==null?void 0:e.width)??null,n=(e==null?void 0:e.height)??null,r=(e==null?void 0:e.durationInFrames)??null,o=El();return c.useMemo(()=>{if(!o)return null;const{id:i,durationInFrames:s,fps:a,height:l,width:u,defaultProps:d,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:w,defaultPixelFormat:v,defaultProResProfile:E,defaultSampleRate:g}=o;return{id:i,width:t??u,height:n??l,fps:a,durationInFrames:r??s,defaultProps:d,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:w,defaultPixelFormat:v,defaultProResProfile:E,defaultSampleRate:g}},[r,n,t,o])},Xe=()=>{const e=kl(),t=c.useContext(Lr),n=lf();if(!e)throw typeof window<"u"&&window.remotion_isPlayer||n?new Error(["No video config found. Likely reasons:","- You are probably calling useVideoConfig() from outside the component passed to <Player />. 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 <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");if(!t)throw new Error("Called useVideoConfig() outside a Remotion composition.");return e},as=({frame:e,children:t,active:n=!0})=>{const r=ht(),o=Xe();if(typeof e>"u")throw new Error("The <Freeze /> component requires a 'frame' prop, but none was passed.");if(typeof e!="number")throw new Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof e}`);if(Number.isNaN(e))throw new Error("The 'frame' prop of <Freeze /> must be a real number, but it is NaN.");if(!Number.isFinite(e))throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${e}.`);const i=c.useMemo(()=>{if(typeof n=="boolean")return n;if(typeof n=="function")return n(r)},[n,r]),s=pr(),a=c.useContext(Ke),l=(a==null?void 0:a.relativeFrom)??0,u=c.useMemo(()=>i?{...s,playing:!1,imperativePlaying:{current:!1},frame:{[o.id]:e+l}}:s,[i,s,o.id,e,l]),d=c.useMemo(()=>a?i?{...a,cumulatedFrom:0}:a:null,[a,i]);return f.jsx(Do.Provider,{value:u,children:f.jsx(Ke.Provider,{value:d,children:t})})},xn={"style.transformOrigin":{type:"transform-origin",step:1,default:"50% 50%",description:"Transform origin"},"style.translate":{type:"translate",step:1,default:"0px 0px",description:"Offset"},"style.scale":{type:"scale",max:100,step:.01,default:1,description:"Scale",defaultKeyframeOutput:"perceptual-scale"},"style.rotate":{type:"rotation-css",step:1,default:"0deg",description:"Rotation"},"style.opacity":{type:"number",min:0,max:1,step:.01,default:1,description:"Opacity",hiddenFromList:!1}},kS=xn,Cl={"style.color":{type:"color",default:void 0,description:"Color"},"style.fontFamily":{type:"font-family",default:void 0,description:"Font family",keyframable:!1},"style.fontSize":{type:"number",default:void 0,min:0,step:1,description:"Font size",hiddenFromList:!1},"style.lineHeight":{type:"number",default:void 0,min:0,step:.05,description:"Line height",hiddenFromList:!1},"style.fontWeight":{type:"enum",default:"400",description:"Font weight",variants:{100:{},200:{},300:{},400:{},500:{},600:{},700:{},800:{},900:{},normal:{},bold:{}}},"style.fontStyle":{type:"enum",default:"normal",description:"Font style",variants:{normal:{},italic:{},oblique:{}}},"style.textAlign":{type:"enum",default:"left",description:"Text align",variants:{left:{},center:{},right:{},justify:{},start:{},end:{}}},"style.letterSpacing":{type:"number",default:void 0,step:.1,description:"Letter spacing",hiddenFromList:!1}},hr={"style.borderWidth":{type:"number",default:void 0,min:0,step:1,description:"Border width",hiddenFromList:!1},"style.borderStyle":{type:"enum",default:"none",description:"Border style",variants:{none:{},hidden:{},solid:{},dashed:{},dotted:{},double:{},groove:{},ridge:{},inset:{},outset:{}}},"style.borderColor":{type:"color",default:void 0,description:"Border color"}},gr={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},Ry={children:{type:"text-content",default:"",description:"Text",keyframable:!1}},Oo={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1,keyframable:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0,keyframable:!1}},Py={...Oo},Fy={...xn,...gr,...hr,...Py},gf={type:"boolean",default:!1,description:"Hidden"},My={type:"hidden"},vf={type:"hidden"},CS=e=>({name:vf,...e}),yf={type:"number",default:void 0,min:1,step:1,hiddenFromList:!0},jy={type:"number",default:0,step:1,hiddenFromList:!0},$y={type:"number",default:0,min:0,step:1,hiddenFromList:!0},wf={type:"number",default:null,step:1,hiddenFromList:!0},An={durationInFrames:yf,from:jy,trimBefore:$y,freeze:wf,hidden:gf,name:vf,showInTimeline:My},Fo={...An,layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":Fy,none:{}}}},IS={durationInFrames:yf,trimBefore:$y,freeze:wf,hidden:gf,name:vf,showInTimeline:My},TS={...IS,layout:Fo.layout},_S={...Fo,layout:{...Fo.layout,default:"none"}},Vo=J.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),Il=J.createContext({current:[]}),Cn=e=>`${e.absolutePath}\0${e.nodePath.join(".")}\0${e.sequenceKeys.join(".")}\0${e.effectKeys.map(t=>t.join(".")).join(".")}`,Tl=J.createContext({propStatuses:{}}),_l=J.createContext({current:{}}),Rl=J.createContext({getDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")},getEffectDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")}}),Ay=J.createContext({setDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},clearDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},setEffectDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},clearEffectDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},setPropStatuses:()=>{throw new Error("VisualModeSettersContext not initialized")}}),ku=(e,t)=>`${Cn(e)}.effects.${t}`,RS=({children:e})=>{const[t,n]=c.useState([]),r=c.useRef(t);r.current=t;const[o,i]=c.useState({}),s=c.useRef(o);s.current=o;const[a,l]=c.useState({}),[u,d]=c.useState({}),p=c.useRef(u);p.current=u;const m=c.useCallback((F,j,P)=>{i(A=>({...A,[Cn(F)]:{...A[Cn(F)],[j]:P}}))},[]),h=c.useCallback(F=>{i(j=>{const P=Cn(F);if(!j[P])return j;const A={...j};return delete A[P],A})},[]),w=c.useCallback((F,j,P,A)=>{l(V=>{const _=ku(F,j);return{...V,[_]:{...V[_],[P]:A}}})},[]),v=c.useCallback((F,j)=>{l(P=>{const A=ku(F,j);if(!P[A])return P;const V={...P};return delete V[A],V})},[]),E=c.useCallback((F,j)=>{d(P=>{const A=Cn(F),V=P[A],_=j(V);return V===_?P:{...P,[A]:_}})},[]),g=c.useCallback(F=>{n(j=>[...j,F])},[]),y=c.useCallback(F=>{n(j=>j.filter(P=>P.id!==F))},[]),x=c.useMemo(()=>({registerSequence:g,sequences:t,unregisterSequence:y}),[g,t,y]),b=c.useCallback(F=>o[Cn(F)]??{},[o]),k=c.useCallback((F,j)=>a[ku(F,j)]??{},[a]),S=c.useMemo(()=>({propStatuses:u}),[u]),C=c.useMemo(()=>({getDragOverrides:b,getEffectDragOverrides:k}),[b,k]),I=c.useMemo(()=>({setDragOverrides:m,clearDragOverrides:h,setEffectDragOverrides:w,clearEffectDragOverrides:v,setPropStatuses:E}),[m,h,w,v,E]);return f.jsx(Il.Provider,{value:r,children:f.jsx(Vo.Provider,{value:x,children:f.jsx(_l.Provider,{value:p,children:f.jsx(Tl.Provider,{value:S,children:f.jsx(Rl.Provider,{value:C,children:f.jsx(Ay.Provider,{value:I,children:e})})})})})})},Pl=c.createContext(!1),PS=({children:e})=>f.jsx(Pl.Provider,{value:!0,children:e}),Ny=({children:e})=>f.jsx(Pl.Provider,{value:!1,children:e}),FS=()=>{if(!J.useContext(Pl))throw new Error("This component must be inside a <Series /> component.")},Ly=c.createContext({premountFramesRemaining:0}),MS=!1,ls=e=>e??MS,us=({from:e,durationInFrames:t,premountFor:n,postmountFor:r,style:o,styleWhilePremounted:i,styleWhilePostmounted:s,hideWhilePremounted:a})=>{const l=c.useContext(Ly),u=ht()-l.premountFramesRemaining,d=Ve(),{fps:p}=Xe(),m=n??0,h=r??0,w=Math.ceil(e+t-1),v=!d.isRendering&&u<e&&u>=e-m,E=!d.isRendering&&u>w&&u<=w+h,g=v||E,y=v?e:E?e+t-1:0,x=c.useMemo(()=>g?{...o,...a==="opacity"?{opacity:0}:{display:"none"},pointerEvents:"none",...v?i:{},...E?s:{}}:o,[g,a,E,v,o,s,i]);return{effectivePremountFor:m,effectivePostmountFor:h,premountingActive:v,postmountingActive:E,isPremountingOrPostmounting:g,freezeFrame:y,premountingStyle:x}},jS=(e,t)=>{for(const n of t){const r=n.split("."),o=[e];let i=e;for(let s=0;s<r.length-1;s++){const a=r[s],l=i[a];if(l==null){i=null;break}i=l,o.push(i)}if(i!==null){delete i[r[r.length-1]];for(let s=o.length-1;s>0;s--){const a=o[s];if(Object.keys(a).length===0){const l=r[s-1];delete o[s-1][l]}else break}}}return e},$S=4,AS=.001,NS=1e-7,LS=10,vi=11,Ls=1/(vi-1),zS=typeof Float32Array=="function";function zy(e,t){return 1-3*t+3*e}function Dy(e,t){return 3*t-6*e}function Oy(e){return 3*e}function Ha(e,t,n){return((zy(t,n)*e+Dy(t,n))*e+Oy(t))*e}function Vy(e,t,n){return 3*zy(t,n)*e*e+2*Dy(t,n)*e+Oy(t)}function DS({aX:e,_aA:t,_aB:n,mX1:r,mX2:o}){let i,s,a=0,l=t,u=n;do s=l+(u-l)/2,i=Ha(s,r,o)-e,i>0?u=s:l=s;while(Math.abs(i)>NS&&++a<LS);return s}function OS(e,t,n,r){let o=t;for(let i=0;i<$S;++i){const s=Vy(o,n,r);if(s===0)return o;const a=Ha(o,n,r)-e;o-=a/s}return o}function By(e,t,n,r){if(!(e>=0&&e<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");const o=zS?new Float32Array(vi):new Array(vi);if(e!==t||n!==r)for(let s=0;s<vi;++s)o[s]=Ha(s*Ls,e,n);function i(s){let a=0,l=1;const u=vi-1;for(;l!==u&&o[l]<=s;++l)a+=Ls;--l;const d=(s-o[l])/(o[l+1]-o[l]),p=a+d*Ls,m=Vy(p,e,n);return m>=AS?OS(s,p,e,n):m===0?p:DS({aX:s,_aA:a,_aB:a+Ls,mX1:e,mX2:n})}return function(s){const a=Math.min(1,Math.max(0,s));return e===t&&n===r?a:a===0?0:a===1?1:Ha(i(a),t,r)}}var VS=e=>Math.round(e*1e6)/1e6,BS=new Set(["deg","rad","grad","turn"]),Wy=new Set(["%","cap","ch","cm","cqb","cqh","cqi","cqmax","cqmin","cqw","dvh","dvw","em","ex","ic","in","lh","lvh","lvw","mm","pc","pt","px","q","rem","rlh","svh","svw","vb","vh","vi","vmax","vmin","vw"]),Uy=/^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/,Hy=new Set(["left","center","right","top","bottom"]),fo=e=>e==="left"?[{axis:"x",value:{value:0,unit:"%"}}]:e==="right"?[{axis:"x",value:{value:100,unit:"%"}}]:e==="top"?[{axis:"y",value:{value:0,unit:"%"}}]:e==="bottom"?[{axis:"y",value:{value:100,unit:"%"}}]:[{axis:"x",value:{value:50,unit:"%"}},{axis:"y",value:{value:50,unit:"%"}}],ri={value:50,unit:"%"},pm=e=>String(VS(e)),WS=(e,t)=>{const n=Uy.exec(e);if(n===null)throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported scale, translate, or rotate value`);const r=n[2]??null,o=Number(n[1]);if(!Number.isFinite(o))throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(r===null)return{kind:"scale",value:o,unit:null};if(BS.has(r))return{kind:"rotate",value:o,unit:r};if(Wy.has(r))return{kind:"translate",value:o,unit:r};throw new TypeError(`Cannot interpolate "${t}" because "${r}" is not a supported translate or rotate unit`)},Zy=({component:e,value:t,allowPercentage:n})=>{const r=Uy.exec(e);if(r===null)throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${n?"length-percentage":"z length"}`);const o=r[2]??null,i=Number(r[1]);if(!Number.isFinite(i))throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(o===null||!Wy.has(o)||!n&&o==="%")throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${n?"length-percentage":"z length"}`);return{value:i,unit:o}},Cu=(e,t)=>{const n=e.toLowerCase();return Hy.has(n)?{type:"keyword",keyword:n}:{type:"length-percentage",parsed:Zy({component:e,value:t,allowPercentage:!0})}},US=(e,t,n)=>{const r=[];for(const o of fo(e))for(const i of fo(t))o.axis!==i.axis&&r.push(o.axis==="x"?[o.value,i.value]:[i.value,o.value]);if(r.length===0)throw new TypeError(`Cannot interpolate "${n}" because "${e} ${t}" is not a valid transform-origin keyword pair`);return r[0]},HS=(e,t)=>{if(e.length===1){const a=Cu(e[0],t);return a.type==="length-percentage"?[a.parsed,ri]:a.keyword==="top"||a.keyword==="bottom"?[ri,fo(a.keyword)[0].value]:[fo(a.keyword)[0].value,ri]}const n=Cu(e[0],t),r=Cu(e[1],t);if(n.type==="length-percentage"&&r.type==="length-percentage")return[n.parsed,r.parsed];if(n.type==="keyword"&&r.type==="keyword")return US(n.keyword,r.keyword,t);const o=n.type==="keyword"?n:r.type==="keyword"?r:null,i=n.type==="length-percentage"?n.parsed:r.type==="length-percentage"?r.parsed:null;if(o===null||i===null)throw new Error("Expected a keyword and a length-percentage value");const s=n.type==="keyword";if(o.keyword==="left"||o.keyword==="right"){if(!s)throw new TypeError(`Cannot interpolate "${t}" because horizontal transform-origin keywords must come before a length-percentage value`);return[fo(o.keyword)[0].value,i]}return o.keyword==="top"||o.keyword==="bottom"?[i,fo(o.keyword)[0].value]:s?[ri,i]:[i,ri]},ZS=(e,t)=>{const[n,r]=HS(t.slice(0,2),e),o=t[2]===void 0?{value:0,unit:null}:Zy({component:t[2],value:e,allowPercentage:!1});return{kind:"translate",values:[n.value,r.value,o.value],units:[n.unit,r.unit,o.unit],dimensions:t[2]===void 0?2:3}},YS=e=>{var o,i,s,a,l,u;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`outputRange must contain only finite numbers, but got [${e}]`);return{kind:"scale",values:[e,e,1],units:[null,null,null],dimensions:1}}const t=e.trim().split(/\s+/);if(t.length<1||t.length>3||t[0]==="")throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${e}"`);if(t.some(d=>Hy.has(d.toLowerCase())))return ZS(e,t);const n=t.map(d=>WS(d,e)),[{kind:r}]=n;for(const d of n)if(d.kind!==r)throw new TypeError(`Cannot interpolate "${e}" because it mixes ${r} and ${d.kind} values`);if(r==="scale"){const d=n[0].value,p=((o=n[1])==null?void 0:o.value)??d,m=((i=n[2])==null?void 0:i.value)??1;return{kind:r,values:[d,p,m],units:[null,null,null],dimensions:n.length}}return{kind:r,values:[n[0].value,((s=n[1])==null?void 0:s.value)??0,((a=n[2])==null?void 0:a.value)??0],units:[n[0].unit,((l=n[1])==null?void 0:l.unit)??null,((u=n[2])==null?void 0:u.unit)??null],dimensions:n.length}},KS=({kind:e,values:t,units:n,dimensions:r})=>e==="scale"?t.slice(0,r).map(o=>pm(o)).join(" "):t.slice(0,r).map((o,i)=>`${pm(o)}${n[i]}`).join(" "),mm=e=>e===0?0:Math.sign(e)*e*e,XS=e=>e===0?0:Math.sign(e)*Math.sqrt(Math.abs(e));function GS(e,t,n,r){const{extrapolateLeft:o,extrapolateRight:i,easing:s,output:a}=r;let l=e;const[u,d]=t,[p,m]=n;if(l<u){if(o==="identity")return l;if(o==="clamp")l=u;else if(o==="wrap"){const h=d-u;l=((l-u)%h+h)%h+u}}if(l>d){if(i==="identity")return l;if(i==="clamp")l=d;else if(i==="wrap"){const h=d-u;l=((l-u)%h+h)%h+u}}if(p===m)return p;if(l=(l-u)/(d-u),l=s(l),a==="perceptual-scale"){const h=mm(p),w=mm(m);l=XS(l*(w-h)+h)}else l=l*(m-p)+p;return l}function qS(e,t){let n;for(n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var QS=e=>e,JS=e=>e??"linear",Yy=e=>e.remotionShouldExtendRight===!0,hm=({easing:e,segmentIndex:t})=>e===void 0?QS:typeof e=="function"?e:e[t],gm=({input:e,inputRange:t,outputRange:n,easing:r,extrapolateLeft:o,extrapolateRight:i,output:s})=>GS(e,t,n,{easing:r,extrapolateLeft:o,extrapolateRight:e>t[1]&&i==="clamp"&&Yy(r)?"extend":i,output:s}),xf=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=JS(r==null?void 0:r.output);if(t.length===1)return n[0];const i=r==null?void 0:r.easing;let s="extend";(r==null?void 0:r.extrapolateLeft)!==void 0&&(s=r.extrapolateLeft);let a="extend";(r==null?void 0:r.extrapolateRight)!==void 0&&(a=r.extrapolateRight);const l=(r==null?void 0:r.posterize)===void 0?e:Math.floor(e/r.posterize)*r.posterize,u=qS(l,t),d=hm({easing:i,segmentIndex:u});let p=gm({input:l,inputRange:[t[u],t[u+1]],outputRange:[n[u],n[u+1]],easing:d,extrapolateLeft:s,extrapolateRight:a,output:o});for(let m=0;m<u;m++){const h=hm({easing:i,segmentIndex:m});if(!Yy(h))continue;const w=t[m+1];if(l<=w)continue;const v=gm({input:l,inputRange:[t[m],w],outputRange:[n[m],n[m+1]],easing:h,extrapolateLeft:s,extrapolateRight:"extend",output:o});p+=v-n[m+1]}return p},eE=({input:e,inputRange:t,outputRange:n,options:r})=>{var u;const o=n.map(YS),i=(u=o[0])==null?void 0:u.kind;if(i===void 0)throw new Error("outputRange must have at least 1 element");for(const d of o)if(d.kind!==i)throw new TypeError(`Cannot interpolate ${i} values with ${d.kind} values`);const s=Math.max(...o.map(d=>d.dimensions)),a=[null,null,null];if(i!=="scale")for(let d=0;d<s;d++){for(const p of o){const m=p.units[d];if(m!==null){if(a[d]===null){a[d]=m;continue}if(a[d]!==m)throw new TypeError(`Cannot interpolate ${i} values with different units on axis ${d+1}: ${a[d]} and ${m}`)}}if(a[d]===null)throw new TypeError(`Cannot interpolate ${i} values because axis ${d+1} has no unit`)}const l=[0,0,0];for(let d=0;d<s;d++)l[d]=xf({input:e,inputRange:t,outputRange:o.map(p=>p.values[d]),options:r});return KS({kind:i,values:l,units:a,dimensions:s})},tE=e=>{var n;const t=(n=e[0])==null?void 0:n.length;if(t===void 0)throw new Error("outputRange must have at least 1 element");if(t===0)throw new TypeError("outputRange tuples must contain at least 1 number");for(const r of e){if(r.length!==t)throw new TypeError(`outputRange tuples must all have the same length, but got ${t} and ${r.length}`);for(const o of r)if(typeof o!="number"||!Number.isFinite(o))throw new TypeError(`outputRange tuples must contain only finite numbers, but got [${r.join(",")}]`)}return t},nE=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=tE(n);return new Array(o).fill(!0).map((i,s)=>xf({input:e,inputRange:t,outputRange:n.map(a=>a[s]),options:r}))};function rE(e){for(let t=1;t<e.length;++t)if(!(e[t]>e[t-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${e.join(",")}]`)}function vm(e,t){if(t.length<1)throw new Error(e+" must have at least 1 element");for(const n of t){if(typeof n!="number")throw new Error(`${e} must contain only numbers`);if(!Number.isFinite(n))throw new Error(`${e} must contain only finite numbers, but got [${t.join(",")}]`)}}function oE(e,t){if(e===void 0||typeof e=="function")return;const n=t-1;if(e.length!==n)throw new Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${n}), but got length ${e.length}`);for(let r=0;r<e.length;r++)if(typeof e[r]!="function")throw new Error(`easing[${r}] must be a function`)}function iE(e){if(e!==void 0&&(typeof e!="number"||!Number.isFinite(e)||e<=0))throw new Error(`posterize must be a positive finite number, but got ${e}`)}function sE(e){if(!(e===void 0||e==="linear"||e==="perceptual-scale"))throw new Error(`output must be "linear" or "perceptual-scale", but got ${String(e)}`)}function Bo(e,t,n,r){if(typeof e>"u")throw new Error("input can not be undefined");if(typeof t>"u")throw new Error("inputRange can not be undefined");if(typeof n>"u")throw new Error("outputRange can not be undefined");if(t.length!==n.length)throw new Error("inputRange ("+t.length+") and outputRange ("+n.length+") must have the same length");if(vm("inputRange",t),rE(t),oE(r==null?void 0:r.easing,t.length),iE(r==null?void 0:r.posterize),sE(r==null?void 0:r.output),typeof e!="number")throw new TypeError("Cannot interpolate an input which is not a number");if(!Array.isArray(n))throw new Error("outputRange must contain only numbers");if(n.some(i=>typeof i=="string")){if(!n.every(i=>typeof i=="string"||typeof i=="number"))throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");return eE({input:e,inputRange:t,outputRange:n,options:r})}if(n.every(i=>Array.isArray(i)))return nE({input:e,inputRange:t,outputRange:n,options:r});if(!n.every(i=>typeof i=="number"))throw new TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");return vm("outputRange",n),xf({input:e,inputRange:t,outputRange:n,options:r})}var aE=({allowFloats:e,durationInFrames:t,frame:n})=>{if(typeof n>"u")throw new TypeError('Argument missing for parameter "frame"');if(typeof n!="number")throw new TypeError(`Argument passed for "frame" is not a number: ${n}`);if(!Number.isFinite(n))throw new RangeError(`Frame ${n} is not finite`);if(n<0&&n<-t)throw new RangeError(`Cannot use frame ${n}: Duration of composition is ${t}, therefore the lowest frame that can be rendered is ${-t}`);if(n>t-1)throw new RangeError(`Cannot use frame ${n}: Duration of composition is ${t}, therefore the highest frame that can be rendered is ${t-1}`)},lE=e=>{if(!(typeof e>"u")){if(typeof e!="number")throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof e}"`);if(Number.isNaN(e))throw new TypeError('A "duration" of a spring is NaN, which it must not be');if(!Number.isFinite(e))throw new TypeError('A "duration" of a spring must be finite, but is '+e);if(e<=0)throw new TypeError('A "duration" of a spring must be positive, but is '+e)}},uE={damping:10,mass:1,stiffness:100,overshootClamping:!1},Iu={};function cE({animation:e,now:t,config:n}){const{toValue:r,lastTimestamp:o,current:i,velocity:s}=e,a=Math.min(t-o,64);if(n.damping<=0)throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");const l=n.damping,u=n.mass,d=n.stiffness,p=[r,o,i,s,l,u,d,t].join("-");if(Iu[p])return Iu[p];const m=-s,h=r-i,w=l/(2*Math.sqrt(d*u)),v=Math.sqrt(d/u),E=v*Math.sqrt(1-w**2),g=a/1e3,y=Math.sin(E*g),x=Math.cos(E*g),b=Math.exp(-w*v*g),k=b*(y*((m+w*v*h)/E)+h*x),S=r-k,C=w*v*k-b*(x*(m+w*v*h)-E*h*y),I=Math.exp(-v*g),F=r-I*(h+(m+v*h)*g),j=I*(m*(g*v-1)+g*h*v*v),P={toValue:r,prevPosition:i,lastTimestamp:t,current:w<1?S:F,velocity:w<1?C:j};return Iu[p]=P,P}var Tu={};function Ky({frame:e,fps:t,config:n={}}){const i=[e,t,n.damping,n.mass,n.overshootClamping,n.stiffness].join("-");if(Tu[i])return Tu[i];let s={lastTimestamp:0,current:0,toValue:1,velocity:0,prevPosition:0};const a=Math.max(0,e),l=a%1;for(let u=0;u<=Math.floor(a);u++){u===Math.floor(a)&&(u+=l);const d=u/t*1e3;s=cE({animation:s,now:d,config:{...uE,...n}})}return Tu[i]=s,s}var _u=new Map;function Xy({fps:e,config:t={},threshold:n=.005}){if(typeof n!="number")throw new TypeError(`threshold must be a number, got ${n} of type ${typeof n}`);if(n===0)return 1/0;if(n===1)return 0;if(isNaN(n))throw new TypeError("Threshold is NaN");if(!Number.isFinite(n))throw new TypeError("Threshold is not finite");if(n<0)throw new TypeError("Threshold is below 0");const r=[e,t.damping,t.mass,t.overshootClamping,t.stiffness,n].join("-");if(_u.has(r))return _u.get(r);xl(e,"to the measureSpring() function");let o=0,i=0;const s=()=>Ky({fps:e,frame:o,config:t});let a=s();const l=()=>Math.abs(a.current-a.toValue);let u=l();for(;u>=n;)o++,a=s(),u=l();i=o;for(let d=0;d<20;d++)o++,a=s(),u=l(),u>=n&&(d=0,i=o+1);return _u.set(r,i),i}function Qc({frame:e,fps:t,config:n={},from:r=0,to:o=1,durationInFrames:i,durationRestThreshold:s,delay:a=0,reverse:l=!1}){lE(i),aE({frame:e,durationInFrames:1/0,allowFloats:!0}),xl(t,"to spring()");const u=l||typeof i<"u",d=u?Xy({fps:t,config:n,threshold:s}):void 0,p=u?{get:()=>d}:{get:()=>{throw new Error("did not calculate natural duration, this is an error with Remotion. Please report")}},h=(l?(i??p.get())-e:e)+(l?a:-a),w=i===void 0?h:h/(i/p.get());if(i&&h>i)return o;const v=Ky({fps:t,frame:w,config:n}),E=n.overshootClamping?o>=r?Math.min(v.current,o):Math.max(v.current,o):v.current;return r===0&&o===1?E:Bo(E,[0,1],[r,o])}var ym=e=>Math.min(1,Math.max(0,e)),oi=30;class Za{static step0(t){return t>0?1:0}static step1(t){return t>=1?1:0}static linear(t){return t}static ease(t){return Za.bezier(.42,0,1,1)(t)}static quad(t){return t*t}static cubic(t){return t*t*t}static poly(t){return n=>n**t}static sin(t){return 1-Math.cos(t*Math.PI/2)}static circle(t){const n=ym(t);return 1-Math.sqrt(1-n*n)}static exp(t){return 2**(10*(t-1))}static elastic(t=1){const n=t*Math.PI;return r=>1-Math.cos(r*Math.PI/2)**3*Math.cos(r*n)}static back(t=1.70158){return n=>n*n*((t+1)*n-t)}static spring({allowTail:t=!1,durationRestThreshold:n,...r}={}){return Object.assign(i=>i<=0?0:!t&&i>=1?1:Qc(t?{fps:oi,frame:i*Xy({fps:oi,config:r,threshold:n}),config:r}:{fps:oi,frame:i*oi,config:r,durationInFrames:oi,durationRestThreshold:n}),{remotionShouldExtendRight:t})}static bounce(t){const n=ym(t);if(n<1/2.75)return 7.5625*n*n;if(n<2/2.75){const o=n-.5454545454545454;return 7.5625*o*o+.75}if(n<2.5/2.75){const o=n-.8181818181818182;return 7.5625*o*o+.9375}const r=n-2.625/2.75;return 7.5625*r*r+.984375}static bezier(t,n,r,o){return By(t,n,r,o)}static in(t){return t}static out(t){return n=>1-t(1-n)}static inOut(t){return n=>n<.5?t(n*2)/2:1-t((1-n)*2)/2}}var Qt="[-+]?\\d*\\.?\\d+",zs=Qt+"%";function Ds(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Os="(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";function ii(e){return new RegExp(e+"\\(\\s*("+Os+")\\s+("+Os+")\\s+("+Os+")(?:\\s*\\/\\s*("+Os+"))?\\s*\\)")}function dE(){const e={rgb:void 0,rgba:void 0,hsl:void 0,hsla:void 0,hex3:void 0,hex4:void 0,hex5:void 0,hex6:void 0,hex8:void 0,oklch:void 0,oklab:void 0,lab:void 0,lch:void 0,hwb:void 0};return e.rgb===void 0&&(e.rgb=new RegExp("rgb"+Ds(Qt,Qt,Qt)),e.rgba=new RegExp("rgba"+Ds(Qt,Qt,Qt,Qt)),e.hsl=new RegExp("hsl"+Ds(Qt,zs,zs)),e.hsla=new RegExp("hsla"+Ds(Qt,zs,zs,Qt)),e.hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,e.hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,e.hex6=/^#([0-9a-fA-F]{6})$/,e.hex8=/^#([0-9a-fA-F]{8})$/,e.oklch=ii("oklch"),e.oklab=ii("oklab"),e.lab=ii("lab"),e.lch=ii("lch"),e.hwb=ii("hwb")),e}function bo(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wm(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=bo(o,r,e+1/3),s=bo(o,r,e),a=bo(o,r,e-1/3);return Math.round(i*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function Yr(e){const t=Number.parseInt(e,10);return t<0?0:t>255?255:t}function xm(e){return(Number.parseFloat(e)%360+360)%360/360}function bm(e){const t=Number.parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Vs(e){const t=Number.parseFloat(e);return t<0?0:t>100?1:t/100}function Vt(e,t){return e==="none"?0:e.endsWith("%")?Number.parseFloat(e)/100*t:Number.parseFloat(e)}function Ru(e){return e==="none"?0:e.endsWith("rad")?Number.parseFloat(e)*180/Math.PI:e.endsWith("grad")?Number.parseFloat(e)*.9:e.endsWith("turn")?Number.parseFloat(e)*360:Number.parseFloat(e)}function si(e){return e===void 0||e==="none"?1:e.endsWith("%")?Math.max(0,Math.min(1,Number.parseFloat(e)/100)):Math.max(0,Math.min(1,Number.parseFloat(e)))}function So(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function Bs(e){return Math.max(0,Math.min(1,e))}function ai(e,t,n,r){const o=Math.round(Bs(e)*255),i=Math.round(Bs(t)*255),s=Math.round(Bs(n)*255),a=Math.round(Bs(r)*255);return(o<<24|i<<16|s<<8|a)>>>0}function Sm(e,t,n){const r=e+.3963377774*t+.2158037573*n,o=e-.1055613458*t-.0638541728*n,i=e-.0894841775*t-1.291485548*n,s=r*r*r,a=o*o*o,l=i*i*i,u=4.0767416621*s-3.3077115913*a+.2309699292*l,d=-1.2684380046*s+2.6097574011*a-.3413193965*l,p=-.0041960863*s-.7034186147*a+1.707614701*l;return[So(u),So(d),So(p)]}function Em(e,t,n){const r=.008856451679035631,o=24389/27,i=.95047,s=1,a=1.08883,l=(e+16)/116,u=t/500+l,d=l-n/200,p=u*u*u,m=d*d*d,h=p>r?p:(116*u-16)/o,w=e>o*r?((e+16)/116)**3:e/o,v=m>r?m:(116*d-16)/o,E=h*i,g=w*s,y=v*a,x=3.2404542*E-1.5371385*g-.4985314*y,b=-.969266*E+1.8760108*g+.041556*y,k=.0556434*E-.2040259*g+1.0572252*y;return[So(x),So(b),So(k)]}function fE(e,t,n){if(t+n>=1){const u=t/(t+n);return[u,u,u]}const r=1,o=0,i=bo(o,r,e+1/3),s=bo(o,r,e),a=bo(o,r,e-1/3),l=1-t-n;return[i*l+t,s*l+t,a*l+t]}var km={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};function pE(e){const t=dE();let n;if(t.hex6&&(n=t.hex6.exec(e)))return Number.parseInt(n[1]+"ff",16)>>>0;if(km[e]!==void 0)return km[e];if(t.rgb&&(n=t.rgb.exec(e)))return(Yr(n[1])<<24|Yr(n[2])<<16|Yr(n[3])<<8|255)>>>0;if(t.rgba&&(n=t.rgba.exec(e)))return(Yr(n[1])<<24|Yr(n[2])<<16|Yr(n[3])<<8|bm(n[4]))>>>0;if(t.hex3&&(n=t.hex3.exec(e)))return Number.parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0;if(t.hex8&&(n=t.hex8.exec(e)))return Number.parseInt(n[1],16)>>>0;if(t.hex4&&(n=t.hex4.exec(e)))return Number.parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0;if(t.hsl&&(n=t.hsl.exec(e)))return(wm(xm(n[1]),Vs(n[2]),Vs(n[3]))|255)>>>0;if(t.hsla&&(n=t.hsla.exec(e)))return(wm(xm(n[1]),Vs(n[2]),Vs(n[3]))|bm(n[4]))>>>0;if(t.oklch&&(n=t.oklch.exec(e))){const r=Vt(n[1],1),o=Vt(n[2],.4),i=Ru(n[3]),s=si(n[4]),a=i*Math.PI/180,[l,u,d]=Sm(r,o*Math.cos(a),o*Math.sin(a));return ai(l,u,d,s)}if(t.oklab&&(n=t.oklab.exec(e))){const r=Vt(n[1],1),o=Vt(n[2],.4),i=Vt(n[3],.4),s=si(n[4]),[a,l,u]=Sm(r,o,i);return ai(a,l,u,s)}if(t.lab&&(n=t.lab.exec(e))){const r=Vt(n[1],100),o=Vt(n[2],125),i=Vt(n[3],125),s=si(n[4]),[a,l,u]=Em(r,o,i);return ai(a,l,u,s)}if(t.lch&&(n=t.lch.exec(e))){const r=Vt(n[1],100),o=Vt(n[2],150),i=Ru(n[3]),s=si(n[4]),a=i*Math.PI/180,[l,u,d]=Em(r,o*Math.cos(a),o*Math.sin(a));return ai(l,u,d,s)}if(t.hwb&&(n=t.hwb.exec(e))){const r=Ru(n[1]),o=Vt(n[2],1),i=Vt(n[3],1),s=si(n[4]),[a,l,u]=fE(r/360,o,i);return ai(a,l,u,s)}throw new Error(`invalid color string ${e} provided`)}var Cm=e=>(e>>24&255)/255,mE=e=>e>>16&255,hE=e=>e>>8&255,gE=e=>e&255,vE=(e,t,n,r)=>`rgba(${e}, ${t}, ${n}, ${r})`;function yE(e){const t=pE(e);return(t<<24|t>>>8)>>>0}var wE=(e,t,n,r)=>{const[o,i,s,a]=[mE,hE,gE,Cm].map(l=>{const u=Bo(e,t,n.map(d=>l(d)),{easing:r==null?void 0:r.easing,extrapolateLeft:"clamp",extrapolateRight:"clamp",posterize:r==null?void 0:r.posterize});return l===Cm?Number(u.toFixed(3)):Math.round(u)});return vE(o,i,s,a)},xE=(e,t,n,r)=>{if(typeof e>"u")throw new TypeError("input can not be undefined");if(typeof t>"u")throw new TypeError("inputRange can not be undefined");if(typeof n>"u")throw new TypeError("outputRange can not be undefined");if(t.length!==n.length)throw new TypeError("inputRange ("+t.length+" values provided) and outputRange ("+n.length+" values provided) must have the same length");const o=n.map(i=>yE(i));return wE(e,t,o,r)},Im=({easing:e,forceSpringAllowTail:t})=>{switch(e.type){case"linear":return Za.linear;case"spring":return Za.spring({allowTail:t??e.allowTail??void 0,damping:e.damping,durationRestThreshold:e.durationRestThreshold??void 0,mass:e.mass,overshootClamping:e.overshootClamping,stiffness:e.stiffness});case"bezier":return By(e.x1,e.y1,e.x2,e.y2);default:throw new TypeError(`Unsupported easing: ${JSON.stringify(e)}`)}},cs=({frame:e,forceSpringAllowTail:t,status:n})=>{const{keyframes:r,easing:o,clamping:i,interpolationFunction:s}=n;if(r.length===0)return null;const a=[...r].sort((d,p)=>d.frame-p.frame),l=a.map(d=>d.frame),u=a.map(d=>d.value);if(s==="interpolateColors"){if(!u.every(d=>typeof d=="string"))return null;if(r.length===1)return u[0];try{return xE(e,l,u,{easing:o.map(d=>Im({easing:d,forceSpringAllowTail:t})),posterize:n.posterize})}catch{return null}}if(s!=="interpolate")return null;try{return Bo(e,l,u,{easing:o.map(d=>Im({easing:d,forceSpringAllowTail:t})),extrapolateLeft:i.left,extrapolateRight:i.right,output:n.output,posterize:n.posterize})}catch{return null}},Fl=({dragOverrideValue:e,frame:t})=>{if(e===void 0)return{type:"none"};if(e.type==="static")return{type:"resolved",value:e.value};if(t===null)return{type:"none"};const n=cs({forceSpringAllowTail:null,frame:t,status:e.status});return n===null?{type:"none"}:{type:"resolved",value:n}},Gy=({propStatus:e,dragOverrideValue:t,defaultValue:n,frame:r=null,shouldResortToDefaultValueIfUndefined:o=!1})=>{const i=Fl({dragOverrideValue:t,frame:r});return i.type==="resolved"&&i.value!==void 0?i.value:e.status==="keyframed"?r!==null?cs({forceSpringAllowTail:null,frame:r,status:e}):o?n:void 0:e.codeValue===void 0&&o?n:e.codeValue},bf=c.createContext({overrideIdToNodePathMappings:{}}),bE=c.createContext({setOverrideIdToNodePath:()=>{throw new Error("OverrideIdsToNodePathsSettersContext not initialized")}}),SE=({descriptor:e,propStatusOverrides:t,dragOverrides:n,frame:r})=>{if(!t&&!n)return{params:e.params,effectKey:e.effectKey};const o={...e.params};if(t)for(const[i,s]of Object.entries(t))s!==void 0&&(o[i]=s);if(n)for(const[i,s]of Object.entries(n)){const a=Fl({dragOverrideValue:s,frame:r});a.type==="resolved"&&(o[i]=a.value)}return{params:o,effectKey:e.definition.calculateKey(o)}},EE=(e,t)=>{if(!e)return null;const n={};let r=!1;for(const[o,i]of Object.entries(e)){if(i.status==="static"){n[o]=i.codeValue,r=!0;continue}if(i.status==="keyframed"){const s=cs({forceSpringAllowTail:null,frame:t,status:i});s!==null&&(n[o]=s,r=!0)}}return r?n:null},ds=e=>{const t=c.useRef(null),n=e.map(i=>i.definition),r=t.current;return r!==null&&r.length===n.length&&r.every((i,s)=>i===n[s])?r:(t.current=n,n)},qy=({propStatuses:e,nodePath:t,effectIndex:n})=>{const r=e[Cn(t)];if(!r)return{type:"cannot-update-sequence",reason:"not-found"};if(!r.canUpdate)return{type:"cannot-update-sequence",reason:r.reason};const o=r.effects.find(i=>i.effectIndex===n);return o?o.canUpdate?{type:"can-update-effect",props:o.props}:{type:"cannot-update-effect",reason:o.reason}:{type:"cannot-update-effect",reason:"not-found"}},Qy=(e,t)=>{const n=e[Cn(t)];if(n&&n.canUpdate)return n.props},fs=({effects:e,overrideId:t})=>{const n=c.useRef(null),{propStatuses:r}=c.useContext(Tl),{getEffectDragOverrides:o}=c.useContext(Rl),i=ht(),{overrideIdToNodePathMappings:s}=c.useContext(bf),a=n.current,l=t?s[t]??null:null,u=e.map((m,h)=>{if(l===null)return{descriptor:m,params:m.params,effectKey:m.effectKey};const w=qy({propStatuses:r,nodePath:l,effectIndex:h}),v=w.type==="can-update-effect"?EE(w.props,i):null,E=o(l,h),g=Object.keys(E).length===0?null:E,{params:y,effectKey:x}=SE({descriptor:m,propStatusOverrides:v,dragOverrides:g,frame:i});return{descriptor:m,params:y,effectKey:x}});if(a!==null&&a.length===u.length&&a.every((m,h)=>m.definition===u[h].descriptor.definition&&m.effectKey===u[h].effectKey))return a;const p=u.map(({descriptor:m,params:h,effectKey:w})=>({definition:m.definition,effectKey:w,params:h,memoized:!0}));return n.current=p,p},Sf=(e,t)=>{const n={};for(const r of Object.keys(e)){const o=e[r];if(o.type!=="hidden")if(o.type==="enum"){n[r]=o;const i=t(r)??o.default,s=o.variants[i];s&&Object.assign(n,Sf(s,t))}else n[r]=o}return n},Ef=e=>{const t={},n=(r,o)=>{r in t||(t[r]=o)};for(const r of Object.keys(e)){const o=e[r];if(n(r,o),o.type==="enum")for(const i of Object.values(o.variants)){const s=Ef(i);for(const a of Object.keys(s))n(a,s[a])}}return t},Jy=({schema:e,key:t,value:n})=>{const r=e[t];if(!r)throw new Error("Key "+JSON.stringify(t)+" not found in schema");if(typeof n!="string")throw new Error("Value must be a string, but is "+JSON.stringify(n));if(r.type!=="enum")throw new Error("Key "+JSON.stringify(t)+" is not an enum");if(!r.variants[n])throw new Error("Value for "+JSON.stringify(t)+" must be one of "+Object.keys(r.variants).map(a=>JSON.stringify(a)).join(", ")+", got "+JSON.stringify(n));const i=Object.keys(r.variants).filter(a=>a!==n),s=new Set;for(const a of i){const l=r.variants[a],u=Object.keys(l);for(const d of u)s.add(d)}return[...s]},Tm={type:"linear"},kE=({insertedKeyframeIndex:e,easingLength:t,keyframeCount:n})=>!(e>0&&e<n-1)||t===0?null:Math.min(e-1,t-1),CE=e=>({type:"static",value:e}),IE=({status:e,frame:t,value:n})=>{const r=e.keyframes.findIndex(s=>s.frame===t),o=r===-1?[...e.keyframes,{frame:t,value:n}].sort((s,a)=>s.frame-a.frame):e.keyframes.map((s,a)=>a===r?{frame:t,value:n}:s),i=[...e.easing];if(r===-1){const s=o.findIndex(u=>u.frame===t),a=kE({insertedKeyframeIndex:s,easingLength:i.length,keyframeCount:o.length}),l=a===null?Tm:i[a];i.splice(s,0,l)}for(;i.length<o.length-1;)i.push(Tm);return i.length>o.length-1&&(i.length=o.length-1),{type:"keyframed",status:{...e,keyframes:o,easing:i}}},TE=e=>{if((e==null?void 0:e.type)==="static")return e.value},_E=e=>e!==null&&e.status==="keyframed",e0=(e,t)=>{if(t in e)return e[t];for(const n of Object.values(e))if(n.type==="enum")for(const r of Object.values(n.variants)){const o=e0(r,t);if(o)return o}},t0=({schema:e,currentValue:t,overrideValues:n,propStatus:r,frame:o})=>{var a;const i={},s=new Set;for(const l of Object.keys(t)){const u=(r==null?void 0:r[l])??null,d=e0(e,l);if((d==null?void 0:d.type)==="hidden")continue;let p;if(u===null)p=t[l];else if(_E(u))if((d==null?void 0:d.type)==="array"||(d==null?void 0:d.keyframable)===!1)p=t[l];else{const m=Fl({dragOverrideValue:n[l],frame:o});m.type==="resolved"?p=m.value:o!==null?p=cs({forceSpringAllowTail:null,frame:o,status:u})??t[l]:p=t[l]}else u.status==="computed"?p=t[l]:p=Gy({propStatus:u,dragOverrideValue:n[l],defaultValue:d==null?void 0:d.default,frame:o,shouldResortToDefaultValueIfUndefined:!1});(d==null?void 0:d.type)==="asset"&&typeof p=="string"&&p.startsWith(Yi)&&(p=`${window.remotion_staticBase}/${p.slice(Yi.length)}`),p===void 0&&s.add(l),i[l]=p}for(const l of Object.keys(n))if(((a=e[l])==null?void 0:a.type)==="enum"){const u=Jy({schema:e,key:l,value:i[l]});for(const d of u)s.add(d)}return{merged:i,propsToDelete:s}},n0=(e,t)=>{const n=t.split(".");let r=e;for(const o of n){if(r==null||typeof r!="object")return;r=r[o]}return r},r0=({flatSchema:e,key:t,props:n})=>{var o;const r=n0(n,t);if(!(((o=e[t])==null?void 0:o.type)==="text-content"&&typeof r!="string"))return r},RE=(e,t,n)=>{const r={};for(const o of t)r[o]=n?r0({flatSchema:n,key:o,props:e}):n0(e,o);return r},PE=(e,t)=>Object.keys(Sf(e,n=>t[n])),FE=({flatSchema:e,props:t,valuesDotNotation:n,schemaKeys:r,propsToDelete:o})=>{var a;const i={...t};for(const l of r){const u=n[l];if(((a=e[l])==null?void 0:a.type)==="text-content"&&u===void 0)continue;const d=l.split(".");if(d.length===1){i[l]=u;continue}let p=i;for(let m=0;m<d.length-1;m++){const h=d[m];typeof p[h]=="object"&&p[h]!==null?p[h]={...p[h]}:p[h]={},p=p[h]}p[d[d.length-1]]=u}const s=new Set([...o].filter(l=>{var u;return!(((u=e[l])==null?void 0:u.type)==="text-content"&&n[l]===void 0)}));return jS(i,s),i},_m={},Nn=({Component:e,componentName:t,componentIdentity:n,schema:r,supportsEffects:o})=>{const i=CS(r),s=Ef(i),a=Object.keys(s),l=c.forwardRef((u,d)=>{const p=Ve();if(!p.isStudio||p.isReadOnlyStudio||p.isRendering)return J.createElement(e,{...u,controls:null,ref:d});const{propStatuses:m}=c.useContext(Tl),{getDragOverrides:h}=c.useContext(Rl),w=c.useContext(bf),v=ht();if(u.controls)return J.createElement(e,{...u,ref:d});const[E]=c.useState(()=>{const{stack:F}=u;if(!F)return String(Math.random());const j=_m[F];if(j)return j;const P=String(Math.random());return _m[F]=P,P}),g=w.overrideIdToNodePathMappings[E]??null,y=a.map(F=>r0({flatSchema:s,key:F,props:u})),x=c.useMemo(()=>RE(u,a,s),y),b=c.useMemo(()=>({schema:i,currentRuntimeValueDotNotation:x,overrideId:E,supportsEffects:o,componentIdentity:n,componentName:t}),[x,E]),{merged:k,propsToDelete:S}=c.useMemo(()=>t0({schema:i,currentValue:x,overrideValues:g===null?{}:h(g),propStatus:g===null?void 0:Qy(m,g),frame:v}),[x,h,g,m,v]),C=PE(i,k),I=FE({flatSchema:s,props:u,valuesDotNotation:k,schemaKeys:C,propsToDelete:S});return J.createElement(e,{...I,controls:b,ref:d})});return l.displayName=`withInteractivitySchema(${e.displayName||e.name||"Component"})`,l},Pu=[],ME=({from:e=0,trimBefore:t=0,freeze:n,durationInFrames:r=1/0,children:o,name:i,height:s,width:a,showInTimeline:l=!0,hidden:u=!1,controls:d,_remotionInternalEffects:p,_remotionInternalLoopDisplay:m,_remotionInternalStack:h,_remotionInternalDocumentationLink:w,_remotionInternalSingleChildComponent:v,_remotionInternalPremountDisplay:E,_remotionInternalPostmountDisplay:g,_remotionInternalIsMedia:y,outlineRef:x,...b},k)=>{const{layout:S="absolute-fill"}=b,[C]=c.useState(()=>String(Math.random())),I=c.useContext(Ke),{rootId:F}=pr(),j=I?I.cumulatedFrom+I.relativeFrom:0,P=yl();if(S!=="absolute-fill"&&S!=="none")throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${S}`);if(S==="none"&&typeof b.style<"u")throw new TypeError('If layout="none", you may not pass a style. Passed: '+JSON.stringify(b.style));if(typeof r!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof r}, but it must be a number.`);if(r<=0)throw new TypeError(`durationInFrames must be positive, but got ${r}`);if(typeof e!="number")throw new TypeError(`You passed to the "from" props of your <Sequence> an argument of type ${typeof e}, but it must be a number.`);if(!Number.isFinite(e))throw new TypeError(`The "from" prop of a sequence must be finite, but got ${e}.`);if(typeof t!="number")throw new TypeError(`You passed to the "trimBefore" prop of your <Sequence> an argument of type ${typeof t}, but it must be a number.`);if(t<0)throw new TypeError(`The "trimBefore" prop of <Sequence /> must be greater than or equal to 0, but got ${t}.`);if(Number.isNaN(t))throw new TypeError('The "trimBefore" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(t))throw new TypeError(`The "trimBefore" prop of <Sequence /> must be finite, but it is ${t}.`);if(typeof n<"u"&&n!==null){if(typeof n!="number")throw new TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof n}.`);if(Number.isNaN(n))throw new TypeError('The "freeze" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(n))throw new TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${n}.`)}const A=mr(),V=Xe(),_=e-t,L=((I==null?void 0:I.absoluteFrom)??0)+_,O=I?Math.min(I.durationInFrames-_,r):r,N=Math.max(0,Math.min(V.durationInFrames-e,O)),{registerSequence:T,unregisterSequence:z}=c.useContext(Vo),R=c.useRef(null),$=b.layout==="none"?x??null:x??R,B=c.useMemo(()=>(I==null?void 0:I.premounting)||!!b._remotionInternalIsPremounting,[b._remotionInternalIsPremounting,I==null?void 0:I.premounting]),W=c.useMemo(()=>(I==null?void 0:I.postmounting)||!!b._remotionInternalIsPostmounting,[b._remotionInternalIsPostmounting,I==null?void 0:I.postmounting]),M=j+_,D=I?I.cumulatedFrom+I.relativeFrom:0,K=I?D-I.cumulatedNegativeFrom:0,G=Math.max(0,K,M),oe=M-G,ne=c.useMemo(()=>({absoluteFrom:L,cumulatedFrom:j,relativeFrom:_,cumulatedNegativeFrom:oe,durationInFrames:N,parentFrom:(I==null?void 0:I.relativeFrom)??0,id:C,height:s??(I==null?void 0:I.height)??null,width:a??(I==null?void 0:I.width)??null,premounting:B,postmounting:W,premountDisplay:E??null,postmountDisplay:g??null}),[j,L,_,N,I,C,s,a,B,W,E,g,oe]),Z=c.useMemo(()=>i??"",[i]),ee=w??"https://www.remotion.dev/docs/sequence",ae=Ve(),me=c.useContext(Pl),ge=(b==null?void 0:b.stack)??null,le=c.useRef(null);le.current=h??ge;const q=typeof n=="number"?n:null,de=t===0?null:t,ye=(I==null?void 0:I.cumulatedNegativeFrom)??0,Fe=y&&y.type!=="image"?y.data.startMediaFrom+ye-oe:null,se=y&&y.type!=="image"?y.data.startMediaFrom+ye:null,We=y&&y.type!=="image"&&se!==null?q===null?null:se+(m?q%m.durationInFrames:q)*y.data.playbackRate:null;c.useEffect(()=>{if(ae.isStudio)return y?(y.type==="image"?T({type:"image",controls:d??null,effects:p??Pu,displayName:Z,documentationLink:ee,duration:N,from:e,trimBefore:de,id:C,loopDisplay:m,nonce:P.get(),parent:(I==null?void 0:I.id)??null,postmountDisplay:g??null,premountDisplay:E??null,rootId:F,showInTimeline:l,src:y.src,getStack:()=>le.current,refForOutline:$??null,isInsideSeries:me,frozenFrame:q,singleChildComponent:v??null}):T({type:y.type,controls:d??null,effects:p??Pu,displayName:Z,documentationLink:ee,doesVolumeChange:y.data.doesVolumeChange,duration:N,from:e,trimBefore:de,id:C,loopDisplay:m,nonce:P.get(),parent:(I==null?void 0:I.id)??null,playbackRate:y.data.playbackRate,postmountDisplay:g??null,premountDisplay:E??null,rootId:F,showInTimeline:l,src:y.data.src,getStack:()=>le.current,startMediaFrom:Fe??y.data.startMediaFrom,mediaFrameAtSequenceZero:se,volume:y.data.volumes,refForOutline:$??null,isInsideSeries:me,frozenFrame:q,frozenMediaFrame:We,singleChildComponent:v??null}),()=>{z(C)}):(T({from:e,trimBefore:de,duration:N,id:C,displayName:Z,documentationLink:ee,parent:(I==null?void 0:I.id)??null,type:"sequence",rootId:F,showInTimeline:l,nonce:P.get(),loopDisplay:m,getStack:()=>le.current,premountDisplay:E??null,postmountDisplay:g??null,controls:d??null,effects:p??Pu,refForOutline:$??null,isInsideSeries:me,frozenFrame:q,singleChildComponent:v??null}),()=>{z(C)})},[r,C,i,T,Z,z,I==null?void 0:I.id,N,F,e,t,de,l,P,m,E,g,ae.isStudio,d,p,y,ee,$,me,q,Fe,se,We,v]);const zt=Math.ceil(j+e+r-1),nt=A<j+e||A>zt?null:o,Ge=nt===null||typeof n>"u"||n===null?nt:f.jsx(as,{frame:n,children:nt}),lt=b.layout==="none"?void 0:b.style,ut=c.useCallback(Xt=>{R.current=Xt,typeof k=="function"?k(Xt):k&&(k.current=Xt)},[k]),Dt=c.useMemo(()=>({flexDirection:void 0,...a?{width:a}:{},...s?{height:s}:{},...lt??{}}),[s,lt,a]);if(k!==null&&S==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');return u?null:f.jsx(Ke.Provider,{value:ne,children:Ge===null?null:b.layout==="none"?Ge:f.jsx(an,{ref:ut,style:Dt,className:b.className,children:Ge})})},jE=c.forwardRef(ME),$E=(e,t)=>{if(e.layout==="none")throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');const{style:n,from:r=0,durationInFrames:o=1/0,premountFor:i=0,postmountFor:s=0,styleWhilePremounted:a,styleWhilePostmounted:l,...u}=e,{freezeFrame:d,isPremountingOrPostmounting:p,postmountingActive:m,premountingActive:h,premountingStyle:w}=us({from:r,durationInFrames:o,premountFor:i,postmountFor:s,style:n??null,styleWhilePremounted:a??null,styleWhilePostmounted:l??null,hideWhilePremounted:"opacity"});return f.jsx(as,{frame:d,active:p,children:f.jsx(Ml,{ref:t,from:r,durationInFrames:o,style:w??void 0,_remotionInternalPremountDisplay:i,_remotionInternalPostmountDisplay:s,_remotionInternalIsPremounting:h,_remotionInternalIsPostmounting:m,...u})})},AE=c.forwardRef($E),NE=(e,t)=>{const n=Ve(),{fps:r}=Xe();if(e.layout!=="none"&&!n.isRendering){const o=e.premountFor;if(o||e.postmountFor)return f.jsx(AE,{ref:t,...e,premountFor:o})}return f.jsx(jE,{...e,ref:t})},Ml=c.forwardRef(NE),o0=Ml,at=Nn({Component:Ml,componentName:"<Sequence>",componentIdentity:"dev.remotion.remotion.Sequence",schema:Fo,supportsEffects:!1});Nn({Component:Ml,componentName:"<Sequence>",componentIdentity:null,schema:TS,supportsEffects:!1});var i0=(e,t,n)=>{switch(e){case"fill":return[0,0,t.width,t.height,0,0,n.width,n.height];case"contain":{const r=Math.min(n.width/t.width,n.height/t.height),o=(n.width-t.width*r)/2,i=(n.height-t.height*r)/2;return[0,0,t.width,t.height,o,i,t.width*r,t.height*r]}case"cover":{const r=Math.max(n.width/t.width,n.height/t.height),o=(n.width-t.width*r)/2,i=(n.height-t.height*r)/2;return[0,0,t.width,t.height,o,i,t.width*r,t.height*r]}default:throw new Error("Unknown fit: "+e)}},LE="https://remotion.dev/docs/troubleshooting/webgl2-context",s0=(e,t)=>`Failed to acquire ${e} context for ${t}. Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. See ${LE}`,zE=e=>new Error(s0("WebGL",e)),a0=e=>new Error(s0("WebGL2",e));class DE{constructor(t,n){Se(this,"width");Se(this,"height");Se(this,"pairs",new Map);Se(this,"lostContexts",new Set);this.width=t,this.height=n}getPair(t){const n=this.pairs.get(t);if(n)return n;const r=[this.allocateCanvas(t),this.allocateCanvas(t)];return this.pairs.set(t,r),r}assertContextNotLost(t){if(this.lostContexts.has(t))throw new Error("WebGL context was lost during canvas effect rendering. This typically happens in headless or memory-constrained environments (e.g. Remotion Lambda). Try reducing concurrency or increasing the Lambda function memory.")}allocateCanvas(t){const n=document.createElement("canvas");switch(n.width=this.width,n.height=this.height,t){case"2d":{if(!n.getContext("2d",{colorSpace:"srgb"}))throw new Error("Failed to acquire 2D context for canvas effect");return n}case"webgl2":{const r=n.getContext("webgl2",{premultipliedAlpha:!0,alpha:!0,preserveDrawingBuffer:!0});if(!r)throw a0("canvas effect");return n.addEventListener("webglcontextlost",o=>{o.preventDefault(),this.lostContexts.add(n)}),n.addEventListener("webglcontextrestored",()=>{this.lostContexts.delete(n)}),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n}case"webgpu":{if(typeof navigator>"u"||!("gpu"in navigator))throw new Error("WebGPU is not available in this environment for canvas effect");return n}default:{const r=t;throw new Error(`Unknown effect backend: ${r}`)}}}}var OE=e=>{const t=[];let n=[],r=null;for(const o of e){const{backend:i}=o.definition;r===null||i===r?(n.push(o),r=i):(t.push({backend:r,effects:n}),n=[o],r=i)}return r!==null&&n.length>0&&t.push({backend:r,effects:n}),t},Ws=null,VE=()=>Ws||(Ws=(async()=>{if(typeof navigator>"u"||!("gpu"in navigator))throw new Error("WebGPU is not available in this environment");const{gpu:e}=navigator,t=await e.requestAdapter();if(!t)throw new Error("No WebGPU adapter available");return t.requestDevice()})(),Ws),l0=(e,t)=>({pool:new DE(e,t),setupCache:new WeakMap,cleanupRegistry:[],currentRunId:0}),Jc=e=>{e.currentRunId++;for(const t of e.cleanupRegistry)t.definition.cleanup(t.state)},BE=(e,t,n)=>{const r=t;let o=e.setupCache.get(r);if(o||(o=new WeakMap,e.setupCache.set(r,o)),o.has(n))return o.get(n);const i=t.setup(n);return o.set(n,i),e.cleanupRegistry.push({definition:r,state:i}),i},ps=async({state:e,source:t,effects:n,output:r,width:o,height:i})=>{const s=++e.currentRunId,a=()=>e.currentRunId!==s,l=n.filter(E=>!E.params.disabled),u=OE(l);let d=t,p=null;if(u.length===0){if(t===r)return!0;const E=r.getContext("2d");if(!E)throw new Error("Failed to acquire 2D context for output canvas");return E.clearRect(0,0,o,i),E.drawImage(d,0,0,o,i),!0}let m=!1;for(const E of u)if(E.backend==="webgpu"){m=!0;break}const h=m?await VE():null;if(a())return!1;let w=!0;for(let E=0;E<u.length;E++){const g=u[E],[y,x]=e.pool.getPair(g.backend);let b=y;for(const S of g.effects){const C=S.definition,I=BE(e,C,b);C.apply({source:d,target:b,state:I,params:S.params,width:o,height:i,gpuDevice:h,flipSourceY:g.backend==="webgl2"?w:!1}),g.backend==="webgl2"&&(w=!0,e.pool.assertContextNotLost(b)),d=b,b=b===y?x:y}p=d??p;const k=u[E+1];if(k&&k.backend!==g.backend&&p)if(g.backend==="2d"&&k.backend==="webgl2")d=p,w=!0;else{const S=await createImageBitmap(p);if(a())return S.close(),!1;d=S,k.backend==="webgl2"&&(w=!1)}}if(!p)return!0;const v=r.getContext("2d");if(!v)throw new Error("Failed to acquire 2D context for output canvas");return v.clearRect(0,0,o,i),v.drawImage(p,0,0,o,i),!0},ms=()=>{const e=c.useRef(null),t=c.useRef(null);return c.useEffect(()=>()=>{e.current&&Jc(e.current)},[]),c.useMemo(()=>({get:(n,r)=>((!t.current||t.current.width!==n||t.current.height!==r)&&(e.current&&Jc(e.current),e.current=l0(n,r),t.current={width:n,height:r}),e.current)}),[])},WE=({width:e,height:t,fit:n,className:r,style:o,effects:i,...s},a)=>{const l=c.useRef(null),u=ms(),d=c.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),p=c.useCallback(m=>{const h=l.current,w=e??m.displayWidth,v=t??m.displayHeight;if(!h)throw new Error("Canvas ref is not set");if(!d)throw new Error("Source canvas is not available");d.width=w,d.height=v;const E=d.getContext("2d");if(!E)throw new Error("Could not get 2d context for source canvas");return E.drawImage(m,...i0(n,{height:m.displayHeight,width:m.displayWidth},{width:w,height:v})),h.width=w,h.height=v,ps({state:u.get(w,v),source:d,effects:i,output:h,width:w,height:v})},[u,i,n,t,d,e]);return c.useImperativeHandle(a,()=>({draw:p,getCanvas:()=>{if(!l.current)throw new Error("Canvas ref is not set");return l.current},clear:()=>{var h;const m=(h=l.current)==null?void 0:h.getContext("2d");if(!m)throw new Error("Could not get 2d context");m.clearRect(0,0,l.current.width,l.current.height)}}),[p]),f.jsx("canvas",{ref:l,className:r,style:o,...s})},UE=J.forwardRef(WE),u0=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{if(typeof ImageDecoder>"u")throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");const o=await fetch(e,{...n,signal:t}),{body:i}=o;if(!i)throw new Error("Got no body");const s=new ImageDecoder({data:i,type:r??o.headers.get("Content-Type")??"image/gif"});await Promise.all([s.completed,s.tracks.ready]);const{selectedTrack:a}=s.tracks;if(!a)throw s.close(),new Error("No selected track");return{decoder:s,selectedTrack:a}},HE=5,Rm=({loopBehavior:e,durationFound:t,timeInSec:n})=>e==="loop"?t?n%t:n:Math.min(n,t||1/0),ZE=async({resolvedSrc:e,signal:t,requestInit:n,currentTime:r,initialLoopBehavior:o})=>{const{decoder:i,selectedTrack:s}=await u0({resolvedSrc:e,signal:t,requestInit:n,contentType:null}),a=[];let l=null;const u=async h=>{const w=a.find(E=>E.frameIndex===h);if(w&&w.frame)return w;const v=await i.decode({frameIndex:h,completeFramesOnly:!0});return w?w.frame=v.image:a.push({frame:v.image,frameIndex:h,timeInSeconds:v.image.timestamp/1e6}),{frame:v.image,frameIndex:h,timeInSeconds:v.image.timestamp/1e6}},d=h=>{const v=a.filter(E=>E.frame).sort((E,g)=>{const y=Math.abs(E.timeInSeconds-h),x=Math.abs(g.timeInSeconds-h);return y-x});for(let E=0;E<v.length;E++){if(E<HE)continue;const g=v[E];g.frame=null}},p=async({timeInSec:h,loopBehavior:w})=>{const v=Rm({durationFound:l,loopBehavior:w,timeInSec:h}),g=a.filter(x=>x.timeInSeconds<=v).map(x=>x.frameIndex).reduce((x,b)=>Math.max(x,b),0);let y=g;for(;;){const x=await u(y);if(y++,!x.frame)throw new Error("No frame found");if(!x.frame.duration||(y===s.frameCount&&l===null&&(l=(x.frame.timestamp+x.frame.duration)/1e6),x.timeInSeconds>v||y===s.frameCount))break}s.frameCount-g<3&&w==="loop"&&await u(0),d(v)};return await p({timeInSec:r,loopBehavior:o}),await p({timeInSec:r,loopBehavior:o}),{close:()=>{var h;for(const w of a)(h=w.frame)==null||h.close(),w.frame=null;i.close()},getFrame:async(h,w)=>{if(l!==null&&h>l&&w==="clear-after-finish")return null;const v=Rm({loopBehavior:w,durationFound:l,timeInSec:h});await p({timeInSec:v,loopBehavior:w});const g=a.filter(y=>y.frame).reduce((y,x)=>{const b=Math.abs(y.timeInSeconds-v),k=Math.abs(x.timeInSeconds-v);return b<k?y:x});if(!g.frame)throw new Error("No frame found");return g},frameCount:s.frameCount}},YE=({frame:e,playbackRate:t,fps:n})=>e*t/n,KE=e=>{if(!e)return null;const t={...e};delete t.signal;const{headers:n,...r}=t;return JSON.stringify({...r,headers:n?Array.from(new Headers(n).entries()):null})},XE=e=>typeof window>"u"?e:new URL(e,window.origin).href,GE={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...An,...Oo,playbackRate:{type:"number",min:0,max:10,step:.1,default:1,description:"Playback rate",hiddenFromList:!1,keyframable:!1},...xn,...gr,...hr},qE=e=>{const t={},n=t;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(r.startsWith("data-")||r.startsWith("aria-"))&&(n[r]=e[r]);return t},c0=c.forwardRef(({src:e,width:t,height:n,onError:r,loopBehavior:o="loop",playbackRate:i=1,fit:s="fill",requestInit:a,effects:l,controls:u,...d},p)=>{const m=XE(e),[h,w]=c.useState(null),{delayRender:v,continueRender:E}=ln(),[g]=c.useState(()=>v(`Rendering <AnimatedImage/> with src="${m}"`)),y=ht(),{fps:x}=Xe(),b=YE({frame:y,playbackRate:i,fps:x}),k=c.useRef(b);k.current=b;const S=KE(a),C=c.useRef(a);C.current=a;const I=c.useRef(null),F=fs({effects:l,overrideId:(u==null?void 0:u.overrideId)??null});c.useImperativeHandle(p,()=>{var A;const P=(A=I.current)==null?void 0:A.getCanvas();if(!P)throw new Error("Canvas ref is not set");return P},[]);const[j]=c.useState(()=>o);return c.useEffect(()=>{const P=new AbortController;let A=!1,V=!1;const _=()=>{V||(V=!0,E(g))};return ZE({resolvedSrc:m,signal:P.signal,requestInit:C.current,currentTime:k.current,initialLoopBehavior:j}).then(L=>{if(A){L.close();return}w(L),_()}).catch(L=>{if(!A){if(L.name==="AbortError"){_();return}r?(r==null||r(L),_()):Ki(L)}}),()=>{A=!0,P.abort(),_()}},[m,g,r,S,j,E]),c.useEffect(()=>()=>{h==null||h.close()},[h]),c.useLayoutEffect(()=>{if(!h)return;const P=v(`Rendering frame at ${b} of <AnimatedImage src="${e}"/>`);let A=!1;return h.getFrame(b,o).then(async V=>{var L,O;if(A)return;if(V===null){(L=I.current)==null||L.clear(),E(P);return}await((O=I.current)==null?void 0:O.draw(V.frame))&&!A&&E(P)}).catch(V=>{A||(r?(r(V),E(P)):Ki(V))}),()=>{A=!0,E(P)}},[b,h,o,r,e,E,v,F,s,t,n]),f.jsx(UE,{ref:I,width:t,height:n,fit:s,effects:F,...d})});c0.displayName="AnimatedImageContent";var QE=({src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:u,durationInFrames:d,from:p,premountFor:m,postmountFor:h,styleWhilePremounted:w,styleWhilePostmounted:v,requestInit:E,effects:g=[],controls:y,ref:x,...b})=>{const k=c.useRef(null),S=ds(g);c.useImperativeHandle(x,()=>k.current,[]);const{effectivePostmountFor:C,effectivePremountFor:I,freezeFrame:F,isPremountingOrPostmounting:j,postmountingActive:P,premountingActive:A,premountingStyle:V}=us({from:p??0,durationInFrames:d??1/0,premountFor:m??null,postmountFor:h??null,style:u??null,styleWhilePremounted:w??null,styleWhilePostmounted:v??null,hideWhilePremounted:"display-none"}),_=qE(b),L={src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:V??void 0,requestInit:E,..._};return f.jsx(as,{frame:F,active:j,children:f.jsx(at,{layout:"none",from:p??0,durationInFrames:d??1/0,name:"<AnimatedImage>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/animatedimage",controls:y,_remotionInternalEffects:S,_remotionInternalPremountDisplay:I||null,_remotionInternalPostmountDisplay:C||null,_remotionInternalIsPremounting:A,_remotionInternalIsPostmounting:P,...b,outlineRef:k,children:f.jsx(c0,{...L,ref:k,effects:g,controls:y})})})},d0=Nn({Component:QE,componentName:"<AnimatedImage>",componentIdentity:"dev.remotion.remotion.AnimatedImage",schema:GE,supportsEffects:!0});d0.displayName="AnimatedImage";bt(d0);var JE={type:"boolean",default:!1,description:"Disabled"},ek=e=>{const{calculateKey:t,validateParams:n}=e,r={...e,documentationLink:e.documentationLink??null,calculateKey:i=>{const s=i.disabled??!1;return`${t(i)}-disabled-${s}`},schema:{disabled:JE,...e.schema}};return(i={})=>(n(i),{definition:r,params:i,effectKey:r.calculateKey(i),memoized:!1})},tk=e=>{if(typeof e!="string")throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof e}`);if(e.trim()==="")throw new Error("The `filename` must not be empty");if(!e.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.')},nk=e=>{if(typeof e!="string"&&!(e instanceof Uint8Array))throw new TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof e}`);if(typeof e=="string"&&e.trim()==="")throw new Error("The `content` must not be empty")},f0=e=>{e.type==="artifact"&&(tk(e.filename),e.contentType!=="thumbnail"&&nk(e.content))},Or=c.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),rk=({children:e,collectAssets:t})=>{const[n,r]=c.useState([]),o=c.useRef([]),i=c.useCallback(l=>{f0(l),o.current=[...o.current,l],r(o.current)},[]);t&&c.useImperativeHandle(t,()=>({collectAssets:()=>{const l=o.current;return o.current=[],r([]),l}}),[]);const s=c.useCallback(l=>{o.current=o.current.filter(u=>u.id!==l),r(o.current)},[]);c.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const l=o.current;return o.current=[],r([]),l})},[]);const a=c.useMemo(()=>({registerRenderAsset:i,unregisterRenderAsset:s,renderAssets:n}),[n,i,s]);return f.jsx(Or.Provider,{value:a,children:e})},yn=e=>typeof window>"u"||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://")||e.startsWith("blob:")||e.startsWith("data:")?e:new URL(e,window.origin).href,jl=({trimAfter:e,mediaDurationInFrames:t,playbackRate:n,trimBefore:r})=>{let o=t;typeof e<"u"&&(o=e),typeof r<"u"&&(o-=r);const i=o/n;return Number(i.toFixed(10))},p0=c.createContext(null),ok=()=>J.useContext(p0),$l=({durationInFrames:e,times:t=1/0,children:n,name:r,showInTimeline:o,...i})=>{const s=ht(),{durationInFrames:a}=Xe();if(wl(e,{component:"of the <Loop /> component",allowFloats:!0}),typeof t!="number")throw new TypeError(`You passed to "times" an argument of type ${typeof t}, but it must be a number.`);if(t!==1/0&&t%1!==0)throw new TypeError(`The "times" prop of a loop must be an integer, but got ${t}.`);if(t<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${t}`);const l=Math.ceil(a/e),u=Math.min(l,t),d=i.layout==="none"?void 0:i.style,p=e*(u-1),h=Math.floor(s/e)*e,w=Math.min(h,p),v=c.useMemo(()=>({numberOfTimes:Math.min(a/e,t),startOffset:-w,durationInFrames:e}),[a,e,w,t]),E=c.useMemo(()=>({iteration:Math.floor(s/e),durationInFrames:e}),[s,e]);return f.jsx(p0.Provider,{value:E,children:f.jsx(at,{durationInFrames:e,from:w,name:r??"<Loop>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/loop",_remotionInternalLoopDisplay:v,layout:i.layout,style:d,showInTimeline:o,children:n})})};$l.useLoop=ok;var pt=({logLevel:e,tag:t,message:n,mountTime:r})=>{const o=[r?Date.now()-r+"ms ":null,t].filter(Boolean).join(" ");et.trace({logLevel:e,tag:null},`[${o}]`,n)},Al=c.createContext({}),Pm={},Fu=[],m0=({children:e})=>{const[t,n]=c.useState(()=>Pm);return c.useEffect(()=>{const r=()=>{n(Pm)};return Fu.push(r),()=>{Fu=Fu.filter(o=>o!==r)}},[]),f.jsx(Al.Provider,{value:t,children:e})},h0=e=>{const t=e.indexOf("#");return t===-1?null:t},ik=e=>{const t=h0(e);return t===null?e:e.slice(0,t)},Vr=e=>{const t=c.useContext(Al),n=h0(e),r=ik(e);return t[r]?n!==null?t[r]+e.slice(n):t[r]:e},Nl=(e,t)=>{if(typeof e.volume!="number"&&typeof e.volume!="function"&&typeof e.volume<"u")throw new TypeError(`You have passed a volume of type ${typeof e.volume} to your <${t} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if(typeof e.volume=="number"&&e.volume<0)throw new TypeError(`You have passed a volume below 0 to your <${t} /> component. Volume must be between 0 and 1`);if(typeof e.playbackRate!="number"&&typeof e.playbackRate<"u")throw new TypeError(`You have passed a playbackRate of type ${typeof e.playbackRate} to your <${t} /> component. Playback rate must a real number or undefined.`);if(typeof e.playbackRate=="number"&&(isNaN(e.playbackRate)||!Number.isFinite(e.playbackRate)||e.playbackRate<=0))throw new TypeError(`You have passed a playbackRate of ${e.playbackRate} to your <${t} /> component. Playback rate must be a real number above 0.`);if(typeof e.preservePitch!="boolean"&&typeof e.preservePitch<"u")throw new TypeError(`'preservePitch' must be a boolean or undefined but got '${typeof e.preservePitch}' instead`)},sk=(e,t)=>{if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw new TypeError("startFrom prop can not be NaN or Infinity.");if(e<0)throw new TypeError(`startFrom must be greater than equal to 0 instead got ${e}.`)}if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw new TypeError("endAt prop can not be NaN.");if(t<=0)throw new TypeError(`endAt must be a positive number, instead got ${t}.`)}if(t<e)throw new TypeError("endAt prop must be greater than startFrom prop.")},ak=(e,t)=>{if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of trimBefore prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw new TypeError("trimBefore prop can not be NaN or Infinity.");if(e<0)throw new TypeError(`trimBefore must be greater than equal to 0 instead got ${e}.`)}if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of trimAfter prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw new TypeError("trimAfter prop can not be NaN.");if(t<=0)throw new TypeError(`trimAfter must be a positive number, instead got ${t}.`)}if(t<=e)throw new TypeError("trimAfter prop must be greater than trimBefore prop.")},Ll=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>{if(typeof e<"u"&&typeof n<"u")throw new TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof t<"u"&&typeof r<"u")throw new TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");typeof n<"u"||typeof r<"u"?ak(n,r):(typeof e<"u"||typeof t<"u")&&sk(e,t)},zl=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>({trimBeforeValue:n??e??void 0,trimAfterValue:r??t??void 0}),lk=(e,t)=>{switch(t.type){case"got-duration":{const n=yn(t.src);return e[n]===t.durationInSeconds?e:{...e,[n]:t.durationInSeconds}}default:return e}},kf=c.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),g0=({children:e})=>{const[t,n]=c.useReducer(lk,{}),r=c.useMemo(()=>({durations:t,setDurations:n}),[t]);return f.jsx(kf.Provider,{value:r,children:e})},Cf=({crossOrigin:e,requestsVideoFrame:t,isClientSideRendering:n})=>{if(e!=null)return e;if(n||t)return"anonymous"},Ya=({mediaRef:e,mediaType:t,onAutoPlayError:n,logLevel:r,mountTime:o,reason:i,isPlayer:s})=>{const{current:a}=e;if(!a)return;pt({logLevel:r,tag:"play",message:`Attempting to play ${a.src}. Reason: ${i}`,mountTime:o});const l=a.play();l.catch&&l.catch(u=>{if(a&&!u.message.includes("request was interrupted by a call to pause")&&!u.message.includes("The operation was aborted.")&&!u.message.includes("The fetching process for the media resource was aborted by the user agent")&&!u.message.includes("request was interrupted by a new load request")&&!u.message.includes("because the media was removed from the document")&&!(u.message.includes("user didn't interact with the document")&&a.muted)&&(console.log(`Could not play ${t} due to following error: `,u),!a.muted)){if(n){n();return}t==="video"&&s&&(et.info({logLevel:r,tag:"<"+t+">"},"The video will be muted and we'll retry playing it."),et.info({logLevel:r,tag:"<"+t+">"},"Use onAutoPlayError() to handle this error yourself."),a.muted=!0,a.play())}})},If=({audioContext:e,ref:t})=>{let n=null,r=!1,o=e;return{setAudioContext:i=>{o=i},attemptToConnect:()=>{if(r)throw new Error("SharedElementSourceNode has been disposed");!n&&t.current&&o&&(n=o.createMediaElementSource(t.current))},get:()=>{if(!n)throw new Error("Audio element not connected");return n},cleanup:()=>{n&&(n.disconnect(),n=null),r=!0}}},Fm=!1,uk=e=>{Fm||(Fm=!0,typeof window<"u"&&et.warn({logLevel:e,tag:null},"AudioContext is not supported in this browser"))},ck=({logLevel:e,latencyHint:t,audioEnabled:n,sampleRate:r})=>{const o=Ve(),i=c.useRef(r);if(r!==i.current)throw new Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${i.current} Hz, but ${r} Hz was passed later.`);return c.useMemo(()=>{if(o.isRendering||!n)return null;if(typeof AudioContext>"u")return uk(e),null;const a=new AudioContext({latencyHint:t,sampleRate:r}),l=a.createGain();l.connect(a.destination),et.trace({logLevel:e,tag:"audio"},"Creating new audio context"),a.suspend();let u=null;return{audioContext:a,gainNode:l,getState:()=>{const h=a.state;return u==="running"&&h!=="running"?"suspended-to-running":u==="suspended"&&h!=="suspended"?"running-to-suspended":h},resume:()=>{u="running";const h=a.resume();return h.finally(()=>{u==="running"&&(u=null)}),h},suspend:()=>{u="suspended";const h=a.suspend();return h.finally(()=>{u==="suspended"&&(u=null)}),h}}},[e,t,o.isRendering,n,r])},dk=(e,t)=>new Promise(n=>{const r=e.currentTime,i=e.getOutputTimestamp().performanceTime,s=performance.now(),a=()=>{var p;const{currentTime:l}=e,u=e.getOutputTimestamp(),d=performance.now()-s;if(i!==void 0&&u.performanceTime!==void 0&&u.performanceTime>i&&u.contextTime!==void 0&&u.contextTime>r){et.verbose({logLevel:t,tag:"audio"},`waitUntilActuallyResumed: getOutputTimestamp.performanceTime advanced from ${i.toFixed(6)} to ${u.performanceTime.toFixed(6)} after ${d.toFixed(1)}ms. currentTime=${l.toFixed(6)} (advanced by ${(l-r).toFixed(6)}), getOutputTimestamp.performanceTime=${((p=u.performanceTime)==null?void 0:p.toFixed(1))??"undefined"}`),n();return}requestAnimationFrame(a)};requestAnimationFrame(a)}),Mu="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",fk=(e,t)=>{const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==r[o]||e[n[o]]!==t[r[o]])return!1;return!0},pk=(e,t,n)=>e==="src"&&!n.startsWith("data:")&&!t.startsWith("data:")?new URL(n,window.origin).toString()!==new URL(t,window.origin).toString():n!==t,Wo=c.createContext(null),Dl=c.createContext(null),mk=e=>{if(e==="suspended"||e==="running-to-suspended"||e==="interrupted")return!0;if(e==="running"||e==="suspended-to-running")return!1;throw new Error(`Unexpected audio context state: ${e}`)},v0=({children:e,audioLatencyHint:t,audioEnabled:n,previewSampleRate:r})=>{const o=wn(),i=r??48e3;c.useEffect(()=>{typeof window>"u"||(window.remotion_sampleRate=i)},[i]);const s=ck({logLevel:o,latencyHint:t,audioEnabled:n,sampleRate:i}),a=c.useRef(!1),l=c.useRef(null),u=c.useMemo(()=>({value:0}),[]),d=c.useRef([]),p=c.useMemo(()=>({dispatch:b=>{d.current.forEach(k=>k(b))},subscribe:b=>(d.current.push(b),{remove:()=>{d.current=d.current.filter(k=>k!==b)}})}),[]),m=c.useRef({scheduledEndTime:null,mediaEndTime:null}),h=c.useRef(new Map),w=c.useCallback(b=>{h.current.delete(b)},[]),v=c.useMemo(()=>({node:b,mediaTimestamp:k,sourceOffset:S,scheduledTime:C,duration:I,offset:F,originalUnloopedMediaTimestamp:j})=>{if(!s)throw new Error("Audio context not found");const P=s.getState();if(P==="closed")return{type:"not-started",reason:"audio context is closed"};const A=mk(P);I>0&&(A?h.current.set(b,{scheduledTime:C,offset:F,duration:I}):b.start(C,F,I));const V=C+I/b.playbackRate.value,_=k+F-S,L=_+I,O=s.audioContext.baseLatency+s.audioContext.outputLatency,N=C-s.audioContext.currentTime,T=m.current,z=T.scheduledEndTime!==null&&Math.abs(C-T.scheduledEndTime)>.001,R=T.mediaEndTime!==null&&Math.abs(_-T.mediaEndTime)>.001;return et.verbose({logLevel:o,tag:"audio-scheduling"},"scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s %s %s",z?"color: red; font-weight: bold":"",C.toFixed(4),"",V.toFixed(4),R?"color: red; font-weight: bold":"",_.toFixed(4),"",L.toFixed(4),I<0||N<0?"color: red; font-weight: bold":"color: blue; font-weight: bold",I<0?"missed "+Math.abs(F).toFixed(2)+"s":Math.abs(N).toFixed(2)+(N<0?" delay":" ahead"),"","current="+s.audioContext.currentTime.toFixed(4),"offset="+F.toFixed(4),"latency="+O.toFixed(4),"state="+s.audioContext.state,j!==_?"original_ts="+j.toFixed(4):"","action="+(A?"schedule":"start"),""),T.scheduledEndTime=V,T.mediaEndTime=L,I>0?{type:"started",scheduledTime:C}:{type:"not-started",reason:"missed "+Math.abs(F).toFixed(2)+"s"}},[s,o]),E=c.useCallback(()=>{if(!s||a.current)return Promise.resolve();a.current=!0,s.gainNode.gain.cancelScheduledValues(s.audioContext.currentTime),s.gainNode.gain.setValueAtTime(0,s.audioContext.currentTime),s.gainNode.gain.linearRampToValueAtTime(1,s.audioContext.currentTime+.03),h.current.forEach((k,S)=>{S.start(k.scheduledTime,k.offset,k.duration)}),h.current.clear();const b=s.resume();return l.current=new Promise(k=>{dk(s.audioContext,o).then(k),b.catch(S=>{et.warn({logLevel:o,tag:"audio"},"AudioContext resume rejected, continuing without audio sync",S),k()})}).finally(()=>{l.current=null}),b.catch(()=>{})},[s,o]),g=c.useCallback(()=>l.current,[]),y=c.useCallback(()=>!s||!a.current?Promise.resolve():(a.current=!1,s.suspend()),[s]),x=c.useMemo(()=>({audioContext:(s==null?void 0:s.audioContext)??null,getAudioContextState:()=>(s==null?void 0:s.getState())??null,gainNode:(s==null?void 0:s.gainNode)??null,audioSyncAnchor:u,audioSyncAnchorEmitter:p,scheduleAudioNode:v,resume:E,suspend:y,getIsResumingAudioContext:g,unscheduleAudioNode:w}),[s,u,p,v,E,y,g,w]);return f.jsx(Wo.Provider,{value:x,children:e})},y0=({children:e,numberOfAudioTags:t})=>{const n=c.useRef([]),[r]=c.useState(t);if(t!==r)throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");const o=wn(),i=ss(),s=Ve(),a=c.useContext(Wo),l=(a==null?void 0:a.audioContext)??null,u=a==null?void 0:a.resume,[d]=c.useState(()=>new Array(t).fill(!0).map(()=>{const b=c.createRef();return{id:Math.random(),ref:b,mediaElementSourceNode:If({audioContext:l,ref:b})}}));for(const{mediaElementSourceNode:b}of d)b==null||b.setAudioContext(l);(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{d.forEach(({mediaElementSourceNode:b})=>{b==null||b.cleanup()})})},[d]);const m=c.useRef(new Array(t).fill(!1)),h=c.useCallback(()=>{d.forEach(({ref:b,id:k})=>{var I;const S=(I=n.current)==null?void 0:I.find(F=>F.id===k),{current:C}=b;if(C){if(S===void 0){C.src!==Mu&&(C.src=Mu);return}if(!S)throw new TypeError("Expected audio data to be there");Object.keys(S.props).forEach(F=>{pk(F,S.props[F],C[F])&&(C[F]=S.props[F])})}})},[d]),w=c.useCallback(b=>{var O,N;const{aud:k,audioId:S,premounting:C,postmounting:I}=b,F=(O=n.current)==null?void 0:O.find(T=>T.audioId===S);if(F)return F;const j=m.current.findIndex(T=>T===!1);if(j===-1)throw new Error(`Tried to simultaneously mount ${t+1} <Html5Audio /> tags at the same time. With the current settings, the maximum amount of <Html5Audio /> tags is limited to ${t} 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:P,ref:A,mediaElementSourceNode:V}=d[j],_=[...m.current];_[j]=P,m.current=_;const L={props:k,id:P,el:A,audioId:S,mediaElementSourceNode:V,premounting:C,audioMounted:!!A.current,postmounting:I,cleanupOnMediaTagUnmount:()=>{}};return(N=n.current)==null||N.push(L),h(),L},[t,d,h]),v=c.useCallback(b=>{var C;const k=[...m.current],S=d.findIndex(I=>I.id===b);if(S===-1)throw new TypeError(`Unknown audio ref ${b}; refs: ${d.map(I=>I.id).join(", ")}`);k[S]=!1,m.current=k,n.current=(C=n.current)==null?void 0:C.filter(I=>I.id!==b),h()},[d,h]),E=c.useCallback(({aud:b,audioId:k,id:S,premounting:C,postmounting:I})=>{var j;let F=!1;n.current=(j=n.current)==null?void 0:j.map(P=>{const A=!!P.el.current;return P.audioMounted!==A&&(F=!0),P.id===S?fk(b,P.props)&&P.premounting===C&&P.postmounting===I?P.audioMounted===A?P:{...P,audioMounted:A}:(F=!0,{...P,props:b,premounting:C,postmounting:I,audioId:k,audioMounted:A}):P.audioMounted===A?P:{...P,audioMounted:A}}),F&&h()},[h]),g=c.useCallback(()=>{d.forEach(b=>{const k=n.current.find(S=>S.el===b.ref);k!=null&&k.premounting||Ya({mediaRef:b.ref,mediaType:"audio",onAutoPlayError:null,logLevel:o,mountTime:i,reason:"playing all audios",isPlayer:s.isPlayer})}),u==null||u()},[o,i,d,s.isPlayer,u]),y=c.useMemo(()=>({registerAudio:w,unregisterAudio:v,updateAudio:E,playAllAudios:g,numberOfAudioTags:t}),[t,g,w,v,E]),x=c.useMemo(()=>d.map(({id:b,ref:k})=>f.jsx("audio",{ref:k,preload:"metadata",src:Mu},b)),[d]);return f.jsxs(Dl.Provider,{value:y,children:[x,e]})},hk=({aud:e,audioId:t,premounting:n,postmounting:r})=>{var l;const o=c.useContext(Wo),i=c.useContext(Dl),[s]=c.useState(()=>{if(i&&i.numberOfAudioTags>0)return i.registerAudio({aud:e,audioId:t,premounting:n,postmounting:r});const u=J.createRef(),d=If({audioContext:(o==null?void 0:o.audioContext)??null,ref:u});return{el:u,id:Math.random(),props:e,audioId:t,mediaElementSourceNode:d,premounting:n,audioMounted:!!u.current,postmounting:r,cleanupOnMediaTagUnmount:()=>{d==null||d.cleanup()}}});(l=s.mediaElementSourceNode)==null||l.setAudioContext((o==null?void 0:o.audioContext)??null);const a=J.useInsertionEffect??J.useLayoutEffect;return typeof document<"u"&&(a(()=>{i&&i.numberOfAudioTags>0&&i.updateAudio({id:s.id,aud:e,audioId:t,premounting:n,postmounting:r})},[e,i,s.id,t,n,r]),a(()=>()=>{i&&i.numberOfAudioTags>0&&i.unregisterAudio(s.id)},[i,s.id])),s},gk=1e-5,Ka=(e,t)=>Math.abs(e-t)<gk,w0=(e,t)=>Math.round(e/t*100)/100,ed=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),Ol=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&ed(),vk=e=>Ol()&&e.startsWith("blob:"),td=({actualFrom:e,fps:t})=>w0(Math.max(0,-e),t),nd=({duration:e,fps:t})=>w0(e,t),yk=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{if(vk(e)||e.startsWith("data:")||!!new URL(e,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(t))return e;const i=`${e}#t=${td({actualFrom:t,fps:r})}`;return Number.isFinite(n)?`${i},${nd({duration:n,fps:r})}`:i},wk=({prevStartFrom:e,newStartFrom:t,prevDuration:n,newDuration:r,fps:o})=>{const i=td({actualFrom:e,fps:o}),s=td({actualFrom:t,fps:o}),a=nd({duration:n,fps:o}),l=nd({duration:r,fps:o});return!(s<i||l>a)},xk=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{const o=c.useRef(t),i=c.useRef(n),s=c.useRef(e);return(!wk({prevStartFrom:o.current,newStartFrom:t,prevDuration:i.current,newDuration:n,fps:r})||e!==s.current)&&(o.current=t,i.current=n,s.current=e),yk({actualSrc:s.current,actualFrom:o.current,duration:i.current,fps:r})},Mm=!1,bk=e=>{Mm||(Mm=!0,et.warn({logLevel:e,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),et.warn({logLevel:e,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),et.warn({logLevel:e,tag:null},e,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},x0=({mediaRef:e,volume:t,logLevel:n,source:r,shouldUseWebAudioApi:o})=>{var m,h,w;const i=c.useRef(null),s=c.useRef(t);s.current=t;const a=c.useContext(Wo);if(!a)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:l,gainNode:u}=a;if(typeof window<"u"&&c.useLayoutEffect(()=>{var E,g;if(!l||!e.current||!o)return;if(e.current.playbackRate!==1&&ed()){bk(n);return}if(!r||!u)return;const v=new GainNode(l,{gain:s.current});return r.attemptToConnect(),r.get().connect(v),v.connect(u),i.current={gainNode:v},et.trace({logLevel:n,tag:null},`Starting to amplify ${(E=e.current)==null?void 0:E.src}. Gain = ${s.current}, playbackRate = ${(g=e.current)==null?void 0:g.playbackRate}`),()=>{i.current=null,v.disconnect(),r.get().disconnect()}},[n,e,l,r,o,u]),i.current){const v=t;Ka(i.current.gainNode.gain.value,v)||(i.current.gainNode.gain.value=v,et.trace({logLevel:n,tag:null},`Setting gain to ${v} for ${(m=e.current)==null?void 0:m.src}`))}return(ed()&&e.current&&((h=e.current)==null?void 0:h.playbackRate)!==1||!o)&&e.current&&!Ka(t,(w=e.current)==null?void 0:w.volume)&&(e.current.volume=Math.min(t,1)),i},Mr=()=>{const e=c.useContext(Ke);return(e==null?void 0:e.cumulatedNegativeFrom)??0},Uo=e=>{const t=$l.useLoop(),n=ht(),r=Mr();return e==="repeat"||t===null?n+r:n+r+t.durationInFrames*t.iteration},b0=e=>{if(/data:|blob:/.test(e.substring(0,5)))return"Data URL";const t=e.split("/").map(n=>n.split("\\")).flat(1);return t[t.length-1]},Sk=({compositionDurationInFrames:e,playbackRate:t,trimBefore:n,trimAfter:r,parentSequenceDurationInFrames:o,loop:i})=>{if(i)return e;const s=jl({mediaDurationInFrames:e*t+(n??0),playbackRate:t,trimBefore:n,trimAfter:r});if(o!==null){const a=Math.min(o,s);return Number(a.toFixed(10))}return s},Br=({frame:e,volume:t,mediaVolume:n=1})=>{if(typeof t=="number")return t*n;if(typeof t>"u")return Number(n);const r=t(e)*n;if(typeof r!="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 r} for frame ${e}`);if(Number.isNaN(r))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${e}.`);if(!Number.isFinite(r))throw new TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${e}.`);return Math.max(0,r)},jm={},Ek=e=>{jm[e]||(console.warn(e),jm[e]=!0)},S0=({volume:e,mediaVolume:t,mediaType:n,src:r,displayName:o,trimBefore:i,trimAfter:s,playbackRate:a,sequenceDurationInFrames:l,mediaStartsAt:u,loop:d})=>{if(!r)throw new Error("No src passed");const p=c.useContext(Ke),[m]=c.useState(()=>e),h=Sk({compositionDurationInFrames:l,playbackRate:a,trimBefore:i,trimAfter:s,parentSequenceDurationInFrames:(p==null?void 0:p.durationInFrames)??null,loop:d}),w=c.useMemo(()=>typeof e=="number"?e:new Array(Math.floor(Math.max(0,h+u))).fill(!0).map((b,k)=>Br({frame:k+u,volume:e,mediaVolume:t})).join(","),[h,u,e,t]);c.useEffect(()=>{typeof e=="number"&&e!==m&&Ek(`Remotion: The ${n} with src ${r} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`)},[m,n,r,e]);const v=typeof e=="function",E=yl(),{rootId:g}=pr(),y=0-u+(i??0);return c.useMemo(()=>({volumes:w,duration:h,doesVolumeChange:v,nonce:E,rootId:g,finalDisplayName:o??b0(r),startMediaFrom:y,src:r,playbackRate:a}),[w,h,v,E,g,o,r,y,a])},Tf=({volume:e,mediaVolume:t,src:n,mediaType:r,playbackRate:o,displayName:i,id:s,getStack:a,showInTimeline:l,premountDisplay:u,postmountDisplay:d,loopDisplay:p,documentationLink:m,refForOutline:h})=>{const w=c.useContext(Ke),v=Mr(),{registerSequence:E,unregisterSequence:g}=c.useContext(Vo),{durationInFrames:y}=Xe(),x=Mr(),{volumes:b,duration:k,doesVolumeChange:S,nonce:C,rootId:I,finalDisplayName:F}=S0({volume:e,mediaVolume:t,mediaType:r,src:n,displayName:i,trimAfter:void 0,trimBefore:void 0,playbackRate:o,sequenceDurationInFrames:y,mediaStartsAt:x,loop:!1}),{isStudio:j}=Ve();c.useEffect(()=>{var P,A;if(!n)throw new Error("No src passed");if(!(!j&&((A=(P=window.process)==null?void 0:P.env)==null?void 0:A.NODE_ENV)!=="test")&&l)return E({type:r,src:n,id:s,duration:k,from:0,trimBefore:null,parent:(w==null?void 0:w.id)??null,displayName:F,documentationLink:m,rootId:I,volume:b,showInTimeline:!0,nonce:C.get(),startMediaFrom:0-v,mediaFrameAtSequenceZero:null,doesVolumeChange:S,loopDisplay:p,playbackRate:o,getStack:a,premountDisplay:u,postmountDisplay:d,controls:null,effects:[],refForOutline:h,isInsideSeries:!1,frozenFrame:null,frozenMediaFrame:null}),()=>{g(s)}},[k,s,w,n,E,g,b,S,C,r,v,o,a,l,u,d,p,m,I,F,j,h])},kk=(e,t)=>{const[n,r]=c.useState([]),[o,i]=c.useState([]),[s,a]=c.useState([]),u=Ve().isRendering,d=c.useRef(!1),p=c.useCallback(w=>{if(u)return{unblock:()=>{}};let v=!1;return r(E=>[...E,w]),{unblock:()=>{v||(v=!0,r(E=>{const g=E.filter(y=>y!==w);return g.length===E.length?E:g}))}}},[u]),m=c.useCallback(w=>(i(v=>[...v,w]),{remove:()=>{i(v=>v.filter(E=>E!==w))}}),[]),h=c.useCallback(w=>(a(v=>[...v,w]),{remove:()=>{a(v=>v.filter(E=>E!==w))}}),[]);return c.useEffect(()=>{u||n.length>0&&!d.current&&(d.current=!0,o.forEach(w=>w()),pt({logLevel:e,message:"Player is entering buffer state",mountTime:t,tag:"player"}))},[n]),typeof window<"u"&&c.useLayoutEffect(()=>{u||n.length===0&&d.current&&(d.current=!1,s.forEach(w=>w()),pt({logLevel:e,message:"Player is exiting buffer state",mountTime:t,tag:"player"}))},[n]),c.useMemo(()=>({addBlock:p,listenForBuffering:m,listenForResume:h,buffering:d}),[p,d,m,h])},Ho=J.createContext(null),E0=({children:e})=>{const{logLevel:t,mountTime:n}=c.useContext(zr),r=kk(t??"info",n);return f.jsx(Ho.Provider,{value:r,children:e})},k0=e=>{const[t,n]=c.useState(e.buffering.current);return c.useEffect(()=>{const r=()=>{n(!0)},o=()=>{n(!1)},i=e.listenForBuffering(r),s=e.listenForResume(o);return()=>{i.remove(),s.remove()}},[e]),t},Vl=()=>{const e=c.useContext(Ho),t=wn(),n=e?e.addBlock:null;return c.useMemo(()=>({delayPlayback:()=>{if(!n)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 <Composition>. 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");et.trace({logLevel:t,tag:"[buffer-state]"},"Adding buffer handle",new Error().stack);const{unblock:r}=n({id:String(Math.random())});let o=!1;return{unblock:()=>{o||(o=!0,et.trace({logLevel:t,tag:"[buffer-state]"},"Removing buffer handle"),r())}}}}),[n,t])},Ck=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),Ik=({mediaRef:e,mediaType:t,onVariableFpsVideoDetected:n,pauseWhenBuffering:r,logLevel:o,mountTime:i})=>{const s=c.useRef(!1),{delayPlayback:a}=Vl(),l=c.useCallback(u=>{var w;if(t!=="video"||!r)return;const d=e.current;if(!d)return;if(d.readyState>=d.HAVE_FUTURE_DATA&&!Ck()){pt({logLevel:o,message:`Not using buffer until first frame, because readyState is ${d.readyState} and is not Safari or Desktop Chrome`,mountTime:i,tag:"buffer"});return}if(!d.requestVideoFrameCallback){pt({logLevel:o,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:i,tag:"buffer"});return}s.current=!0,pt({logLevel:o,message:`Buffering ${(w=e.current)==null?void 0:w.src} until the first frame is received`,mountTime:i,tag:"buffer"});const p=a(),m=()=>{p.unblock(),d.removeEventListener("ended",m,{once:!0}),d.removeEventListener("pause",m,{once:!0}),s.current=!1},h=()=>{m()};d.requestVideoFrameCallback((v,E)=>{Math.abs(E.mediaTime-u)>.5&&n(),m()}),d.addEventListener("ended",h,{once:!0}),d.addEventListener("pause",h,{once:!0}),d.addEventListener("canplay",h,{once:!0})},[a,o,e,t,i,n,r]);return c.useMemo(()=>({isBuffering:()=>s.current,bufferUntilFirstFrame:l}),[l])},Tk=e=>{const{duration:t,currentTime:n,paused:r,ended:o,desiredUnclampedTime:i,mediaTagTime:s,mediaTagLastUpdate:a,rvcTime:l,rvcLastUpdate:u,isVariableFpsVideo:d,acceptableTimeShift:p,lastSeekDueToShift:m,playing:h,playbackRate:w,mediaTagBufferingOrStalled:v,playerBuffering:E,absoluteFrame:g,onlyWarnForMediaSeekingError:y,isPremounting:x,isPostmounting:b,pauseWhenBuffering:k}=e,S=!Number.isNaN(t)&&Number.isFinite(t)?Math.min(t,i):i,C=Math.abs(S-s),I=l?Math.abs(S-l):null,F=u&&l>a?I:C,j=I&&!d?F:C;if(j>p&&m!==S)return{type:"seek-due-to-shift",shouldBeTime:S,why:`because time shift is too big. shouldBeTime = ${S}, isTime = ${s}, requestVideoCallbackTime = ${l}, timeShift = ${j}${d?", isVariableFpsVideo = true":""}, isPremounting = ${x}, isPostmounting = ${b}, pauseWhenBuffering = ${k}`,bufferUntilFirstFrame:h&&w>0,playReason:h&&r?"player is playing but media tag is paused, and just seeked":null,warnAboutNonSeekable:!y};const P=h?.15:.01,A=Math.abs(n-S)>P;if(!h||E&&!v)return{type:"seek-if-not-playing",shouldBeTime:S,why:A?`not playing or something else is buffering. time offset is over seek threshold (${P})`:null};if(!h||E)return{type:"none"};const _=r&&!o;if(_||g===0){const O=_?"media tag is paused":"absolute frame is 0";return{type:"play-and-seek",shouldBeTime:S,why:A?`is over timeshift threshold (threshold = ${P}) and ${O}`:null,playReason:`player is playing and ${O}`,bufferUntilFirstFrame:!d&&w>0}}return{type:"none"}},_k=e=>{var r,o;const t=J.useRef({time:((r=e.current)==null?void 0:r.currentTime)??0,lastUpdate:performance.now()}),n=((o=e.current)==null?void 0:o.currentTime)??null;return n!==null&&t.current.time!==n&&(t.current.time=n,t.current.lastUpdate=performance.now()),t},ga=({mediaRef:e,time:t,logLevel:n,why:r,mountTime:o})=>{const i=Ol()?Number(t.toFixed(1)):t;return pt({logLevel:n,tag:"seek",message:`Seeking from ${e.currentTime} to ${i}. src= ${e.src} Reason: ${r}`,mountTime:o}),e.currentTime=i,i},Rk=({element:e,shouldBuffer:t,isPremounting:n,isPostmounting:r,logLevel:o,mountTime:i,src:s})=>{const a=Vl(),[l,u]=c.useState(!1);return c.useEffect(()=>{let d=[];const{current:p}=e;if(!p||!t)return;if(n||r){if((n||r)&&p.readyState<p.HAVE_FUTURE_DATA&&!navigator.userAgent.includes("Firefox/")){pt({logLevel:o,message:`Calling .load() on ${p.src} because readyState is ${p.readyState} and it is not Firefox. Element is premounted ${p.playbackRate}`,tag:"load",mountTime:i});const v=p.playbackRate;p.load(),p.playbackRate=v}return}const m=v=>{let E=!1;d.forEach(g=>{g(v),E=!0}),d=[],u(g=>(g&&(E=!0),!1)),E&&pt({logLevel:o,message:`Unmarking as buffering: ${p.src}. Reason: ${v}`,tag:"buffer",mountTime:i})},h=v=>{u(!0),pt({logLevel:o,message:`Marking as buffering: ${p.src}. Reason: ${v}`,tag:"buffer",mountTime:i});const{unblock:E}=a.delayPlayback(),g=()=>{m('"canplay" was fired'),w()},y=()=>{m('"error" event was occurred'),w()};p.addEventListener("canplay",g,{once:!0}),d.push(()=>{p.removeEventListener("canplay",g)}),p.addEventListener("error",y,{once:!0}),d.push(()=>{p.removeEventListener("error",y)}),d.push(x=>{pt({logLevel:o,message:`Unblocking ${p.src} from buffer. Reason: ${x}`,tag:"buffer",mountTime:i}),E()})},w=()=>{if(p.readyState<p.HAVE_FUTURE_DATA){if(h(`readyState is ${p.readyState}, which is less than HAVE_FUTURE_DATA`),!navigator.userAgent.includes("Firefox/")){pt({logLevel:o,message:`Calling .load() on ${s} because readyState is ${p.readyState} and it is not Firefox. ${p.playbackRate}`,tag:"load",mountTime:i});const v=p.playbackRate;p.load(),p.playbackRate=v}}else{const v=()=>{h('"waiting" event was fired')};p.addEventListener("waiting",v),d.push(()=>{p.removeEventListener("waiting",v)})}};return w(),()=>{m("element was unmounted or prop changed")}},[a,s,e,n,r,o,t,i]),l},Pk=({mediaRef:e,mediaType:t,lastSeek:n,onVariableFpsVideoDetected:r})=>{const o=c.useRef(null);return c.useEffect(()=>{const{current:i}=e;if(i)o.current={time:i.currentTime,lastUpdate:performance.now()};else{o.current=null;return}if(t!=="video"){o.current=null;return}const s=i;if(!s.requestVideoFrameCallback)return;let a=()=>{};const l=()=>{if(!s)return;const u=s.requestVideoFrameCallback((d,p)=>{if(o.current!==null){const m=Math.abs(o.current.time-p.mediaTime),h=Math.abs(n.current===null?1/0:p.mediaTime-n.current);m>.5&&h>.5&&p.mediaTime>o.current.time&&r()}o.current={time:p.mediaTime,lastUpdate:performance.now()},l()});a=()=>{s.cancelVideoFrameCallback(u),a=()=>{}}};return l(),()=>{a()}},[n,e,t,r]),o},C0=({frame:e,playbackRate:t,startFrom:n})=>Bo(e,[-1,n,n+1],[-1,n,n+t]),I0=({fps:e,frame:t,playbackRate:n,startFrom:r})=>{const o=C0({frame:t,playbackRate:n,startFrom:r}),i=1e3/e;return o*i/1e3},$m={},Fk=(e,t)=>{if(e===null||e.seekable.length===0||e.seekable.length>1||$m[e.src])return;const n={start:e.seekable.start(0),end:e.seekable.end(0)};if(n.start===0&&n.end===0){const r=[`The media ${e.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(`
57
+ `);console.error(r),$m[e.src]=!0}},T0=({mediaRef:e,src:t,mediaType:n,playbackRate:r,preservePitch:o=!0,onlyWarnForMediaSeekingError:i,acceptableTimeshift:s,pauseWhenBuffering:a,isPremounting:l,isPostmounting:u,onAutoPlayError:d})=>{const{playbackRate:p}=hf(),m=ht(),h=mr(),[w]=_y(),v=c.useContext(Ho),{fps:E}=Xe(),g=Mr(),y=c.useRef(null),x=c.useRef(null),b=wn(),k=ss();if(!v)throw new Error("useMediaPlayback must be used inside a <BufferingContext>");const S=c.useRef({}),C=c.useCallback(()=>{t&&(S.current[t]||(et.verbose({logLevel:b,tag:null},`Detected ${t} as a variable FPS video. Disabling buffering while seeking.`),S.current[t]=!0))},[b,t]),I=Pk({mediaRef:e,mediaType:n,lastSeek:x,onVariableFpsVideoDetected:C}),F=_k(e),j=I0({frame:m,playbackRate:r,startFrom:-g,fps:E}),P=Rk({element:e,shouldBuffer:a,isPremounting:l,isPostmounting:u,logLevel:b,mountTime:k,src:t??null}),{bufferUntilFirstFrame:A,isBuffering:V}=Ik({mediaRef:e,mediaType:n,onVariableFpsVideoDetected:C,pauseWhenBuffering:a,logLevel:b,mountTime:k}),_=r*p,L=(()=>{var $;return($=e.current)!=null&&$.duration?Math.min(e.current.duration,s??.65):s??.65})(),O=k0(v);c.useEffect(()=>{var R,$,B,W,M;if((R=e.current)!=null&&R.paused)return;if(!w){pt({logLevel:b,tag:"pause",message:`Pausing ${($=e.current)==null?void 0:$.src} because ${l?"media is premounting":u?"media is postmounting":"Player is not playing"}`,mountTime:k}),(B=e.current)==null||B.pause();return}const T=P||V();v.buffering.current&&!T&&(pt({logLevel:b,tag:"pause",message:`Pausing ${(W=e.current)==null?void 0:W.src} because player is buffering but media tag is not`,mountTime:k}),(M=e.current)==null||M.pause())},[V,P,v,O,l,b,e,n,k,w,u]);const N=Ve();c.useLayoutEffect(()=>{const T=Math.max(0,_);e.current&&e.current.playbackRate!==T&&(e.current.playbackRate=T),e.current&&e.current.preservesPitch!==o&&(e.current.preservesPitch=o)},[e,_,o]),c.useEffect(()=>{var $,B;const T=n==="audio"?"<Html5Audio>":"<Html5Video>";if(!e.current)throw new Error(`No ${n} ref found`);if(!t)throw new Error(`No 'src' attribute was passed to the ${T} element.`);const{current:z}=e,R=Tk({duration:z.duration,currentTime:z.currentTime,paused:z.paused,ended:z.ended,desiredUnclampedTime:j,mediaTagTime:F.current.time,mediaTagLastUpdate:F.current.lastUpdate,rvcTime:(($=I.current)==null?void 0:$.time)??null,rvcLastUpdate:((B=I.current)==null?void 0:B.lastUpdate)??null,isVariableFpsVideo:!!S.current[t],acceptableTimeShift:L,lastSeekDueToShift:y.current,playing:w,playbackRate:_,mediaTagBufferingOrStalled:P||V(),playerBuffering:v.buffering.current,absoluteFrame:h,onlyWarnForMediaSeekingError:i,isPremounting:l,isPostmounting:u,pauseWhenBuffering:a});if(R.type!=="none"){if(R.type==="seek-due-to-shift"){x.current=ga({mediaRef:z,time:R.shouldBeTime,logLevel:b,why:R.why,mountTime:k}),y.current=x.current,R.bufferUntilFirstFrame&&A(R.shouldBeTime),R.playReason!==null&&Ya({mediaRef:e,mediaType:n,onAutoPlayError:d,logLevel:b,mountTime:k,reason:R.playReason,isPlayer:N.isPlayer}),R.warnAboutNonSeekable&&Fk(z);return}if(R.type==="seek-if-not-playing"){R.why!==null&&(x.current=ga({mediaRef:z,time:R.shouldBeTime,logLevel:b,why:R.why,mountTime:k}));return}R.why!==null&&(x.current=ga({mediaRef:z,time:R.shouldBeTime,logLevel:b,why:R.why,mountTime:k})),Ya({mediaRef:e,mediaType:n,onAutoPlayError:d,logLevel:b,mountTime:k,reason:R.playReason,isPlayer:N.isPlayer}),R.bufferUntilFirstFrame&&A(R.shouldBeTime)}},[h,L,A,v.buffering,I,b,j,V,P,e,n,i,_,w,t,d,l,u,a,k,F,N.isPlayer])},_0=({mediaRef:e,id:t,mediaType:n,onAutoPlayError:r,isPremounting:o,isPostmounting:i})=>{const{audioAndVideoTags:s,imperativePlaying:a}=pr(),l=wn(),u=ss(),d=Ve();c.useEffect(()=>{const p={id:t,play:m=>{if(a.current&&!(o||i))return Ya({mediaRef:e,mediaType:n,onAutoPlayError:r,logLevel:l,mountTime:u,reason:m,isPlayer:d.isPlayer})}};return s.current.push(p),()=>{s.current=s.current.filter(m=>m.id!==t)}},[s,t,e,n,r,a,o,i,l,u,d.isPlayer])},_f=c.createContext({playerMuted:!1,mediaVolume:1}),Rf=c.createContext({setPlayerMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),Pf=()=>{const{mediaVolume:e}=c.useContext(_f),{setMediaVolume:t}=c.useContext(Rf);return c.useMemo(()=>[e,t],[e,t])},Ff=()=>{const{playerMuted:e}=c.useContext(_f),{setPlayerMuted:t}=c.useContext(Rf);return c.useMemo(()=>[e,t],[e,t])},Zo=e=>{if(e>=100)throw new Error(`Volume was set to ${e}, 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.`)},Mk=(e,t)=>{const[n]=c.useState(e.shouldPreMountAudioTags);if(e.shouldPreMountAudioTags!==n)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const r=wn(),{volume:o,muted:i,playbackRate:s,preservePitch:a,shouldPreMountAudioTags:l,src:u,onDuration:d,acceptableTimeShiftInSeconds:p,_remotionInternalNeedsDurationCalculation:m,_remotionInternalNativeLoopPassed:h,_remotionInternalStack:w,allowAmplificationDuringRender:v,name:E,pauseWhenBuffering:g,showInTimeline:y,loopVolumeCurveBehavior:x,stack:b,crossOrigin:k,delayRenderRetries:S,delayRenderTimeoutInMilliseconds:C,toneFrequency:I,useWebAudioApi:F,onError:j,onNativeError:P,audioStreamIndex:A,...V}=e,[_]=Pf(),[L]=Ff(),O=Uo(x??"repeat");if(!u)throw new TypeError("No 'src' was passed to <Html5Audio>.");const N=Vr(u),T=c.useContext(Ke),[z]=c.useState(()=>String(Math.random())),R=Br({frame:O,volume:o,mediaVolume:_});Zo(R);const $=Cf({crossOrigin:k,requestsVideoFrame:!1,isClientSideRendering:!1}),B=c.useMemo(()=>({muted:i||L||R<=0,src:N,loop:h,crossOrigin:$,...V}),[h,L,i,V,N,R,$]),W=c.useMemo(()=>`audio-${Dr(u??"")}-${T==null?void 0:T.relativeFrom}-${T==null?void 0:T.cumulatedFrom}-${T==null?void 0:T.durationInFrames}-muted:${e.muted}-loop:${e.loop}`,[u,T==null?void 0:T.relativeFrom,T==null?void 0:T.cumulatedFrom,T==null?void 0:T.durationInFrames,e.muted,e.loop]),{el:M,mediaElementSourceNode:D,cleanupOnMediaTagUnmount:K}=hk({aud:B,audioId:W,premounting:!!(T!=null&&T.premounting),postmounting:!!(T!=null&&T.postmounting)}),G=c.useCallback(()=>w??null,[w]);Tf({volume:o,mediaVolume:_,src:u,mediaType:"audio",playbackRate:s??1,displayName:E??null,id:z,getStack:G,showInTimeline:y,premountDisplay:(T==null?void 0:T.premountDisplay)??null,postmountDisplay:(T==null?void 0:T.postmountDisplay)??null,loopDisplay:void 0,documentationLink:"https://www.remotion.dev/docs/html5-audio",refForOutline:null}),T0({mediaRef:M,src:u,mediaType:"audio",playbackRate:s??1,preservePitch:a,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:p??null,isPremounting:!!(T!=null&&T.premounting),isPostmounting:!!(T!=null&&T.postmounting),pauseWhenBuffering:g,onAutoPlayError:null}),_0({id:z,isPostmounting:!!(T!=null&&T.postmounting),isPremounting:!!(T!=null&&T.premounting),mediaRef:M,mediaType:"audio",onAutoPlayError:null}),x0({logLevel:r,mediaRef:M,source:D,volume:R,shouldUseWebAudioApi:F??!1}),(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{K()})},[K]),c.useImperativeHandle(t,()=>M.current,[M]);const ne=c.useRef(d);return ne.current=d,c.useEffect(()=>{var ae;const{current:Z}=M;if(!Z)return;if(Z.duration){(ae=ne.current)==null||ae.call(ne,Z.src,Z.duration);return}const ee=()=>{var me;(me=ne.current)==null||me.call(ne,Z.src,Z.duration)};return Z.addEventListener("loadedmetadata",ee),()=>{Z.removeEventListener("loadedmetadata",ee)}},[M,u]),n?null:f.jsx("audio",{ref:M,preload:"metadata",crossOrigin:$,...B})},R0=c.forwardRef(Mk),jk=(e,t)=>{const n=c.useRef(null),{volume:r,playbackRate:o,allowAmplificationDuringRender:i,onDuration:s,toneFrequency:a,_remotionInternalNeedsDurationCalculation:l,_remotionInternalNativeLoopPassed:u,acceptableTimeShiftInSeconds:d,name:p,onNativeError:m,delayRenderRetries:h,delayRenderTimeoutInMilliseconds:w,loopVolumeCurveBehavior:v,pauseWhenBuffering:E,audioStreamIndex:g,preservePitch:y,...x}=e,b=mr(),k=Uo(v??"repeat"),S=ht(),C=c.useContext(Ke),{registerRenderAsset:I,unregisterRenderAsset:F}=c.useContext(Or),{delayRender:j,continueRender:P}=ln(),A=c.useMemo(()=>`audio-${Dr(e.src??"")}-${C==null?void 0:C.relativeFrom}-${C==null?void 0:C.cumulatedFrom}-${C==null?void 0:C.durationInFrames}`,[e.src,C==null?void 0:C.relativeFrom,C==null?void 0:C.cumulatedFrom,C==null?void 0:C.durationInFrames]),V=Br({volume:r,frame:k,mediaVolume:1});Zo(V),c.useImperativeHandle(t,()=>n.current,[]),c.useEffect(()=>{if(!e.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!e.muted&&!(V<=0))return I({type:"audio",src:yn(e.src),id:A,frame:b,volume:V,mediaFrame:S,playbackRate:e.playbackRate??1,toneFrequency:a??1,audioStartFrame:Math.max(0,-((C==null?void 0:C.cumulatedNegativeFrom)??0)),audioStreamIndex:g??0}),()=>F(A)},[e.muted,e.src,I,b,A,F,V,k,S,o,e.playbackRate,a,C==null?void 0:C.cumulatedNegativeFrom,g]);const{src:_}=e,L=t||l;return c.useLayoutEffect(()=>{var z,R;if(((R=(z=window.process)==null?void 0:z.env)==null?void 0:R.NODE_ENV)==="test"||!L)return;const O=j("Loading <Html5Audio> duration with src="+_,{retries:h??void 0,timeoutInMilliseconds:w??void 0}),{current:N}=n,T=()=>{N!=null&&N.duration&&s(N.src,N.duration),P(O)};return N!=null&&N.duration?(s(N.src,N.duration),P(O)):N==null||N.addEventListener("loadedmetadata",T,{once:!0}),()=>{N==null||N.removeEventListener("loadedmetadata",T),P(O)}},[_,s,L,h,w,P,j]),L?f.jsx("audio",{ref:n,...x,onError:m}):null},$k=c.forwardRef(jk),Ak=(e,t)=>{const n=c.useContext(Dl),r=e,{startFrom:o,endAt:i,trimBefore:s,trimAfter:a,name:l,stack:u,pauseWhenBuffering:d,showInTimeline:p,onError:m,freeze:h,...w}=r,{loop:v,freeze:E,...g}=r,{fps:y}=Xe(),x=Ve(),b=ls(d);if(x.isClientSideRendering)throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");if(typeof h<"u")throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');const{durations:k,setDurations:S}=c.useContext(kf);if(typeof e.src!="string")throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const C=Vr(e.src),I=c.useCallback(V=>{console.log(V.currentTarget.error);const _=`Could not play audio with src ${C}: ${V.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;if(v){if(m){m(new Error(_));return}Ki(new Error(_))}else m==null||m(new Error(_)),console.warn(_)},[v,m,C]),F=c.useCallback((V,_)=>{S({type:"got-duration",durationInSeconds:_,src:V})},[S]),j=k[yn(C)]??k[yn(e.src)];Ll({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});const{trimBeforeValue:P,trimAfterValue:A}=zl({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});if(v&&j!==void 0){if(!Number.isFinite(j))return f.jsx(va,{...g,ref:t,_remotionInternalNativeLoopPassed:!0});const V=j*y;return f.jsx($l,{layout:"none",durationInFrames:jl({trimAfter:A,mediaDurationInFrames:V,playbackRate:e.playbackRate??1,trimBefore:P}),children:f.jsx(va,{...g,ref:t,_remotionInternalNativeLoopPassed:!0})})}return typeof P<"u"||typeof A<"u"?f.jsx(at,{layout:"none",from:0-(P??0),showInTimeline:!1,durationInFrames:A,name:l,children:f.jsx(va,{_remotionInternalNeedsDurationCalculation:!!v,pauseWhenBuffering:b,...w,ref:t})}):(Nl({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Audio"),x.isRendering?f.jsx($k,{onDuration:F,...e,ref:t,onNativeError:I,_remotionInternalNeedsDurationCalculation:!!v}):f.jsx(R0,{_remotionInternalNativeLoopPassed:e._remotionInternalNativeLoopPassed??!1,_remotionInternalStack:u??null,shouldPreMountAudioTags:n!==null&&n.numberOfAudioTags>0,...e,ref:t,onNativeError:I,onDuration:F,pauseWhenBuffering:b,_remotionInternalNeedsDurationCalculation:!!v,showInTimeline:p??!0}))},va=c.forwardRef(Ak);bt(va);var Nk=e=>{if(e===void 0)return 1;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new Error(`<Solid>: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e},Lk={...An,color:{type:"color",default:"transparent",description:"Color"},width:{type:"number",min:1,step:1,default:1920,description:"Width",hiddenFromList:!1},height:{type:"number",min:1,step:1,default:1080,description:"Height",hiddenFromList:!1},pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},...xn,...gr,...hr},zk=({color:e,width:t,height:n,effects:r=[],className:o,style:i,pixelDensity:s,overrideId:a,reference:l})=>{const{delayRender:u,continueRender:d,cancelRender:p}=ln(),m=Nk(s),h=Math.ceil(t*m),w=Math.ceil(n*m),[v,E]=c.useState(null),g=fs({effects:r,overrideId:a??null}),y=c.useMemo(()=>{if(typeof document>"u")return null;const S=document.createElement("canvas");return S.width=1,S.height=1,S},[]),x=ms(),b=c.useCallback(S=>{E(S),typeof l=="function"?l(S):l&&(l.current=S)},[l]);c.useEffect(()=>{if(!v||!y)return;const S=u("Solid effect chain");if(!x)return d(S),()=>{d(S)};const C=y.getContext("2d",{colorSpace:"srgb"});if(!C){p(new Error("Failed to acquire 2D context for <Solid> source"));return}return C.clearRect(0,0,1,1),e!==void 0&&(C.fillStyle=e,C.fillRect(0,0,1,1)),ps({state:x.get(h,w),source:y,effects:g,output:v,width:h,height:w}).then(I=>{I&&d(S)}).catch(I=>{p(I)}),()=>{d(S)}},[e,v,y,x,h,w,u,d,p,g]);const k=c.useMemo(()=>({width:t,height:n,...i??{}}),[n,i,t]);return f.jsx("canvas",{ref:b,width:h,height:w,className:o,style:k})},Dk=c.forwardRef(({effects:e=[],controls:t,color:n,height:r,width:o,className:i,durationInFrames:s,style:a,name:l,from:u,trimBefore:d,freeze:p,hidden:m,showInTimeline:h,pixelDensity:w,...v},E)=>{const g=ds(e),y=c.useRef(null);return c.useImperativeHandle(E,()=>y.current,[]),f.jsx(at,{layout:"none",from:u,trimBefore:d,freeze:p,hidden:m,showInTimeline:h,controls:t,_remotionInternalEffects:g,durationInFrames:s,name:l??"<Solid>",outlineRef:y,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/solid",...v,children:f.jsx(zk,{reference:y,overrideId:(t==null?void 0:t.overrideId)??null,color:n,height:r,width:o,className:i,style:a,effects:e,pixelDensity:w})})}),P0=Nn({Component:Dk,componentName:"<Solid>",componentIdentity:"dev.remotion.remotion.Solid",schema:Lk,supportsEffects:!0});P0.displayName="Solid";bt(P0);var Us=null,F0=()=>{if(Us!==null)return Us;if(typeof document>"u")return!1;const e=document.createElement("canvas"),t=e.getContext("2d");return Us=typeof(t==null?void 0:t.drawElementImage)=="function"&&typeof e.requestPaint=="function"&&typeof e.captureElementImage=="function"&&"transferControlToOffscreen"in HTMLCanvasElement.prototype,Us},Ok="HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";function Vk(e,t){if(typeof e!="number"||typeof t!="number")throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(e)}, height=${String(t)}.`);if(!Number.isInteger(e)||e<=0)throw new Error(`HtmlInCanvas: \`width\` must be a positive integer. Received: ${String(e)}.`);if(!Number.isInteger(t)||t<=0)throw new Error(`HtmlInCanvas: \`height\` must be a positive integer. Received: ${String(t)}.`)}function Bk(e){if(e===void 0)return 1;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new Error(`HtmlInCanvas: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e}var Hs=e=>e instanceof DOMException&&e.name==="InvalidStateError",Am="HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.",Nm=({target:e,width:t,height:n})=>{e.width!==t&&(e.width=t),e.height!==n&&(e.height=n)},Wk=({canvas:e,element:t,elementImage:n})=>{const r=e.getContext("2d");if(!r)throw new Error("Failed to acquire 2D context for <HtmlInCanvas> canvas");r.reset();const o=r.drawElementImage(n,0,0);t.style.transform=o.toString()},Lm=c.createContext(null),M0=c.forwardRef(({width:e,height:t,effects:n,children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l},u)=>{const d=c.useContext(Lm);Vk(e,t);const p=Bk(s),m=Math.ceil(e*p),h=Math.ceil(t*p),{delayRender:w,continueRender:v,cancelRender:E}=ln(),{isClientSideRendering:g,isRendering:y}=Ve(),x=!y||g,b=o===void 0&&i===void 0;F0()||E(new Error(Ok));const k=c.useRef(null),S=c.useRef(null),C=c.useRef(null),I=`${e}x${t}@${p}-${b?"direct":"offscreen"}`,F=c.useCallback(M=>{k.current=M,typeof u=="function"?u(M):u&&(u.current=M)},[u]),j=ms(),P=fs({effects:n,overrideId:(a==null?void 0:a.overrideId)??null}),A=c.useRef(P);A.current=P;const V=c.useRef(o);V.current=o;const _=c.useRef(i);_.current=i;const L=c.useRef(!1),O=c.useRef(null),N=c.useRef(!1),T=c.useRef(d);T.current=d;const z=c.useCallback(async()=>{var K;const M=C.current;if(!M)throw new Error("Canvas or scene element not found");const D=S.current;if(!D)throw new Error("HtmlInCanvas: paint target is not ready because the canvas is remounting");Nm({target:D,width:m,height:h});try{const G=k.current;if(!G)throw new Error("Canvas not found");const oe=w("onPaint");if(!L.current){const Z=_.current;if(!Z)L.current=!0;else{let ee;try{ee=G.captureElementImage(M)}catch(ae){if(Hs(ae)&&x){v(oe);return}throw Hs(ae)?new Error(Am):ae}L.current=!0;try{if(D instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onInit requires an OffscreenCanvas paint target");const ae=await Z({canvas:D,element:M,elementImage:ee,pixelDensity:p});if(typeof ae!="function")throw new Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");N.current?ae():O.current=ae}finally{ee.close()}}}let ne;try{ne=G.captureElementImage(M)}catch(Z){if(Hs(Z)&&x){v(oe);return}throw Hs(Z)?new Error(Am):Z}try{const Z=V.current;if(Z){if(D instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onPaint requires an OffscreenCanvas paint target");const ee=Z({canvas:D,element:M,elementImage:ne,pixelDensity:p});ee&&await ee}else Wk({canvas:D,element:M,elementImage:ne,pixelDensity:p});await ps({state:j.get(m,h),source:D,effects:A.current,output:D,width:m,height:h})}finally{ne.close()}(K=T.current)==null||K.requestParentPaint(),v(oe)}catch(G){E(G)}},[h,m,j,v,E,w,p,x]);c.useLayoutEffect(()=>{const M=k.current;if(!M)throw new Error("Canvas not found");M.layoutSubtree=!0;const D=b?M:M.transferControlToOffscreen();return S.current=D,Nm({target:D,width:m,height:h}),L.current=!1,N.current=!1,M.addEventListener("paint",z),()=>{var K;M.removeEventListener("paint",z),S.current=null,L.current=!1,N.current=!0,(K=O.current)==null||K.call(O),O.current=null}},[z,E,m,h,b]);const R=c.useRef(!1);c.useLayoutEffect(()=>{var D;if(!R.current){R.current=!0;return}const M=k.current;M&&((D=M.requestPaint)==null||D.call(M))},[o,P]),c.useLayoutEffect(()=>{const M=k.current;if(!M)return;const D=w("waiting for first paint after canvas resize");return M.addEventListener("paint",()=>{v(D)},{once:!0}),()=>{v(D)}},[e,t,v,w,I]);const $=c.useMemo(()=>({width:e,height:t}),[e,t]),B=c.useMemo(()=>({width:e,height:t,...l??{}}),[t,l,e]),W=c.useMemo(()=>({requestParentPaint:()=>{var M,D;(D=(M=k.current)==null?void 0:M.requestPaint)==null||D.call(M)}}),[]);return f.jsx(Lm.Provider,{value:W,children:f.jsx("canvas",{ref:F,width:m,height:h,style:B,children:f.jsx("div",{ref:C,style:$,children:r})},I)})});M0.displayName="HtmlInCanvasContent";var j0=c.forwardRef(({width:e,height:t,effects:n=[],children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,durationInFrames:u,name:d,...p},m)=>{const h=ds(n),w=c.useRef(null),v=c.useCallback(E=>{w.current=E,typeof m=="function"?m(E):m&&(m.current=E)},[m]);return f.jsx(at,{durationInFrames:u,name:d??"<HtmlInCanvas>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/remotion/html-in-canvas",controls:a,_remotionInternalEffects:h,outlineRef:w,layout:"none",...p,children:f.jsx(M0,{ref:v,width:e,height:t,effects:n,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,children:r})})});j0.displayName="HtmlInCanvas";var Uk={...An,pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},...xn,...gr,...hr},Hk=Nn({Component:j0,componentName:"<HtmlInCanvas>",componentIdentity:"dev.remotion.remotion.HtmlInCanvas",schema:Uk,supportsEffects:!0}),$0=Object.assign(Hk,{isSupported:F0});$0.displayName="HtmlInCanvas";bt($0);function _n(e){return e.startsWith("data:")&&e.length>100?e.slice(0,60)+"...["+e.length+" chars total]":e}var Zk={...An,...Oo,fit:{type:"enum",default:"fill",description:"Fit",variants:{fill:{},contain:{},cover:{}}},...xn,...gr,...hr},Yk=()=>{if(typeof DOMException<"u")return new DOMException("Image loading was aborted","AbortError");const e=new Error("Image loading was aborted");return e.name="AbortError",e},Kk=({src:e,signal:t})=>new Promise((n,r)=>{const o=new Image;let i=!1;function s(){o.onload=null,o.onerror=null}function a(u){i||(i=!0,s(),u())}function l(){a(()=>r(Yk()))}if(o.onload=()=>{var u;Promise.resolve((u=o.decode)==null?void 0:u.call(o)).catch(()=>{}).then(()=>{const d=o.naturalWidth||o.width,p=o.naturalHeight||o.height;if(d<=0||p<=0){a(()=>r(new Error(`Could not determine dimensions for <CanvasImage> with src="${_n(e)}"`)));return}a(()=>n({element:o,width:d,height:p}))})},o.onerror=()=>{a(()=>r(new Error(`Could not load <CanvasImage> with src="${_n(e)}"`)))},t.addEventListener("abort",l,{once:!0}),t.aborted){l();return}o.crossOrigin="anonymous",o.src=e});function Xk(e){return 1e3*2**(e-1)}var Gk=({onFrame:e})=>{if(typeof requestAnimationFrame>"u")return e(),()=>{};const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)},A0=c.forwardRef(({src:e,width:t,height:n,fit:r="fill",effects:o,controls:i,onError:s,className:a,style:l,id:u,pauseWhenLoading:d,maxRetries:p=2,delayRenderRetries:m,delayRenderTimeoutInMilliseconds:h,refForOutline:w,...v},E)=>{const{delayRender:g,continueRender:y,cancelRender:x}=ln(),{delayPlayback:b}=Vl(),[k,S]=c.useState(null),[C,I]=c.useState(null),F=Vr(e),j=ms(),P=fs({effects:o,overrideId:(i==null?void 0:i.overrideId)??null}),A=c.useContext(Ke),V=c.useRef(null),[_,L]=c.useState(!1),O=!!(A!=null&&A.premounting),N=!!(A!=null&&A.postmounting),T=c.useCallback(({markAsReady:$})=>{const B=V.current;!B||B.continued||(B.continued=!0,$&&L(!1),y(B.handle),V.current=null)},[y]),z=c.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),R=c.useCallback($=>{S($),w&&(w.current=$),typeof E=="function"?E($):E&&(E.current=$)},[E,w]);return c.useLayoutEffect(()=>{if(!(!d||!_||O||N))return b().unblock},[b,_,N,O,d]),c.useLayoutEffect(()=>{const $=g(`Rendering <CanvasImage> with src="${_n(F)}"`,{retries:m??void 0,timeoutInMilliseconds:h??void 0}),B=new AbortController;let W=!1,M=0,D=null;I(null),L(!0),V.current={handle:$,continued:!1};const K=()=>{Kk({src:F,signal:B.signal}).then(G=>{W||I(G)}).catch(G=>{if(G.name==="AbortError"){T({markAsReady:!1});return}if(M++,M<=p){const oe=Xk(M);console.warn(`Could not load <CanvasImage> with src="${_n(F)}", retrying in ${oe}ms`),D=setTimeout(()=>{W||K()},oe)}else s?(s(G),T({markAsReady:!0})):x(G)})};return K(),()=>{W=!0,D!==null&&clearTimeout(D),B.abort(),T({markAsReady:!1})}},[F,x,T,g,m,h,p,s]),c.useLayoutEffect(()=>{if(!C||!k||!z)return;const $=g(`Applying effects to <CanvasImage> with src="${_n(F)}"`);let B=!1,W=!1,M=()=>{};const D=()=>{W||(W=!0,y($))},K=t??C.width,G=n??C.height,oe=z.getContext("2d",{colorSpace:"srgb"});return oe?(z.width=K,z.height=G,k.width=K,k.height=G,oe.clearRect(0,0,K,G),oe.drawImage(C.element,...i0(r,{width:C.width,height:C.height},{width:K,height:G})),ps({state:j.get(K,G),source:z,effects:P,output:k,width:K,height:G}).then(ne=>{ne&&!B&&(M=Gk({onFrame:()=>{B||(D(),T({markAsReady:!0}))}}))}).catch(ne=>{B||(s?(s(ne),D(),T({markAsReady:!0})):x(ne))}),()=>{B=!0,M(),D()}):(x(new Error("Could not get 2D context for <CanvasImage> source canvas")),D(),()=>{D()})},[F,x,j,y,T,g,r,n,C,P,s,k,z,t]),f.jsx("canvas",{...v,ref:R,width:t,height:n,className:a,style:l,id:u})});A0.displayName="CanvasImageContent";var qk=c.forwardRef(({src:e,width:t,height:n,fit:r,effects:o=[],className:i,style:s,id:a,onError:l,pauseWhenLoading:u,maxRetries:d,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,durationInFrames:h,from:w,trimBefore:v,freeze:E,premountFor:g,postmountFor:y,styleWhilePremounted:x,styleWhilePostmounted:b,hidden:k,name:S,showInTimeline:C,stack:I,controls:F,_remotionInternalDocumentationLink:j,outlineRef:P,...A},V)=>{if(!e)throw new Error('No "src" prop was passed to <CanvasImage>.');const _=ds(o),L=c.useRef(null);c.useImperativeHandle(V,()=>L.current,[]);const{effectivePostmountFor:O,effectivePremountFor:N,freezeFrame:T,isPremountingOrPostmounting:z,postmountingActive:R,premountingActive:$,premountingStyle:B}=us({from:w??0,durationInFrames:h??1/0,premountFor:g??null,postmountFor:y??null,style:s??null,styleWhilePremounted:x??null,styleWhilePostmounted:b??null,hideWhilePremounted:"display-none"});return f.jsx(as,{frame:T,active:z,children:f.jsx(at,{layout:"none",from:w??0,trimBefore:v,durationInFrames:h??1/0,freeze:E,hidden:k,showInTimeline:C??!0,name:S??"<CanvasImage>",_remotionInternalDocumentationLink:j??"https://www.remotion.dev/docs/canvasimage",controls:F,_remotionInternalEffects:_,_remotionInternalIsMedia:{type:"image",src:e},_remotionInternalStack:I,_remotionInternalPremountDisplay:N||null,_remotionInternalPostmountDisplay:O||null,_remotionInternalIsPremounting:$,_remotionInternalIsPostmounting:R,outlineRef:P??L,children:f.jsx(A0,{ref:L,src:e,width:t,height:n,fit:r,effects:o,controls:F,className:i,style:B??void 0,id:a,onError:l,pauseWhenLoading:u,maxRetries:d,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,refForOutline:P??null,...A})})})}),Mf=Nn({Component:qk,componentName:"<CanvasImage>",componentIdentity:"dev.remotion.remotion.CanvasImage",schema:Zk,supportsEffects:!0});Mf.displayName="CanvasImage";bt(Mf);var Qk=({onLoad:e,onError:t,delayRenderRetries:n,delayRenderTimeoutInMilliseconds:r,...o},i)=>{const{delayRender:s,continueRender:a}=ln(),[l]=c.useState(()=>s(`Loading <IFrame> with source ${o.src}`,{retries:n??void 0,timeoutInMilliseconds:r??void 0})),u=c.useCallback(p=>{a(l),e==null||e(p)},[l,e,a]),d=c.useCallback(p=>{a(l),t?t(p):console.error("Error loading iframe:",p,"Handle the event using the onError() prop to make this message disappear.")},[l,t,a]);return f.jsx("iframe",{referrerPolicy:"strict-origin-when-cross-origin",...o,ref:i,onError:d,onLoad:u})};c.forwardRef(Qk);function Jk(e){return 1e3*2**(e-1)}var eC=({onError:e,maxRetries:t=2,src:n,pauseWhenLoading:r,delayRenderRetries:o,delayRenderTimeoutInMilliseconds:i,onImageFrame:s,crossOrigin:a,decoding:l,ref:u,refForOutline:d,...p})=>{const m=c.useRef(null),h=c.useRef({}),{delayPlayback:w}=Vl(),v=c.useContext(Ke),[E,g]=c.useState(!1),y=c.useCallback(_=>{m.current=_,d.current=_,typeof u=="function"?u(_):u&&(u.current=_)},[u,d]),x=Vr(n),b=c.useCallback(_=>{if(!m.current)return;const L=m.current.src;setTimeout(()=>{var N;if(!m.current)return;const O=(N=m.current)==null?void 0:N.src;O===L&&(m.current.removeAttribute("src"),m.current.setAttribute("src",O))},_)},[]),{delayRender:k,continueRender:S,cancelRender:C}=ln(),I=!!(v!=null&&v.premounting),F=!!(v!=null&&v.postmounting),j=c.useCallback(_=>{var L,O,N,T,z,R,$;if(h.current){if(h.current[(L=m.current)==null?void 0:L.src]=(h.current[(O=m.current)==null?void 0:O.src]??0)+1,e&&(h.current[(N=m.current)==null?void 0:N.src]??0)>t){e(_);return}if((h.current[(T=m.current)==null?void 0:T.src]??0)<=t){const B=Jk(h.current[(z=m.current)==null?void 0:z.src]??0);console.warn(`Could not load image with source ${_n((R=m.current)==null?void 0:R.src)}, retrying again in ${B}ms`),b(B);return}try{C("Error loading image with src: "+_n(($=m.current)==null?void 0:$.src))}catch{}}},[C,t,e,b]);typeof window<"u"&&(c.useLayoutEffect(()=>{if(!(!r||!E||I||F))return w().unblock},[w,E,F,I,r]),c.useLayoutEffect(()=>{var T,z;if(((z=(T=window.process)==null?void 0:T.env)==null?void 0:z.NODE_ENV)==="test"){m.current&&(m.current.src=x);return}const{current:_}=m;if(!_)return;g(!0);const L=k("Loading <Img> with src="+_n(x),{retries:o??void 0,timeoutInMilliseconds:i??void 0});let O=!1;const N=()=>{var R,$,B;if(O){S(L);return}(h.current[(R=m.current)==null?void 0:R.src]??0)>0&&(delete h.current[($=m.current)==null?void 0:$.src],console.info(`Retry successful - ${_n((B=m.current)==null?void 0:B.src)} is now loaded`)),_&&(s==null||s(_)),g(!1),S(L)};if(!m.current){N();return}return _.src=x,_.decode().then(N).catch(R=>{console.warn(R),_.complete&&_.naturalWidth>0&&_.naturalHeight>0?N():_.addEventListener("load",N)}),()=>{O=!0,_.removeEventListener("load",N),S(L)}},[x,o,i,s,S,k]));const{isClientSideRendering:P,isRendering:A}=Ve(),V=Cf({crossOrigin:a,requestsVideoFrame:!1,isClientSideRendering:P});return f.jsx("img",{...p,ref:y,crossOrigin:V,onError:j,decoding:A?"sync":l})},tC=({hidden:e,name:t,stack:n,showInTimeline:r,src:o,from:i,trimBefore:s,durationInFrames:a,freeze:l,premountFor:u,postmountFor:d,style:p,styleWhilePremounted:m,styleWhilePostmounted:h,controls:w,outlineRef:v,...E})=>{if(!o)throw new Error('No "src" prop was passed to <Img>.');const{effectivePostmountFor:g,effectivePremountFor:y,freezeFrame:x,isPremountingOrPostmounting:b,postmountingActive:k,premountingActive:S,premountingStyle:C}=us({from:i??0,durationInFrames:a??1/0,premountFor:u??null,postmountFor:d??null,style:p??null,styleWhilePremounted:m??null,styleWhilePostmounted:h??null,hideWhilePremounted:"display-none"});return f.jsx(as,{frame:x,active:b,children:f.jsx(at,{layout:"none",from:i??0,trimBefore:s,durationInFrames:a??1/0,freeze:l,_remotionInternalStack:n,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",_remotionInternalIsMedia:{type:"image",src:o},_remotionInternalPremountDisplay:y||null,_remotionInternalPostmountDisplay:g||null,_remotionInternalIsPremounting:S,_remotionInternalIsPostmounting:k,name:t??"<Img>",controls:w,showInTimeline:r??!0,hidden:e,outlineRef:v,children:f.jsx(eC,{src:o,refForOutline:v,style:C??void 0,...E})})})},nC=Mf,rC={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...An,...Oo,...xn,...gr,...hr},oC=new Set(["alt","crossOrigin","decoding","fetchPriority","loading","onError","onImageFrame","onLoad","sizes","srcSet","useMap"]),iC=e=>Object.keys(e).filter(t=>e[t]!==void 0&&oC.has(t)),sC=e=>e.map(t=>`"${t}"`).join(", "),aC=({props:e,ref:t,width:n,height:r})=>{if(typeof n=="string"||typeof r=="string")throw new Error('The "width" and "height" props must be numbers on <Img> when effects are passed, because <Img> renders a <CanvasImage>. Use numeric props or CSS dimensions in "style".');const o=iC(e);if(t!=null&&o.unshift("ref"),o.length!==0)throw new Error(`The ${sC(o)} prop${o.length===1?"":"s"} cannot be used on <Img> when effects are passed, because <Img> renders a <canvas> instead of a native <img>. Remove ${o.length===1?"this prop":"these props"}.`)},lC=e=>{const t=e==null?void 0:e.objectFit;if(t==="fill"||t==="contain"||t==="cover")return t},uC=({effects:e=[],ref:t,hidden:n,name:r,stack:o,showInTimeline:i,src:s,from:a,trimBefore:l,durationInFrames:u,freeze:d,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:w,controls:v,width:E,height:g,className:y,style:x,id:b,pauseWhenLoading:k,maxRetries:S,delayRenderRetries:C,delayRenderTimeoutInMilliseconds:I,...F})=>{const j=c.useRef(null),P=ls(k);if(e.length===0)return f.jsx(tC,{...F,ref:t,hidden:n,name:r,stack:o,showInTimeline:i,src:s,from:a,trimBefore:l,durationInFrames:u,freeze:d,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:w,controls:v,width:E,height:g,className:y,style:x,id:b,pauseWhenLoading:P,maxRetries:S,delayRenderRetries:C,delayRenderTimeoutInMilliseconds:I,outlineRef:j});if(!s)throw new Error('No "src" prop was passed to <Img>.');aC({props:F,ref:t,width:E,height:g});const A=typeof E=="number"?E:void 0,V=typeof g=="number"?g:void 0,_=F,L=lC(x)??"fill";return f.jsx(nC,{src:s,width:A,height:V,fit:L,effects:e,className:y,style:x,id:b,pauseWhenLoading:P,maxRetries:S,delayRenderRetries:C,delayRenderTimeoutInMilliseconds:I,from:a,trimBefore:l,durationInFrames:u,freeze:d,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:w,hidden:n,name:r??"<Img>",showInTimeline:i,stack:o,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",controls:v,outlineRef:j,..._})},jf=Nn({Component:uC,componentName:"<Img>",componentIdentity:"dev.remotion.remotion.Img",schema:rC,supportsEffects:!0});bt(jf);var cC=e=>{if(e==="remotion")return"dev.remotion.remotion";if(e.startsWith("@remotion/"))return`dev.remotion.${e.slice(10).replace(/-([a-z])/g,(n,r)=>r.toUpperCase())}`;throw new Error(`Unsupported Remotion package name: ${e}`)},N0=({packageName:e,componentName:t})=>`${cC(e)}.${t}`,$f={...An,...xn},dC={...$f,...gr},L0={...dC,...hr},fC={...L0,...Cl,...Ry},pC={...$f,...Cl,...Ry},mC=(e,t)=>{typeof e=="function"?e(t):e&&(e.current=t)},z0=e=>{const t=Nn(e);return bt(t),t},Xa=(e,t,n)=>{const r=c.forwardRef((i,s)=>{const{durationInFrames:a,from:l,trimBefore:u,freeze:d,hidden:p,name:m,showInTimeline:h,stack:w,controls:v,...E}=i,g=c.useRef(null),y=c.useCallback(x=>{g.current=x,mC(s,x)},[s]);return f.jsx(at,{layout:"none",from:l??0,trimBefore:u,durationInFrames:a??1/0,freeze:d,hidden:p,name:m??t,showInTimeline:h??!0,controls:v,_remotionInternalStack:w,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/interactive",outlineRef:g,children:J.createElement(e,{...E,ref:y})})});r.displayName=t;const o=z0({Component:r,componentName:t,componentIdentity:N0({packageName:"remotion",componentName:t.slice(1,-1)}),schema:n,supportsEffects:!1});return o.displayName=t,o},Ee=(e,t)=>Xa(e,t,fC),Kr=(e,t)=>Xa(e,t,$f),On={baseSchema:An,transformSchema:xn,textSchema:Cl,backgroundSchema:gr,borderSchema:hr,premountSchema:Oo,sequenceSchema:Fo,withSchema:z0,_internalMakeRemotionComponentIdentity:N0,A:Ee("a","<Interactive.A>"),Article:Ee("article","<Interactive.Article>"),Aside:Ee("aside","<Interactive.Aside>"),Button:Ee("button","<Interactive.Button>"),Circle:Kr("circle","<Interactive.Circle>"),Code:Ee("code","<Interactive.Code>"),Div:Ee("div","<Interactive.Div>"),Ellipse:Kr("ellipse","<Interactive.Ellipse>"),Em:Ee("em","<Interactive.Em>"),Footer:Ee("footer","<Interactive.Footer>"),G:Kr("g","<Interactive.G>"),H1:Ee("h1","<Interactive.H1>"),H2:Ee("h2","<Interactive.H2>"),H3:Ee("h3","<Interactive.H3>"),H4:Ee("h4","<Interactive.H4>"),H5:Ee("h5","<Interactive.H5>"),H6:Ee("h6","<Interactive.H6>"),Header:Ee("header","<Interactive.Header>"),Label:Ee("label","<Interactive.Label>"),Li:Ee("li","<Interactive.Li>"),Line:Kr("line","<Interactive.Line>"),Main:Ee("main","<Interactive.Main>"),Nav:Ee("nav","<Interactive.Nav>"),Ol:Ee("ol","<Interactive.Ol>"),P:Ee("p","<Interactive.P>"),Path:Kr("path","<Interactive.Path>"),Pre:Ee("pre","<Interactive.Pre>"),Rect:Kr("rect","<Interactive.Rect>"),Section:Ee("section","<Interactive.Section>"),Small:Ee("small","<Interactive.Small>"),Span:Ee("span","<Interactive.Span>"),Strong:Ee("strong","<Interactive.Strong>"),Svg:Xa("svg","<Interactive.Svg>",L0),Text:Xa("text","<Interactive.Text>",pC),Ul:Ee("ul","<Interactive.Ul>")},hC=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{const{decoder:o,selectedTrack:i}=await u0({resolvedSrc:e,signal:t,requestInit:n,contentType:r});try{const{image:s}=await o.decode({frameIndex:i.frameCount-1,completeFramesOnly:!0});try{if(s.duration===null)throw new Error("Could not determine animated image duration");return(s.timestamp+s.duration)/1e6}finally{s.close()}}finally{o.close()}},D0=J.createRef(),gC=({children:e,onlyRenderComposition:t,currentCompositionMetadata:n,initialCompositions:r,initialCanvasContent:o})=>{const[i,s]=c.useState([]),[a,l]=c.useState(o),[u,d]=c.useState(r),p=c.useRef(u),m=c.useCallback(x=>{d(b=>{const k=x(b);return p.current=k,k})},[]),h=c.useCallback(x=>{m(b=>{if(b.find(k=>k.id===x.id))throw new Error(`Multiple composition with id ${x.id} are registered.`);return[...b,x]})},[m]),w=c.useCallback(x=>{d(b=>b.filter(k=>k.id!==x))},[]),v=c.useCallback((x,b,k,S)=>{s(C=>[...C,{name:x,parent:b,nonce:k,stack:S}])},[]),E=c.useCallback((x,b)=>{s(k=>k.filter(S=>!(S.name===x&&S.parent===b)))},[]);c.useImperativeHandle(D0,()=>({getCompositions:()=>p.current}),[]);const g=c.useMemo(()=>({registerComposition:h,unregisterComposition:w,registerFolder:v,unregisterFolder:E,setCanvasContent:l,onlyRenderComposition:t}),[h,v,w,E,t]),y=c.useMemo(()=>({compositions:u,folders:i,currentCompositionMetadata:n,canvasContent:a}),[u,i,n,a]);return f.jsx(No.Provider,{value:y,children:f.jsx(rs.Provider,{value:g,children:e})})},O0={};iy(O0,{makeDefaultPreviewCSS:()=>yC,injectCSS:()=>vC,OBJECTFIT_CONTAIN_CLASS_NAME:()=>Xi});var Zs={},vC=e=>{if(typeof document>"u")return()=>{};if(Zs[e])return()=>{};const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");return n.appendChild(document.createTextNode(e)),t.prepend(n),Zs[e]=n,()=>{const r=Zs[e];r&&(r.parentNode&&r.parentNode.removeChild(r),delete Zs[e])}},Xi="__remotion_objectfitcontain",yC=(e,t)=>e?`
58
+ ${e} * {
59
+ box-sizing: border-box;
60
+ }
61
+ ${e} *:-webkit-full-screen {
62
+ width: 100%;
63
+ height: 100%;
64
+ }
65
+ ${e} .${Xi} {
66
+ object-fit: contain;
67
+ }
68
+ `:`
69
+ * {
70
+ box-sizing: border-box;
71
+ }
72
+ body {
73
+ margin: 0;
74
+ background-color: ${t};
75
+ }
76
+ .${Xi} {
77
+ object-fit: contain;
78
+ }
79
+ `,V0="__remotion-studio-container",wC=()=>document.getElementById(V0),xC=J.createContext(null),bC=null,ju=[],SC=()=>bC,EC=e=>(ju.push(e),()=>{ju=ju.filter(t=>t!==e)}),Af=c.createContext(null),kC=()=>{const e=c.useContext(Af);return!e||e.videoEnabled===null?window.remotion_videoEnabled:e.videoEnabled},CC=()=>{const e=c.useContext(Af);return!e||e.audioEnabled===null?window.remotion_audioEnabled:e.audioEnabled},IC=({children:e,videoEnabled:t,audioEnabled:n})=>{const r=c.useMemo(()=>({videoEnabled:t,audioEnabled:n}),[t,n]);return f.jsx(Af.Provider,{value:r,children:e})},TC=({children:e,numberOfAudioTags:t,logLevel:n,audioLatencyHint:r,previewSampleRate:o,videoEnabled:i,audioEnabled:s,frameState:a})=>{const l=c.useMemo(()=>{let d=0;return{getNonce:()=>d++}},[]),u=c.useMemo(()=>({logLevel:n,mountTime:Date.now()}),[n]);return f.jsx(zr.Provider,{value:u,children:f.jsx(os.Provider,{value:l,children:f.jsx(ES,{frameState:a,children:f.jsx(IC,{videoEnabled:i,audioEnabled:s,children:f.jsx(fy,{children:f.jsx(m0,{children:f.jsx(RS,{children:f.jsx(g0,{children:f.jsx(E0,{children:f.jsx(v0,{audioLatencyHint:r,audioEnabled:s,previewSampleRate:o,children:f.jsx(y0,{numberOfAudioTags:t,children:e})})})})})})})})})})})},zm=["h264","h265","vp8","vp9","av1","mp3","aac","wav","prores","h264-mkv","h264-ts","gif"];function _C(e,t,n){if(!(typeof e>"u")){if(typeof e!="string")throw new TypeError(`The "${n}" prop ${t} must be a string, but you passed a value of type ${typeof e}.`);if(!zm.includes(e))throw new Error(`The "${n}" prop ${t} must be one of ${zm.join(", ")}, but you passed ${e}.`)}}var RC=({calculated:e,compositionId:t,compositionFps:n,compositionHeight:r,compositionWidth:o,compositionDurationInFrames:i})=>{const s=`calculated by calculateMetadata() for the composition "${t}"`,a=`of the "<Composition />" component with the id "${t}"`,l=(e==null?void 0:e.width)??o??void 0;Wa(l,"width",e!=null&&e.width?s:a);const u=(e==null?void 0:e.height)??r??void 0;Wa(u,"height",e!=null&&e.height?s:a);const d=(e==null?void 0:e.fps)??n??null;xl(d,e!=null&&e.fps?s:a);const p=(e==null?void 0:e.durationInFrames)??i??null;wl(p,{allowFloats:!1,component:`of the "<Composition />" component with the id "${t}"`});const m=e==null?void 0:e.defaultCodec;_C(m,s,"defaultCodec");const h=e==null?void 0:e.defaultOutName,w=e==null?void 0:e.defaultVideoImageFormat,v=e==null?void 0:e.defaultPixelFormat,E=e==null?void 0:e.defaultProResProfile,g=e==null?void 0:e.defaultSampleRate;return{width:l,height:u,fps:d,durationInFrames:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:w,defaultPixelFormat:v,defaultProResProfile:E,defaultSampleRate:g}},Dm=({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionId:o,compositionWidth:i,defaultProps:s,originalProps:a})=>{const l=RC({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionWidth:i,compositionId:o});return{metadataSource:{durationInFrames:(e==null?void 0:e.durationInFrames)===void 0?"composition":"calculate-metadata",fps:(e==null?void 0:e.fps)===void 0?"composition":"calculate-metadata",height:(e==null?void 0:e.height)===void 0?"composition":"calculate-metadata",width:(e==null?void 0:e.width)===void 0?"composition":"calculate-metadata"},videoConfig:{...l,id:o,defaultProps:Kc(s??{}),props:Kc((e==null?void 0:e.props)??a),defaultCodec:l.defaultCodec??null,defaultOutName:l.defaultOutName??null,defaultVideoImageFormat:l.defaultVideoImageFormat??null,defaultPixelFormat:l.defaultPixelFormat??null,defaultProResProfile:l.defaultProResProfile??null,defaultSampleRate:l.defaultSampleRate??null}}},B0=({calculateMetadata:e,signal:t,defaultProps:n,inputProps:r,compositionId:o,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l})=>{const u=e?e({defaultProps:n,props:r,abortSignal:t,compositionId:o,isRendering:mn().isRendering}):null;return u!==null&&typeof u=="object"&&"then"in u?u.then(d=>Dm({calculated:d,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})):Dm({calculated:u,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})},W0=e=>{const t=B0(e);return typeof t=="object"&&"then"in t?t.then(({videoConfig:n})=>n):t.videoConfig},PC=e=>{try{return{type:"success",result:B0(e)}}catch(t){return{type:"error",error:t}}},FC=e=>{try{return{type:"success",result:W0(e)}}catch(t){return{type:"error",error:t}}},MC=J.createContext(()=>{}),jC=()=>{if(mn().isRendering){const e=window.remotion_envVariables;return e?{...JSON.parse(e),NODE_ENV:"production"}:{}}return{NODE_ENV:"production"}},$C=()=>{const e=jC();window.process||(window.process={}),window.process.env||(window.process.env={}),Object.keys(e).forEach(t=>{window.process.env[t]=e[t]})},AC=J.createContext(null),NC=c.createContext({setSize:()=>{},size:{size:"auto",translation:{x:0,y:0}}}),LC=({canvasSize:e,compositionHeight:t,compositionWidth:n,previewSize:r})=>{const o=e.height/t,i=e.width/n,s=Math.min(o,i);return r==="auto"?s===0?1:s:Number(r)},zC=J.createContext(null),DC=({src:e,transparent:t,currentTime:n,toneMapped:r})=>`http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(yn(e))}&time=${encodeURIComponent(Math.max(0,n))}&transparent=${String(t)}&toneMapped=${String(r)}`,OC=({onError:e,volume:t,playbackRate:n,src:r,muted:o,allowAmplificationDuringRender:i,transparent:s,toneMapped:a,toneFrequency:l,name:u,loopVolumeCurveBehavior:d,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onVideoFrame:h,crossOrigin:w,audioStreamIndex:v,preservePitch:E,...g})=>{const y=mr(),x=ht(),b=Uo(d),k=kl(),S=c.useContext(Ke),C=Mr(),{registerRenderAsset:I,unregisterRenderAsset:F}=c.useContext(Or);if(!r)throw new TypeError("No `src` was passed to <OffthreadVideo>.");const j=c.useMemo(()=>`offthreadvideo-${Dr(r)}-${S==null?void 0:S.cumulatedFrom}-${S==null?void 0:S.relativeFrom}-${S==null?void 0:S.durationInFrames}`,[r,S==null?void 0:S.cumulatedFrom,S==null?void 0:S.relativeFrom,S==null?void 0:S.durationInFrames]);if(!k)throw new Error("No video config found");const P=Br({volume:t,frame:b,mediaVolume:1});Zo(P),c.useEffect(()=>{if(!r)throw new Error("No src passed");if(window.remotion_audioEnabled&&!o&&!(P<=0))return I({type:"video",src:yn(r),id:j,frame:y,volume:P,mediaFrame:x,playbackRate:n,toneFrequency:l,audioStartFrame:Math.max(0,-((S==null?void 0:S.cumulatedNegativeFrom)??0)),audioStreamIndex:v}),()=>F(j)},[o,r,I,j,F,P,x,y,n,l,S==null?void 0:S.cumulatedNegativeFrom,v]);const A=c.useMemo(()=>C0({frame:x,playbackRate:n||1,startFrom:-C})/k.fps,[x,C,n,k.fps]),V=c.useMemo(()=>DC({src:r,currentTime:A,transparent:s,toneMapped:a}),[a,A,r,s]),[_,L]=c.useState(null),{delayRender:O,continueRender:N}=ln();c.useLayoutEffect(()=>{if(!window.remotion_videoEnabled)return;const $=[];L(null);const B=new AbortController,W=O(`Fetching ${V} from server`,{retries:p??void 0,timeoutInMilliseconds:m??void 0});return(async()=>{try{const D=await fetch(V,{signal:B.signal,cache:"no-store"});if(D.status!==200){if(D.status===500){const oe=await D.json();if(oe.error){const ne=oe.error.replace(/^Error: /,"");throw new Error(ne)}}throw new Error(`Server returned status ${D.status} while fetching ${V}`)}const K=await D.blob(),G=URL.createObjectURL(K);$.push(()=>URL.revokeObjectURL(G)),L({src:G,handle:W})}catch(D){if(D.message.includes("aborted")){N(W);return}if(B.signal.aborted){N(W);return}D.message.includes("Failed to fetch")&&(D=new Error(`Failed to fetch ${V}. This could be caused by Chrome rejecting the request because the disk space is low. Consider increasing the disk size of your environment.`,{cause:D})),e?e(D):Ki(D)}})(),$.push(()=>{B.signal.aborted||B.abort()}),()=>{$.forEach(D=>D())}},[V,p,m,e,N,O]);const T=c.useCallback(()=>{e?e==null||e(new Error("Failed to load image with src "+_)):Ki("Failed to load image with src "+_)},[_,e]),z=c.useMemo(()=>[Xi,g.className].filter(Lo).join(" "),[g.className]),R=c.useCallback($=>{h&&h($)},[h]);return!_||!window.remotion_videoEnabled?null:(N(_.handle),f.jsx(jf,{src:_.src,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onImageFrame:R,...g,onError:T,className:z}))},U0=({ref:e,onVideoFrame:t})=>{c.useEffect(()=>{const{current:n}=e;if(!n||!t)return;let r=0;const o=(i,s)=>{e.current&&(t(e.current,i,s),r=e.current.requestVideoFrameCallback(o))};if(t(n),!!n.requestVideoFrameCallback)return r=n.requestVideoFrameCallback(o),()=>{r&&n.cancelVideoFrameCallback(r)}},[t,e])};class po extends Error{constructor({message:n,src:r}){super(n);Se(this,"src");this.name="MediaPlaybackError",this.src=r}}var VC=(e,t)=>{const n=c.useContext(Wo);if(!n)throw new Error("SharedAudioContext not found");const r=c.useRef(null),o=c.useMemo(()=>n.audioContext?If({audioContext:n.audioContext,ref:r}):null,[n.audioContext]);(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{o==null||o.cleanup()})},[o]);const{volume:s,muted:a,playbackRate:l,preservePitch:u,onlyWarnForMediaSeekingError:d,src:p,onDuration:m,acceptableTimeShift:h,acceptableTimeShiftInSeconds:w,toneFrequency:v,name:E,_remotionInternalNativeLoopPassed:g,_remotionInternalStack:y,style:x,pauseWhenBuffering:b,showInTimeline:k,loopVolumeCurveBehavior:S,onError:C,onAutoPlayError:I,onVideoFrame:F,crossOrigin:j,delayRenderRetries:P,delayRenderTimeoutInMilliseconds:A,allowAmplificationDuringRender:V,useWebAudioApi:_,audioStreamIndex:L,...O}=e,N=Uo(S??"repeat"),{fps:T,durationInFrames:z}=Xe(),R=c.useContext(Ke),$=wn(),B=ss(),[W]=c.useState(()=>String(Math.random()));if(typeof h<"u")throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");const[M]=Pf(),[D]=Ff(),K=Br({frame:N,volume:s,mediaVolume:M});Zo(K);const G=c.useCallback(()=>y??null,[y]);Tf({volume:s,mediaVolume:M,mediaType:"video",src:p,playbackRate:e.playbackRate??1,displayName:E??null,id:W,getStack:G,showInTimeline:k,premountDisplay:(R==null?void 0:R.premountDisplay)??null,postmountDisplay:(R==null?void 0:R.postmountDisplay)??null,loopDisplay:void 0,documentationLink:d?"https://www.remotion.dev/docs/offthreadvideo":"https://www.remotion.dev/docs/html5-video",refForOutline:r}),T0({mediaRef:r,src:p,mediaType:"video",playbackRate:e.playbackRate??1,preservePitch:u,onlyWarnForMediaSeekingError:d,acceptableTimeshift:w??null,isPremounting:!!(R!=null&&R.premounting),isPostmounting:!!(R!=null&&R.postmounting),pauseWhenBuffering:b,onAutoPlayError:I??null}),_0({id:W,isPostmounting:!!(R!=null&&R.postmounting),isPremounting:!!(R!=null&&R.premounting),mediaRef:r,mediaType:"video",onAutoPlayError:I??null}),x0({logLevel:$,mediaRef:r,volume:K,source:o,shouldUseWebAudioApi:_??!1});const oe=R?R.relativeFrom:0,ne=R?Math.min(R.durationInFrames,z):z,Z=Vr(p),ee=xk({actualSrc:Z,actualFrom:oe,duration:ne,fps:T});c.useImperativeHandle(t,()=>r.current,[]),c.useState(()=>pt({logLevel:$,message:`Mounting video with source = ${ee}, v=${gi}, user agent=${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"video",mountTime:B})),c.useEffect(()=>{const{current:le}=r;if(!le)return;const q=()=>{var de;if(le.error){if(console.error("Error occurred in video",le==null?void 0:le.error),C){const ye=new po({message:`Code ${le.error.code}: ${le.error.message}`,src:p});C(ye);return}throw new po({message:`The browser threw an error while playing the video ${p}: Code ${le.error.code} - ${(de=le==null?void 0:le.error)==null?void 0:de.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:p})}else{if(C){const ye=new po({message:`The browser threw an error while playing the video ${p}`,src:p});C(ye);return}throw new po({message:"The browser threw an error while playing the video",src:p})}};return le.addEventListener("error",q,{once:!0}),()=>{le.removeEventListener("error",q)}},[C,p]);const ae=c.useRef(m);ae.current=m,U0({ref:r,onVideoFrame:F}),c.useEffect(()=>{var de;const{current:le}=r;if(!le)return;if(le.duration){(de=ae.current)==null||de.call(ae,p,le.duration);return}const q=()=>{var ye;(ye=ae.current)==null||ye.call(ae,p,le.duration)};return le.addEventListener("loadedmetadata",q),()=>{le.removeEventListener("loadedmetadata",q)}},[p]),c.useEffect(()=>{const{current:le}=r;le&&(Ol()?le.preload="metadata":le.preload="auto")},[]);const me=c.useMemo(()=>({...x}),[x]),ge=Cf({crossOrigin:j,requestsVideoFrame:!!F,isClientSideRendering:!1});return f.jsx("video",{...O,ref:r,muted:a||D||K<=0,playsInline:!0,src:ee,loop:g,style:me,disableRemotePlayback:!0,crossOrigin:ge,controls:!1})},Nf=c.forwardRef(VC),Lf=e=>{const{startFrom:t,endAt:n,trimBefore:r,trimAfter:o,name:i,pauseWhenBuffering:s,stack:a,showInTimeline:l,...u}=e,d=Ve(),p=ls(s);if(d.isClientSideRendering)throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");const m=c.useCallback(()=>{},[]);if(typeof e.src!="string")throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);Ll({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});const{trimBeforeValue:h,trimAfterValue:w}=zl({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});if(typeof h<"u"||typeof w<"u")return f.jsx(at,{layout:"none",from:0-(h??0),showInTimeline:!1,durationInFrames:w,name:i,children:f.jsx(Lf,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0})});if(Nl(e,"Video"),d.isRendering)return f.jsx(OC,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0});const{transparent:v,toneMapped:E,onAutoPlayError:g,onVideoFrame:y,crossOrigin:x,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:k,...S}=u;return f.jsx(Nf,{_remotionInternalStack:a??null,onDuration:m,onlyWarnForMediaSeekingError:!0,pauseWhenBuffering:p,showInTimeline:l??!0,onAutoPlayError:g??void 0,onVideoFrame:y??null,crossOrigin:x,...S,_remotionInternalNativeLoopPassed:!1})},H0=({src:e,acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:n,audioStreamIndex:r,crossOrigin:o,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:a,muted:l,name:u,onAutoPlayError:d,onError:p,onVideoFrame:m,pauseWhenBuffering:h,playbackRate:w,preservePitch:v,showInTimeline:E,style:g,toneFrequency:y,toneMapped:x,transparent:b,trimAfter:k,trimBefore:S,useWebAudioApi:C,volume:I,_remotionInternalNativeLoopPassed:F,endAt:j,stack:P,startFrom:A,imageFormat:V,..._})=>{if(V)throw new TypeError("The `<OffthreadVideo>` tag does no longer accept `imageFormat`. Use the `transparent` prop if you want to render a transparent video.");return f.jsx(Lf,{acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:n??!0,audioStreamIndex:r??0,crossOrigin:o,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:a??"repeat",muted:l??!1,name:u,onAutoPlayError:d??null,onError:p,onVideoFrame:m,pauseWhenBuffering:ls(h),playbackRate:w??1,preservePitch:v,toneFrequency:y??1,showInTimeline:E??!0,src:e,stack:P,startFrom:A,_remotionInternalNativeLoopPassed:F??!1,endAt:j,style:g,toneMapped:x??!0,transparent:b??!1,trimAfter:k,trimBefore:S,useWebAudioApi:C??!1,volume:I,..._})};bt(H0);var BC="remotion_staticFilesChanged";function WC(){const e=J.useContext(No),t=J.useContext(Do),n=J.useContext(zo),r=J.useContext(Ke),o=J.useContext(os),i=J.useContext(Lr),s=J.useContext(Al),a=J.useContext(bl),l=J.useContext(Or),u=J.useContext(Vo),d=J.useContext(Il),p=J.useContext(_l),m=J.useContext(Ho),h=J.useContext(zr);return c.useMemo(()=>({compositionManagerCtx:e,timelineContext:t,setTimelineContext:n,sequenceContext:r,nonceContext:o,canUseRemotionHooksContext:i,preloadContext:s,resolveCompositionContext:a,renderAssetManagerContext:l,sequenceManagerContext:u,sequenceManagerRefContext:d,visualModePropStatusesRefContext:p,bufferManagerContext:m,logLevelContext:h}),[e,o,r,n,t,i,s,a,l,u,d,p,m,h])}var UC=e=>{const{children:t,contexts:n}=e;return f.jsx(zr.Provider,{value:n.logLevelContext,children:f.jsx(Lr.Provider,{value:n.canUseRemotionHooksContext,children:f.jsx(os.Provider,{value:n.nonceContext,children:f.jsx(Al.Provider,{value:n.preloadContext,children:f.jsx(No.Provider,{value:n.compositionManagerCtx,children:f.jsx(Il.Provider,{value:n.sequenceManagerRefContext,children:f.jsx(Vo.Provider,{value:n.sequenceManagerContext,children:f.jsx(_l.Provider,{value:n.visualModePropStatusesRefContext,children:f.jsx(Or.Provider,{value:n.renderAssetManagerContext,children:f.jsx(bl.Provider,{value:n.resolveCompositionContext,children:f.jsx(Do.Provider,{value:n.timelineContext,children:f.jsx(zo.Provider,{value:n.setTimelineContext,children:f.jsx(Ke.Provider,{value:n.sequenceContext,children:f.jsx(Ho.Provider,{value:n.bufferManagerContext,children:t})})})})})})})})})})})})})})},HC=c.createRef(),re={MaxMediaCacheSizeContext:xC,useUnsafeVideoConfig:kl,useFrameForVolumeProp:Uo,useTimelinePosition:mr,useAbsoluteTimelinePosition:Iy,evaluateVolume:Br,getAbsoluteSrc:yn,getAnimatedImageDurationInSeconds:hC,getAssetDisplayName:b0,Timeline:qc,validateMediaTrimProps:Ll,validateMediaProps:Nl,resolveTrimProps:zl,VideoForPreview:Nf,CompositionManager:No,CompositionSetters:rs,VisualModePropStatusesContext:Tl,VisualModePropStatusesRefContext:_l,VisualModeDragOverridesContext:Rl,VisualModeSettersContext:Ay,SequenceManager:Vo,SequenceManagerRefContext:Il,SequenceStackTracesUpdateContext:MC,baseSchema:An,sequenceSchema:Fo,SequenceWithoutSchema:o0,sequenceStyleSchema:Fy,sequenceVisualStyleSchema:kS,sequencePremountSchema:Py,textSchema:Cl,transformSchema:xn,premountSchema:Oo,flattenActiveSchema:Sf,getFlatSchemaWithAllKeys:Ef,RemotionRootContexts:TC,CompositionManagerProvider:gC,useVideo:El,getRoot:SC,useMediaVolumeState:Pf,usePlayerMutedState:Ff,useMediaInTimeline:Tf,useLazyComponent:gy,truthy:Lo,SequenceContext:Ke,PremountContext:Ly,usePremounting:us,useRemotionContexts:WC,RemotionContextProvider:UC,CSSUtils:O0,setupEnvVariables:$C,MediaVolumeContext:_f,SetMediaVolumeContext:Rf,getRemotionEnvironment:mn,SharedAudioContext:Wo,SharedAudioContextProvider:v0,SharedAudioTagsContext:Dl,SharedAudioTagsContextProvider:y0,invalidCompositionErrorMessage:pS,invalidFolderNameErrorMessage:Nb,calculateMediaDuration:jl,isCompositionIdValid:yy,isFolderNameValid:ly,getPreviewDomElement:wC,compositionsRef:D0,portalNode:Xc,waitForRoot:EC,SetTimelineContext:zo,CanUseRemotionHooksProvider:Hc,CanUseRemotionHooks:Lr,PrefetchProvider:m0,DurationsContextProvider:g0,IsPlayerContextProvider:Ob,useIsPlayer:lf,EditorPropsProvider:fy,EditorPropsContext:uf,usePreload:Vr,NonceContext:os,resolveVideoConfig:W0,resolveVideoConfigOrCatch:FC,resolveVideoConfigWithMetadataOrCatch:PC,ResolveCompositionContext:bl,useResolvedVideoConfig:cf,resolveCompositionsRef:Gb,REMOTION_STUDIO_CONTAINER_ELEMENT:V0,RenderAssetManager:Or,persistCurrentFrame:by,usePlaybackRate:hf,useTimelineContext:pr,useTimelineSetFrame:Ty,isIosSafari:Ol,WATCH_REMOTION_STATIC_FILES:BC,addSequenceStackTraces:bt,useMediaStartsAt:Mr,BufferingProvider:E0,BufferingContextReact:Ho,getComponentsToAddStacksTo:vS,getSequenceComponent:wS,getSingleChildComponent:xS,CurrentScaleContext:AC,PixelDensityContext:zC,PreviewSizeContext:NC,calculateScale:LC,validateRenderAsset:f0,Log:et,LogLevelContext:zr,useLogLevel:wn,playbackLogging:pt,timeValueRef:Xb,compositionSelectorRef:HC,RemotionEnvironmentContext:py,warnAboutTooHighVolume:Zo,AudioForPreview:R0,OBJECTFIT_CONTAIN_CLASS_NAME:Xi,InnerOffthreadVideo:Lf,useBasicMediaInTimeline:S0,getInputPropsOverride:dy,setInputPropsOverride:Zb,useVideoEnabled:kC,useAudioEnabled:CC,useIsPlayerBuffering:k0,TimelinePosition:qc,DelayRenderContextType:hy,TimelineContext:Do,PlaybackRateContext:ff,AbsoluteTimeContext:pf,RenderAssetManagerProvider:rk,getEffectiveVisualModeValue:Gy,CompositionRenderErrorContext:sy,useEffectChainState:ms,createEffectChainState:l0,cleanupEffectChainState:Jc,runEffectChain:ps,useMemoizedEffects:fs,useMemoizedEffectDefinitions:ds,createEffect:ek,createWebGLContextError:zE,createWebGL2ContextError:a0,computeEffectiveSchemaValuesDotNotation:t0,interpolateKeyframedStatus:cs,makeStaticDragOverride:CE,makeKeyframedDragOverride:IE,resolveDragOverrideValue:Fl,getStaticDragOverrideValue:TE,OverrideIdsToNodePathsGettersContext:bf,OverrideIdsToNodePathsSettersContext:bE,findPropsToDelete:Jy,makeSequencePropsSubscriptionKey:Cn,getPropStatusesCtx:Qy,getEffectPropStatusesCtx:qy,hiddenField:gf,durationInFramesField:yf,freezeField:wf,fromField:jy},Z0=e=>J.Children.toArray(e).reduce((n,r)=>r.type===J.Fragment?n.concat(Z0(r.props.children)):(n.push(r),n),[]),ZC={durationInFrames:On.baseSchema.durationInFrames,name:On.sequenceSchema.name,hidden:On.sequenceSchema.hidden,showInTimeline:On.sequenceSchema.showInTimeline,freeze:On.baseSchema.freeze,trimBefore:On.sequenceSchema.trimBefore,layout:On.sequenceSchema.layout},YC=c.forwardRef(({offset:e=0,className:t="",stack:n=null,_remotionInternalRender:r=null,...o},i)=>(FS(),r?r({...o,offset:e,className:t||void 0,stack:n},i):f.jsx(Ny,{children:o.children}))),Y0=On.withSchema({Component:YC,componentName:"<Series.Sequence>",componentIdentity:"dev.remotion.remotion.Series.Sequence",schema:ZC,supportsEffects:!1}),KC=o0,Om=({durationInFrames:e,offset:t,index:n,childrenLength:r})=>{const o=`index = ${n}, duration = ${e}`;(n!==r-1||e!==1/0)&&wl(e,{component:"of a <Series.Sequence /> component",allowFloats:!0});const i=t??0;if(Number.isNaN(i))throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${o}).`);if(!Number.isFinite(i))throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${i} (${o}).`);if(i%1!==0)throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${i} (${o}).`);return i},XC=e=>{const t=c.useMemo(()=>{const n=Z0(e.children),r=(o,i)=>{if(o===n.length)return null;const a=n[o];if(typeof a=="string"){if(a.trim()==="")return r(o+1,i);throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${a}"`)}if(a.type!==Y0)throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${a} instead`);const l=a;return Om({durationInFrames:l.props.durationInFrames,offset:l.props.offset,index:o,childrenLength:n.length}),J.cloneElement(l,{_remotionInternalRender:(u,d)=>{const p=u.durationInFrames,{durationInFrames:m,children:h,offset:w,controls:v,stack:E,from:g,name:y,...x}=u,b=Om({durationInFrames:p,offset:w,index:o,childrenLength:n.length}),k=i+b,S=i+p+b;return f.jsxs(f.Fragment,{children:[f.jsx(KC,{ref:d,name:y||"<Series.Sequence>",_remotionInternalDocumentationLink:y?void 0:"https://www.remotion.dev/docs/series",_remotionInternalStack:E??void 0,controls:v??void 0,from:k,durationInFrames:p,...x,children:f.jsx(Ny,{children:h})}),r(o+1,S)]})}})};return r(0,0)},[e.children]);return f.jsx(PS,{children:f.jsx(at,{layout:"none",name:"<Series>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/series",...e,children:t})})},GC=Object.assign(Nn({Component:XC,componentName:"<Series>",componentIdentity:"dev.remotion.remotion.Series",schema:_S,supportsEffects:!1}),{Sequence:Y0});bt(GC);var qC={"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";"},Vm={},QC=e=>{Vm[e]||(console.warn(e),Vm[e]=!0)},JC=e=>{for(const t of Object.keys(qC))if(e.includes(t))return{containsHex:!0,hexCode:t};return{containsHex:!1}},rd=e=>e.startsWith("/")?rd(e.substring(1)):e,e2=e=>{if(typeof window<"u"&&window.remotion_staticBase){if(e.startsWith(window.remotion_staticBase))throw new Error(`The value "${e}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);return`${window.remotion_staticBase}/${rd(e)}`}return`/${rd(e)}`},t2=e=>e.split("/").map(o=>encodeURIComponent(o)).join("/"),K0=e=>{if(e===null)throw new TypeError("null was passed to staticFile()");if(typeof e>"u")throw new TypeError("undefined was passed to staticFile()");if(e.startsWith("http://")||e.startsWith("https://"))throw new TypeError(`staticFile() does not support remote URLs - got "${e}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);if(e.startsWith("..")||e.startsWith("./"))throw new TypeError(`staticFile() does not support relative paths - got "${e}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(e.startsWith("/Users")||e.startsWith("/home")||e.startsWith("/tmp")||e.startsWith("/etc")||e.startsWith("/opt")||e.startsWith("/var")||e.startsWith("C:")||e.startsWith("D:")||e.startsWith("E:"))throw new TypeError(`staticFile() does not support absolute paths - got "${e}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(e.startsWith("public/"))throw new TypeError(`Do not include the public/ prefix when using staticFile() - got "${e}". See: https://remotion.dev/docs/staticfile-relative-paths`);const t=JC(e);t.containsHex&&QC(`WARNING: You seem to pass an already encoded path (path contains ${t.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);const n=t2(e),r=e2(n);return r.startsWith("/")?r:`/${r}`},n2=e=>{const t={...e,durationInFrames:1,fps:1};return J.createElement(Ua,t)};bt(n2);var Bm=e=>Math.round(e*1e5)/1e5,$u=({element:e,desiredTime:t,logLevel:n,mountTime:r})=>{if(Ka(e.currentTime,t))return{wait:Promise.resolve(t),cancel:()=>{}};ga({logLevel:n,mediaRef:e,time:t,why:"Seeking during rendering",mountTime:r});let o,i=null;const s=new Promise(l=>{o=e.requestVideoFrameCallback((u,d)=>{const p=d.expectedDisplayTime-u;if(p<=0){l(d.mediaTime);return}setTimeout(()=>{l(d.mediaTime)},p+150)})}),a=new Promise(l=>{const u=()=>{l()};e.addEventListener("seeked",u,{once:!0}),i=()=>{e.removeEventListener("seeked",u)}});return{wait:Promise.all([s,a]).then(([l])=>l),cancel:()=>{i==null||i(),e.cancelVideoFrameCallback(o)}}},r2=({element:e,desiredTime:t,fps:n,logLevel:r,mountTime:o})=>{const i=1/n/2;let s=()=>{};return Number.isFinite(e.duration)&&e.currentTime>=e.duration&&t>=e.duration?{prom:Promise.resolve(),cancel:()=>{}}:{prom:new Promise((l,u)=>{const d=$u({element:e,desiredTime:t+i,logLevel:r,mountTime:o});d.wait.then(p=>{if(Math.abs(t-p)<=i)return l();const h=t>p?1:-1,w=$u({element:e,desiredTime:p+i*h,logLevel:r,mountTime:o});s=w.cancel,w.wait.then(v=>{const E=Math.abs(t-v);if(Bm(E)<=Bm(i))return l();const g=$u({element:e,desiredTime:t+i,logLevel:r,mountTime:o});return s=g.cancel,g.wait.then(()=>{l()}).catch(y=>{u(y)})}).catch(v=>{u(v)})}),s=d.cancel}),cancel:()=>{s()}}},o2=({onError:e,volume:t,allowAmplificationDuringRender:n,playbackRate:r,onDuration:o,toneFrequency:i,name:s,acceptableTimeShiftInSeconds:a,delayRenderRetries:l,delayRenderTimeoutInMilliseconds:u,loopVolumeCurveBehavior:d,audioStreamIndex:p,onVideoFrame:m,preservePitch:h,...w},v)=>{const E=mr(),g=ht(),y=Uo(d??"repeat"),x=kl(),b=c.useRef(null),k=c.useContext(Ke),S=Mr(),C=Ve(),I=wn(),F=ss(),{delayRender:j,continueRender:P}=ln(),{registerRenderAsset:A,unregisterRenderAsset:V}=c.useContext(Or),_=c.useMemo(()=>`video-${Dr(w.src??"")}-${k==null?void 0:k.cumulatedFrom}-${k==null?void 0:k.relativeFrom}-${k==null?void 0:k.durationInFrames}`,[w.src,k==null?void 0:k.cumulatedFrom,k==null?void 0:k.relativeFrom,k==null?void 0:k.durationInFrames]);if(!x)throw new Error("No video config found");const L=Br({volume:t,frame:y,mediaVolume:1});Zo(L),c.useEffect(()=>{if(!w.src)throw new Error("No src passed");if(!w.muted&&!(L<=0)&&window.remotion_audioEnabled)return A({type:"video",src:yn(w.src),id:_,frame:E,volume:L,mediaFrame:g,playbackRate:r??1,toneFrequency:i??1,audioStartFrame:Math.max(0,-((k==null?void 0:k.cumulatedNegativeFrom)??0)),audioStreamIndex:p??0}),()=>V(_)},[w.muted,w.src,A,_,V,L,g,E,r,i,k==null?void 0:k.cumulatedNegativeFrom,p]),c.useImperativeHandle(v,()=>b.current,[]),U0({ref:b,onVideoFrame:m}),c.useEffect(()=>{var W,M;if(!window.remotion_videoEnabled)return;const{current:N}=b;if(!N)return;const T=I0({frame:g,playbackRate:r||1,startFrom:-S,fps:x.fps}),z=j(`Rendering <Html5Video /> with src="${w.src}" at time ${T}`,{retries:l??void 0,timeoutInMilliseconds:u??void 0});if(((M=(W=window.process)==null?void 0:W.env)==null?void 0:M.NODE_ENV)==="test"){P(z);return}if(Ka(N.currentTime,T)){if(N.readyState>=2){P(z);return}const D=()=>{P(z)};return N.addEventListener("loadeddata",D,{once:!0}),()=>{N.removeEventListener("loadeddata",D)}}const R=()=>{P(z)},$=r2({element:N,desiredTime:T,fps:x.fps,logLevel:I,mountTime:F});$.prom.then(()=>{P(z)}),N.addEventListener("ended",R,{once:!0});const B=()=>{var D;if(N!=null&&N.error){if(console.error("Error occurred in video",N==null?void 0:N.error),e)return;throw new po({message:`The browser threw an error while playing the video ${w.src}: Code ${N.error.code} - ${(D=N==null?void 0:N.error)==null?void 0:D.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:w.src})}else throw new po({message:"The browser threw an error",src:w.src})};return N.addEventListener("error",B,{once:!0}),()=>{$.cancel(),N.removeEventListener("ended",R),N.removeEventListener("error",B),P(z)}},[y,w.src,r,x.fps,g,S,e,l,u,I,F,P,j]);const{src:O}=w;return C.isRendering&&c.useLayoutEffect(()=>{var R,$;if((($=(R=window.process)==null?void 0:R.env)==null?void 0:$.NODE_ENV)==="test")return;const N=j("Loading <Html5Video> duration with src="+O,{retries:l??void 0,timeoutInMilliseconds:u??void 0}),{current:T}=b,z=()=>{T!=null&&T.duration&&o(O,T.duration),P(N)};return T!=null&&T.duration?(o(O,T.duration),P(N)):T==null||T.addEventListener("loadedmetadata",z,{once:!0}),()=>{T==null||T.removeEventListener("loadedmetadata",z),P(N)}},[O,o,l,u,P,j]),f.jsx("video",{ref:b,disableRemotePlayback:!0,...w})},i2=c.forwardRef(o2),s2=(e,t)=>{const{startFrom:n,endAt:r,trimBefore:o,trimAfter:i,name:s,pauseWhenBuffering:a,stack:l,_remotionInternalNativeLoopPassed:u,showInTimeline:d,onAutoPlayError:p,onVideoFrame:m,...h}=e,{loop:w,...v}=e,{fps:E}=Xe(),g=Ve(),y=ls(a);if(g.isClientSideRendering)throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");const{durations:x,setDurations:b}=c.useContext(kf);if(typeof t=="string")throw new Error("string refs are not supported");if(typeof e.src!="string")throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const k=Vr(e.src),S=c.useCallback((j,P)=>{b({type:"got-duration",durationInSeconds:P,src:j})},[b]),C=x[yn(k)]??x[yn(e.src)];Ll({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});const{trimBeforeValue:I,trimAfterValue:F}=zl({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});if(w&&C!==void 0){if(!Number.isFinite(C))return f.jsx(ya,{...v,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0});const j=C*E;return f.jsx($l,{durationInFrames:jl({trimAfter:F,mediaDurationInFrames:j,playbackRate:e.playbackRate??1,trimBefore:I}),layout:"none",name:s,showInTimeline:!1,children:f.jsx(ya,{...v,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0})})}return typeof I<"u"||typeof F<"u"?f.jsx(at,{layout:"none",from:0-(I??0),showInTimeline:!1,durationInFrames:F===void 0?void 0:F/(e.playbackRate??1),name:s,children:f.jsx(ya,{pauseWhenBuffering:y,onVideoFrame:m,...h,ref:t,stack:l})}):(Nl({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Video"),g.isRendering?f.jsx(i2,{onDuration:S,onVideoFrame:m??null,...h,ref:t}):f.jsx(Nf,{onlyWarnForMediaSeekingError:!1,...h,ref:t,onVideoFrame:m??null,pauseWhenBuffering:y,onDuration:S,_remotionInternalStack:l??null,_remotionInternalNativeLoopPassed:u??!1,showInTimeline:d??!0,onAutoPlayError:p??void 0}))},ya=c.forwardRef(s2);bt(ya);bS();var a2={},l2=new Proxy(a2,{get(e,t){return t==="Bundling"||t==="Rendering"||t==="Log"||t==="Puppeteer"||t==="Output"?l2:()=>{console.warn("⚠️ The CLI configuration has been extracted from Remotion Core."),console.warn("Update the import from the config file:"),console.warn(),console.warn("- Delete:"),console.warn('import {Config} from "remotion";'),console.warn("+ Replace:"),console.warn('import {Config} from "@remotion/cli/config";'),console.warn(),console.warn("For more information, see https://www.remotion.dev/docs/4-0-migration."),process.exit(1)}}});at.displayName="Sequence";bt(at);yS(at);bt(Ua);bt(Lb);typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var u2={"style.transformOrigin":{type:"transform-origin",step:1,default:"50% 50%",description:"Transform origin"},"style.translate":{type:"translate",step:1,default:"0px 0px",description:"Offset"},"style.scale":{type:"scale",max:100,step:.01,default:1,description:"Scale",defaultKeyframeOutput:"perceptual-scale"},"style.rotate":{type:"rotation-css",step:1,default:"0deg",description:"Rotation"},"style.opacity":{type:"number",min:0,max:1,step:.01,default:1,description:"Opacity",hiddenFromList:!1}},c2={"style.borderWidth":{type:"number",default:void 0,min:0,step:1,description:"Border width",hiddenFromList:!1},"style.borderStyle":{type:"enum",default:"none",description:"Border style",variants:{none:{},hidden:{},solid:{},dashed:{},dotted:{},double:{},groove:{},ridge:{},inset:{},outset:{}}},"style.borderColor":{type:"color",default:void 0,description:"Border color"}},d2={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},f2={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1,keyframable:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0,keyframable:!1}},p2={...f2},m2={...u2,...d2,...c2,...p2},h2={layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":m2,none:{}}}};({...h2.layout});var g2=(e,t,n)=>{if(e){if(typeof e!="object")throw new Error(`"${t}" must be an object, but you passed a value of type ${typeof e}`);if(Array.isArray(e))throw new Error(`"${t}" must be an object, an array was passed ${n?`for composition "${n}"`:""}`)}};function v2(e,t,n){if(typeof e!="number")throw new Error(`The "${t}" prop ${n} must be a number, but you passed a value of type ${typeof e}`);if(isNaN(e))throw new TypeError(`The "${t}" prop ${n} must not be NaN, but is NaN.`);if(!Number.isFinite(e))throw new TypeError(`The "${t}" prop ${n} must be finite, but is ${e}.`);if(e%1!==0)throw new TypeError(`The "${t}" prop ${n} must be an integer, but is ${e}.`);if(e<=0)throw new TypeError(`The "${t}" prop ${n} must be positive, but got ${e}.`)}function y2(e,t){const{allowFloats:n,component:r}=t;if(typeof e>"u")throw new Error(`The "durationInFrames" prop ${r} is missing.`);if(typeof e!="number")throw new Error(`The "durationInFrames" prop ${r} must be a number, but you passed a value of type ${typeof e}`);if(e<=0)throw new TypeError(`The "durationInFrames" prop ${r} must be positive, but got ${e}.`);if(!n&&e%1!==0)throw new TypeError(`The "durationInFrames" prop ${r} must be an integer, but got ${e}.`);if(!Number.isFinite(e))throw new TypeError(`The "durationInFrames" prop ${r} must be finite, but got ${e}.`)}function w2(e,t,n){if(typeof e!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof e} ${t}`);if(!Number.isFinite(e))throw new Error(`"fps" must be a finite, but you passed ${e} ${t}`);if(isNaN(e))throw new Error(`"fps" must not be NaN, but got ${e} ${t}`);if(e<=0)throw new TypeError(`"fps" must be positive, but got ${e} ${t}`);if(n&&e>50)throw new TypeError("The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif")}var Bl={validateFps:w2,validateDimension:v2,validateDurationInFrames:y2,validateDefaultAndInputProps:g2};if(typeof c.createContext!="function"){const e=['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 {Player} from "@remotion/player";',"","After:",' "use client";',' import {Player} from "@remotion/player";'];throw new Error(e.join(`
80
+ `))}var it=25,od=16,x2=()=>f.jsx("svg",{width:it,height:it,viewBox:"0 0 25 25",fill:"none",children:f.jsx("path",{d:"M8 6.375C7.40904 8.17576 7.06921 10.2486 7.01438 12.3871C6.95955 14.5255 7.19163 16.6547 7.6875 18.5625C9.95364 18.2995 12.116 17.6164 14.009 16.5655C15.902 15.5147 17.4755 14.124 18.6088 12.5C17.5158 10.8949 15.9949 9.51103 14.1585 8.45082C12.3222 7.3906 10.2174 6.68116 8 6.375Z",fill:"white",stroke:"white",strokeWidth:"6.25",strokeLinejoin:"round"})}),b2=()=>f.jsxs("svg",{viewBox:"0 0 100 100",width:it,height:it,children:[f.jsx("rect",{x:"25",y:"20",width:"20",height:"60",fill:"#fff",ry:"5",rx:"5"}),f.jsx("rect",{x:"55",y:"20",width:"20",height:"60",fill:"#fff",ry:"5",rx:"5"})]}),S2=({isFullscreen:e})=>{const r=e?0:3,o=e?6*1.6:6/2,i=e?6*1.6:6*2;return f.jsxs("svg",{viewBox:"0 0 32 32",height:od,width:od,children:[f.jsx("path",{d:`
81
+ M ${r} ${i}
82
+ L ${o} ${o}
83
+ L ${i} ${r}
84
+ `,stroke:"#fff",strokeWidth:6,fill:"none"}),f.jsx("path",{d:`
85
+ M ${32-r} ${i}
86
+ L ${32-o} ${o}
87
+ L ${32-i} ${r}
88
+ `,stroke:"#fff",strokeWidth:6,fill:"none"}),f.jsx("path",{d:`
89
+ M ${r} ${32-i}
90
+ L ${o} ${32-o}
91
+ L ${i} ${32-r}
92
+ `,stroke:"#fff",strokeWidth:6,fill:"none"}),f.jsx("path",{d:`
93
+ M ${32-r} ${32-i}
94
+ L ${32-o} ${32-o}
95
+ L ${32-i} ${32-r}
96
+ `,stroke:"#fff",strokeWidth:6,fill:"none"})]})},E2=()=>f.jsx("svg",{width:it,height:it,viewBox:"0 0 24 24",children:f.jsx("path",{d:"M3.63 3.63a.996.996 0 000 1.41L7.29 8.7 7 9H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 101.41-1.41L5.05 3.63c-.39-.39-1.02-.39-1.42 0zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85C17.18 6.54 19 9.06 19 12zm-8.71-6.29l-.17.17L12 7.76V6.41c0-.89-1.08-1.33-1.71-.7zM16.5 12A4.5 4.5 0 0014 7.97v1.79l2.48 2.48c.01-.08.02-.16.02-.24z",fill:"#fff"})}),k2=()=>f.jsx("svg",{width:it,height:it,viewBox:"0 0 24 24",children:f.jsx("path",{d:"M3 10v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71V6.41c0-.89-1.08-1.34-1.71-.71L7 9H4c-.55 0-1 .45-1 1zm13.5 2A4.5 4.5 0 0014 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 4.45v.2c0 .38.25.71.6.85C17.18 6.53 19 9.06 19 12s-1.82 5.47-4.4 6.5c-.36.14-.6.47-.6.85v.2c0 .63.63 1.07 1.21.85C18.6 19.11 21 15.84 21 12s-2.4-7.11-5.79-8.4c-.58-.23-1.21.22-1.21.85z",fill:"#fff"})}),Wm="__remotion_buffering_indicator",Um="__remotion_buffering_animation",C2={width:it,height:it,overflow:"hidden",lineHeight:"normal",fontSize:"inherit"},I2={width:14,height:14,overflow:"hidden",lineHeight:"normal",fontSize:"inherit"},T2=({type:e})=>{const t=e==="player"?C2:I2;return f.jsxs(f.Fragment,{children:[f.jsx("style",{type:"text/css",children:`
97
+ @keyframes ${Um} {
98
+ 0% {
99
+ rotate: 0deg;
100
+ }
101
+ 100% {
102
+ rotate: 360deg;
103
+ }
104
+ }
105
+
106
+ .${Wm} {
107
+ animation: ${Um} 1s linear infinite;
108
+ }
109
+ `}),f.jsx("div",{style:t,children:f.jsx("svg",{viewBox:e==="player"?"0 0 22 22":"0 0 18 18",style:t,className:Wm,children:f.jsx("path",{d:e==="player"?"M 11 4 A 7 7 0 0 1 15.1145 16.66312":"M 9 2 A 7 7 0 0 1 13.1145 14.66312",stroke:"white",strokeLinecap:"round",fill:"none",strokeWidth:3})})})]})},_2=({currentSize:e,width:t,height:n,compositionWidth:r,compositionHeight:o})=>t!==void 0&&n===void 0?{aspectRatio:[r,o].join("/")}:n!==void 0&&t===void 0?{aspectRatio:[r,o].join("/")}:e?{width:r,height:o}:{width:r,height:o},X0=({previewSize:e,compositionWidth:t,compositionHeight:n,canvasSize:r})=>{const o=re.calculateScale({canvasSize:r,compositionHeight:n,compositionWidth:t,previewSize:e}),i=0-(1-o)/2,s=i*t,a=i*n,l=t*o,u=n*o,d=r.width/2-l/2,p=r.height/2-u/2;return{centerX:d,centerY:p,xCorrection:s,yCorrection:a,scale:o}},G0=({config:e,style:t,canvasSize:n,overflowVisible:r,layout:o})=>e?{position:"relative",overflow:r?"visible":"hidden",..._2({compositionHeight:e.height,compositionWidth:e.width,currentSize:n,height:t==null?void 0:t.height,width:t==null?void 0:t.width}),opacity:o?1:0,...t}:{},q0=({config:e,layout:t,scale:n,overflowVisible:r})=>e?t?{position:"absolute",width:e.width,height:e.height,display:"flex",transform:`scale(${n})`,marginLeft:t.xCorrection,marginTop:t.yCorrection,overflow:r?"visible":"hidden"}:{position:"absolute",width:e.width,height:e.height,display:"flex",transform:`scale(${n})`,overflow:r?"visible":"hidden"}:{},Q0=({layout:e,scale:t,config:n,overflowVisible:r})=>{if(!n)return{};if(!e)return{width:n.width*t,height:n.height*t,display:"flex",flexDirection:"column",position:"absolute",overflow:r?"visible":"hidden"};const{centerX:o,centerY:i}=e;return{width:n.width*t,height:n.height*t,display:"flex",flexDirection:"column",position:"absolute",left:o,top:i,overflow:r?"visible":"hidden"}},J0=J.createContext(void 0),ew=J.createContext(void 0);class R2{constructor(){Se(this,"listeners",{ended:[],error:[],pause:[],play:[],ratechange:[],scalechange:[],seeked:[],timeupdate:[],frameupdate:[],fullscreenchange:[],volumechange:[],mutechange:[],waiting:[],resume:[]});Se(this,"dispatchSeek",t=>{this.dispatchEvent("seeked",{frame:t})});Se(this,"dispatchVolumeChange",t=>{this.dispatchEvent("volumechange",{volume:t})});Se(this,"dispatchPause",()=>{this.dispatchEvent("pause",void 0)});Se(this,"dispatchPlay",()=>{this.dispatchEvent("play",void 0)});Se(this,"dispatchEnded",()=>{this.dispatchEvent("ended",void 0)});Se(this,"dispatchRateChange",t=>{this.dispatchEvent("ratechange",{playbackRate:t})});Se(this,"dispatchScaleChange",t=>{this.dispatchEvent("scalechange",{scale:t})});Se(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Se(this,"dispatchTimeUpdate",t=>{this.dispatchEvent("timeupdate",t)});Se(this,"dispatchFrameUpdate",t=>{this.dispatchEvent("frameupdate",t)});Se(this,"dispatchFullscreenChange",t=>{this.dispatchEvent("fullscreenchange",t)});Se(this,"dispatchMuteChange",t=>{this.dispatchEvent("mutechange",t)});Se(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Se(this,"dispatchResume",t=>{this.dispatchEvent("resume",t)})}addEventListener(t,n){this.listeners[t].push(n)}removeEventListener(t,n){this.listeners[t]=this.listeners[t].filter(r=>r!==n)}dispatchEvent(t,n){this.listeners[t].forEach(r=>{r({detail:n})})}}class P2{constructor(){Se(this,"listeners",{error:[],waiting:[],resume:[]});Se(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Se(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Se(this,"dispatchResume",t=>{this.dispatchEvent("resume",t)})}addEventListener(t,n){this.listeners[t].push(n)}removeEventListener(t,n){this.listeners[t]=this.listeners[t].filter(r=>r!==n)}dispatchEvent(t,n){this.listeners[t].forEach(r=>{r({detail:n})})}}var tw=e=>{const t=c.useContext(re.BufferingContextReact);if(!t)throw new Error("BufferingContextReact not found");c.useLayoutEffect(()=>{const n=t.listenForBuffering(()=>{t.buffering.current=!0,e.dispatchWaiting({})}),r=t.listenForResume(()=>{t.buffering.current=!1,e.dispatchResume({})});return()=>{n.remove(),r.remove()}},[t,e])},F2=({children:e,currentPlaybackRate:t})=>{const[n]=c.useState(()=>new R2);if(!c.useContext(re.BufferingContextReact))throw new Error("BufferingContextReact not found");return c.useEffect(()=>{t&&n.dispatchRateChange(t)},[n,t]),tw(n),f.jsx(J0.Provider,{value:n,children:e})},zf=(e,t)=>{const[n,r]=c.useState(!1);return c.useEffect(()=>{const{current:o}=e;if(!o)return;let i;const s=()=>{t&&(clearTimeout(i),i=setTimeout(()=>{r(!1)},t===!0?3e3:t))},a=()=>{r(!0),s()},l=()=>{r(!1),clearTimeout(i)},u=()=>{r(!0),s()};return o.addEventListener("mouseenter",a),o.addEventListener("mouseleave",l),o.addEventListener("mousemove",u),()=>{o.removeEventListener("mouseenter",a),o.removeEventListener("mouseleave",l),o.removeEventListener("mousemove",u),clearTimeout(i)}},[t,e]),n},Wl=()=>{const[e,t,n]=re.Timeline.usePlayingState(),[r,o]=c.useState(!1),i=re.Timeline.useTimelinePosition(),s=c.useRef(i),a=re.Timeline.useTimelineSetFrame(),l=re.Timeline.useTimelineSetFrame(),u=c.useContext(re.SharedAudioContext),d=c.useContext(re.SharedAudioTagsContext),{audioAndVideoTags:p}=re.useTimelineContext(),m=c.useRef(i);m.current=i;const h=re.useVideo(),w=re.useUnsafeVideoConfig(),v=c.useContext(J0),E=((w==null?void 0:w.durationInFrames)??1)-1,g=i===E,y=i===0;if(!v)throw new TypeError("Expected Player event emitter context");const x=c.useContext(re.BufferingContextReact);if(!x)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");const{buffering:b}=x,k=c.useCallback(N=>{const T=w?re.TimelinePosition.clampFrameToCompositionRange(N,w.durationInFrames):Math.max(0,N);h!=null&&h.id&&l(z=>({...z,[h.id]:T})),m.current=T,v.dispatchSeek(T)},[w,v,l,h==null?void 0:h.id]),S=c.useCallback(N=>{n.current||(o(!0),g&&k(0),u==null||u.resume(),d&&d.numberOfAudioTags>0&&N&&d.playAllAudios(),p.current.forEach(T=>T.play("player play() was called and playing audio from a click")),n.current=!0,t(!0),s.current=m.current,v.dispatchPlay())},[n,g,u,d,t,v,k,p]),C=c.useCallback(()=>{n.current&&(n.current=!1,t(!1),v.dispatchPause(),u==null||u.suspend())},[v,n,t,u]),I=c.useCallback(()=>{n.current&&(n.current=!1,m.current=s.current,w&&(l(N=>({...N,[w.id]:s.current})),t(!1),v.dispatchPause()))},[w,v,n,t,l]),F=h==null?void 0:h.id,j=c.useCallback(N=>{if(!F)return null;n.current||a(T=>{const z=T[F]??window.remotion_initialFrame??0,R=Math.max(0,z-N);return z===R?T:{...T,[F]:R}})},[n,a,F]),P=c.useCallback(N=>{if(!F)return null;n.current||a(T=>{const z=T[F]??window.remotion_initialFrame??0,R=Math.min(E,z+N);return z===R?T:{...T,[F]:R}})},[F,n,E,a]),A=c.useCallback(N=>{n.current?C():S(N)},[n,C,S]),V=c.useCallback(()=>n.current,[n]),_=c.useCallback(()=>m.current,[m]),L=c.useCallback(()=>b.current,[b]);return c.useMemo(()=>({frameBack:j,frameForward:P,isLastFrame:g,emitter:v,playing:e,play:S,pause:C,seek:k,isFirstFrame:y,getCurrentFrame:_,isPlaying:V,isBuffering:L,pauseAndReturnToPlayStart:I,hasPlayed:r,toggle:A}),[v,j,P,r,y,g,_,C,I,S,e,k,A,V,L])},M2=({browserMediaControlsBehavior:e,videoConfig:t,playbackRate:n})=>{const{playing:r,pause:o,play:i,emitter:s,getCurrentFrame:a,seek:l}=Wl(),u=c.useRef(!1);c.useEffect(()=>{r&&(u.current=!0)},[r]),c.useEffect(()=>{navigator.mediaSession&&e.mode!=="do-nothing"&&(r?navigator.mediaSession.playbackState="playing":u.current&&(navigator.mediaSession.playbackState="paused"))},[e.mode,r]),c.useEffect(()=>{if(!navigator.mediaSession||e.mode==="do-nothing")return;const d=()=>{t&&navigator.mediaSession&&navigator.mediaSession.setPositionState({duration:t.durationInFrames/t.fps,playbackRate:n,position:a()/t.fps})};return s.addEventListener("timeupdate",d),()=>{s.removeEventListener("timeupdate",d)}},[e.mode,s,a,n,t]),c.useEffect(()=>{if(navigator.mediaSession&&e.mode!=="do-nothing")return navigator.mediaSession.setActionHandler("play",()=>{e.mode==="register-media-session"&&i()}),navigator.mediaSession.setActionHandler("pause",()=>{e.mode==="register-media-session"&&o()}),navigator.mediaSession.setActionHandler("seekto",d=>{e.mode==="register-media-session"&&d.seekTime!==void 0&&t&&l(Math.round(d.seekTime*t.fps))}),navigator.mediaSession.setActionHandler("seekbackward",()=>{e.mode==="register-media-session"&&t&&l(Math.max(0,Math.round((a()-10)*t.fps)))}),navigator.mediaSession.setActionHandler("seekforward",()=>{e.mode==="register-media-session"&&t&&l(Math.max(t.durationInFrames-1,Math.round((a()+10)*t.fps)))}),navigator.mediaSession.setActionHandler("previoustrack",()=>{e.mode==="register-media-session"&&l(0)}),()=>{navigator.mediaSession.metadata=null,navigator.mediaSession.setActionHandler("play",null),navigator.mediaSession.setActionHandler("pause",null),navigator.mediaSession.setActionHandler("seekto",null),navigator.mediaSession.setActionHandler("seekbackward",null),navigator.mediaSession.setActionHandler("seekforward",null),navigator.mediaSession.setActionHandler("previoustrack",null)}},[e.mode,a,o,i,l,t])},j2=({time:e,currentFrame:t,playbackSpeed:n,fps:r,actualLastFrame:o,actualFirstFrame:i,framesAdvanced:s,shouldLoop:a})=>{const u=(n<0?Math.ceil:Math.floor)(e*n/(1e3/r))-s,d=u+t,p=t>o||t<i,m=d>o||d<i,h=!a&&m&&!p;return n>0?m?{nextFrame:i,framesToAdvance:u,hasEnded:h}:{nextFrame:d,framesToAdvance:u,hasEnded:h}:m?{nextFrame:o,framesToAdvance:u,hasEnded:h}:{nextFrame:d,framesToAdvance:u,hasEnded:h}},Hm=()=>typeof document>"u"?!1:document.visibilityState==="hidden",$2=()=>{const e=c.useRef(Hm());return c.useEffect(()=>{const t=()=>{e.current=Hm()};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),e},A2=.1,Zm=({audioContext:e,audioSyncAnchor:t,absoluteTimeInSeconds:n,globalPlaybackRate:r,logLevel:o,force:i})=>{const s=e.currentTime-n/r,a=s-t.value,{outputLatency:l}=e,u=l===0?.3:l,d=e.baseLatency+u;return Math.abs(a)<A2+d&&!i||Math.abs(a)<Number.EPSILON?!1:(re.Log.verbose({logLevel:o,tag:"audio-scheduling"},"Anchor "+(i?"forcibly ":"")+"changed from %s to %s with shift %s",t.value,s,a),t.value=s,!0)},N2=e=>{if(e==="suspended"||e==="running-to-suspended")return!0;if(e==="closed"||e==="interrupted"||e==="running"||e==="suspended-to-running")return!1;throw new Error(`Unexpected audio context state: ${e}`)},L2=({loop:e,playbackRate:t,moveToBeginningWhenEnded:n,inFrame:r,outFrame:o,browserMediaControlsBehavior:i,getCurrentFrame:s,muted:a})=>{const l=re.useUnsafeVideoConfig(),u=re.Timeline.useTimelinePosition(),{playing:d,pause:p,emitter:m,isPlaying:h}=Wl(),w=re.Timeline.useTimelineSetFrame(),v=c.useContext(re.SharedAudioContext),E=re.useLogLevel(),g=$2(),y=c.useRef(0),x=c.useContext(re.BufferingContextReact);if(!x)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");M2({browserMediaControlsBehavior:i,playbackRate:t,videoConfig:l}),c.useLayoutEffect(()=>{if(!v||!v.audioContext||!l||a)return;Zm({audioContext:v.audioContext,audioSyncAnchor:v.audioSyncAnchor,absoluteTimeInSeconds:u/l.fps,globalPlaybackRate:t,logLevel:E,force:!1})&&v.audioSyncAnchorEmitter.dispatch("changed")},[l,u,E,t,v,a]),c.useLayoutEffect(()=>{const b=v==null?void 0:v.audioContext;if(!b||!l||a)return;const k=()=>{const S=v==null?void 0:v.getAudioContextState();S&&N2(S)&&Zm({audioContext:b,audioSyncAnchor:v.audioSyncAnchor,absoluteTimeInSeconds:s()/l.fps,globalPlaybackRate:t,logLevel:E,force:!0})};return b==null||b.addEventListener("statechange",k),()=>{b==null||b.removeEventListener("statechange",k)}},[l,s,E,a,t,v]),c.useEffect(()=>{var V;if(!l)return;if(!d){(V=v==null?void 0:v.suspend)==null||V.call(v);return}let b=!1,k=null,S=performance.now(),C=0;const I=()=>{k!==null&&(k.type==="raf"?cancelAnimationFrame(k.id):clearTimeout(k.id))},F=()=>{b=!0,I()},j=()=>{var $,B;if(b)return;if(!h()){($=v==null?void 0:v.suspend)==null||$.call(v);return}!a&&!x.buffering.current&&((B=v==null?void 0:v.resume)==null||B.call(v));const _=performance.now()-S,L=o??l.durationInFrames-1,O=r??0,N=s(),{nextFrame:T,framesToAdvance:z,hasEnded:R}=j2({time:_,currentFrame:N,playbackSpeed:t,fps:l.fps,actualFirstFrame:O,actualLastFrame:L,framesAdvanced:C,shouldLoop:e});if(C+=z,T!==s()&&(!R||n)&&!x.buffering.current&&w(W=>({...W,[l.id]:T})),R){F(),p(),m.dispatchEnded();return}P()},P=()=>{var L,O;const _=((L=v==null?void 0:v.getIsResumingAudioContext)==null?void 0:L.call(v))??null;if(_!==null&&!a){_.then(()=>{S=performance.now(),C=0,P()});return}if(x.buffering.current){a||(O=v==null?void 0:v.suspend)==null||O.call(v);const N=x.listenForResume(()=>{N.remove(),S=performance.now(),C=0,P()});return}if(g.current){k={type:"timeout",id:setTimeout(j,1e3/l.fps)};return}k={type:"raf",id:requestAnimationFrame(j)}};P();const A=()=>{document.visibilityState!=="visible"&&(I(),j())};return window.addEventListener("visibilitychange",A),()=>{window.removeEventListener("visibilitychange",A),F()}},[l,e,p,d,w,m,t,r,o,n,g,s,x,h,v,E,a]),c.useEffect(()=>{const b=performance.now(),k=b-y.current;if(k>=250){m.dispatchTimeUpdate({frame:u}),y.current=b;return}const S=setTimeout(()=>{m.dispatchTimeUpdate({frame:u}),y.current=performance.now()},250-k);return()=>clearTimeout(S)},[m,u]),c.useEffect(()=>{m.dispatchFrameUpdate({frame:u})},[m,u])},Au=[],Nu=e=>e?"current"in e?e.current:e:null,Df=(e,t)=>{const[n,r]=c.useState(()=>{const s=Nu(e);if(!s)return null;const a=s.getClientRects();return a[0]?{width:a[0].width,height:a[0].height,left:a[0].x,top:a[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}}:null}),o=c.useMemo(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const{contentRect:a,target:l}=s[0],u=l.getClientRects();if(!(u!=null&&u[0])){r(null);return}const d=a.width===0?1:u[0].width/a.width,p=a.height===0?1:u[0].height/a.height,m=t.shouldApplyCssTransforms||d===0?u[0].width:u[0].width*(1/d),h=t.shouldApplyCssTransforms||p===0?u[0].height:u[0].height*(1/p);r(w=>w&&w.width===m&&w.height===h&&w.left===u[0].x&&w.top===u[0].y&&w.windowSize.height===window.innerHeight&&w.windowSize.width===window.innerWidth?w:{width:m,height:h,left:u[0].x,top:u[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})}),[t.shouldApplyCssTransforms]),i=c.useCallback(()=>{const s=Nu(e);if(!s)return;const a=s.getClientRects();if(!a[0]){r(null);return}r(l=>l&&l.width===a[0].width&&l.height===a[0].height&&l.left===a[0].x&&l.top===a[0].y&&l.windowSize.height===window.innerHeight&&l.windowSize.width===window.innerWidth?l:{width:a[0].width,height:a[0].height,left:a[0].x,top:a[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})},[e]);return c.useEffect(()=>{i()},[i]),c.useEffect(()=>{if(!o)return;const s=Nu(e);return s&&o.observe(s),()=>{s&&o.unobserve(s)}},[o,e]),c.useEffect(()=>{if(t.triggerOnWindowResize)return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[t.triggerOnWindowResize,i]),c.useEffect(()=>(Au.push(i),()=>{Au=Au.filter(s=>s!==i)}),[i]),c.useMemo(()=>n?{...n,refresh:i}:null,[n,i])},Of=e=>e??"__remotion-player",z2={display:"flex",justifyContent:"center",alignItems:"center",flex:1,height:"100%",width:"100%"};class nw extends J.Component{constructor(){super(...arguments);Se(this,"state",{hasError:null})}static getDerivedStateFromError(n){return{hasError:n}}componentDidCatch(n){this.props.onError(n)}render(){return this.state.hasError?f.jsx("div",{style:z2,children:this.props.errorFallback({error:this.state.hasError})}):this.props.children}}var D2=async()=>{if(typeof window>"u"||typeof window.crypto>"u"||typeof window.crypto.subtle>"u")return null;try{const e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(window.location.hostname));return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}catch{return null}},Lu={backgroundColor:"red",position:"absolute",padding:12,fontFamily:"Arial"},O2=["28d262b44cc61fa750f1686b16ad0604dabfe193fbc263eec05c89b7ad4c2cd6","4db1b0a94be33165dfefcb3ba03d04c7a2666dd27c496d3dc9fa41858e94925e","fbc48530bbf245da790f63675e84e06bab38c3b114fab07eb350025119922bdc","7baf10a8932757b1b3a22b3fce10a048747ac2f8eaf638603487e3705b07eb83","8a6c21a598d8c667272b5207c051b85997bf5b45d5fb712378be3f27cd72c6a6","a2f7aaac9c50a9255e7fc376110c4e0bfe153722dc66ed3c5d3bf2a135f65518"],Ym=!1,V2=()=>{const[e,t]=J.useState(!1);return c.useEffect(()=>{Ym||(Ym=!0,D2().then(n=>{n&&O2.includes(n)&&t(!0)}).catch(()=>{}))},[]),c.useEffect(()=>{if(!e)return;const n=()=>{if(!document.querySelector(".warning-banner")){const i=document.createElement("div");i.className="warning-banner",Object.assign(i.style,Lu,{zIndex:"9999",cssText:`${Lu.cssText} !important;`}),i.innerHTML=`
110
+ <a href="https://github.com/remotion-dev/remotion/pull/4589" style="color: white;">
111
+ Remotion Unlicensed – Contact hi@remotion.dev
112
+ </a>
113
+ `,document.body.appendChild(i)}},r=new MutationObserver(()=>n());return r.observe(document.body,{childList:!0,subtree:!0}),()=>{r.disconnect()}},[e]),e?f.jsx("div",{style:Lu,className:"warning-banner",children:f.jsx("a",{style:{color:"white"},href:"https://github.com/remotion-dev/remotion/pull/4589",children:"Remotion Unlicensed – Contact hi@remotion.dev"})}):null},Km=({playing:e,buffering:t})=>e&&t?f.jsx(T2,{type:"player"}):e?f.jsx(b2,{}):f.jsx(x2,{}),Xr=12,Xm=5,B2=({volume:e,isVertical:t,onBlur:n,inputRef:r,setVolume:o})=>{const i=c.useMemo(()=>{const m={paddingLeft:5,height:it,width:Sr,display:"inline-flex",alignItems:"center"};return t?{...m,position:"absolute",transform:`rotate(-90deg) translateX(${Sr/2+it/2}px)`}:{...m}},[t]),s=typeof J.useId>"u"?"volume-slider":J.useId(),[a]=c.useState(()=>`__remotion-volume-slider-${Dr(s)}`.replace(".","")),l=c.useCallback(p=>{o(parseFloat(p.target.value))},[o]),u=c.useMemo(()=>{const p={WebkitAppearance:"none",backgroundColor:"rgba(255, 255, 255, 0.5)",borderRadius:Xm/2,cursor:"pointer",height:Xm,width:Sr,backgroundImage:`linear-gradient(
114
+ to right,
115
+ white ${e*100}%, rgba(255, 255, 255, 0) ${e*100}%
116
+ )`};return t?{...p,bottom:it+Sr/2}:p},[t,e]),d=`
117
+ .${a}::-webkit-slider-thumb {
118
+ -webkit-appearance: none;
119
+ background-color: white;
120
+ border-radius: ${Xr/2}px;
121
+ box-shadow: 0 0 2px black;
122
+ height: ${Xr}px;
123
+ width: ${Xr}px;
124
+ }
125
+
126
+ .${a}::-moz-range-thumb {
127
+ -webkit-appearance: none;
128
+ background-color: white;
129
+ border-radius: ${Xr/2}px;
130
+ box-shadow: 0 0 2px black;
131
+ height: ${Xr}px;
132
+ width: ${Xr}px;
133
+ }
134
+ `;return f.jsxs("div",{style:i,children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:d}}),f.jsx("input",{ref:r,"aria-label":"Change volume",className:a,max:1,min:0,onBlur:n,onChange:l,step:.01,type:"range",value:e,style:u})]})},W2=e=>f.jsx(B2,{...e}),Sr=100,U2=({displayVerticalVolumeSlider:e,renderMuteButton:t,renderVolumeSlider:n})=>{const[r,o]=re.usePlayerMutedState(),[i,s]=re.useMediaVolumeState(),[a,l]=c.useState(!1),u=c.useRef(null),d=c.useRef(null),p=zf(u,!1),m=c.useCallback(()=>{setTimeout(()=>{d.current&&document.activeElement!==d.current&&l(!1)},10)},[]),h=i===0,w=c.useCallback(()=>{if(h){s(1),o(!1);return}o(b=>!b)},[h,o,s]),v=c.useMemo(()=>({display:"inline-flex",background:"none",border:"none",justifyContent:"center",alignItems:"center",touchAction:"none",...e&&{position:"relative"}}),[e]),E=c.useMemo(()=>({display:"inline",width:it,height:it,cursor:"pointer",appearance:"none",background:"none",border:"none",padding:0}),[]),g=c.useCallback(({muted:b,volume:k})=>{const S=b||k===0;return f.jsx("button",{"aria-label":S?"Unmute sound":"Mute sound",title:S?"Unmute sound":"Mute sound",onClick:w,onBlur:m,onFocus:()=>l(!0),style:E,type:"button",children:S?f.jsx(E2,{}):f.jsx(k2,{})})},[m,w,E]),y=c.useMemo(()=>t?t({muted:r,volume:i}):g({muted:r,volume:i}),[r,i,g,t]),x=c.useMemo(()=>(a||p)&&!r&&!re.isIosSafari()?(n??W2)({isVertical:e,volume:i,onBlur:()=>l(!1),inputRef:d,setVolume:s}):null,[e,a,p,r,i,n,s]);return f.jsxs("div",{ref:u,style:v,children:[y,x]})};function H2(e){const[t,n]=c.useState(e),r=c.useRef(null);return c.useEffect(()=>{const o=i=>{r.current&&!r.current.contains(i.target)&&n(!1)};return document.addEventListener("pointerup",o,!0),()=>{document.removeEventListener("pointerup",o,!0)}},[]),{ref:r,isComponentVisible:t,setIsComponentVisible:n}}var Z2=35,Y2=70,K2={height:30,paddingRight:15,paddingLeft:12,display:"flex",flexDirection:"row",alignItems:"center"},X2={width:22,display:"flex",alignItems:"center"},G2={width:14,height:14,color:"black"},q2=()=>f.jsx("svg",{viewBox:"0 0 512 512",style:G2,children:f.jsx("path",{fill:"currentColor",d:"M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"})}),Q2=e=>{const t=e.toString();return t.includes(".")?t:t+".0"},J2=({rate:e,onSelect:t,selectedRate:n,keyboardSelectedRate:r})=>{const o=c.useCallback(p=>{p.stopPropagation(),p.preventDefault(),t(e)},[t,e]),[i,s]=c.useState(!1),a=c.useCallback(()=>{s(!0)},[]),l=c.useCallback(()=>{s(!1)},[]),u=r===e,d=c.useMemo(()=>({...K2,backgroundColor:i||u?"#eee":"transparent"}),[i,u]);return f.jsxs("div",{onPointerEnter:a,onPointerLeave:l,tabIndex:0,style:d,onClick:o,children:[f.jsx("div",{style:X2,children:e===n?f.jsx(q2,{}):null}),Q2(e),"x"]},e)},eI=({setIsComponentVisible:e,playbackRates:t,canvasSize:n})=>{const{setPlaybackRate:r,playbackRate:o}=re.usePlaybackRate(),[i,s]=c.useState(o);c.useEffect(()=>{const u=d=>{if(d.preventDefault(),d.key==="ArrowUp"){const p=t.findIndex(m=>m===i);if(p===0)return;s(p===-1?t[0]:t[p-1])}else if(d.key==="ArrowDown"){const p=t.findIndex(m=>m===i);if(p===t.length-1)return;s(p===-1?t[t.length-1]:t[p+1])}else d.key==="Enter"&&(r(i),e(!1))};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[t,i,r,e]);const a=c.useCallback(u=>{r(u),e(!1)},[e,r]),l=c.useMemo(()=>({position:"absolute",right:0,width:125,maxHeight:n.height-Y2-Z2,bottom:35,background:"#fff",borderRadius:4,overflow:"auto",color:"black",textAlign:"left"}),[n.height]);return f.jsx("div",{style:l,children:t.map(u=>f.jsx(J2,{selectedRate:o,onSelect:a,rate:u,keyboardSelectedRate:i},u))})},tI={fontSize:13,fontWeight:"bold",color:"white",border:"2px solid white",borderRadius:20,paddingLeft:8,paddingRight:8,paddingTop:2,paddingBottom:2},id={appearance:"none",backgroundColor:"transparent",border:"none",cursor:"pointer",paddingLeft:0,paddingRight:0,paddingTop:6,paddingBottom:6,height:37,display:"inline-flex",marginBottom:0,marginTop:0,alignItems:"center"},nI={...id,position:"relative"},rI=({playbackRates:e,canvasSize:t})=>{const{ref:n,isComponentVisible:r,setIsComponentVisible:o}=H2(!1),{playbackRate:i}=re.usePlaybackRate(),s=c.useCallback(a=>{a.stopPropagation(),a.preventDefault(),o(l=>!l)},[o]);return f.jsx("div",{ref:n,children:f.jsxs("button",{type:"button","aria-label":"Change playback rate",style:nI,onClick:s,children:[f.jsxs("div",{style:tI,children:[i,"x"]}),r&&f.jsx(eI,{canvasSize:t,playbackRates:e,setIsComponentVisible:o})]})})},Gm=(e,t,n)=>Math.round(Bo(e,[0,n],[0,t-1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})),mo=5,li=12,sd=4,oI={userSelect:"none",WebkitUserSelect:"none",paddingTop:sd,paddingBottom:sd,boxSizing:"border-box",cursor:"pointer",position:"relative",touchAction:"none"},iI={height:mo,backgroundColor:"rgba(255, 255, 255, 0.25)",width:"100%",borderRadius:mo/2},sI=e=>{let t=e;for(;t.parentElement;)t=t.parentElement;return t},aI=({durationInFrames:e,onSeekEnd:t,onSeekStart:n,inFrame:r,outFrame:o})=>{const i=c.useRef(null),s=zf(i,!1),a=Df(i,{triggerOnWindowResize:!0,shouldApplyCssTransforms:!0}),{seek:l,play:u,pause:d,playing:p}=Wl(),m=re.Timeline.useTimelinePosition(),[h,w]=c.useState({dragging:!1}),v=(a==null?void 0:a.width)??0,E=c.useCallback(S=>{var F;if(S.button!==0)return;const C=(F=i.current)==null?void 0:F.getBoundingClientRect().left,I=Gm(S.clientX-C,e,v);d(),l(I),w({dragging:!0,wasPlaying:p}),n()},[e,v,d,l,p,n]),g=c.useCallback(S=>{var F;if(!a)throw new Error("Player has no size");if(!h.dragging)return;const C=(F=i.current)==null?void 0:F.getBoundingClientRect().left,I=Gm(S.clientX-C,e,a.width);l(I)},[h.dragging,e,l,a]),y=c.useCallback(()=>{w({dragging:!1}),h.dragging&&(h.wasPlaying?u():d(),t())},[h,t,d,u]);c.useEffect(()=>{if(!h.dragging)return;const S=sI(i.current);return S.addEventListener("pointermove",g),S.addEventListener("pointerup",y),()=>{S.removeEventListener("pointermove",g),S.removeEventListener("pointerup",y)}},[h.dragging,g,y]);const x=c.useMemo(()=>({height:li,width:li,borderRadius:li/2,position:"absolute",top:sd-li/2+5/2,backgroundColor:"white",left:Math.max(0,m/Math.max(1,e-1)*v-li/2),boxShadow:"0 0 2px black",opacity:Number(s||h.dragging)}),[s,h.dragging,e,m,v]),b=c.useMemo(()=>({height:mo,backgroundColor:"rgba(255, 255, 255, 1)",width:(m-(r??0))/(e-1)*v,marginLeft:(r??0)/(e-1)*v,borderRadius:mo/2}),[e,m,r,v]),k=c.useMemo(()=>({height:mo,backgroundColor:"rgba(255, 255, 255, 0.25)",width:((o??e-1)-(r??0))/(e-1)*100+"%",marginLeft:(r??0)/(e-1)*100+"%",borderRadius:mo/2,position:"absolute"}),[e,r,o]);return f.jsxs("div",{ref:i,onPointerDown:E,style:oI,children:[f.jsxs("div",{style:iI,children:[f.jsx("div",{style:k}),f.jsx("div",{style:b})]}),f.jsx("div",{style:x})]})},qm=e=>{const t=Math.floor(e/60),n=Math.floor(e-t*60);return`${String(t)}:${String(n).padStart(2,"0")}`},lI=({durationInFrames:e,maxTimeLabelWidth:t,fps:n})=>{const r=re.Timeline.useTimelinePosition(),o=c.useMemo(()=>({color:"white",fontFamily:"sans-serif",fontSize:14,maxWidth:t===null?void 0:t,overflow:"hidden",textOverflow:"ellipsis"}),[t]),s=r===e-1?r+1:r;return f.jsxs("div",{style:o,children:[qm(s/n)," / ",qm(e/n)]})},uI=10,ad=12,cI=({allowFullscreen:e,playerWidth:t})=>c.useMemo(()=>{const r=it,o=it,i=e?od:0,s=o+r+i+ad*2+uI*2,a=t-s,l=Math.max(a,0),u=l-Sr,p=(u<Sr?l:u)+s+Sr,m=t<p;return{maxTimeLabelWidth:l===0?null:l,displayVerticalVolumeSlider:m}},[e,t]),dI=[0,.013,.049,.104,.175,.259,.352,.45,.55,.648,.741,.825,.896,.951,.987],fI=[0,8.1,15.5,22.5,29,35.3,41.2,47.1,52.9,58.8,64.7,71,77.5,84.5,91.9],pI=1/.7,mI={boxSizing:"border-box",position:"absolute",bottom:0,width:"100%",paddingTop:40,paddingBottom:10,backgroundImage:`linear-gradient(to bottom,${dI.map((e,t)=>`hsla(0, 0%, 0%, ${e}) ${fI[t]*pI}%`).join(", ")}, hsl(0, 0%, 0%) 100%)`,backgroundSize:"auto 145px",display:"flex",paddingRight:ad,paddingLeft:ad,flexDirection:"column",transition:"opacity 0.3s"},hI={display:"flex",flexDirection:"row",width:"100%",alignItems:"center",justifyContent:"center",userSelect:"none",WebkitUserSelect:"none"},gI={display:"flex",flexDirection:"row",userSelect:"none",WebkitUserSelect:"none",alignItems:"center"},ui={width:12},vI={height:8},yI={flex:1},wI={},xI=({durationInFrames:e,isFullscreen:t,fps:n,showVolumeControls:r,onFullscreenButtonClick:o,allowFullscreen:i,onExitFullscreenButtonClick:s,spaceKeyToPlayOrPause:a,onSeekEnd:l,onSeekStart:u,inFrame:d,outFrame:p,initiallyShowControls:m,canvasSize:h,renderPlayPauseButton:w,renderFullscreenButton:v,alwaysShowControls:E,showPlaybackRateControl:g,containerRef:y,buffering:x,hideControlsWhenPointerDoesntMove:b,onPointerDown:k,onDoubleClick:S,renderMuteButton:C,renderVolumeSlider:I,playing:F,toggle:j,renderCustomControls:P})=>{const A=c.useRef(null),[V,_]=c.useState(!1),L=zf(y,b),{maxTimeLabelWidth:O,displayVerticalVolumeSlider:N}=cI({allowFullscreen:i,playerWidth:(h==null?void 0:h.width)??0}),[T,z]=c.useState(()=>{if(typeof m=="boolean")return m;if(typeof m=="number"){if(m%1!==0)throw new Error("initiallyShowControls must be an integer or a boolean");if(Number.isNaN(m))throw new Error("initiallyShowControls must not be NaN");if(!Number.isFinite(m))throw new Error("initiallyShowControls must be finite");if(m<=0)throw new Error("initiallyShowControls must be a positive integer");return m}throw new TypeError("initiallyShowControls must be a number or a boolean")}),R=c.useMemo(()=>({...mI,opacity:Number(L||!F||T||E)}),[L,T,F,E]);c.useEffect(()=>{A.current&&a&&A.current.focus({preventScroll:!0})},[F,a]),c.useEffect(()=>{_((typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled))??!1)},[]),c.useEffect(()=>{if(T===!1)return;const oe=setTimeout(()=>{z(!1)},T===!0?2e3:T);return()=>{clearInterval(oe)}},[T]);const $=c.useMemo(()=>{if(g===!0)return[.5,.8,1,1.2,1.5,1.8,2,2.5,3];if(Array.isArray(g)){for(const G of g){if(typeof G!="number")throw new Error("Every item in showPlaybackRateControl must be a number");if(G<=0)throw new Error("Every item in showPlaybackRateControl must be positive")}return g}return null},[g]),B=P?P():null,W=c.useRef(null),M=c.useRef(null),D=c.useCallback(G=>{(G.target===W.current||G.target===M.current)&&(k==null||k(G))},[k]),K=c.useCallback(G=>{(G.target===W.current||G.target===M.current)&&(S==null||S(G))},[S]);return f.jsxs("div",{ref:W,style:R,onPointerDown:D,onDoubleClick:K,children:[f.jsxs("div",{ref:M,style:hI,children:[f.jsxs("div",{style:gI,children:[f.jsx("button",{ref:A,type:"button",style:id,onClick:j,"aria-label":F?"Pause video":"Play video",title:F?"Pause video":"Play video",children:w===null?f.jsx(Km,{buffering:x,playing:F}):w({playing:F,isBuffering:x})??f.jsx(Km,{buffering:x,playing:F})}),r?f.jsxs(f.Fragment,{children:[f.jsx("div",{style:ui}),f.jsx(U2,{renderMuteButton:C,renderVolumeSlider:I,displayVerticalVolumeSlider:N})]}):null,f.jsx("div",{style:ui}),f.jsx(lI,{durationInFrames:e,fps:n,maxTimeLabelWidth:O}),f.jsx("div",{style:ui})]}),f.jsx("div",{style:yI}),B,B&&$&&h?f.jsx("div",{style:ui}):null,$&&h&&f.jsx(rI,{canvasSize:h,playbackRates:$}),$&&V&&i?f.jsx("div",{style:ui}):null,f.jsx("div",{style:wI,children:V&&i?f.jsx("button",{type:"button","aria-label":t?"Exit fullscreen":"Enter Fullscreen",title:t?"Exit fullscreen":"Enter Fullscreen",style:id,onClick:t?s:o,children:v===null?f.jsx(S2,{isFullscreen:t}):v({isFullscreen:t})}):null})]}),f.jsx("div",{style:vI}),f.jsx(aI,{onSeekEnd:l,onSeekStart:u,durationInFrames:e,inFrame:d,outFrame:p})]})},rw=typeof document>"u",bI=e=>{let t=!1;return{promise:new Promise((r,o)=>{e.then(i=>{if(t){o({isCanceled:t,value:i});return}r(i)}).catch(i=>{o({isCanceled:t,error:i})})}),cancel:()=>{t=!0}}},SI=e=>new Promise(t=>setTimeout(t,e)),EI=()=>{const e=c.useRef([]),t=c.useCallback(i=>{e.current=[...e.current,i]},[]),n=c.useCallback(i=>{e.current=e.current.filter(s=>s!==i)},[]),r=c.useCallback(()=>e.current.map(i=>i.cancel()),[]);return c.useMemo(()=>({appendPendingPromise:t,removePendingPromise:n,clearPendingPromises:r}),[t,r,n])},kI=(e,t,n)=>{const r=EI(),o=c.useCallback(async l=>{if(l instanceof PointerEvent?l.pointerType==="touch":l.nativeEvent.pointerType==="touch"){e(l);return}r.clearPendingPromises();const u=bI(SI(200));r.appendPendingPromise(u);try{await u.promise,r.removePendingPromise(u),e(l)}catch(d){const p=d;if(r.removePendingPromise(u),!p.isCanceled)throw p.error}},[r,e]),i=c.useCallback(()=>{document.addEventListener("pointerup",l=>{o(l)},{once:!0})},[o]),s=c.useCallback(()=>{r.clearPendingPromises(),t()},[r,t]);return c.useMemo(()=>n?{handlePointerDown:i,handleDoubleClick:s}:{handlePointerDown:e,handleDoubleClick:()=>{}},[n,s,i,e])},ld=J.version.split(".")[0];if(ld==="0")throw new Error(`Version ${ld} of "react" is not supported by Remotion`);var CI=parseInt(ld,10)>=18,II=({controls:e,style:t,loop:n,autoPlay:r,allowFullscreen:o,inputProps:i,clickToPlay:s,showVolumeControls:a,doubleClickToFullscreen:l,spaceKeyToPlayOrPause:u,errorFallback:d,playbackRate:p,renderLoading:m,renderPoster:h,className:w,moveToBeginningWhenEnded:v,showPosterWhenUnplayed:E,showPosterWhenEnded:g,showPosterWhenPaused:y,showPosterWhenBuffering:x,showPosterWhenBufferingAndPaused:b,inFrame:k,outFrame:S,initiallyShowControls:C,renderFullscreen:I,renderPlayPauseButton:F,renderMuteButton:j,renderVolumeSlider:P,renderCustomControls:A,alwaysShowControls:V,showPlaybackRateControl:_,posterFillMode:L,bufferStateDelayInMilliseconds:O,hideControlsWhenPointerDoesntMove:N,overflowVisible:T,browserMediaControlsBehavior:z,overrideInternalClassName:R,noSuspense:$},B)=>{const W=re.useUnsafeVideoConfig(),M=re.useVideo(),D=c.useRef(null),K=Df(D,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),[G,oe]=c.useState(!1),[ne,Z]=c.useState(r),[ee,ae]=c.useState(()=>!1),[me,ge]=c.useState(!1),le=c.useMemo(()=>typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled),[]),q=Wl(),de=q.toggle,{playerMuted:ye,mediaVolume:Fe}=c.useContext(re.MediaVolumeContext);c.useEffect(()=>{q.emitter.dispatchVolumeChange(Fe)},[q.emitter,Fe]);const se=ye||Fe===0;c.useEffect(()=>{q.emitter.dispatchMuteChange({isMuted:se})},[q.emitter,se]),L2({loop:n,playbackRate:p,moveToBeginningWhenEnded:v,inFrame:k,outFrame:S,getCurrentFrame:q.getCurrentFrame,browserMediaControlsBehavior:z,muted:se}),c.useEffect(()=>{G&&!q.playing&&(oe(!1),q.play())},[G,q]),c.useEffect(()=>{const{current:ve}=D;if(!ve)return;const we=()=>{const Gt=document.fullscreenElement===ve||document.webkitFullscreenElement===ve;ae(Gt)};return document.addEventListener("fullscreenchange",we),document.addEventListener("webkitfullscreenchange",we),()=>{document.removeEventListener("fullscreenchange",we),document.removeEventListener("webkitfullscreenchange",we)}},[]);const We=c.useCallback(ve=>{de(ve)},[de]),zt=c.useCallback(()=>{if(!o)throw new Error("allowFullscreen is false");if(!le)throw new Error("Browser doesnt support fullscreen");if(!D.current)throw new Error("No player ref found");D.current.webkitRequestFullScreen?D.current.webkitRequestFullScreen():D.current.requestFullscreen()},[o,le]),nt=c.useCallback(()=>{document.webkitExitFullscreen?document.webkitExitFullscreen():document.exitFullscreen()},[]);c.useEffect(()=>{const{current:ve}=D;if(!ve)return;const we=()=>{const Gt=document.webkitFullscreenElement??document.fullscreenElement;Gt&&Gt===D.current?q.emitter.dispatchFullscreenChange({isFullscreen:!0}):q.emitter.dispatchFullscreenChange({isFullscreen:!1})};return ve.addEventListener("webkitfullscreenchange",we),ve.addEventListener("fullscreenchange",we),()=>{ve.removeEventListener("webkitfullscreenchange",we),ve.removeEventListener("fullscreenchange",we)}},[q.emitter]);const Ge=(W==null?void 0:W.durationInFrames)??1,lt=c.useMemo(()=>!W||!K?null:X0({canvasSize:K,compositionHeight:W.height,compositionWidth:W.width,previewSize:"auto"}),[K,W]),ut=(lt==null?void 0:lt.scale)??1,Dt=c.useRef(!1);c.useEffect(()=>{if(!Dt.current){Dt.current=!0;return}q.emitter.dispatchScaleChange(ut)},[q.emitter,ut]);const{setMediaVolume:Xt,setPlayerMuted:H}=c.useContext(re.SetMediaVolumeContext),[X,Q]=c.useState(!1);c.useEffect(()=>{let ve=null,we=!1;const Gt=()=>{we=!1,requestAnimationFrame(()=>{O===0?Q(!0):ve=setTimeout(()=>{we||Q(!0)},O)})},Hr=()=>{requestAnimationFrame(()=>{we=!0,Q(!1),ve&&clearTimeout(ve)})};return q.emitter.addEventListener("waiting",Gt),q.emitter.addEventListener("resume",Hr),()=>{q.emitter.removeEventListener("waiting",Gt),q.emitter.removeEventListener("resume",Hr),Q(!1),ve&&clearTimeout(ve),we=!0}},[O,q.emitter]),c.useImperativeHandle(B,()=>{const ve={play:q.play,pause:()=>{oe(!1),q.pause()},toggle:We,getContainerNode:()=>D.current,getCurrentFrame:q.getCurrentFrame,isPlaying:q.isPlaying,seekTo:we=>{const Gt=Ge-1,Hr=Math.max(0,Math.min(Gt,we));q.isPlaying()&&(oe(Hr!==Gt||n),q.pause()),Hr===Gt&&!n&&q.emitter.dispatchEnded(),q.seek(Hr)},isFullscreen:()=>{const{current:we}=D;return we?document.fullscreenElement===we||document.webkitFullscreenElement===we:!1},requestFullscreen:zt,exitFullscreen:nt,getVolume:()=>ye?0:Fe,setVolume:we=>{if(typeof we!="number")throw new TypeError(`setVolume() takes a number, got value of type ${typeof we}`);if(isNaN(we))throw new TypeError("setVolume() got a number that is NaN. Volume must be between 0 and 1.");if(we<0||we>1)throw new TypeError(`setVolume() got a number that is out of range. Must be between 0 and 1, got ${we}`);Xt(we)},isMuted:()=>se,mute:()=>{H(!0)},unmute:()=>{H(!1)},getScale:()=>ut,pauseAndReturnToPlayStart:()=>{q.pauseAndReturnToPlayStart()}};return Object.assign(q.emitter,ve)},[Ge,nt,n,ye,se,Fe,q,zt,H,Xt,We,ut]);const pe=M?M.component:null,Ce=c.useMemo(()=>G0({canvasSize:K,config:W,style:t,overflowVisible:T,layout:lt}),[K,W,lt,T,t]),Ot=c.useMemo(()=>Q0({config:W,layout:lt,scale:ut,overflowVisible:T}),[W,lt,T,ut]),Gl=c.useMemo(()=>q0({config:W,layout:lt,scale:ut,overflowVisible:T}),[W,lt,T,ut]),Ko=q.pause,Ur=q.emitter.dispatchError,ql=c.useCallback(ve=>{Ko(),Ur(ve)},[Ur,Ko]),St=c.useCallback(ve=>{ve.stopPropagation(),zt()},[zt]),qw=c.useCallback(ve=>{ve.stopPropagation(),nt()},[nt]),Qw=c.useCallback(ve=>{(ve instanceof MouseEvent?ve.button===2:ve.nativeEvent.button)||We(ve)},[We]),Jw=c.useCallback(()=>{ge(!0)},[]),e1=c.useCallback(()=>{ge(!1)},[]),t1=c.useCallback(()=>{ee?nt():zt()},[nt,ee,zt]),{handlePointerDown:vs,handleDoubleClick:ys}=kI(Qw,t1,l&&o&&le);c.useEffect(()=>{ne&&(q.play(),Z(!1))},[ne,q]);const n1=c.useMemo(()=>m?m({height:Ce.height,width:Ce.width,isBuffering:X}):null,[Ce.height,Ce.width,m,X]),r1=c.useMemo(()=>({type:"scale",scale:ut}),[ut]);if(!W)return null;const ws=h?h({height:L==="player-size"?Ce.height:W.height,width:L==="player-size"?Ce.width:W.width,isBuffering:X}):null;if(ws===void 0)throw new TypeError("renderPoster() must return a React element, but undefined was returned");const Xf=ws&&[y&&!q.isPlaying()&&!me,g&&q.isLastFrame&&!q.isPlaying(),E&&!q.hasPlayed&&!q.isPlaying(),x&&X&&q.isPlaying(),b&&X&&!q.isPlaying()].some(Boolean),{left:Rj,top:Pj,width:Fj,height:Mj,...o1}=Ot,Gf=f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:Ot,onPointerDown:s?vs:void 0,onDoubleClick:l?ys:void 0,children:[f.jsxs("div",{style:Gl,className:Of(R),children:[pe?f.jsx(nw,{onError:ql,errorFallback:d,children:f.jsx(re.CurrentScaleContext.Provider,{value:r1,children:f.jsx(pe,{...(M==null?void 0:M.props)??{},...i??{}})})}):null,Xf&&L==="composition-size"?f.jsx("div",{style:{...o1,width:W.width,height:W.height},onPointerDown:s?vs:void 0,onDoubleClick:l?ys:void 0,children:ws}):null]}),f.jsx(V2,{})]}),Xf&&L==="player-size"?f.jsx("div",{style:Ot,onPointerDown:s?vs:void 0,onDoubleClick:l?ys:void 0,children:ws}):null,e?f.jsx(xI,{fps:W.fps,playing:q.playing,toggle:q.toggle,durationInFrames:W.durationInFrames,containerRef:D,onFullscreenButtonClick:St,isFullscreen:ee,allowFullscreen:o,showVolumeControls:a,onExitFullscreenButtonClick:qw,spaceKeyToPlayOrPause:u,onSeekEnd:e1,onSeekStart:Jw,inFrame:k,outFrame:S,initiallyShowControls:C,canvasSize:K,renderFullscreenButton:I,renderPlayPauseButton:F,alwaysShowControls:V,showPlaybackRateControl:_,buffering:X,hideControlsWhenPointerDoesntMove:N,onDoubleClick:l?ys:void 0,onPointerDown:s?vs:void 0,renderMuteButton:j,renderVolumeSlider:P,renderCustomControls:A}):null]});return $||rw&&!CI?f.jsx("div",{ref:D,style:Ce,className:w,children:Gf}):f.jsx("div",{ref:D,style:Ce,className:w,children:f.jsx(c.Suspense,{fallback:n1,children:Gf})})},TI=c.forwardRef(II),ow="remotion.volumePreference",_I=(e,t,n)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(n??ow,String(e))}catch(r){re.Log.error({logLevel:t,tag:null},"Could not persist volume",r)}},RI=e=>{if(typeof window>"u")return 1;try{const t=window.localStorage.getItem(e??ow);return t?Number(t):1}catch{return 1}},Vf="player-comp",iw=({children:e,timelineContext:t,playbackRateContext:n,fps:r,compositionHeight:o,compositionWidth:i,durationInFrames:s,component:a,numberOfSharedAudioTags:l,initiallyMuted:u,logLevel:d,audioLatencyHint:p,sampleRate:m,volumePersistenceKey:h,initialVolume:w,inputProps:v,audioEnabled:E})=>{const g=w===void 0,y=c.useMemo(()=>({compositions:[{component:a,durationInFrames:s,height:o,width:i,fps:r,id:Vf,nonce:[[0,777]],folderName:null,parentFolderName:null,schema:null,calculateMetadata:null,stack:null}],folders:[],currentCompositionMetadata:{defaultCodec:null,defaultOutName:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null,defaultVideoImageFormat:null,durationInFrames:s,fps:r,height:o,width:i,props:v},canvasContent:{type:"composition",compositionId:"player-comp"}}),[a,s,o,i,r,v]),[x,b]=c.useState(()=>u),[k,S]=c.useState(()=>g?RI(h??null):w),C=c.useMemo(()=>({playerMuted:x,mediaVolume:k}),[x,k]),I=c.useRef(!1),F=I.current||E&&!x&&k>0;I.current=F;const j=c.useCallback(_=>{S(_),g&&_I(_,d,h??null)},[g,d,h]),P=c.useMemo(()=>({setPlayerMuted:b,setMediaVolume:j}),[j]),A=c.useMemo(()=>({logLevel:d,mountTime:Date.now()}),[d]),V=c.useMemo(()=>({isPlayer:!0,isRendering:!1,isStudio:!1,isClientSideRendering:!1,isReadOnlyStudio:!1}),[]);return f.jsx(re.RemotionEnvironmentContext.Provider,{value:V,children:f.jsx(re.LogLevelContext.Provider,{value:A,children:f.jsx(re.CanUseRemotionHooksProvider,{children:f.jsx(re.AbsoluteTimeContext.Provider,{value:t,children:f.jsx(re.PlaybackRateContext.Provider,{value:n,children:f.jsx(re.TimelineContext.Provider,{value:t,children:f.jsx(re.CompositionManager.Provider,{value:y,children:f.jsx(re.PrefetchProvider,{children:f.jsx(re.DurationsContextProvider,{children:f.jsx(re.MediaVolumeContext.Provider,{value:C,children:f.jsx(re.SetMediaVolumeContext.Provider,{value:P,children:f.jsx(re.BufferingProvider,{children:f.jsx(re.SharedAudioContextProvider,{audioLatencyHint:p,audioEnabled:F,previewSampleRate:m,children:f.jsx(re.SharedAudioTagsContextProvider,{numberOfAudioTags:l,children:e})})})})})})})})})})})})})})},Qm=!1,PI=(e,t)=>{e||Qm||(Qm=!0,re.Log.warn({logLevel:t,tag:null},"Note: Some companies are required to obtain a license to use Remotion. See: https://remotion.dev/license\nPass the `acknowledgeRemotionLicense` prop to `<Player />` function to make this message disappear."))},Jm=(e,t)=>{if(typeof e>"u"||e===null)return e??null;if(typeof e!="number")throw new TypeError(`"${t}" must be a number, but is ${JSON.stringify(e)}`);if(Number.isNaN(e))throw new TypeError(`"${t}" must not be NaN, but is ${JSON.stringify(e)}`);if(!Number.isFinite(e))throw new TypeError(`"${t}" must be finite, but is ${JSON.stringify(e)}`);if(e%1!==0)throw new TypeError(`"${t}" must be an integer, but is ${JSON.stringify(e)}`);return e},FI=({inFrame:e,durationInFrames:t,outFrame:n})=>{const r=Jm(e,"inFrame"),o=Jm(n,"outFrame");if(!(r===null&&o===null)){if(r!==null&&r>t-1)throw new Error("inFrame must be less than (durationInFrames - 1), but is "+r);if(o!==null&&o>t-1)throw new Error("outFrame must be less than (durationInFrames - 1), but is "+o);if(r!==null&&r<0)throw new Error("inFrame must be greater than 0, but is "+r);if(o!==null&&o<=0)throw new Error(`outFrame must be greater than 0, but is ${o}. If you want to render a single frame, use <Thumbnail /> instead.`);if(o!==null&&r!==null&&o<=r)throw new Error("outFrame must be greater than inFrame, but is "+o+" <= "+r)}},MI=({initialFrame:e,durationInFrames:t})=>{if(typeof t!="number")throw new Error(`\`durationInFrames\` must be a number, but is ${JSON.stringify(t)}`);if(!(typeof e>"u")){if(typeof e!="number")throw new Error(`\`initialFrame\` must be a number, but is ${JSON.stringify(e)}`);if(Number.isNaN(e))throw new Error("`initialFrame` must be a number, but is NaN");if(!Number.isFinite(e))throw new Error("`initialFrame` must be a number, but is Infinity");if(e%1!==0)throw new Error(`\`initialFrame\` must be an integer, but is ${JSON.stringify(e)}`);if(e>t-1)throw new Error(`\`initialFrame\` must be less or equal than \`durationInFrames - 1\`, but is ${JSON.stringify(e)}`)}},jI=e=>{if(e!==void 0){if(e>10)throw new Error(`The highest possible playback rate is 10. You passed: ${e}`);if(e<-10)throw new Error(`The lowest possible playback rate is -10. You passed: ${e}`);if(e===0)throw new Error("A playback rate of 0 is not supported.")}},$I=Bl.validateFps,eh=Bl.validateDimension,AI=Bl.validateDurationInFrames,NI=Bl.validateDefaultAndInputProps,LI=e=>"component"in e?e.component:null,zI=({durationInFrames:e,compositionHeight:t,compositionWidth:n,fps:r,inputProps:o,style:i,controls:s=!1,loop:a=!1,autoPlay:l=!1,showVolumeControls:u=!0,allowFullscreen:d=!0,clickToPlay:p,doubleClickToFullscreen:m=!1,spaceKeyToPlayOrPause:h=!0,moveToBeginningWhenEnded:w=!0,numberOfSharedAudioTags:v=5,errorFallback:E=()=>"⚠️",playbackRate:g=1,renderLoading:y,className:x,showPosterWhenUnplayed:b,showPosterWhenEnded:k,showPosterWhenPaused:S,showPosterWhenBuffering:C,showPosterWhenBufferingAndPaused:I,initialFrame:F,renderPoster:j,inFrame:P,outFrame:A,initiallyShowControls:V,renderFullscreenButton:_,renderPlayPauseButton:L,renderVolumeSlider:O,renderCustomControls:N,alwaysShowControls:T=!1,initiallyMuted:z=!1,showPlaybackRateControl:R=!1,posterFillMode:$="player-size",bufferStateDelayInMilliseconds:B,hideControlsWhenPointerDoesntMove:W=!0,overflowVisible:M=!1,renderMuteButton:D,browserMediaControlsBehavior:K,overrideInternalClassName:G,logLevel:oe="info",noSuspense:ne,acknowledgeRemotionLicense:Z,audioLatencyHint:ee="playback",sampleRate:ae=48e3,volumePersistenceKey:me,initialVolume:ge,...le},q)=>{if(typeof window<"u"&&(window.remotion_isPlayer=!0),le.defaultProps!==void 0)throw new Error("The <Player /> component does not accept `defaultProps`, but some were passed. Use `inputProps` instead.");const de=LI(le);if((de==null?void 0:de.type)===Ua)throw new TypeError("'component' should not be an instance of <Composition/>. Pass the React component directly, and set the duration, fps and dimensions as separate props. See https://www.remotion.dev/docs/player/examples for an example.");if(de===Ua)throw new TypeError("'component' must not be the 'Composition' component. Pass your own React component directly, and set the duration, fps and dimensions as separate props. See https://www.remotion.dev/docs/player/examples for an example.");c.useState(()=>PI(!!Z,oe));const ye=re.useLazyComponent({compProps:le,componentName:"Player",noSuspense:!!ne});MI({initialFrame:F,durationInFrames:e});const[Fe,se]=c.useState(()=>({[Vf]:F??0})),[We,zt]=c.useState(!1),[nt]=c.useState("player-comp"),Ge=c.useRef(null),lt=c.useRef([]),ut=c.useRef(!1),[Dt,Xt]=c.useState(g);if(typeof t!="number")throw new TypeError(`'compositionHeight' must be a number but got '${typeof t}' instead`);if(typeof n!="number")throw new TypeError(`'compositionWidth' must be a number but got '${typeof n}' instead`);if(eh(t,"compositionHeight","of the <Player /> component"),eh(n,"compositionWidth","of the <Player /> component"),AI(e,{component:"of the <Player/> component",allowFloats:!1}),$I(r,"as a prop of the <Player/> component",!1),NI(o,"inputProps",null),FI({durationInFrames:e,inFrame:P,outFrame:A}),typeof s!="boolean"&&typeof s<"u")throw new TypeError(`'controls' must be a boolean or undefined but got '${typeof s}' instead`);if(typeof l!="boolean"&&typeof l<"u")throw new TypeError(`'autoPlay' must be a boolean or undefined but got '${typeof l}' instead`);if(typeof a!="boolean"&&typeof a<"u")throw new TypeError(`'loop' must be a boolean or undefined but got '${typeof a}' instead`);if(typeof m!="boolean"&&typeof m<"u")throw new TypeError(`'doubleClickToFullscreen' must be a boolean or undefined but got '${typeof m}' instead`);if(typeof u!="boolean"&&typeof u<"u")throw new TypeError(`'showVolumeControls' must be a boolean or undefined but got '${typeof u}' instead`);if(typeof d!="boolean"&&typeof d<"u")throw new TypeError(`'allowFullscreen' must be a boolean or undefined but got '${typeof d}' instead`);if(typeof p!="boolean"&&typeof p<"u")throw new TypeError(`'clickToPlay' must be a boolean or undefined but got '${typeof p}' instead`);if(typeof h!="boolean"&&typeof h<"u")throw new TypeError(`'spaceKeyToPlayOrPause' must be a boolean or undefined but got '${typeof h}' instead`);if(typeof ae!="number"||!Number.isFinite(ae)||Number.isNaN(ae)||ae<=0||ae%1!==0)throw new TypeError(`'sampleRate' must be a positive integer but got '${ae}' instead`);if(typeof ge<"u"&&typeof ge!="number")throw new TypeError(`'initialVolume' must be a number or undefined but got '${typeof ge}' instead`);if(typeof ge=="number"&&(!Number.isFinite(ge)||Number.isNaN(ge)||ge<0||ge>1))throw new TypeError(`'initialVolume' must be between 0 and 1 but got '${ge}' instead`);if(typeof v!="number"||v%1!==0||!Number.isFinite(v)||Number.isNaN(v)||v<0)throw new TypeError(`'numberOfSharedAudioTags' must be an integer but got '${v}' instead`);jI(Dt),c.useEffect(()=>{Xt(g)},[g]),c.useImperativeHandle(q,()=>Ge.current,[]),c.useState(()=>{re.playbackLogging({logLevel:oe,message:`[player] Mounting <Player>. User agent = ${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"player",mountTime:Date.now()})});const H=c.useMemo(()=>({frame:Fe,playing:We,rootId:nt,imperativePlaying:ut,audioAndVideoTags:lt}),[Fe,We,nt]),X=c.useMemo(()=>({playbackRate:Dt,setPlaybackRate:Xt}),[Dt]),Q=c.useMemo(()=>({setFrame:se,setPlaying:zt}),[se]);typeof window<"u"&&c.useLayoutEffect(()=>{re.CSSUtils.injectCSS(re.CSSUtils.makeDefaultPreviewCSS(`.${Of(G)}`,"#fff"))},[G]);const pe=c.useMemo(()=>o??{},[o]),Ce=c.useMemo(()=>K??{mode:"prevent-media-session"},[K]);return f.jsx(re.IsPlayerContextProvider,{children:f.jsx(iw,{timelineContext:H,playbackRateContext:X,component:ye,compositionHeight:t,compositionWidth:n,durationInFrames:e,fps:r,numberOfSharedAudioTags:v,initiallyMuted:z,logLevel:oe,audioLatencyHint:ee,sampleRate:ae,volumePersistenceKey:me,initialVolume:ge,inputProps:pe,audioEnabled:!0,children:f.jsx(re.SetTimelineContext.Provider,{value:Q,children:f.jsx(F2,{currentPlaybackRate:Dt,children:f.jsx(TI,{ref:Ge,posterFillMode:$,renderLoading:y,autoPlay:!!l,loop:!!a,controls:!!s,errorFallback:E,style:i,inputProps:pe,allowFullscreen:!!d,moveToBeginningWhenEnded:!!w,clickToPlay:typeof p=="boolean"?p:!!s,showVolumeControls:!!u,doubleClickToFullscreen:!!m,spaceKeyToPlayOrPause:!!h,playbackRate:Dt,className:x??void 0,showPosterWhenUnplayed:!!b,showPosterWhenEnded:!!k,showPosterWhenPaused:!!S,showPosterWhenBuffering:!!C,showPosterWhenBufferingAndPaused:!!I,renderPoster:j,inFrame:P??null,outFrame:A??null,initiallyShowControls:V??!0,renderFullscreen:_??null,renderPlayPauseButton:L??null,renderMuteButton:D??null,renderVolumeSlider:O??null,renderCustomControls:N??null,alwaysShowControls:T,showPlaybackRateControl:R,bufferStateDelayInMilliseconds:B??300,hideControlsWhenPointerDoesntMove:W,overflowVisible:M,browserMediaControlsBehavior:Ce,overrideInternalClassName:G??void 0,noSuspense:!!ne})})})})})},DI=c.forwardRef,OI=DI(zI),VI=()=>{const e=c.useContext(ew);if(!e)throw new TypeError("Expected Player event emitter context");return c.useMemo(()=>({emitter:e}),[e])},ud=J.version.split(".")[0];if(ud==="0")throw new Error(`Version ${ud} of "react" is not supported by Remotion`);var BI=parseInt(ud,10)>=18,WI=({style:e,inputProps:t,errorFallback:n,renderLoading:r,className:o,overflowVisible:i,noSuspense:s,overrideInternalClassName:a},l)=>{const u=re.useUnsafeVideoConfig(),d=re.useVideo(),p=c.useRef(null),m=Df(p,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),h=c.useMemo(()=>!u||!m?null:X0({canvasSize:m,compositionHeight:u.height,compositionWidth:u.width,previewSize:"auto"}),[m,u]),w=(h==null?void 0:h.scale)??1,v=VI();tw(v.emitter),c.useImperativeHandle(l,()=>{const I={getContainerNode:()=>p.current,getScale:()=>w};return Object.assign(v.emitter,I)},[w,v.emitter]);const E=d?d.component:null,g=c.useMemo(()=>G0({config:u,style:e,canvasSize:m,overflowVisible:i,layout:h}),[m,u,h,i,e]),y=c.useMemo(()=>Q0({config:u,layout:h,scale:w,overflowVisible:i}),[u,h,i,w]),x=c.useMemo(()=>q0({config:u,layout:h,scale:w,overflowVisible:i}),[u,h,i,w]),b=c.useCallback(I=>{v.emitter.dispatchError(I)},[v.emitter]),k=c.useMemo(()=>r?r({height:g.height,width:g.width,isBuffering:!1}):null,[g.height,g.width,r]),S=c.useMemo(()=>({type:"scale",scale:w}),[w]);if(!u)return null;const C=f.jsx("div",{style:y,children:f.jsx("div",{style:x,className:Of(a),children:E?f.jsx(nw,{onError:b,errorFallback:n,children:f.jsx(re.CurrentScaleContext.Provider,{value:S,children:f.jsx(E,{...(d==null?void 0:d.props)??{},...t??{}})})}):null})});return s||rw&&!BI?f.jsx("div",{ref:p,style:g,className:o,children:C}):f.jsx("div",{ref:p,style:g,className:o,children:f.jsx(c.Suspense,{fallback:k,children:C})})},UI=c.forwardRef(WI),HI=({frameToDisplay:e,style:t,inputProps:n,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,className:a,errorFallback:l=()=>"⚠️",renderLoading:u,overflowVisible:d=!1,overrideInternalClassName:p,logLevel:m="info",noSuspense:h,...w},v)=>{typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_isPlayer=!0},[]);const[E]=c.useState(()=>String(Dr(null))),g=c.useRef(null),y=c.useMemo(()=>({playing:!1,frame:{[Vf]:e},rootId:E,imperativePlaying:{current:!1},audioAndVideoTags:{current:[]}}),[e,E]),x=c.useMemo(()=>({playbackRate:1,setPlaybackRate:()=>{throw new Error("thumbnail")}}),[]);c.useImperativeHandle(v,()=>g.current,[]);const b=re.useLazyComponent({compProps:w,componentName:"Thumbnail",noSuspense:!!h}),[k]=c.useState(()=>new P2),S=c.useMemo(()=>n??{},[n]);return f.jsx(re.IsPlayerContextProvider,{children:f.jsx(iw,{timelineContext:y,playbackRateContext:x,component:b,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,numberOfSharedAudioTags:0,initiallyMuted:!0,logLevel:m,audioLatencyHint:"playback",sampleRate:48e3,inputProps:S,audioEnabled:!1,children:f.jsx(ew.Provider,{value:k,children:f.jsx(UI,{ref:g,className:a,errorFallback:l,inputProps:S,renderLoading:u,style:t,overflowVisible:d,overrideInternalClassName:p,noSuspense:!!h})})})})},ZI=c.forwardRef;ZI(HI);const Eo=[1,1.5,2,4];function th(e){return Eo.find(t=>t>e+1e-9)??Eo[Eo.length-1]}function YI(e,t){switch(t){case"L":return e.playing&&e.rate>0?{rate:th(e.rate),playing:!0}:{rate:Eo[0],playing:!0};case"J":return e.playing&&e.rate<0?{rate:-th(-e.rate),playing:!0}:{rate:-Eo[0],playing:!0};case"K":return{rate:Eo[0],playing:!e.playing}}}const KI=({src:e,spans:t,punchInScale:n=1.07,punchThresholdSec:r=.15,audioFadeSec:o=.01,background:i="black"})=>{const{fps:s}=Xe(),a=c.useMemo(()=>{const u=[];let d=!1;for(let p=0;p<t.length;p++){const m=t[p-1],h=m?t[p].srcIn-m.srcOut:0;p>0&&h>=r&&(d=!d),u.push(d?n:1)}return u},[t,n,r]),l=Math.max(1,Math.round(o*s));return f.jsx(an,{style:{backgroundColor:i},children:t.map((u,d)=>{const p=Math.round(u.outIn*s),m=Math.max(1,Math.round((u.outOut-u.outIn)*s));return f.jsx(at,{from:p,durationInFrames:m,premountFor:s,children:f.jsx(an,{style:{transform:`scale(${a[d]})`},children:f.jsx(H0,{src:e,trimBefore:Math.round(u.srcIn*s),trimAfter:Math.round(u.srcOut*s),style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"var(--ossclip-obj-x, 50%) var(--ossclip-obj-y, 50%)"},volume:h=>Math.max(0,Math.min(1,(h+1)/l,(m-h)/l))})})},d)})})};function U(e,t,n){function r(a,l){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(const d in s.prototype)d in a||Object.defineProperty(a,d,{value:s.prototype[d].bind(a)});a._zod.constr=s,a._zod.def=l}const o=(n==null?void 0:n.Parent)??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const u=n!=null&&n.Parent?new i:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,u;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(u=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class Gi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const sw={};function ir(e){return sw}function XI(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function GI(e,t){return typeof t=="bigint"?t.toString():t}function aw(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Bf(e){return e==null}function Wf(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function qI(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Re(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Uf(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ci(e){return JSON.stringify(e)}const lw=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function cd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const QI=aw(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ga(e){if(cd(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(cd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const JI=new Set(["string","number","symbol"]);function Ul(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wr(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function ie(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function eT(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const tT={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function nT(e,t){const n={},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(n[o]=r.shape[o])}return Wr(e,{...e._zod.def,shape:n,checks:[]})}function rT(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete n[o]}return Wr(e,{...e._zod.def,shape:n,checks:[]})}function oT(e,t){if(!Ga(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return Uf(this,"shape",r),r},checks:[]};return Wr(e,n)}function iT(e,t){return Wr(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Uf(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function sT(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)o[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return Wr(t,{...t._zod.def,shape:o,checks:[]})}function aT(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)o[i]=new e({type:"nonoptional",innerType:r[i]});return Wr(t,{...t._zod.def,shape:o,checks:[]})}function Ti(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function Er(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Ys(e){return typeof e=="string"?e:e==null?void 0:e.message}function sr(e,t,n){var o,i,s,a,l,u;const r={...e,path:e.path??[]};if(!e.message){const d=Ys((s=(i=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:i.error)==null?void 0:s.call(i,e))??Ys((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??Ys((l=n.customError)==null?void 0:l.call(n,e))??Ys((u=n.localeError)==null?void 0:u.call(n,e))??"Invalid input";r.message=d}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Hf(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function qi(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const uw=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,GI,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cw=U("$ZodError",uw),dw=U("$ZodError",uw,{Parent:Error});function lT(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function uT(e,t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return o(e),r}const cT=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Gi;if(s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>sr(l,i,ir())));throw lw(a,o==null?void 0:o.callee),a}return s.value},dT=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>sr(l,i,ir())));throw lw(a,o==null?void 0:o.callee),a}return s.value},fw=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Gi;return i.issues.length?{success:!1,error:new(e??cw)(i.issues.map(s=>sr(s,o,ir())))}:{success:!0,data:i.value}},fT=fw(dw),pw=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>sr(s,o,ir())))}:{success:!0,data:i.value}},pT=pw(dw),mT=/^[cC][^\s-]{8,}$/,hT=/^[0-9a-z]+$/,gT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,vT=/^[0-9a-vA-V]{20}$/,yT=/^[A-Za-z0-9]{27}$/,wT=/^[a-zA-Z0-9_-]{21}$/,xT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bT=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nh=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,ST=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ET="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function kT(){return new RegExp(ET,"u")}const CT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,IT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,TT=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,_T=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,RT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mw=/^[A-Za-z0-9_-]*$/,PT=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,FT=/^\+(?:[0-9]){6,14}[0-9]$/,hw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",MT=new RegExp(`^${hw}$`);function gw(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function jT(e){return new RegExp(`^${gw(e)}$`)}function $T(e){const t=gw({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${hw}T(?:${r})$`)}const AT=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},NT=/^\d+$/,LT=/^-?\d+(?:\.\d+)?/i,zT=/true|false/i,DT=/^[^A-Z]*$/,OT=/^[^a-z]*$/,Rt=U("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vw={number:"number",bigint:"bigint",object:"date"},yw=U("$ZodCheckLessThan",(e,t)=>{Rt.init(e,t);const n=vw[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ww=U("$ZodCheckGreaterThan",(e,t)=>{Rt.init(e,t);const n=vw[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),VT=U("$ZodCheckMultipleOf",(e,t)=>{Rt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):qI(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),BT=U("$ZodCheckNumberFormat",(e,t)=>{var s;Rt.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),r=n?"int":"number",[o,i]=tT[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=o,l.maximum=i,n&&(l.pattern=NT)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}l<o&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inst:e})}}),WT=U("$ZodCheckMaxLength",(e,t)=>{var n;Rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Bf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=Hf(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),UT=U("$ZodCheckMinLength",(e,t)=>{var n;Rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Bf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=Hf(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),HT=U("$ZodCheckLengthEquals",(e,t)=>{var n;Rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Bf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=Hf(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Hl=U("$ZodCheckStringFormat",(e,t)=>{var n,r;Rt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ZT=U("$ZodCheckRegex",(e,t)=>{Hl.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),YT=U("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=DT),Hl.init(e,t)}),KT=U("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=OT),Hl.init(e,t)}),XT=U("$ZodCheckIncludes",(e,t)=>{Rt.init(e,t);const n=Ul(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),GT=U("$ZodCheckStartsWith",(e,t)=>{Rt.init(e,t);const n=new RegExp(`^${Ul(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),qT=U("$ZodCheckEndsWith",(e,t)=>{Rt.init(e,t);const n=new RegExp(`.*${Ul(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),QT=U("$ZodCheckOverwrite",(e,t)=>{Rt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class JT{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
135
+ `).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
136
+ `))}}const e_={major:4,minor:0,patch:0},Ne=U("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=e_;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,a,l)=>{let u=Ti(s),d;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(u)continue;const m=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Gi;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,s.issues.length!==m&&(u||(u=Ti(s,m)))});else{if(s.issues.length===m)continue;u||(u=Ti(s,m))}}return d?d.then(()=>s):s};e._zod.run=(s,a)=>{const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new Gi;return l.then(u=>i(u,r,a))}return i(l,r,a)}}e["~standard"]={validate:i=>{var s;try{const a=fT(e,i);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return pT(e,i).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),Zf=U("$ZodString",(e,t)=>{var n;Ne.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??AT(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Pe=U("$ZodStringFormat",(e,t)=>{Hl.init(e,t),Zf.init(e,t)}),t_=U("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=bT),Pe.init(e,t)}),n_=U("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=nh(r))}else t.pattern??(t.pattern=nh());Pe.init(e,t)}),r_=U("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ST),Pe.init(e,t)}),o_=U("$ZodURL",(e,t)=>{Pe.init(e,t),e._zod.check=n=>{try{const r=n.value,o=new URL(r),i=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:PT.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),i_=U("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=kT()),Pe.init(e,t)}),s_=U("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wT),Pe.init(e,t)}),a_=U("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=mT),Pe.init(e,t)}),l_=U("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=hT),Pe.init(e,t)}),u_=U("$ZodULID",(e,t)=>{t.pattern??(t.pattern=gT),Pe.init(e,t)}),c_=U("$ZodXID",(e,t)=>{t.pattern??(t.pattern=vT),Pe.init(e,t)}),d_=U("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=yT),Pe.init(e,t)}),f_=U("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=$T(t)),Pe.init(e,t)}),p_=U("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=MT),Pe.init(e,t)}),m_=U("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=jT(t)),Pe.init(e,t)}),h_=U("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=xT),Pe.init(e,t)}),g_=U("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=CT),Pe.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),v_=U("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=IT),Pe.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),y_=U("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=TT),Pe.init(e,t)}),w_=U("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=_T),Pe.init(e,t),e._zod.check=n=>{const[r,o]=n.value.split("/");try{if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function xw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const x_=U("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=RT),Pe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{xw(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function b_(e){if(!mw.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return xw(n)}const S_=U("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=mw),Pe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{b_(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),E_=U("$ZodE164",(e,t)=>{t.pattern??(t.pattern=FT),Pe.init(e,t)});function k_(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const C_=U("$ZodJWT",(e,t)=>{Pe.init(e,t),e._zod.check=n=>{k_(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),bw=U("$ZodNumber",(e,t)=>{Ne.init(e,t),e._zod.pattern=e._zod.bag.pattern??LT,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),I_=U("$ZodNumber",(e,t)=>{BT.init(e,t),bw.init(e,t)}),T_=U("$ZodBoolean",(e,t)=>{Ne.init(e,t),e._zod.pattern=zT,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),__=U("$ZodUnknown",(e,t)=>{Ne.init(e,t),e._zod.parse=n=>n}),R_=U("$ZodNever",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function rh(e,t,n){e.issues.length&&t.issues.push(...Er(n,e.issues)),t.value[n]=e.value}const P_=U("$ZodArray",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(u=>rh(u,n,s))):rh(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Ks(e,t,n){e.issues.length&&t.issues.push(...Er(n,e.issues)),t.value[n]=e.value}function oh(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...Er(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const F_=U("$ZodObject",(e,t)=>{Ne.init(e,t);const n=aw(()=>{const p=Object.keys(t.shape);for(const h of p)if(!(t.shape[h]instanceof Ne))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const m=eT(t.shape);return{shape:t.shape,keys:p,keySet:new Set(p),numKeys:p.length,optionalKeys:new Set(m)}});Re(e._zod,"propValues",()=>{const p=t.shape,m={};for(const h in p){const w=p[h]._zod;if(w.values){m[h]??(m[h]=new Set);for(const v of w.values)m[h].add(v)}}return m});const r=p=>{const m=new JT(["shape","payload","ctx"]),h=n.value,w=y=>{const x=ci(y);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};m.write("const input = payload.value;");const v=Object.create(null);let E=0;for(const y of h.keys)v[y]=`key_${E++}`;m.write("const newResult = {}");for(const y of h.keys)if(h.optionalKeys.has(y)){const x=v[y];m.write(`const ${x} = ${w(y)};`);const b=ci(y);m.write(`
137
+ if (${x}.issues.length) {
138
+ if (input[${b}] === undefined) {
139
+ if (${b} in input) {
140
+ newResult[${b}] = undefined;
141
+ }
142
+ } else {
143
+ payload.issues = payload.issues.concat(
144
+ ${x}.issues.map((iss) => ({
145
+ ...iss,
146
+ path: iss.path ? [${b}, ...iss.path] : [${b}],
147
+ }))
148
+ );
149
+ }
150
+ } else if (${x}.value === undefined) {
151
+ if (${b} in input) newResult[${b}] = undefined;
152
+ } else {
153
+ newResult[${b}] = ${x}.value;
154
+ }
155
+ `)}else{const x=v[y];m.write(`const ${x} = ${w(y)};`),m.write(`
156
+ if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
157
+ ...iss,
158
+ path: iss.path ? [${ci(y)}, ...iss.path] : [${ci(y)}]
159
+ })));`),m.write(`newResult[${ci(y)}] = ${x}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");const g=m.compile();return(y,x)=>g(p,y,x)};let o;const i=cd,s=!sw.jitless,l=s&&QI.value,u=t.catchall;let d;e._zod.parse=(p,m)=>{d??(d=n.value);const h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;const w=[];if(s&&l&&(m==null?void 0:m.async)===!1&&m.jitless!==!0)o||(o=r(t.shape)),p=o(p,m);else{p.value={};const x=d.shape;for(const b of d.keys){const k=x[b],S=k._zod.run({value:h[b],issues:[]},m),C=k._zod.optin==="optional"&&k._zod.optout==="optional";S instanceof Promise?w.push(S.then(I=>C?oh(I,p,b,h):Ks(I,p,b))):C?oh(S,p,b,h):Ks(S,p,b)}}if(!u)return w.length?Promise.all(w).then(()=>p):p;const v=[],E=d.keySet,g=u._zod,y=g.def.type;for(const x of Object.keys(h)){if(E.has(x))continue;if(y==="never"){v.push(x);continue}const b=g.run({value:h[x],issues:[]},m);b instanceof Promise?w.push(b.then(k=>Ks(k,p,x))):Ks(b,p,x)}return v.length&&p.issues.push({code:"unrecognized_keys",keys:v,input:h,inst:e}),w.length?Promise.all(w).then(()=>p):p}});function ih(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(i=>sr(i,r,ir())))}),t}const M_=U("$ZodUnion",(e,t)=>{Ne.init(e,t),Re(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Re(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Re(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Re(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Wf(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let o=!1;const i=[];for(const s of t.options){const a=s._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>ih(s,n,e,r)):ih(i,n,e,r)}}),j_=U("$ZodIntersection",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>sh(n,l,u)):sh(n,i,s)}});function dd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ga(e)&&Ga(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=dd(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=dd(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function sh(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ti(e))return e;const r=dd(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const $_=U("$ZodRecord",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Ga(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:o[l],issues:[]},r);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&n.issues.push(...Er(l,d.issues)),n.value[l]=d.value})):(u.issues.length&&n.issues.push(...Er(l,u.issues)),n.value[l]=u.value)}let a;for(const l in o)s.has(l)||(a=a??[],a.push(l));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>sr(u,r,ir())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const l=t.valueType._zod.run({value:o[s],issues:[]},r);l instanceof Promise?i.push(l.then(u=>{u.issues.length&&n.issues.push(...Er(s,u.issues)),n.value[a.value]=u.value})):(l.issues.length&&n.issues.push(...Er(s,l.issues)),n.value[a.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),A_=U("$ZodEnum",(e,t)=>{Ne.init(e,t);const n=XI(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>JI.has(typeof r)).map(r=>typeof r=="string"?Ul(r):r.toString()).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:e}),r}}),N_=U("$ZodTransform",(e,t)=>{Ne.init(e,t),e._zod.parse=(n,r)=>{const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new Gi;return n.value=o,n}}),L_=U("$ZodOptional",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Re(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Wf(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),z_=U("$ZodNullable",(e,t)=>{Ne.init(e,t),Re(e._zod,"optin",()=>t.innerType._zod.optin),Re(e._zod,"optout",()=>t.innerType._zod.optout),Re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Wf(n.source)}|null)$`):void 0}),Re(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),D_=U("$ZodDefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",Re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ah(i,t)):ah(o,t)}});function ah(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const O_=U("$ZodPrefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",Re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),V_=U("$ZodNonOptional",(e,t)=>{Ne.init(e,t),Re(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>lh(i,e)):lh(o,e)}});function lh(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const B_=U("$ZodCatch",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",Re(e._zod,"optout",()=>t.innerType._zod.optout),Re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>sr(s,r,ir()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>sr(i,r,ir()))},input:n.value}),n.issues=[]),n)}}),W_=U("$ZodPipe",(e,t)=>{Ne.init(e,t),Re(e._zod,"values",()=>t.in._zod.values),Re(e._zod,"optin",()=>t.in._zod.optin),Re(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>uh(i,t,r)):uh(o,t,r)}});function uh(e,t,n){return Ti(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const U_=U("$ZodReadonly",(e,t)=>{Ne.init(e,t),Re(e._zod,"propValues",()=>t.innerType._zod.propValues),Re(e._zod,"values",()=>t.innerType._zod.values),Re(e._zod,"optin",()=>t.innerType._zod.optin),Re(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(ch):ch(o)}});function ch(e){return e.value=Object.freeze(e.value),e}const H_=U("$ZodCustom",(e,t)=>{Rt.init(e,t),Ne.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>dh(i,n,r,e));dh(o,n,r,e)}});function dh(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(qi(o))}}class Z_{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function Y_(){return new Z_}const Xs=Y_();function K_(e,t){return new e({type:"string",...ie(t)})}function X_(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ie(t)})}function fh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ie(t)})}function G_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ie(t)})}function q_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ie(t)})}function Q_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ie(t)})}function J_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ie(t)})}function eR(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ie(t)})}function tR(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ie(t)})}function nR(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ie(t)})}function rR(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ie(t)})}function oR(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ie(t)})}function iR(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ie(t)})}function sR(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ie(t)})}function aR(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ie(t)})}function lR(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ie(t)})}function uR(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ie(t)})}function cR(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ie(t)})}function dR(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ie(t)})}function fR(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ie(t)})}function pR(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ie(t)})}function mR(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ie(t)})}function hR(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ie(t)})}function gR(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ie(t)})}function vR(e,t){return new e({type:"string",format:"date",check:"string_format",...ie(t)})}function yR(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ie(t)})}function wR(e,t){return new e({type:"string",format:"duration",check:"string_format",...ie(t)})}function xR(e,t){return new e({type:"number",checks:[],...ie(t)})}function bR(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ie(t)})}function SR(e,t){return new e({type:"boolean",...ie(t)})}function ER(e){return new e({type:"unknown"})}function kR(e,t){return new e({type:"never",...ie(t)})}function ph(e,t){return new yw({check:"less_than",...ie(t),value:e,inclusive:!1})}function zu(e,t){return new yw({check:"less_than",...ie(t),value:e,inclusive:!0})}function mh(e,t){return new ww({check:"greater_than",...ie(t),value:e,inclusive:!1})}function Du(e,t){return new ww({check:"greater_than",...ie(t),value:e,inclusive:!0})}function hh(e,t){return new VT({check:"multiple_of",...ie(t),value:e})}function Sw(e,t){return new WT({check:"max_length",...ie(t),maximum:e})}function qa(e,t){return new UT({check:"min_length",...ie(t),minimum:e})}function Ew(e,t){return new HT({check:"length_equals",...ie(t),length:e})}function CR(e,t){return new ZT({check:"string_format",format:"regex",...ie(t),pattern:e})}function IR(e){return new YT({check:"string_format",format:"lowercase",...ie(e)})}function TR(e){return new KT({check:"string_format",format:"uppercase",...ie(e)})}function _R(e,t){return new XT({check:"string_format",format:"includes",...ie(t),includes:e})}function RR(e,t){return new GT({check:"string_format",format:"starts_with",...ie(t),prefix:e})}function PR(e,t){return new qT({check:"string_format",format:"ends_with",...ie(t),suffix:e})}function hs(e){return new QT({check:"overwrite",tx:e})}function FR(e){return hs(t=>t.normalize(e))}function MR(){return hs(e=>e.trim())}function jR(){return hs(e=>e.toLowerCase())}function $R(){return hs(e=>e.toUpperCase())}function AR(e,t,n){return new e({type:"array",element:t,...ie(n)})}function NR(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ie(n)})}const LR=U("ZodISODateTime",(e,t)=>{f_.init(e,t),Le.init(e,t)});function zR(e){return gR(LR,e)}const DR=U("ZodISODate",(e,t)=>{p_.init(e,t),Le.init(e,t)});function OR(e){return vR(DR,e)}const VR=U("ZodISOTime",(e,t)=>{m_.init(e,t),Le.init(e,t)});function BR(e){return yR(VR,e)}const WR=U("ZodISODuration",(e,t)=>{h_.init(e,t),Le.init(e,t)});function UR(e){return wR(WR,e)}const HR=(e,t)=>{cw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>uT(e,n)},flatten:{value:n=>lT(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},Zl=U("ZodError",HR,{Parent:Error}),ZR=cT(Zl),YR=dT(Zl),KR=fw(Zl),XR=pw(Zl),Be=U("ZodType",(e,t)=>(Ne.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>Wr(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>ZR(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>KR(e,n,r),e.parseAsync=async(n,r)=>YR(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>XR(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(VP(n,r)),e.superRefine=n=>e.check(BP(n)),e.overwrite=n=>e.check(hs(n)),e.optional=()=>yh(e),e.nullable=()=>wh(e),e.nullish=()=>yh(wh(e)),e.nonoptional=n=>jP(e,n),e.array=()=>lr(e),e.or=n=>SP([e,n]),e.and=n=>kP(e,n),e.transform=n=>xh(e,TP(n)),e.default=n=>PP(e,n),e.prefault=n=>MP(e,n),e.catch=n=>AP(e,n),e.pipe=n=>xh(e,n),e.readonly=()=>zP(e),e.describe=n=>{const r=e.clone();return Xs.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=Xs.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Xs.get(e);const r=e.clone();return Xs.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),kw=U("_ZodString",(e,t)=>{Zf.init(e,t),Be.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(CR(...r)),e.includes=(...r)=>e.check(_R(...r)),e.startsWith=(...r)=>e.check(RR(...r)),e.endsWith=(...r)=>e.check(PR(...r)),e.min=(...r)=>e.check(qa(...r)),e.max=(...r)=>e.check(Sw(...r)),e.length=(...r)=>e.check(Ew(...r)),e.nonempty=(...r)=>e.check(qa(1,...r)),e.lowercase=r=>e.check(IR(r)),e.uppercase=r=>e.check(TR(r)),e.trim=()=>e.check(MR()),e.normalize=(...r)=>e.check(FR(...r)),e.toLowerCase=()=>e.check(jR()),e.toUpperCase=()=>e.check($R())}),GR=U("ZodString",(e,t)=>{Zf.init(e,t),kw.init(e,t),e.email=n=>e.check(X_(qR,n)),e.url=n=>e.check(eR(QR,n)),e.jwt=n=>e.check(hR(pP,n)),e.emoji=n=>e.check(tR(JR,n)),e.guid=n=>e.check(fh(gh,n)),e.uuid=n=>e.check(G_(Gs,n)),e.uuidv4=n=>e.check(q_(Gs,n)),e.uuidv6=n=>e.check(Q_(Gs,n)),e.uuidv7=n=>e.check(J_(Gs,n)),e.nanoid=n=>e.check(nR(eP,n)),e.guid=n=>e.check(fh(gh,n)),e.cuid=n=>e.check(rR(tP,n)),e.cuid2=n=>e.check(oR(nP,n)),e.ulid=n=>e.check(iR(rP,n)),e.base64=n=>e.check(fR(cP,n)),e.base64url=n=>e.check(pR(dP,n)),e.xid=n=>e.check(sR(oP,n)),e.ksuid=n=>e.check(aR(iP,n)),e.ipv4=n=>e.check(lR(sP,n)),e.ipv6=n=>e.check(uR(aP,n)),e.cidrv4=n=>e.check(cR(lP,n)),e.cidrv6=n=>e.check(dR(uP,n)),e.e164=n=>e.check(mR(fP,n)),e.datetime=n=>e.check(zR(n)),e.date=n=>e.check(OR(n)),e.time=n=>e.check(BR(n)),e.duration=n=>e.check(UR(n))});function ue(e){return K_(GR,e)}const Le=U("ZodStringFormat",(e,t)=>{Pe.init(e,t),kw.init(e,t)}),qR=U("ZodEmail",(e,t)=>{r_.init(e,t),Le.init(e,t)}),gh=U("ZodGUID",(e,t)=>{t_.init(e,t),Le.init(e,t)}),Gs=U("ZodUUID",(e,t)=>{n_.init(e,t),Le.init(e,t)}),QR=U("ZodURL",(e,t)=>{o_.init(e,t),Le.init(e,t)}),JR=U("ZodEmoji",(e,t)=>{i_.init(e,t),Le.init(e,t)}),eP=U("ZodNanoID",(e,t)=>{s_.init(e,t),Le.init(e,t)}),tP=U("ZodCUID",(e,t)=>{a_.init(e,t),Le.init(e,t)}),nP=U("ZodCUID2",(e,t)=>{l_.init(e,t),Le.init(e,t)}),rP=U("ZodULID",(e,t)=>{u_.init(e,t),Le.init(e,t)}),oP=U("ZodXID",(e,t)=>{c_.init(e,t),Le.init(e,t)}),iP=U("ZodKSUID",(e,t)=>{d_.init(e,t),Le.init(e,t)}),sP=U("ZodIPv4",(e,t)=>{g_.init(e,t),Le.init(e,t)}),aP=U("ZodIPv6",(e,t)=>{v_.init(e,t),Le.init(e,t)}),lP=U("ZodCIDRv4",(e,t)=>{y_.init(e,t),Le.init(e,t)}),uP=U("ZodCIDRv6",(e,t)=>{w_.init(e,t),Le.init(e,t)}),cP=U("ZodBase64",(e,t)=>{x_.init(e,t),Le.init(e,t)}),dP=U("ZodBase64URL",(e,t)=>{S_.init(e,t),Le.init(e,t)}),fP=U("ZodE164",(e,t)=>{E_.init(e,t),Le.init(e,t)}),pP=U("ZodJWT",(e,t)=>{C_.init(e,t),Le.init(e,t)}),Cw=U("ZodNumber",(e,t)=>{bw.init(e,t),Be.init(e,t),e.gt=(r,o)=>e.check(mh(r,o)),e.gte=(r,o)=>e.check(Du(r,o)),e.min=(r,o)=>e.check(Du(r,o)),e.lt=(r,o)=>e.check(ph(r,o)),e.lte=(r,o)=>e.check(zu(r,o)),e.max=(r,o)=>e.check(zu(r,o)),e.int=r=>e.check(vh(r)),e.safe=r=>e.check(vh(r)),e.positive=r=>e.check(mh(0,r)),e.nonnegative=r=>e.check(Du(0,r)),e.negative=r=>e.check(ph(0,r)),e.nonpositive=r=>e.check(zu(0,r)),e.multipleOf=(r,o)=>e.check(hh(r,o)),e.step=(r,o)=>e.check(hh(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ce(e){return xR(Cw,e)}const mP=U("ZodNumberFormat",(e,t)=>{I_.init(e,t),Cw.init(e,t)});function vh(e){return bR(mP,e)}const hP=U("ZodBoolean",(e,t)=>{T_.init(e,t),Be.init(e,t)});function ar(e){return SR(hP,e)}const gP=U("ZodUnknown",(e,t)=>{__.init(e,t),Be.init(e,t)});function Mo(){return ER(gP)}const vP=U("ZodNever",(e,t)=>{R_.init(e,t),Be.init(e,t)});function yP(e){return kR(vP,e)}const wP=U("ZodArray",(e,t)=>{P_.init(e,t),Be.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(qa(n,r)),e.nonempty=n=>e.check(qa(1,n)),e.max=(n,r)=>e.check(Sw(n,r)),e.length=(n,r)=>e.check(Ew(n,r)),e.unwrap=()=>e.element});function lr(e,t){return AR(wP,e,t)}const xP=U("ZodObject",(e,t)=>{F_.init(e,t),Be.init(e,t),Re(e,"shape",()=>t.shape),e.keyof=()=>Yo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Mo()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mo()}),e.strict=()=>e.clone({...e._zod.def,catchall:yP()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>oT(e,n),e.merge=n=>iT(e,n),e.pick=n=>nT(e,n),e.omit=n=>rT(e,n),e.partial=(...n)=>sT(Iw,e,n[0]),e.required=(...n)=>aT(Tw,e,n[0])});function xe(e,t){const n={type:"object",get shape(){return Uf(this,"shape",{...e}),this.shape},...ie(t)};return new xP(n)}const bP=U("ZodUnion",(e,t)=>{M_.init(e,t),Be.init(e,t),e.options=t.options});function SP(e,t){return new bP({type:"union",options:e,...ie(t)})}const EP=U("ZodIntersection",(e,t)=>{j_.init(e,t),Be.init(e,t)});function kP(e,t){return new EP({type:"intersection",left:e,right:t})}const CP=U("ZodRecord",(e,t)=>{$_.init(e,t),Be.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function ur(e,t,n){return new CP({type:"record",keyType:e,valueType:t,...ie(n)})}const fd=U("ZodEnum",(e,t)=>{A_.init(e,t),Be.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new fd({...t,checks:[],...ie(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new fd({...t,checks:[],...ie(o),entries:i})}});function Yo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new fd({type:"enum",entries:n,...ie(t)})}const IP=U("ZodTransform",(e,t)=>{N_.init(e,t),Be.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(qi(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(qi(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function TP(e){return new IP({type:"transform",transform:e})}const Iw=U("ZodOptional",(e,t)=>{L_.init(e,t),Be.init(e,t),e.unwrap=()=>e._zod.def.innerType});function yh(e){return new Iw({type:"optional",innerType:e})}const _P=U("ZodNullable",(e,t)=>{z_.init(e,t),Be.init(e,t),e.unwrap=()=>e._zod.def.innerType});function wh(e){return new _P({type:"nullable",innerType:e})}const RP=U("ZodDefault",(e,t)=>{D_.init(e,t),Be.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function PP(e,t){return new RP({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const FP=U("ZodPrefault",(e,t)=>{O_.init(e,t),Be.init(e,t),e.unwrap=()=>e._zod.def.innerType});function MP(e,t){return new FP({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Tw=U("ZodNonOptional",(e,t)=>{V_.init(e,t),Be.init(e,t),e.unwrap=()=>e._zod.def.innerType});function jP(e,t){return new Tw({type:"nonoptional",innerType:e,...ie(t)})}const $P=U("ZodCatch",(e,t)=>{B_.init(e,t),Be.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function AP(e,t){return new $P({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const NP=U("ZodPipe",(e,t)=>{W_.init(e,t),Be.init(e,t),e.in=t.in,e.out=t.out});function xh(e,t){return new NP({type:"pipe",in:e,out:t})}const LP=U("ZodReadonly",(e,t)=>{U_.init(e,t),Be.init(e,t)});function zP(e){return new LP({type:"readonly",innerType:e})}const DP=U("ZodCustom",(e,t)=>{H_.init(e,t),Be.init(e,t)});function OP(e){const t=new Rt({check:"custom"});return t._zod.check=e,t}function VP(e,t={}){return NR(DP,e,t)}function BP(e){const t=OP(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(qi(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(qi(o))}},e(n.value,n)));return t}const Yl=Yo(["full-bleed","video-top","pip-bubble","graphic-only","blurred-behind","lower-third","split-left","split-right"]),Kl=Yo(["TitleCard","StatCard","RuleCard","StrikethroughReveal","FlowDiagram","TerminalMock","ChatMock","ScreenshotFrame","BulletList"]),WP=xe({startWord:ce().int().nonnegative(),endWord:ce().int().nonnegative()});xe({id:ue(),anchor:WP,layout:Yl,component:Kl,props:ur(ue(),Mo()),overrides:ur(ue(),Mo()).default({}),rationale:ue().optional()});xe({id:ue(),kind:Yo(["graphic","plain"]).optional(),layout:Yl,component:Kl.optional(),props:ur(ue(),Mo()).optional(),startSec:ce().nonnegative(),endSec:ce().nonnegative(),graphicRect:xe({x:ce(),y:ce(),w:ce(),h:ce()}).optional(),elements:ur(ue(),xe({dx:ce().optional(),dy:ce().optional(),scale:ce().positive().optional()})).optional(),video:xe({scale:ce().positive().max(4).optional(),dy:ce().optional(),dx:ce().optional(),autoZoom:ar().optional()}).optional(),pip:xe({cornerRadius:ce().min(0).max(1).optional(),x:ce().min(0).max(1).optional(),y:ce().min(0).max(1).optional()}).optional(),captionY:ce().min(0).max(1).optional(),captionScale:ce().min(.2).max(3).optional(),pinned:ar().optional()}).superRefine((e,t)=>{e.kind!=="plain"&&(e.component===void 0||e.props===void 0)&&t.addIssue({code:"custom",message:'a graphic cue requires component and props; only kind: "plain" may omit them'})});xe({centerYFrac:ce().min(0).max(1),sizeFrac:ce().min(0).max(1).optional(),centerXFrac:ce().min(0).max(1).optional(),sourceAspect:ce().positive().optional()});const Yf=xe({bg:ue().default("#0B0B0E"),fg:ue().default("#FFFFFF"),accent:ue().default("#FFE14D"),muted:ue().default("#9A9AA3"),success:ue().default("#5FBF77"),cardBg:ue().default("#15151B"),cardBorder:ue().default("#2A2A33"),danger:ue().default("#FF5C5C"),radiusPx:ce().default(24),fontDisplay:ue().default("'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif"),fontMono:ue().default("'SF Mono', 'Cascadia Code', Consolas, monospace")}),UP=Yf.parse({}),HP=xe({eyebrow:ue().max(28).optional(),title:ue().min(1).max(48).describe("the claim WITHOUT the emphasis token — never repeat the emphasis here"),emphasis:ue().max(16).optional().describe("the number/punch token pulled OUT of the title (e.g. '861%') — not a duplicate of it"),sub:ue().max(64).optional()}),ZP=xe({label:ue().min(1).max(28),value:ue().min(1).max(12),caption:ue().max(40).optional(),inverted:ar().default(!1)}),YP=xe({kicker:ue().min(1).max(24),text:ue().min(1).max(40),struck:ue().max(40).optional()}),KP=xe({lines:lr(xe({text:ue().min(1).max(32),struck:ar().default(!1),mark:Yo(["none","cross","check"]).default("none")})).min(1).max(4)}),XP=xe({title:ue().max(28).optional(),items:lr(ue().min(1).max(36)).min(2).max(5)}),GP=xe({nodes:lr(ue().min(1).max(16)).min(2).max(5),emphasizeLast:ar().default(!0)}),qP=xe({windows:lr(xe({title:ue().max(24),lines:lr(ue().max(40)).min(1).max(6)})).min(1).max(5),fanOut:ue().max(20).optional()}),QP=xe({messages:lr(xe({from:Yo(["user","agent"]),text:ue().min(1).max(60)})).min(1).max(4),keyword:ue().max(16).optional().describe("ONLY for a 'comment <word>' ask: the single distinctive word the viewer types, plain and unformatted. Leave unset for any other CTA — especially 'reply with a number/which one', where there is no word to type. Never a referential filler like 'number', 'answer', 'comment' or 'below'.")}),JP=xe({src:ue().optional(),label:ue().max(32).optional(),kenBurns:ar().default(!0)}),eF={TitleCard:{propsSchema:HP,defaultProps:{title:"TITLE"},defaultLayout:"pip-bubble",altLayouts:[],whenToUse:"The core claim or hook as big typography; use `emphasis` for a huge number or punch word."},StatCard:{propsSchema:ZP,defaultProps:{label:"METRIC",value:"+0%"},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"One striking metric (value like '+242%', '×3', '5s'); punchline in `caption`."},RuleCard:{propsSchema:YP,defaultProps:{kicker:"RULE",text:"DO THE THING"},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"A prescriptive takeaway ('CAPACITY RULE / CAP ACTIVE AGENTS'); `struck` shows the rejected alternative."},StrikethroughReveal:{propsSchema:KP,defaultProps:{lines:[{text:"NOT THIS",struck:!0}]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:'Negation/contrast beat — big words over the blurred speaker. Strike EVERY line of the phrase the speaker negates, not just its tail — a half-struck claim reads as a typo. For wrong-vs-right lists, set mark: "cross"/"check" (✗/✓) per line instead.'},FlowDiagram:{propsSchema:GP,defaultProps:{nodes:["A","B"]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"A causal chain or pipeline as chips with arrows (TEAM → AI AGENTS → CHURN)."},TerminalMock:{propsSchema:qP,defaultProps:{windows:[{title:"terminal-01",lines:["$ run"]}]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"Anything about running code/processes/agents — stylized terminal windows."},ChatMock:{propsSchema:QP,defaultProps:{messages:[{from:"user",text:"hello"}]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:"A quoted phrase or exchange as chat bubbles over the blurred speaker; for a comment-CTA beat, set `keyword` to the word viewers should type."},ScreenshotFrame:{propsSchema:JP,defaultProps:{},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"Reference to a document/PR/review — a framed screenshot look with a label chip."},BulletList:{propsSchema:XP,defaultProps:{items:["FIRST","SECOND"]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:"An ENUMERATION — the speaker lists two or more parallel things ('what you need is X, Y, Z'). One bullet per item, optional kicker title. Use this for lists instead of bending TitleCard or StrikethroughReveal around them."}};function bh(e,t,n={}){const r=eF[e],o={...r.defaultProps,...t,...n},i=r.propsSchema.safeParse(o);return i.success?i.data:null}const tF=xe({dx:ce().optional(),dy:ce().optional(),scale:ce().positive().optional()}),_w=xe({props:ur(ue(),Mo()).default({}),elements:ur(ue(),tF).default({}),timing:xe({startSec:ce().nonnegative(),endSec:ce().nonnegative()}).optional(),component:Kl.optional(),layout:Yl.optional(),video:xe({scale:ce().positive().max(4).optional(),dy:ce().optional(),dx:ce().optional(),autoZoom:ar().optional()}).optional(),pip:xe({cornerRadius:ce().min(0).max(1).optional(),x:ce().min(0).max(1).optional(),y:ce().min(0).max(1).optional()}).optional(),captionY:ce().min(0).max(1).optional(),captionScale:ce().min(.2).max(3).optional(),graphicRect:xe({x:ce().min(0).max(1),y:ce().min(0).max(1),w:ce().min(.08).max(1),h:ce().min(.05).max(1)}).optional(),hidden:ar().optional()}),nF=xe({text:ue().min(1).max(80),was:ue()});function rF(e,t,n){var r;return((r=e[String(t)])==null?void 0:r.was)??n}const oF=xe({theme:Yf.partial().default({}),scenes:ur(ue(),_w).default({}),captions:ur(ue(),nF).default({}),splits:lr(ce().nonnegative()).default([])}),iF=()=>oF.parse({});function sF(e,t){return bh(e,{},t)??bh(e,{},{})}function aF(e,t){const n=e[t],r=t.indexOf("@");if(r===-1)return n;const o=e[t.slice(0,r)];if(!o)return n;const{timing:i,hidden:s,...a}=o;return n?{...a,...n,props:{...a.props,...n.props},elements:{...a.elements,...n.elements},...a.video||n.video?{video:{...a.video,...n.video}}:{},...a.pip||n.pip?{pip:{...a.pip,...n.pip}}:{}}:{...a,props:{...a.props},elements:{...a.elements}}}function Ou(e,t){const n=new Set(e.map(i=>i.id)),r=Object.keys(t.scenes).filter(i=>!n.has(i));return{cues:e.map(i=>{const s=aF(t.scenes,i.id);if(!s)return i;const a=s.component!==void 0&&s.component!==i.component,l=s.component??i.component,u=s.component!==void 0&&a?sF(s.component,s.props):{...i.props,...s.props},d=s.layout!==void 0&&s.layout!==i.layout,{graphicRect:p,...m}=i;return{...d?m:i,component:l,layout:s.layout??i.layout,props:u,...Object.keys(s.elements).length>0?{elements:s.elements}:{},...s.video?{video:s.video}:{},...s.pip?{pip:s.pip}:{},...s.captionY!==void 0?{captionY:s.captionY}:{},...s.captionScale!==void 0?{captionScale:s.captionScale}:{},...s.graphicRect?{graphicRect:s.graphicRect}:{},...s.timing&&!i.pinned?{startSec:s.timing.startSec,endSec:s.timing.endSec,pinned:!0}:{}}}),orphans:r}}const Qa=.3;function lF(e,t){const n=[...e];for(const r of[...t].sort((o,i)=>o-i)){const o=n.findIndex(s=>r>=s.startSec+Qa&&r<=s.endSec-Qa);if(o===-1)continue;const i=n[o];n.splice(o,1,{...i,endSec:r},{...i,id:`${i.id.split("@")[0]}@${Math.round(r*1e3)}`,startSec:r})}return n}function Sh(e,t){const n=[];return{cues:e.filter(o=>{var i;return((i=t.scenes[o.id])==null?void 0:i.hidden)!==!0?!0:(n.push(o.id),!1)}),hidden:n}}function uF(e,t){const n=[];if(Object.keys(t).length===0)return{lines:[...e],dropped:n};let r=0;return{lines:e.map(i=>({...i,words:i.words.map(s=>{const a=t[String(r++)];return a?s.text!==a.was?(n.push({index:r-1,expected:a.was,found:s.text}),s):{...s,text:a.text}:s})})),dropped:n}}function cF(e,t){return Yf.parse({...e,...t.theme})}function dF(e,t,n,r){const o=e.scenes[t]??_w.parse({});return{...e,scenes:{...e.scenes,[t]:{...o,elements:{...o.elements,[n]:{...o.elements[n],...r}}}}}}function fF(e,t,n){const r=e.scenes[t];if(!r)return e;const{[n]:o,...i}=r.elements;return{...e,scenes:{...e.scenes,[t]:{...r,elements:i}}}}function pF(e,t){const n=e.scenes[t];if(!n||!n.timing)return e;const{timing:r,...o}=n;return{...e,scenes:{...e.scenes,[t]:o}}}function mF(e,t){const n=e.scenes[t];if(!n||!n.graphicRect)return e;const{graphicRect:r,...o}=n;return{...e,scenes:{...e.scenes,[t]:o}}}const hF=.6;function gF(e,t){const n=new Set([0]);for(const r of e??[])Number.isFinite(r)&&r>0&&r<t&&n.add(r);return[...n].sort((r,o)=>r-o)}function vF(e,t){const n=t.outputDurationSec,r=[...e].sort((d,p)=>d.startSec-p.startSec);if(n<=0)return r;const o=gF(t.clipStarts,n),i=[];let s=0;for(const d of r)d.startSec-s>1e-9&&i.push({start:s,end:d.startSec}),s=Math.max(s,d.endSec);n-s>1e-9&&i.push({start:s,end:n});const a=[];for(const d of i){const p=o.filter(h=>h>d.start+1e-9&&h<d.end-1e-9),m=[d.start,...p,d.end];for(let h=0;h<m.length-1;h++){const w=m[h],v=m[h+1];if(v-w<hF)continue;let E=0;for(let g=0;g<o.length;g++)o[g]<=w+1e-9&&(E=g);a.push({start:w,end:v,clip:E})}}const l=new Map,u=a.map(d=>{const p=l.get(d.clip)??0;return l.set(d.clip,p+1),{id:p===0?`take-${d.clip}`:`take-${d.clip}-${p}`,kind:"plain",layout:"full-bleed",startSec:d.start,endSec:d.end}});return[...r,...u].sort((d,p)=>d.startSec-p.startSec)}const yF=1.05;function wF(e,t){for(const r of e)if(t>=r.startSec&&t<r.endSec){const o=r.endSec-r.startSec,i=o>0?(t-r.startSec)/o:1,s=.5-.5*Math.cos(Math.PI*i);return r.from+(r.to-r.from)*s}const n=e[e.length-1];return n&&t===n.endSec?n.to:1}function xF(e,t,n){if(e.length===0)return{x:0,y:0,w:(n==null?void 0:n.width)??0,h:(n==null?void 0:n.height)??0,full:!0};if(t<e[0].startSec)return e[0].rect;for(const r of e)if(t>=r.startSec&&t<r.endSec)return r.rect;return e[e.length-1].rect}const Lt={width:1080,height:1920};Lt.width;Lt.height;const gs={centerYFrac:.38,sizeFrac:.22},bF=.35,SF=.45,Rw=1-1/yF,EF=.4*Rw,kF=.6*Rw;function Pw(e,t,n=Lt){const r=e.w*n.width,o=e.h*n.height;return Math.max(o,r/(t.sourceAspect??n.width/n.height))}function CF(e,t,n=Lt){const r=e.h*n.height,o=Pw(e,t,n),i=o-r;if(i<=1)return .5;const s=t.sizeFrac??gs.sizeFrac,a=(t.centerYFrac-s/2-bF*s)*o,l=(t.centerYFrac+s/2)*o,u=(a+l)/2-SF*r,d=a-EF*r,p=l+kF*r-r,m=p<=d?Math.min(Math.max(u,p),d):p;return Math.min(1,Math.max(0,m/i))}function IF(e,t,n,r,o=Lt){if(r.length===0)return e;const i=t.h*o.height,s=Pw(t,n,o);if(s-i<=1)return e;const l=i/s,u=1-l;if(u<=0)return e;let d=e*u;for(let p=0;p<r.length+1;p++){const m=r.find(x=>{const b=x.y,k=x.y+x.h,S=d+l,C=b<d&&d<k,I=b<S&&S<k;return C||I});if(!m)break;const h=[],w=m.y+m.h;w<=u&&h.push(w);const v=m.y-l;if(v>=0&&h.push(v),m.h<=l){const x=Math.max(0,m.y+m.h-l),b=Math.min(u,m.y);x<=b&&h.push(Math.min(Math.max(d,x),b))}const E=n.sizeFrac??gs.sizeFrac,g=n.centerYFrac+E/2,y=h.filter(x=>x+l>=g);if(y.length===0)return e;d=y.reduce((x,b)=>Math.abs(b-d)<Math.abs(x-d)?b:x)}return Math.min(1,Math.max(0,d/u))}function TF(e,t,n=Lt){const r=e.w*n.width,o=e.h*n.height,i=Math.max(r,o*(t.sourceAspect??n.width/n.height)),s=i-r;if(s<=1||t.centerXFrac===void 0)return .5;const a=t.centerXFrac*i-r/2;return Math.min(1,Math.max(0,a/s))}const _F={top:.12,bottom:.22,right:.16,left:.04},RF={top:.06,bottom:.12,right:.05,left:.05};function kr(e=Lt){return e.width>e.height?RF:_F}function PF(e=Lt){const t=kr(e);return{x:t.left,y:t.top,w:1-t.left-t.right,h:1-t.top-t.bottom}}const FF=.08,MF=.05;function Ja(e,t=Lt){const n=PF(t),r=1e-9,o=(u,d,p)=>u<d-r?d:u>p+r?p:u,i=o(e.w,FF,n.w),s=o(e.h,MF,n.h),a=o(e.x,n.x,n.x+n.w-i),l=o(e.y,n.y,n.y+n.h-s);return{x:a,y:l,w:i,h:s}}const Eh=.045,bn={x:0,y:0,w:1,h:1},Vu=.3,Gr={x:.5-Vu/2,y:.66,w:Vu,h:Vu*1080/1920};function jr(e,t=gs,n=[],r=Lt){const o=a=>IF(CF(a,t,r),a,t,n,r),i=a=>TF(a,t,r),s=r.width>r.height;switch(e){case"full-bleed":return{video:{rect:bn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(bn),objectPosX:i(bn)},graphic:null,captionAnchor:.7};case"lower-third":{const a=s?{x:.05,y:.7,w:.62,h:.18}:{x:.04,y:.56,w:.8,h:.22};return{video:{rect:bn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(bn),objectPosX:i(bn)},graphic:a,captionAnchor:s?.62:.49}}case"split-left":case"split-right":{if(s){const l=e==="split-left",u={x:l?0:.5,y:0,w:.5,h:1};return{video:{rect:u,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(u),objectPosX:i(u)},graphic:l?{x:.55,y:.2,w:.4,h:.56}:{x:.05,y:.2,w:.4,h:.56},captionAnchor:.82}}const a={x:0,y:0,w:1,h:.5};return{video:{rect:a,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(a),objectPosX:i(a)},graphic:{x:.04,y:.58,w:.8,h:.2},captionAnchor:.53}}case"video-top":{const a={x:0,y:0,w:1,h:.42};return{video:{rect:a,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(a),objectPosX:i(a)},graphic:{x:.04,y:.54,w:.8,h:.24},captionAnchor:.48}}case"pip-bubble":return{video:{rect:Gr,cornerRadius:1,blurPx:0,dim:0,opacity:1,objectPosY:o(Gr),objectPosX:i(Gr)},graphic:{x:.06,y:.14,w:.78,h:.42},captionAnchor:.61};case"graphic-only":return{video:{rect:Gr,cornerRadius:1,blurPx:0,dim:0,opacity:0,objectPosY:o(Gr),objectPosX:i(Gr)},graphic:{x:.04,y:.14,w:.8,h:.54},captionAnchor:.73};case"blurred-behind":return{video:{rect:bn,cornerRadius:0,blurPx:22,dim:.55,opacity:1,objectPosY:o(bn),objectPosX:i(bn)},graphic:{x:.07,y:.24,w:.77,h:.36},captionAnchor:.69}}}const jF={x:.07,y:.24,w:.77,h:.36};function Fw(e,t=Lt){return e.graphicRect?Ja(e.graphicRect,t):jr(e.layout,gs,[],t).graphic??jF}const Mw=.35;function nr(e,t){for(const n of e)if(t>=n.startSec&&t<n.endSec)return n;return null}function Ut(e,t,n){return e+(t-e)*n}function $F(e,t,n){return{x:Ut(e.x,t.x,n),y:Ut(e.y,t.y,n),w:Ut(e.w,t.w,n),h:Ut(e.h,t.h,n)}}function kh(e,t,n){return{rect:$F(e.rect,t.rect,n),cornerRadius:Ut(e.cornerRadius,t.cornerRadius,n),blurPx:Ut(e.blurPx,t.blurPx,n),dim:Ut(e.dim,t.dim,n),opacity:Ut(e.opacity,t.opacity,n),objectPosY:Ut(e.objectPosY,t.objectPosY,n),objectPosX:Ut(e.objectPosX,t.objectPosX,n)}}function el(e){return e*e*(3-2*e)}function jw(e){return e.filter(t=>!(t.kind==="plain"&&t.layout==="full-bleed"))}function Bu(e,t,n,r){const o=jr(e.layout,t,n,r).video,i=e.layout==="pip-bubble"?e.pip:void 0;if(!i)return o;const s={...o.rect,x:Math.min(Math.max(i.x??o.rect.x,0),1-o.rect.w),y:Math.min(Math.max(i.y??o.rect.y,0),1-o.rect.h)};return{...o,rect:s,cornerRadius:i.cornerRadius??o.cornerRadius}}function AF(e,t,n=gs,r=[],o=Lt){const i=jw(e),s=r.filter(g=>t>=g.startSec&&t<g.endSec),a=jr("full-bleed",n,s,o).video,l=nr(i,t);if(!l)return a;const u=Bu(l,n,s,o),d=Math.min(Mw,(l.endSec-l.startSec)/2),p=t-l.startSec,m=l.endSec-t,h=nr(i,l.startSec-.001),w=nr(i,l.endSec+.001),v=h?Bu(h,n,s,o):a,E=w?Bu(w,n,s,o):a;return p<d?kh(v,u,el(p/d)):m<d?kh(u,E,el(1-m/d)):u}function Wu(e){return e==="pip-bubble"||e==="graphic-only"?1:0}function NF(e,t){const n=jw(e),r=nr(n,t);if(!r)return 0;const o=Wu(r.layout),i=Math.min(Mw,(r.endSec-r.startSec)/2),s=nr(n,r.startSec-.001),a=nr(n,r.endSec+.001),l=s?Wu(s.layout):0,u=a?Wu(a.layout):0,d=t-r.startSec,p=r.endSec-t;return d<i?Ut(l,o,el(d/i)):p<i?Ut(o,u,el(1-p/i)):o}function LF(e,t,n){return e.filter(r=>(r.startSec??Number.NEGATIVE_INFINITY)<n&&(r.endSec??Number.POSITIVE_INFINITY)>t)}function zF(e,t){let n=0;for(const r of t){const o=Math.max(e.y,r.y),i=Math.min(e.y+e.h,r.y+r.h);i>o&&(n+=i-o)}return Math.min(1,n/e.h)}function DF(e,t,n,r=Lt){const o=jr(e,void 0,[],r),i=kr(r),s=o.captionAnchor,a=l=>{const u={y:l-Eh,h:Eh*2};if(u.y<i.top||u.y+u.h>1-i.bottom||zF(u,t)>0)return!1;const d=n??o.graphic;return!(d&&Math.min(u.y+u.h,d.y+d.h)-Math.max(u.y,d.y)>0)};if(a(s))return s;for(let l=.02;l<=.6;l+=.02)for(const u of[s-l,s+l])if(a(u))return u;return s}const Ch=.4;function OF(e,t){if(!t)return e;const n=e.replace(/^[^A-Za-z0-9]+|[^A-Za-z0-9]+$/g,"");return n.toLowerCase()!==t.toLowerCase()?e:e.replace(n,`"${n.toUpperCase()}"`)}function VF(e,t){return t?e>=t.startSec-Ch&&e<=t.endSec+Ch:!1}const BF=({line:e,wordOffset:t,verticalAnchor:n,fontSizePx:r,activeColor:o,ctaKeyword:i,ctaWindow:s})=>{const a=ht(),{fps:l,width:u,height:d}=Xe(),p=kr({width:u,height:d}),m=e.start+a/l;return f.jsx(an,{style:{pointerEvents:"none"},children:f.jsx("div",{style:{position:"absolute",top:`${n*100}%`,left:0,right:0,transform:"translateY(-50%)",display:"flex",justifyContent:"center",gap:"0.28em",flexWrap:"wrap",paddingLeft:`${p.left*100}%`,paddingRight:`${p.right*100}%`,fontFamily:"'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif",fontWeight:900,fontSize:r,lineHeight:1.15,textAlign:"center",color:"white",WebkitTextStroke:"10px rgba(0,0,0,0.85)",paintOrder:"stroke fill",textShadow:"0 4px 24px rgba(0,0,0,0.55)"},children:e.words.map((h,w)=>{const v=m>=h.start&&m<=Math.max(h.end,h.start+.12);return f.jsx("span",{"data-caption-word":t+w,"data-caption-text":h.text,style:{display:"inline-block",pointerEvents:"auto",transform:v?"scale(1.08)":"scale(1)",color:v?o:"white",transition:"transform 60ms linear"},children:OF(h.text,VF(h.start,s)?i:void 0)},w)})})})},WF=({lines:e,cues:t=[],verticalAnchor:n=.76,fontSizePx:r=64,activeColor:o="#FFE14D",ctaKeyword:i,ctaWindow:s,sourceTextRegions:a=[]})=>{const{fps:l,width:u,height:d}=Xe(),p={width:u,height:d},m=[];let h=0;for(const w of e)m.push(h),h+=w.words.length;return f.jsx(an,{children:e.map((w,v)=>{const E=t.length>0?nr(t,w.start):null,g=(E==null?void 0:E.captionY)!==void 0?E.captionY:t.length>0||a.length>0?DF((E==null?void 0:E.layout)??"full-bleed",LF(a,w.start,w.end),E==null?void 0:E.graphicRect,p):n,y=Math.round(w.start*l),x=Math.max(1,Math.round((w.end-w.start)*l));return f.jsx(at,{from:y,durationInFrames:x,children:f.jsx(BF,{line:w,wordOffset:m[v],verticalAnchor:g,fontSizePx:r*((E==null?void 0:E.captionScale)??1),activeColor:o,ctaKeyword:i,ctaWindow:s})},v)})})};function UF(e,t,n,r=.5,o=.5){const i=Math.max(1,e.width),s=Math.max(1,e.height),a=Math.max(1,t.w),l=Math.max(1,t.h),u=Math.max(n.width/a,n.height/l),d=-t.x*u+(n.width-a*u)*Ih(r),p=-t.y*u+(n.height-l*u)*Ih(o);return{width:i*u,height:s*u,left:d,top:p}}function Ih(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):.5}function $w(e,t,n){const r=Math.max(1,e.width),o=Math.max(1,e.height),i=Math.max(1,t.w),s=Math.max(1,t.h),a=Math.min(n.width/i,n.height/s),l=-t.x*a+(n.width-i*a)/2,u=-t.y*a+(n.height-s*a)/2;return{width:r*a,height:o*a,left:l,top:u}}function HF(e,t){return $w(e,{x:0,y:0,w:e.width,h:e.height},t)}function ZF(e,t){if(e.length===0)return t;for(const o of e)if(t>=o.outIn&&t<o.outOut)return o.srcIn+(t-o.outIn);const n=e[0];return t<n.outIn?n.srcIn:e[e.length-1].srcOut}function YF(e,t,n,r,o,i){return e==="fit"?$w(t,n,r):UF(t,n,r,o,i)}function KF(e,t,n,r){return e.length===0?{x:0,y:0,w:r.width,h:r.height,full:!0}:xF(e,ZF(t,n),r)}const XF=({cues:e,theme:t,face:n,zoomPlan:r,sourceTextRegions:o,contentTimeline:i,spans:s,sourceSize:a,contentCropMode:l="cover",sourceFit:u="cover",children:d})=>{const p=ht(),{fps:m,width:h,height:w}=Xe(),v=p/m,g=AF(e,v,n??void 0,o??[],{width:h,height:w}),y=NF(e,v),x=g.rect.w*h,b=g.rect.h*w,k=g.cornerRadius*Math.min(x,b)/2,S=nr(e,v),C=S==null?void 0:S.video,I=r&&r.length>0?wF(r,v):1,F=Math.max(0,g.opacity*(1-.6*g.cornerRadius)),j=(C==null?void 0:C.autoZoom)!==!1,P=u==="contain"&&a!==void 0,A=j&&!P?1+(I-1)*F:1,V=(C==null?void 0:C.scale)??1,_=(C==null?void 0:C.dx)??0,L=(C==null?void 0:C.dy)??0,O=[_!==0||L!==0?`translate(${_}px, ${L}px)`:"",A*V!==1?`scale(${A*V})`:""].filter(Boolean).join(" ")||void 0;return f.jsxs(an,{children:[f.jsx(an,{style:{background:t.bg,opacity:y}}),f.jsxs("div",{"data-edit-video":S==null?void 0:S.id,style:{position:"absolute",left:`${g.rect.x*100}%`,top:`${g.rect.y*100}%`,width:x,height:b,borderRadius:k,overflow:"hidden",opacity:g.opacity,backgroundColor:P?t.bg:void 0,boxShadow:g.cornerRadius>.5?"0 18px 60px rgba(0,0,0,0.55)":void 0},children:[f.jsx("div",{style:{position:"absolute",inset:0,filter:g.blurPx>.5?`blur(${g.blurPx}px)`:void 0,transform:O,transformOrigin:"50% 40%","--ossclip-obj-y":`${g.objectPosY*100}%`,"--ossclip-obj-x":`${g.objectPosX*100}%`},children:P?f.jsx(GF,{source:a,slot:{width:x,height:b},children:d}):f.jsx(qF,{timeline:i,spans:s,sourceSize:a,mode:l,tSec:v,slot:{width:x,height:b},posX:g.objectPosX,posY:g.objectPosY,children:d})}),f.jsx("div",{style:{position:"absolute",inset:0,background:"black",opacity:g.dim}})]})]})},GF=({source:e,slot:t,children:n})=>{const r=HF(e,t);return f.jsx("div",{style:{position:"absolute",width:r.width,height:r.height,left:r.left,top:r.top},children:n})},qF=({timeline:e,spans:t,sourceSize:n,mode:r,tSec:o,slot:i,posX:s,posY:a,children:l})=>{const u=f.jsx("div",{style:{position:"absolute",inset:0},children:l});if(!e||e.length<2||!n)return u;const d=KF(e,t??[],o,n);if(d.full)return u;const p=YF(r,n,d,i,s,a);return f.jsx("div",{style:{position:"absolute",width:p.width,height:p.height,left:p.left,top:p.top},children:l})},Kf=.94,QF=new Set(["FlowDiagram","StrikethroughReveal","ChatMock","BulletList"]),Th=2.4,qs=.45,Xl=.58,vt=.72,JF=.62;function Qr(e,t,n,r,o){const i=Math.max(1,Math.floor(n/Math.max(1,o*t)));return Math.max(1,Math.ceil(e/i))*t*r}const Me=e=>typeof e=="string"?e:"",Hn=e=>Array.isArray(e)?e:[];function e4(e,t,n,r=1/0){switch(e){case"TitleCard":{const o=n-80,i=Me(t.emphasis),s=28;let a=0,l=0;Me(t.eyebrow)&&(a+=34*1.2,l++),i&&(a+=210*.95,l++);const u=i?64:96;return a+=Qr(Me(t.title).length,u,o,1.05,vt),l++,Me(t.sub)&&(a+=Qr(Me(t.sub).length,40,o,1.2,Xl),l++),a+s*Math.max(0,l-1)}case"StatCard":{const o=Qr(Me(t.label).length,42,n*.55,1.15,vt);let i=88+Math.max(o,110*1.15)+4;return Me(t.caption)&&(i+=30+(38*1.2+32+4)),i}case"RuleCard":{const o=n-60-96;let i=80;return i+=30*1.2+14,i+=Qr(Me(t.text).length,72,o,1.02,vt),Me(t.struck)&&(i+=26+Qr(Me(t.struck).length,44,o,1.2,vt)),i}case"StrikethroughReveal":{const o=Hn(t.lines).map(a=>Me(a==null?void 0:a.text)),i=Dw(o,n,r),s=o.reduce((a,l)=>a+zw(l,i,n).length,0);return s*i*1.08+i*.2*Math.max(0,s-1)}case"FlowDiagram":{const o=Hn(t.nodes).map(l=>Me(l)),i=Math.max(1,o.length),{mode:s,fontSize:a}=Zw(o,n,r);return s==="row"?a*_i+4:a*(_i*i+Hw*(i-1))}case"TerminalMock":{const o=Hn(t.windows);let i=0;for(const s of o){const a=Hn(s==null?void 0:s.lines);i+=56.8+2,i+=Math.max(1,a.length)*27*1.2+8*Math.max(0,a.length-1)+36,i+=4}return i+=22*Math.max(0,o.length-1),Me(t.fanOut)&&(i+=22+40*1.2),i}case"ChatMock":{const o=Ww(t).map(s=>s.text),i=Uw(o,{widthPx:n,heightPx:r});return Bw(o,i,n)}case"ScreenshotFrame":{const o=n*.94;return(Me(t.src)?o*9/16:480)+4}case"BulletList":{const o=Hn(t.items).map(s=>Me(s)),i=Lw(o,n,r,!!Me(t.title));return o4(o.length,i,!!Me(t.title))}}}const Dn=e=>Me(e).split(/\s+/).reduce((t,n)=>Math.max(t,n.length),0);function t4(e,t){switch(e){case"RuleCard":{const n=Dn(t.kicker)*30*(vt+.28),r=Dn(t.text)*72*vt,o=Dn(t.struck)*44*(vt+.04),i=Math.max(n,r,o);return i>0?156+i:0}case"TitleCard":{const n=Me(t.emphasis)?64:96,r=Dn(t.eyebrow)*34*(vt+.35),o=Dn(t.emphasis)*210*vt,i=Dn(t.title)*n*(vt+.02),s=Dn(t.sub)*40*Xl,a=Math.max(r,o,i,s);return a>0?80+a:0}case"TerminalMock":{let n=0;for(const r of Hn(t.windows))for(const o of Hn(r==null?void 0:r.lines))n=Math.max(n,Me(o).length);return n>0?108+n*27*JF:0}case"StatCard":{const n=Me(t.value).length*110*vt;return n===0?0:164+Dn(t.label)*42*vt+40+n}default:return 0}}const _h=36,n4=120,Aw=1.6,Nw=1.1,r4=1.1;function o4(e,t,n){return(Math.max(1,e)*Aw+(n?Nw:0))*t}function Lw(e,t=831,n=1/0,r=!1){const o=e.reduce((a,l)=>Math.max(a,l.length),0);if(o===0)return _h;const i=t/(o*vt+r4),s=n*Kf/(Math.max(1,e.length)*Aw+(r?Nw:0));return Math.max(_h,Math.min(n4,Math.floor(Math.min(i,s))))}const i4=92,s4=44,a4=150,l4=[" → "," -> "," → "," > "];function zw(e,t,n){const r=o=>o.length*t*vt<=n;if(r(e))return[e];for(const o of l4){if(!e.includes(o))continue;const s=e.split(o).map((a,l)=>l===0?a:`${o.trim()} ${a}`.trim());if(s.every(r))return s}return[e]}function Dw(e,t=831,n=1/0){const r=e.reduce((s,a)=>Math.max(s,a.length),0);if(r===0)return i4;const o=t/(r*vt),i=n/(Math.max(1,e.length)*1.28);return Math.max(s4,Math.min(a4,Math.floor(Math.min(o,i))))}const Rh=22,Ph=44,u4=96,Fh=22,Ow=.85,Vw=.82;function Bw(e,t,n){const o=(n-80)*Vw-2*t*Ow;let i=0;for(const s of e)i+=Qr(s.length,t,o,1.2,Xl)+t*1.2+4;return i+t*.5*Math.max(0,e.length-1)}function Ww(e){const t=Me(e.keyword);return t?[{from:"user",text:`"${t.toUpperCase()}"`}]:Hn(e.messages).map(n=>{const r=n??{};return{from:r.from==="agent"?"agent":"user",text:Me(r.text)}})}function Uw(e,t={}){const n=t.widthPx??831,r=t.heightPx??1/0,o=n-80,i=e.reduce((p,m)=>Math.max(p,m.length),0);if(i===0)return Ph;const s=e.flatMap(p=>p.split(/\s+/)).reduce((p,m)=>Math.max(p,m.length),0),a=p=>o*Vw/(p*Xl+2*Ow),l=Math.min(i,Fh),u=i>Fh?Ph:u4;let d=Math.floor(Math.min(a(l),a(s),u));for(;d>Rh&&Bw(e,d,n)>r*Kf;)d-=1;return Math.max(Rh,d)}const Mh=26,c4=22,d4=76,_i=2.1,Hw=2.05;function Zw(e,t,n=1/0){const r=e.reduce((v,E)=>v+E.length,0),o=Math.max(1,e.length),i=.78,s=1.6,a=1.8,l=t-20,u=Math.floor(Math.min(l/(i*r+s*o+a*(o-1)),n/_i)),d=Math.max(...e.map(v=>v.length),1),p=_i*o+Hw*(o-1),m=Math.floor(Math.min(l/(i*d+s),n/p,d4)),h=u>=Mh;return m>=c4?h?u*_i>=m*p?{mode:"row",fontSize:u}:{mode:"stack",fontSize:m}:{mode:"stack",fontSize:m}:{mode:"row",fontSize:Math.max(Mh,u)}}function f4(e,t,n){if(QF.has(e))return 1;const r=n.heightPx*Kf,o=u=>e4(e,t,n.widthPx/u)*u<=r;if(!o(qs))return qs;const i=t4(e,t),s=i>0?n.widthPx/i:Th;let a=qs,l=Math.max(qs,Math.min(Th,s));if(l<=a)return a;for(let u=0;u<24;u++){const d=(a+l)/2;o(d)?a=d:l=d}return a}function tt(e=0){const t=ht(),{fps:n}=Xe();return Qc({frame:t-e,fps:n,config:{damping:200,stiffness:130},durationInFrames:Math.round(n*.5)})}function hn(e,t=26){return{opacity:e,transform:`translateY(${(1-e)*t}px)`}}function $r(e){return{opacity:e,transform:`scale(${.9+.1*e})`}}function p4(e,t){return!e||t===1?e:Object.fromEntries(Object.entries(e).map(([n,r])=>[n,{...r,...r.dx!==void 0?{dx:r.dx/t}:{},...r.dy!==void 0?{dy:r.dy/t}:{}}]))}function Ye(e,t){const n=e==null?void 0:e[t];if(!n)return{};const r=[`translate(${n.dx??0}px, ${n.dy??0}px)`];return n.scale!==void 0&&n.scale!==1&&r.push(`scale(${n.scale})`),{transform:r.join(" ")}}const m4=({props:e,theme:t,edits:n})=>{var l;const r=tt(0),o=tt(5),i=tt(10),s=(l=e.emphasis)==null?void 0:l.trim(),a=!!s&&s.toLowerCase().includes(e.title.trim().toLowerCase());return f.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:28,textAlign:"center",fontFamily:t.fontDisplay,color:t.fg,padding:"0 40px"},children:[e.eyebrow?f.jsx("div",{"data-edit-id":"eyebrow",style:{...hn(r),fontSize:34,fontWeight:700,letterSpacing:"0.35em",color:t.muted,textTransform:"uppercase",...Ye(n,"eyebrow")},children:e.eyebrow}):null,s?f.jsx("div",{"data-edit-id":"emphasis",style:{...hn(o,40),fontSize:210,fontWeight:900,lineHeight:.95,...Ye(n,"emphasis")},children:s}):null,a?null:f.jsx("div",{"data-edit-id":"title",style:{...hn(s?i:o,34),fontSize:s?64:96,fontWeight:900,lineHeight:1.05,textTransform:"uppercase",letterSpacing:"0.02em",...Ye(n,"title")},children:e.title}),e.sub?f.jsx("div",{"data-edit-id":"sub",style:{...hn(i),fontSize:40,fontWeight:600,color:t.muted,...Ye(n,"sub")},children:e.sub}):null]})},h4=({props:e,theme:t,edits:n})=>{const r=tt(0),o=tt(6),i=e.inverted;return f.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:30,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[f.jsxs("div",{style:{...$r(r),display:"flex",alignItems:"center",justifyContent:"space-between",gap:40,width:"100%",background:i?t.fg:t.cardBg,color:i?t.bg:t.fg,border:`2px solid ${i?t.fg:t.cardBorder}`,borderRadius:t.radiusPx,padding:"44px 52px"},children:[f.jsx("div",{"data-edit-id":"label",style:{fontSize:42,fontWeight:800,textTransform:"uppercase",letterSpacing:"0.06em",lineHeight:1.15,maxWidth:"55%",...Ye(n,"label")},children:e.label}),f.jsx("div",{"data-edit-id":"value",style:{fontSize:110,fontWeight:900,whiteSpace:"nowrap",...Ye(n,"value")},children:e.value})]}),e.caption?f.jsx("div",{"data-edit-id":"caption",style:{...hn(o),fontSize:38,fontWeight:800,color:t.fg,background:t.cardBg,border:`2px solid ${t.cardBorder}`,borderRadius:t.radiusPx/2,padding:"16px 30px",textTransform:"uppercase",letterSpacing:"0.08em",...Ye(n,"caption")},children:e.caption}):null]})},g4=({props:e,theme:t,edits:n})=>{const r=tt(0),o=tt(8);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:26,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[f.jsxs("div",{style:{...$r(r),width:"100%",background:t.fg,color:t.bg,borderRadius:t.radiusPx,padding:"40px 48px",textAlign:"left"},children:[f.jsx("div",{"data-edit-id":"kicker",style:{fontSize:30,fontWeight:800,letterSpacing:"0.28em",textTransform:"uppercase",color:"#55555E",marginBottom:14,fontFamily:t.fontMono,...Ye(n,"kicker")},children:e.kicker}),f.jsx("div",{"data-edit-id":"text",style:{fontSize:72,fontWeight:900,lineHeight:1.02,textTransform:"uppercase",...Ye(n,"text")},children:e.text})]}),e.struck?f.jsx("div",{"data-edit-id":"struck",style:{...hn(o),fontSize:44,fontWeight:800,color:t.muted,textDecoration:"line-through",textDecorationThickness:6,textDecorationColor:t.danger,textTransform:"uppercase",letterSpacing:"0.04em",...Ye(n,"struck")},children:e.struck}):null]})},v4=({text:e,struck:t,mark:n,delay:r,fontSize:o,theme:i,editId:s,edits:a})=>{const l=tt(r),u=tt(r+8);return f.jsxs("div",{"data-edit-id":s,style:{...hn(l,30),position:"relative",display:"inline-block",...Ye(a,s)},children:[f.jsxs("span",{style:{fontSize:o,fontWeight:900,textTransform:"uppercase",lineHeight:1.08,whiteSpace:"nowrap",color:t?i.muted:i.fg},children:[n!=="none"?f.jsx("span",{style:{color:n==="cross"?i.danger:i.success,marginRight:"0.3em"},children:n==="cross"?"✗":"✓"}):null,e]}),t?f.jsx("div",{style:{position:"absolute",left:"-2%",top:"50%",height:o*.11,width:`${u*104}%`,background:i.danger,borderRadius:o*.055,transform:"translateY(-50%) rotate(-2deg)"}}):null]})},y4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=e.lines.map(l=>(l.mark??"none")!=="none"?`✗ ${l.text}`:l.text),s=Dw(i,n,r),a=e.lines.flatMap((l,u)=>zw(l.text,s,n??831).map((d,p)=>({text:d,struck:l.struck,mark:p===0?l.mark??"none":"none",lineIndex:u})));return f.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:s*.2,textAlign:"center",fontFamily:t.fontDisplay},children:a.map((l,u)=>f.jsx(v4,{text:l.text,struck:l.struck,mark:l.mark,delay:u*6,fontSize:s,theme:t,editId:`line-${l.lineIndex}`,edits:o},u))})},w4=({text:e,emphasized:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=tt(n);return f.jsx("div",{"data-edit-id":i,style:{...$r(a),background:t?o.fg:o.cardBg,color:t?o.bg:o.fg,border:`2px solid ${t?o.fg:o.cardBorder}`,borderRadius:o.radiusPx/2,padding:`${r*.55}px ${r*.8}px`,fontSize:r,fontWeight:900,textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",fontFamily:o.fontDisplay,...Ye(s,i)},children:e})},x4=({delay:e,fontSize:t,theme:n,down:r=!1})=>{const o=tt(e);return f.jsx("div",{style:{opacity:o,color:n.muted,fontSize:t*1.15,fontWeight:700,lineHeight:1,paddingLeft:r?0:t*.55},children:r?"↓":"→"})};function b4(e,t=S4,n){return Zw(e,t,n)}const S4=864,E4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const{mode:i,fontSize:s}=b4(e.nodes,n,r),a=i==="row";return f.jsx("div",{style:{display:"flex",flexDirection:a?"row":"column",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",gap:a?0:s*.45,padding:"0 10px"},children:e.nodes.map((l,u)=>f.jsxs("div",{style:{display:"flex",flexDirection:a?"row":"column",alignItems:"center",gap:a?s*.55:s*.45},children:[u>0?f.jsx(x4,{delay:u*6+3,fontSize:s,theme:t,down:!a}):null,f.jsx(w4,{text:l,emphasized:e.emphasizeLast&&u===e.nodes.length-1,delay:u*6,fontSize:s,theme:t,editId:`node-${u}`,edits:o})]},u))})},k4=({title:e,lines:t,delay:n,theme:r,editId:o,edits:i})=>{const s=tt(n);return f.jsxs("div",{"data-edit-id":o,style:{...$r(s),background:r.cardBg,border:`2px solid ${r.cardBorder}`,borderRadius:r.radiusPx/2,overflow:"hidden",width:"100%",fontFamily:r.fontMono,...Ye(i,o)},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 20px",borderBottom:`2px solid ${r.cardBorder}`},children:[["#FF5F57","#FEBC2E","#28C840"].map(a=>f.jsx("div",{style:{width:16,height:16,borderRadius:8,background:a}},a)),f.jsx("div",{style:{marginLeft:10,fontSize:24,color:r.muted},children:e})]}),f.jsx("div",{style:{padding:"18px 22px",display:"flex",flexDirection:"column",gap:8},children:t.map((a,l)=>f.jsx("div",{style:{fontSize:27,color:r.fg,whiteSpace:"pre"},children:a},l))})]})},C4=({props:e,theme:t,edits:n})=>{const r=tt(e.windows.length*6+4);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:22,width:"100%",padding:"0 30px"},children:[e.windows.map((o,i)=>f.jsx(k4,{title:o.title,lines:o.lines,delay:i*6,theme:t,editId:`window-${i}`,edits:n},i)),e.fanOut?f.jsxs("div",{"data-edit-id":"fanOut",style:{...hn(r),fontFamily:t.fontDisplay,fontSize:40,fontWeight:900,letterSpacing:"0.2em",color:t.fg,textTransform:"uppercase",...Ye(n,"fanOut")},children:["⌄ ",e.fanOut]}):null]})},I4=({from:e,text:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=tt(n),l=e==="user";return f.jsx("div",{"data-edit-id":i,style:{...$r(a),alignSelf:l?"flex-end":"flex-start",background:l?o.fg:o.cardBg,color:l?o.bg:o.fg,border:`2px solid ${l?o.fg:o.cardBorder}`,borderRadius:28,[l?"borderBottomRightRadius":"borderBottomLeftRadius"]:8,padding:`${r*.6}px ${r*.85}px`,fontSize:r,fontWeight:700,maxWidth:"82%",fontFamily:o.fontDisplay,...Ye(s,i)},children:t})},T4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=Ww(e),s=Uw(i.map(a=>a.text),{widthPx:n,heightPx:r});return f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:s*.5,width:"100%",padding:"0 40px"},children:i.map((a,l)=>f.jsx(I4,{from:a.from,text:a.text,delay:l*8,fontSize:s,theme:t,editId:`message-${l}`,edits:o},l))})},_4=({props:e,theme:t,edits:n})=>{const r=tt(0),o=tt(8),i=ht(),{fps:s}=Xe(),a=e.kenBurns?Bo(i,[0,s*8],[1,1.08],{extrapolateRight:"clamp"}):1,l=e.src?/^https?:\/\//.test(e.src)?e.src:K0(e.src):null;return f.jsxs("div",{"data-edit-id":"image",style:{...$r(r),position:"relative",width:"94%",...Ye(n,"image")},children:[f.jsx("div",{style:{overflow:"hidden",borderRadius:t.radiusPx/2,border:`2px solid ${t.cardBorder}`,background:t.cardBg,boxShadow:"0 24px 80px rgba(0,0,0,0.5)"},children:l?f.jsx(jf,{src:l,style:{width:"100%",display:"block",transform:`scale(${a})`}}):f.jsx("div",{style:{height:420,display:"flex",flexDirection:"column",gap:14,padding:30,transform:`scale(${a})`},children:[.9,.75,.85,.6,.8,.5].map((u,d)=>f.jsx("div",{style:{height:22,width:`${u*100}%`,borderRadius:6,background:d%3===0?t.cardBorder:"#22222B"}},d))})}),e.label?f.jsx("div",{"data-edit-id":"label",style:{...$r(o),position:"absolute",right:-8,bottom:-20,background:t.fg,color:t.bg,fontFamily:t.fontMono,fontSize:28,fontWeight:800,letterSpacing:"0.08em",padding:"12px 22px",borderRadius:10,textTransform:"uppercase",...Ye(n,"label")},children:e.label}):null]})},R4=({text:e,index:t,fontSize:n,theme:r,edits:o})=>{const i=`item-${t}`,s=tt(t*7);return f.jsxs("div",{"data-edit-id":i,style:{...hn(s,26),display:"flex",alignItems:"baseline",gap:n*.35,...Ye(o,i)},children:[f.jsx("span",{style:{fontSize:n*.75,color:r.accent,fontWeight:900},children:"▸"}),f.jsx("span",{style:{fontSize:n,fontWeight:900,textTransform:"uppercase",lineHeight:1.15,whiteSpace:"nowrap",color:r.fg},children:e})]})},P4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=Lw(e.items,n,r,!!e.title),s=tt(0);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:i*.45,fontFamily:t.fontDisplay},children:[e.title?f.jsx("div",{"data-edit-id":"title",style:{...hn(s,20),fontSize:i*.36,fontWeight:700,letterSpacing:"0.28em",textTransform:"uppercase",color:t.muted,...Ye(o,"title")},children:e.title}):null,e.items.map((a,l)=>f.jsx(R4,{text:a,index:l,fontSize:i,theme:t,edits:o},l))]})},F4={TitleCard:m4,StatCard:h4,RuleCard:g4,StrikethroughReveal:y4,FlowDiagram:E4,TerminalMock:C4,ChatMock:T4,ScreenshotFrame:_4,BulletList:P4},M4=.3,j4=new Set(["lower-third","full-bleed"]),$4=.55,A4=e=>{const t=/^#([0-9a-fA-F]{6})$/.exec(e.trim()),[n,r,o]=t?[0,2,4].map(i=>Number.parseInt(t[1].slice(i,i+2),16)):[0,0,0];return`rgba(${n}, ${r}, ${o}, ${$4})`},N4=({durationInFrames:e,children:t})=>{const n=ht(),{fps:r}=Xe(),o=(e-n)/r,i=Math.min(1,Math.max(0,o/M4)),s=i*(2-i);return f.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",opacity:s,transform:s<1?`translateY(${(1-s)*18}px)`:void 0},children:t})},L4=({cues:e,theme:t})=>{const{fps:n,width:r,height:o}=Xe();return f.jsx(an,{style:{pointerEvents:"none"},children:e.map(i=>{if(i.kind==="plain"||!i.component||!i.props)return null;const s=Fw(i,{width:r,height:o}),a=F4[i.component],l=Math.round(i.startSec*n),u=Math.max(1,Math.round((i.endSec-i.startSec)*n)),d=s.w*r,p=s.h*o,m=j4.has(i.layout),h=m?Math.min(24,Math.round(p*.12)):0,w=d-h*2,v=p-h*2,E=f4(i.component,i.props,{widthPx:w,heightPx:v});return f.jsx(at,{from:l,durationInFrames:u,children:f.jsx("div",{"data-edit-scene":i.id,style:{position:"absolute",left:`${s.x*100}%`,top:`${s.y*100}%`,width:`${s.w*100}%`,height:`${s.h*100}%`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto",overflow:"hidden"},children:f.jsxs(N4,{durationInFrames:u,children:[m?f.jsx("div",{style:{position:"absolute",inset:0,background:A4(t.bg),backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",borderRadius:t.radiusPx}}):null,f.jsx("div",{style:{width:w/E,transform:`scale(${E})`,position:"relative"},children:f.jsx(a,{props:i.props,theme:t,widthPx:w/E,heightPx:v/E,edits:p4(i.elements,E)})})]})})},i.id)})})},z4=({videoFileName:e,spans:t,captionLines:n,sceneCues:r,theme:o,face:i,zoomPlan:s,ctaKeyword:a,ctaWindow:l,sourceTextRegions:u,contentTimeline:d,sourceSize:p,contentCropMode:m,sourceFit:h})=>{if(!e)return f.jsx(an,{style:{backgroundColor:"#111",color:"#888",alignItems:"center",justifyContent:"center",fontFamily:"monospace",fontSize:40},children:"no production loaded"});const w=/^https?:\/\//.test(e)?e:K0(e);return f.jsxs(an,{style:{backgroundColor:"black"},children:[f.jsx(XF,{cues:r,theme:o,face:i,zoomPlan:s,sourceTextRegions:u,contentTimeline:d,spans:t,sourceSize:p,contentCropMode:m,sourceFit:h,children:f.jsx(KI,{src:w,spans:t,...h==="contain"?{punchInScale:1,background:"transparent"}:{}})}),f.jsx(L4,{cues:r,theme:o}),f.jsx(WF,{lines:n,cues:r,activeColor:o.accent,ctaKeyword:a,ctaWindow:l,sourceTextRegions:u})]})},D4=600,O4=()=>({doc:iF(),past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null}),cn=(e,t)=>e.scenes[t]??{props:{},elements:{}};function V4(e,t){const n=(r,o)=>{const i=Date.now(),s=o!==void 0&&e.lastCoalesce!==null&&e.lastCoalesce.key===o&&i-e.lastCoalesce.at<D4;return{doc:r,past:s?e.past:[...e.past,e.doc],future:[],dirty:!0,savedAt:e.savedAt,lastCoalesce:o!==void 0?{key:o,at:i}:null}};switch(t.type){case"load":return{doc:t.doc,past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null};case"patchProps":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,props:{...r.props,...t.patch}}}},t.coalesce)}case"patchElement":return n(dF(e.doc,t.sceneId,t.elementId,t.patch),t.coalesce);case"clearElement":return n(fF(e.doc,t.sceneId,t.elementId));case"patchTiming":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,timing:{startSec:t.startSec,endSec:t.endSec}}}})}case"clearTiming":return n(pF(e.doc,t.sceneId));case"patchVideo":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,video:{...r.video,...t.patch}}}},t.coalesce)}case"clearVideo":{const r=e.doc.scenes[t.sceneId];if(!(r!=null&&r.video))return e;const{video:o,...i}=r;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:i}})}case"patchPip":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,pip:{...r.pip,...t.patch}}}},t.coalesce)}case"clearPip":{const r=e.doc.scenes[t.sceneId];if(!(r!=null&&r.pip))return e;const{pip:o,...i}=r;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:i}})}case"patchCaptionY":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,captionY:t.y}}},t.coalesce)}case"patchCaptionScale":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,captionScale:t.scale}}},t.coalesce)}case"clearCaptionStyle":{const r=e.doc.scenes[t.sceneId];if((r==null?void 0:r.captionY)===void 0&&(r==null?void 0:r.captionScale)===void 0)return e;const{captionY:o,captionScale:i,...s}=r;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"patchCaptionStyleAll":{const r={...e.doc.scenes};for(const o of t.sceneIds){const i=r[o]??{props:{},elements:{}};r[o]={...i,...t.y!==void 0?{captionY:t.y}:{},...t.scale!==void 0?{captionScale:t.scale}:{}}}return n({...e.doc,scenes:r})}case"addSplit":return e.doc.splits.some(r=>Math.abs(r-t.t)<.001)?e:n({...e.doc,splits:[...e.doc.splits,t.t].sort((r,o)=>r-o)});case"hideScene":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,hidden:!0}}})}case"restoreScene":{const r=e.doc.scenes[t.sceneId];if(!(r!=null&&r.hidden))return e;const{hidden:o,...i}=r;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:i}})}case"patchComponent":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,component:t.component}}})}case"patchLayout":{const{graphicRect:r,...o}=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,layout:t.layout}}})}case"patchGraphicRect":{const r=cn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...r,graphicRect:t.rect}}},t.coalesce)}case"clearGraphicRect":return n(mF(e.doc,t.sceneId));case"patchCaption":{const r=String(t.index),o=rF(e.doc.captions,t.index,t.was);if(t.text===o){const{[r]:i,...s}=e.doc.captions;return n({...e.doc,captions:s})}return n({...e.doc,captions:{...e.doc.captions,[r]:{text:t.text,was:o}}})}case"patchTheme":return n({...e.doc,theme:{...e.doc.theme,...t.patch}});case"undo":{if(e.past.length===0)return e;const r=e.past[e.past.length-1],o=e.past.slice(0,-1);return{doc:r,past:o,future:[...e.future,e.doc],savedAt:e.savedAt,dirty:o.length!==e.savedAt,lastCoalesce:null}}case"redo":{if(e.future.length===0)return e;const r=e.future[e.future.length-1],o=[...e.past,e.doc];return{doc:r,past:o,future:e.future.slice(0,-1),savedAt:e.savedAt,dirty:o.length!==e.savedAt,lastCoalesce:null}}case"saved":return{...e,dirty:!1,savedAt:e.past.length}}}function B4(){const[e,t]=c.useReducer(V4,void 0,O4),n=async()=>{const r=await fetch("/api/overrides",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e.doc)});if(!r.ok){const o=await r.json().catch(()=>({}));throw new Error(o.error??"save failed")}t({type:"saved"})};return{doc:e.doc,dirty:e.dirty,canUndo:e.past.length>0,canRedo:e.future.length>0,load:r=>t({type:"load",doc:r}),undo:()=>t({type:"undo"}),redo:()=>t({type:"redo"}),save:n,patchProps:(r,o,i)=>t({type:"patchProps",sceneId:r,patch:o,coalesce:i}),patchElement:(r,o,i,s)=>t({type:"patchElement",sceneId:r,elementId:o,patch:i,coalesce:s}),clearElement:(r,o)=>t({type:"clearElement",sceneId:r,elementId:o}),patchTiming:(r,o,i)=>t({type:"patchTiming",sceneId:r,startSec:o,endSec:i}),clearTiming:r=>t({type:"clearTiming",sceneId:r}),patchVideo:(r,o,i)=>t({type:"patchVideo",sceneId:r,patch:o,coalesce:i}),clearVideo:r=>t({type:"clearVideo",sceneId:r}),patchPip:(r,o,i)=>t({type:"patchPip",sceneId:r,patch:o,coalesce:i}),clearPip:r=>t({type:"clearPip",sceneId:r}),patchCaptionY:(r,o,i)=>t({type:"patchCaptionY",sceneId:r,y:o,coalesce:i}),patchCaptionScale:(r,o,i)=>t({type:"patchCaptionScale",sceneId:r,scale:o,coalesce:i}),clearCaptionStyle:r=>t({type:"clearCaptionStyle",sceneId:r}),patchCaptionStyleAll:(r,o)=>t({type:"patchCaptionStyleAll",sceneIds:r,...o}),addSplit:r=>t({type:"addSplit",t:r}),hideScene:r=>t({type:"hideScene",sceneId:r}),restoreScene:r=>t({type:"restoreScene",sceneId:r}),patchGraphicRect:(r,o,i)=>t({type:"patchGraphicRect",sceneId:r,rect:o,coalesce:i}),clearGraphicRect:r=>t({type:"clearGraphicRect",sceneId:r}),patchComponent:(r,o)=>t({type:"patchComponent",sceneId:r,component:o}),patchLayout:(r,o)=>t({type:"patchLayout",sceneId:r,layout:o}),patchCaption:(r,o,i)=>t({type:"patchCaption",index:r,text:o,was:i}),patchTheme:r=>t({type:"patchTheme",patch:r})}}function jh(e){const t=e==null?void 0:e.closest("[data-edit-id]");if(!t)return null;const n=t.closest("[data-edit-scene]");return n?{sceneId:n.dataset.editScene,elementId:t.dataset.editId}:null}function $h(e){const t=e==null?void 0:e.closest("[data-edit-video]");return(t==null?void 0:t.dataset.editVideo)||null}function Ah(e,t,n){const r=e.querySelectorAll(`[data-edit-scene="${t}"] [data-edit-id="${n}"]`);if(r.length===0)return null;let o=1/0,i=1/0,s=-1/0,a=-1/0;return r.forEach(l=>{const u=l.getBoundingClientRect();o=Math.min(o,u.left),i=Math.min(i,u.top),s=Math.max(s,u.right),a=Math.max(a,u.bottom)}),new DOMRect(o,i,s-o,a-i)}function Nh(e,t,n,r){const o={...e};return t==="move"?(o.x+=n,o.y+=r,o):(t.includes("w")&&(o.x+=n,o.w-=n),t.includes("e")&&(o.w+=n),t.includes("n")&&(o.y+=r,o.h-=r),t.includes("s")&&(o.h+=r),o)}const Lh=64,Qs=9,Js=e=>Math.round(e*10)/10,qr=e=>Math.round(e*1e4)/1e4,Yw={position:"absolute",width:10,height:10,background:"#5b8cff",border:"1px solid #0B0B0E",borderRadius:2,pointerEvents:"auto",zIndex:6},zh={nw:{left:0,top:0,transform:"translate(-50%,-50%)",cursor:"nwse-resize"},n:{left:"50%",top:0,transform:"translate(-50%,-50%)",cursor:"ns-resize"},ne:{right:0,top:0,transform:"translate(50%,-50%)",cursor:"nesw-resize"},e:{right:0,top:"50%",transform:"translate(50%,-50%)",cursor:"ew-resize"},se:{right:0,bottom:0,transform:"translate(50%,50%)",cursor:"nwse-resize"},s:{left:"50%",bottom:0,transform:"translate(-50%,50%)",cursor:"ns-resize"},sw:{left:0,bottom:0,transform:"translate(-50%,50%)",cursor:"nesw-resize"},w:{left:0,top:"50%",transform:"translate(-50%,-50%)",cursor:"ew-resize"}},W4={...Yw,background:"#ffe14d"},U4={top:{top:0,left:14,right:14,height:10},bottom:{bottom:0,left:14,right:14,height:10},left:{left:0,top:14,bottom:14,width:10},right:{right:0,top:14,bottom:14,width:10}},H4={position:"absolute",cursor:"move",pointerEvents:"auto",zIndex:5},Kw=/^(line|node|message|window|item)-(\d+)$/;function Z4(e,t,n){const r=Kw.exec(e);if(!r||r[1]==="window")return null;const o=r[1],i=Number(r[2]);if(o==="message"&&i===0&&typeof t.keyword=="string"&&t.keyword){const d=n.trim().replace(/^"(.*)"$/,"$1").toLowerCase();return d?{keyword:d}:null}const s=o==="line"?"lines":o==="node"?"nodes":o==="item"?"items":"messages",a=t[s];if(!Array.isArray(a)||i<0||i>=a.length)return null;const l=a.slice(),u=l[i];if(o==="node"||o==="item")l[i]=n;else{if(typeof u!="object"||u===null)return null;l[i]={...u,text:n}}return{[s]:l}}function Y4(e,t){const n=Kw.exec(e);if(!n){const u=t[e];return typeof u=="string"?u:null}if(n[1]==="window")return null;const r=n[1],o=Number(n[2]);if(r==="message"&&o===0&&typeof t.keyword=="string"&&t.keyword)return t.keyword;const s=t[r==="line"?"lines":r==="node"?"nodes":r==="item"?"items":"messages"];if(!Array.isArray(s)||o<0||o>=s.length)return null;const a=s[o];if(r==="node"||r==="item")return typeof a=="string"?a:null;const l=a==null?void 0:a.text;return typeof l=="string"?l:null}const K4=({stageRef:e,selection:t,onSelect:n,edits:r,onSave:o,settings:i,playerRef:s,onTransport:a,onVideoPreview:l,onGraphicPreview:u,cue:d,cues:p,onToggleHelp:m})=>{const[h,w]=c.useState(null),v=c.useRef(null),E=c.useRef(0),g=c.useRef(null),y=c.useRef(0),x=c.useRef(null),b=c.useRef(0),[k,S]=c.useState(!1),C=c.useRef(null),[I,F]=c.useState(null),[j,P]=c.useState(null),A=c.useRef(null),[V,_]=c.useState({dx:0,dy:0}),L=c.useRef(null),O=c.useRef(t),N=c.useCallback(R=>{O.current=R,n(R)},[n]);c.useEffect(()=>{O.current=t},[t]);const T=(R,$)=>{const B=[];let W=null;for(let M=0;M<25;M++){const D=document.elementFromPoint(R,$);if(!D||D===document.documentElement||D===document.body){W=D;break}if(W=D,D.hasAttribute("data-edit-id")||D.hasAttribute("data-edit-scene")||D.hasAttribute("data-caption-word")||D.closest("[data-edit-video]")!==null||["BUTTON","INPUT","SELECT","TEXTAREA"].includes(D.tagName)||!(D instanceof HTMLElement))break;B.push({el:D,prev:D.style.pointerEvents}),D.style.pointerEvents="none"}return B.forEach(({el:M,prev:D})=>{M.style.pointerEvents=D}),W},z=c.useCallback(()=>{var D,K;const R=e.current,$=(D=s.current)==null?void 0:D.getScale(),B=((K=R==null?void 0:R.querySelector(".__remotion-player"))==null?void 0:K.getBoundingClientRect())??(R==null?void 0:R.getBoundingClientRect());if(!B||!$||$<=0)return null;const W=i.width*$,M=i.height*$;return{left:B.left+(B.width-W)/2,top:B.top+(B.height-M)/2,w:W,h:M}},[e,s,i]);return c.useEffect(()=>{if(!t){w(null);return}let R;const $=()=>{var W;const B=e.current;if(B){const M=t.elementId?Ah(B,t.sceneId,t.elementId):((W=B.querySelector(`[data-edit-scene="${t.sceneId}"]`))==null?void 0:W.getBoundingClientRect())??null;w(M)}R=requestAnimationFrame($)};return R=requestAnimationFrame($),()=>cancelAnimationFrame(R)},[e,t]),c.useEffect(()=>{const R=$=>{var M,D;const B=e.current;if(!B||!B.contains($.target)||$.altKey||$.button!==0)return;(((M=O.current)==null?void 0:M.elementId)&&((D=L.current)==null?void 0:D.contains($.target))||jh(T($.clientX,$.clientY))!==null)&&$.stopPropagation()};return window.addEventListener("pointerdown",R,!0),()=>window.removeEventListener("pointerdown",R,!0)},[e]),c.useEffect(()=>{const R=$=>{var ne,Z,ee,ae,me,ge,le;const B=e.current;if(!B||!B.contains($.target)||$.altKey||$.button!==0)return;const W=$.target instanceof Element?$.target.closest("[data-el-handle]"):null,M=O.current;if(W&&(M!=null&&M.elementId)){const q=Ah(B,M.sceneId,M.elementId);if(q){const de=q.left+q.width/2,ye=q.top+q.height/2,Fe=Math.hypot($.clientX-de,$.clientY-ye);if(Fe>2){const se=((Z=(ne=r.doc.scenes[M.sceneId])==null?void 0:ne.elements[M.elementId])==null?void 0:Z.scale)??1;C.current={sceneId:M.sceneId,elementId:M.elementId,cx:de,cy:ye,startDist:Fe,prior:se,factor:1},F(1)}}return}if((ee=O.current)!=null&&ee.elementId&&((ae=L.current)!=null&&ae.contains($.target))){A.current={x:$.clientX,y:$.clientY,dx:0,dy:0},_({dx:0,dy:0});return}const D=$.target instanceof Element?$.target.closest("[data-box-handle]"):null,K=O.current;if(D&&K&&!K.elementId){const q=B.querySelector(`[data-edit-scene="${K.sceneId}"]`),de=z();if(q&&de){const ye=q.getBoundingClientRect();x.current={sceneId:K.sceneId,handle:D.dataset.boxHandle,x:$.clientX,y:$.clientY,dx:0,dy:0,start:{x:(ye.left-de.left)/de.w,y:(ye.top-de.top)/de.h,w:ye.width/de.w,h:ye.height/de.h}},S(!0)}return}const G=T($.clientX,$.clientY),oe=jh(G);if(!oe){const q=G==null?void 0:G.closest("[data-edit-scene]");if(q){N({sceneId:q.dataset.editScene,elementId:null});return}const de=$h(G),ye=B.getBoundingClientRect().bottom;if(de&&$.clientY<ye-Lh){N({sceneId:de,elementId:null});const Fe=p.find(We=>We.id===de);if((Fe==null?void 0:Fe.layout)==="pip-bubble"&&!$.altKey){const We=jr("pip-bubble",void 0,[],i).video.rect;g.current={sceneId:de,x:$.clientX,y:$.clientY,base:{x:((me=Fe.pip)==null?void 0:me.x)??We.x,y:((ge=Fe.pip)==null?void 0:ge.y)??We.y},slot:{w:We.w,h:We.h}};return}const se=(le=r.doc.scenes[de])==null?void 0:le.video;v.current={sceneId:de,x:$.clientX,y:$.clientY,dx:0,dy:0,baseDx:(se==null?void 0:se.dx)??0,baseDy:(se==null?void 0:se.dy)??0};return}N(null);return}N({sceneId:oe.sceneId,elementId:oe.elementId}),A.current={x:$.clientX,y:$.clientY,dx:0,dy:0},_({dx:0,dy:0})};return window.addEventListener("mousedown",R),()=>window.removeEventListener("mousedown",R)},[e,N,r,z,p,i]),c.useEffect(()=>{const R=()=>{var D,K;const W=(D=s.current)==null?void 0:D.getScale(),M=(K=e.current)==null?void 0:K.getBoundingClientRect();return W&&W>0?1/W:M&&M.width>0?i.width/M.width:1},$=W=>{const M=e.current;if(M&&!(x.current||C.current))if(g.current)M.style.cursor="move";else if(v.current)M.style.cursor="grabbing";else{const Z=W.target instanceof Element?W.target:null,ee=Z!==null&&M.contains(Z)&&!Z.closest("button, input, select, textarea, [data-edit-id], [data-edit-scene], [data-caption-word]")&&W.clientY<M.getBoundingClientRect().bottom-Lh,ae=ee&&(()=>{var ge;const me=$h(Z);return me!==null&&((ge=p.find(le=>le.id===me))==null?void 0:ge.layout)==="pip-bubble"})();M.style.cursor=ee?ae?"move":"grab":""}const D=C.current;if(D){const ee=Math.hypot(W.clientX-D.cx,W.clientY-D.cy)/D.startDist;D.factor=Math.min(4/D.prior,Math.max(.05/D.prior,ee)),F(D.factor);return}const K=x.current;if(K){K.dx=W.clientX-K.x,K.dy=W.clientY-K.y,b.current||(b.current=requestAnimationFrame(()=>{b.current=0;const Z=x.current,ee=z();if(!Z||!ee)return;const ae=Ja(Nh(Z.start,Z.handle,Z.dx/ee.w,Z.dy/ee.h),i);u({sceneId:Z.sceneId,rect:ae})}));return}if(g.current){y.current||(y.current=requestAnimationFrame(()=>{y.current=0;const Z=g.current,ee=z();if(!Z||!ee)return;const ae=(W.clientX-Z.x)/ee.w,me=(W.clientY-Z.y)/ee.h;r.patchPip(Z.sceneId,{x:qr(Math.min(Math.max(Z.base.x+ae,0),1-Z.slot.w)),y:qr(Math.min(Math.max(Z.base.y+me,0),1-Z.slot.h))},`pip:${Z.sceneId}:drag`)}));return}const oe=v.current;if(oe){oe.dx=W.clientX-oe.x,oe.dy=W.clientY-oe.y,E.current||(E.current=requestAnimationFrame(()=>{E.current=0;const Z=v.current;if(!Z)return;const ee=R();l({sceneId:Z.sceneId,patch:{dx:Z.baseDx+Z.dx*ee,dy:Z.baseDy+Z.dy*ee}})}));return}const ne=A.current;ne&&(ne.dx=W.clientX-ne.x,ne.dy=W.clientY-ne.y,_({dx:ne.dx,dy:ne.dy}))},B=()=>{const W=C.current;if(W){C.current=null,F(null),Math.abs(W.factor-1)>.001&&r.patchElement(W.sceneId,W.elementId,{scale:Math.round(W.prior*W.factor*1e3)/1e3});return}const M=x.current;if(M){if(x.current=null,S(!1),b.current&&(cancelAnimationFrame(b.current),b.current=0),M.dx!==0||M.dy!==0){const ne=z();if(ne){const Z=Ja(Nh(M.start,M.handle,M.dx/ne.w,M.dy/ne.h),i);r.patchGraphicRect(M.sceneId,{x:qr(Z.x),y:qr(Z.y),w:qr(Z.w),h:qr(Z.h)})}}u(null);return}if(g.current){g.current=null,y.current&&(cancelAnimationFrame(y.current),y.current=0);return}const K=v.current;if(K){if(v.current=null,E.current&&(cancelAnimationFrame(E.current),E.current=0),K.dx!==0||K.dy!==0){const ne=R();r.patchVideo(K.sceneId,{dx:Js(K.baseDx+K.dx*ne),dy:Js(K.baseDy+K.dy*ne)})}l(null);return}const G=A.current,oe=O.current;if(!G||!(oe!=null&&oe.elementId)){A.current=null;return}if(G.dx!==0||G.dy!==0){const ne=R(),Z=r.doc.scenes[oe.sceneId],ee=Z==null?void 0:Z.elements[oe.elementId];r.patchElement(oe.sceneId,oe.elementId,{dx:Js(((ee==null?void 0:ee.dx)??0)+G.dx*ne),dy:Js(((ee==null?void 0:ee.dy)??0)+G.dy*ne)})}A.current=null,_({dx:0,dy:0})};return window.addEventListener("mousemove",$),window.addEventListener("mouseup",B),()=>{window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",B)}},[r,e,i,s,l,u,z,p]),c.useEffect(()=>{const R=$=>{var K;const B=e.current;if(!B||!B.contains($.target))return;const W=(K=T($.clientX,$.clientY))==null?void 0:K.closest("[data-caption-word]");if(!W)return;$.preventDefault();const M=Number(W.dataset.captionWord),D=W.dataset.captionText??"";!Number.isFinite(M)||!D||P({index:M,was:D,draft:D,rect:W.getBoundingClientRect()})};return window.addEventListener("dblclick",R),()=>window.removeEventListener("dblclick",R)},[e]),c.useEffect(()=>{const R=()=>{const M=document.activeElement;return M instanceof HTMLInputElement||M instanceof HTMLTextAreaElement||M instanceof HTMLSelectElement||M instanceof HTMLElement&&M.isContentEditable},$=()=>{const M=document.activeElement;return M instanceof HTMLTextAreaElement||M instanceof HTMLElement&&M.isContentEditable?!0:M instanceof HTMLInputElement&&!["range","checkbox","radio","button"].includes(M.type)},B=()=>{const M=document.activeElement;M instanceof HTMLElement&&!$()&&M.blur()},W=M=>{var K,G,oe,ne;if(j!==null)return;const D=M.metaKey||M.ctrlKey;if(M.key==="Escape"){if(R()){(K=document.activeElement)==null||K.blur();return}N(null)}else if(D&&M.key.toLowerCase()==="z")M.preventDefault(),M.shiftKey?r.redo():r.undo();else if(D&&M.key.toLowerCase()==="y")M.preventDefault(),r.redo();else if(D&&M.key.toLowerCase()==="s")M.preventDefault(),o();else if(M.key===" "&&!D){if($())return;const Z=document.activeElement;if(Z instanceof HTMLElement&&Z.tagName==="BUTTON"&&((G=e.current)!=null&&G.contains(Z)))return;B(),M.preventDefault(),(oe=s.current)==null||oe.toggle()}else if(!D&&["j","k","l"].includes(M.key.toLowerCase())){if($())return;B(),M.preventDefault(),a(M.key.toUpperCase())}else if(!D&&!M.altKey&&(M.key==="ArrowLeft"||M.key==="ArrowRight")){if(R())return;M.preventDefault();const Z=s.current;if(!Z)return;Z.seekTo(Math.max(0,Z.getCurrentFrame()+(M.key==="ArrowRight"?1:-1)))}else if(D&&M.key.toLowerCase()==="b"){if($())return;M.preventDefault();const Z=s.current;if(!Z)return;const ee=Z.getCurrentFrame()/i.fps;if(!p.find(me=>ee>=me.startSec+Qa&&ee<=me.endSec-Qa))return;r.addSplit(Math.round(ee*1e3)/1e3)}else if(!D&&M.altKey&&(M.key==="ArrowLeft"||M.key==="ArrowRight")){if($())return;const Z=O.current,ee=Z?(()=>{const ae=p.findIndex(me=>me.id===Z.sceneId);return ae===-1?void 0:p[ae+(M.key==="ArrowRight"?1:-1)]})():p[M.key==="ArrowRight"?0:p.length-1];if(!ee)return;M.preventDefault(),N({sceneId:ee.id,elementId:null})}else if(D&&(M.key==="ArrowLeft"||M.key==="ArrowRight")){if($())return;M.preventDefault();const Z=s.current;if(!Z)return;const ee=Z.getCurrentFrame()/i.fps,ae=p.findIndex(ge=>ee>=ge.startSec&&ee<ge.endSec),me=p[(ae===-1?0:ae)+(M.key==="ArrowRight"?1:-1)];if(!me)return;Z.seekTo(Math.round(me.startSec*i.fps)),N({sceneId:me.id,elementId:null})}else if(!D&&!M.altKey&&M.key==="?"){if(R())return;M.preventDefault(),m()}else if(!D&&(M.key==="Delete"||M.key==="Backspace")){if(R())return;const Z=O.current;if(!Z||Z.elementId!==null||!d||d.kind==="plain"||d.id!==Z.sceneId||((ne=r.doc.scenes[Z.sceneId])==null?void 0:ne.hidden)===!0)return;M.preventDefault(),r.hideScene(Z.sceneId)}};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[N,r,j,o,s,e,a,d,p,i,m]),f.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[V.dx!==0||V.dy!==0||k?f.jsx("div",{"data-testid":"safe-area-guide",style:{position:"absolute",left:`${kr(i).left*100}%`,top:`${kr(i).top*100}%`,right:`${kr(i).right*100}%`,bottom:`${kr(i).bottom*100}%`,border:"1px dashed rgba(255, 225, 77, 0.45)",boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.18)",pointerEvents:"none"}}):null,h&&t?f.jsxs("div",{ref:L,"data-testid":"overlay-box",style:{position:"fixed",pointerEvents:"auto",left:h.left+V.dx-Qs/2+h.width*(1-(I??1))/2,top:h.top+V.dy-Qs/2+h.height*(1-(I??1))/2,width:h.width*(I??1)+Qs,height:h.height*(I??1)+Qs,border:t.elementId?"2px dashed #ffe14d":"2px dashed #5b8cff",borderRadius:4,boxShadow:"0 0 0 1px rgba(0,0,0,0.35)",cursor:t.elementId?"grab":"default"},children:[t.elementId?f.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,marginBottom:4,fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",letterSpacing:"0.04em",textTransform:"uppercase",color:"#0B0B0E",background:"#ffe14d",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap"},children:t.elementId}):null,t.elementId?["nw","ne","se","sw"].map(R=>f.jsx("div",{"data-el-handle":R,"data-testid":`el-handle-${R}`,style:{...W4,...zh[R]}},R)):null,!t.elementId&&d&&d.kind!=="plain"?f.jsxs(f.Fragment,{children:[["top","bottom","left","right"].map(R=>f.jsx("div",{"data-box-handle":"move","data-testid":R==="top"?"box-handle-move":`box-handle-move-${R}`,style:{...H4,...U4[R]}},R)),["nw","n","ne","e","se","s","sw","w"].map(R=>f.jsx("div",{"data-box-handle":R,"data-testid":`box-handle-${R}`,style:{...Yw,...zh[R]}},R))]}):null]}):null,j?f.jsx("input",{autoFocus:!0,"data-testid":"caption-edit",value:j.draft,onChange:R=>P({...j,draft:R.target.value}),onBlur:()=>{const R=j.draft.trim();R&&r.patchCaption(j.index,R,j.was),P(null)},onKeyDown:R=>{R.key==="Enter"&&R.target.blur(),R.key==="Escape"&&P(null)},style:{position:"fixed",pointerEvents:"auto",left:j.rect.left-4,top:j.rect.top-4,width:Math.max(j.rect.width+40,90),height:j.rect.height+8,fontSize:Math.max(13,Math.min(j.rect.height*.7,28)),fontFamily:"'Inter', system-ui, sans-serif",fontWeight:800,border:"2px solid #FFE14D",borderRadius:4,padding:"0 4px",background:"#0B0B0E",color:"#fff",outline:"none",zIndex:11}}):null]})},Jt={display:"flex",flexDirection:"column",gap:6},di={display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},De={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},Ri={fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px",width:"100%"},Xw={...Ri,fontFamily:"'Inter', system-ui, sans-serif"},qe={display:"flex",flexDirection:"column",gap:14,padding:"16px 18px",borderBottom:"1px solid #22222a"},Sn={fontSize:12,fontWeight:600,color:"#FF5C5C",background:"transparent",border:"1px solid #452626",borderRadius:6,padding:"7px 10px",cursor:"pointer"},X4=e=>String(Math.round(e*1e3)/1e3),Et=({id:e,value:t,onCommit:n,min:r,max:o,dragStep:i})=>{const[s,a]=J.useState(null),[l,u]=J.useState(!1),d=J.useRef(null),p=J.useRef(null),m=r??-1/0,h=o??1/0,w=i??(r!==void 0&&o!==void 0?(o-r)/240:.5),v=s!==null;return f.jsxs("div",{style:Jt,children:[f.jsx("span",{style:De,children:e}),f.jsx("input",{type:"text",inputMode:"decimal",ref:d,"data-testid":`field-${e}`,style:{...Ri,...v?{}:{cursor:"ew-resize",touchAction:"none"},...l?{borderColor:"#FFE14D",color:"#FFE14D"}:{}},value:s??(Number.isFinite(t)?X4(t):"0"),onFocus:E=>a(E.target.value),onBlur:()=>a(null),onPointerDown:E=>{v||(E.preventDefault(),p.current={x:E.clientX,v:Number.isFinite(t)?t:0,moved:!1},E.currentTarget.setPointerCapture(E.pointerId),u(!0))},onPointerMove:E=>{const g=p.current;if(!g)return;const y=E.clientX-g.x;if(!g.moved&&Math.abs(y)<=2)return;g.moved=!0;const x=Math.round(Math.min(h,Math.max(m,g.v+y*w))*1e3)/1e3;n(x)},onPointerUp:()=>{var g,y,x;const E=((g=p.current)==null?void 0:g.moved)===!0;p.current=null,u(!1),E||((y=d.current)==null||y.focus(),(x=d.current)==null||x.select())},onPointerCancel:()=>{p.current=null,u(!1)},onChange:E=>{a(E.target.value);const g=E.target.value.trim();if(g==="")return;const y=Number(g.replace(",","."));Number.isFinite(y)&&n(Math.min(h,Math.max(m,y)))}})]})},ea=({id:e,value:t,isColor:n,onCommit:r})=>f.jsxs("div",{style:Jt,children:[f.jsx("span",{style:De,children:e}),f.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n?f.jsx("input",{type:"color",value:t,onChange:o=>r(o.target.value),style:{width:28,height:28,border:"1px solid #2A2A33",borderRadius:6,padding:0,background:"none"}}):null,f.jsx("input",{style:{...Xw,flex:1},value:t,onChange:o=>r(o.target.value)})]})]}),G4=({selection:e,cue:t,frame:n,allSceneIds:r,edits:o,resolvedTheme:i,anchorText:s,onVideoPreview:a,runInfo:l})=>{var v,E,g,y,x,b,k,S,C,I,F,j;if(e!=null&&e.elementId&&t){const P=e.elementId,A=((v=t.elements)==null?void 0:v[P])??{},V=t.props?Y4(P,t.props):null;return f.jsxs("div",{children:[f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:"Selected"}),f.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:P})]}),(()=>{var z;const _=/^line-(\d+)$/.exec(P),L=(z=t.props)==null?void 0:z.lines;if(t.component!=="StrikethroughReveal"||!_||!Array.isArray(L))return null;const O=Number(_[1]),N=L[O];if(!N)return null;const T=N.struck?"struck":(N.mark??"none")!=="none"?N.mark:"plain";return f.jsx("div",{style:qe,children:f.jsxs("div",{style:Jt,children:[f.jsx("span",{style:De,children:"Line style"}),f.jsxs("select",{"data-testid":"line-style",style:Ri,value:T,onChange:R=>{const $=R.target.value,B=L.slice();B[O]={...B[O],struck:$==="struck",mark:$==="cross"||$==="check"?$:"none"},o.patchProps(e.sceneId,{lines:B})},children:[f.jsx("option",{value:"plain",children:"plain"}),f.jsx("option",{value:"struck",children:"struck through"}),f.jsx("option",{value:"cross",children:"✗ wrong"}),f.jsx("option",{value:"check",children:"✓ right"})]})]})})})(),V!==null?f.jsx("div",{style:qe,children:f.jsxs("div",{style:Jt,children:[f.jsx("span",{style:De,children:"Text"}),f.jsx("input",{style:Xw,"data-testid":"element-text",value:V,onChange:_=>{const L=t.props??{},O=/^(line|node|message|window|item)-\d+$/.test(P)?Z4(P,L,_.target.value):{[P]:_.target.value};O&&o.patchProps(e.sceneId,O,`text:${e.sceneId}:${P}`)}})]})}):null,f.jsxs("div",{style:qe,children:[f.jsxs("div",{style:Jt,children:[f.jsxs("span",{style:De,children:["scale"," ",f.jsxs("span",{style:{color:"#EDEDF2"},children:[(A.scale??1).toFixed(2),"×"]})]}),f.jsx("input",{type:"range","data-testid":"el-scale-slider",min:.1,max:3,step:.01,value:A.scale??1,onChange:_=>o.patchElement(e.sceneId,P,{scale:Number(_.target.value)},`element:${e.sceneId}:${P}:scale`)})]}),f.jsxs("div",{style:di,children:[f.jsx(Et,{id:"x",value:A.dx??0,dragStep:1,onCommit:_=>o.patchElement(e.sceneId,P,{dx:_},`element:${e.sceneId}:${P}:dx`)}),f.jsx(Et,{id:"y",value:A.dy??0,dragStep:1,onCommit:_=>o.patchElement(e.sceneId,P,{dy:_},`element:${e.sceneId}:${P}:dy`)})]}),f.jsx(Et,{id:"scale",value:A.scale??1,min:.05,max:4,dragStep:.01,onCommit:_=>o.patchElement(e.sceneId,P,{scale:_},`element:${e.sceneId}:${P}:scale`)})]}),f.jsx("div",{style:qe,children:f.jsx("button",{style:Sn,onClick:()=>o.clearElement(e.sceneId,P),children:"Reset element"})})]})}if(e&&t){const P=t.kind==="plain";return((E=o.doc.scenes[e.sceneId])==null?void 0:E.hidden)===!0?f.jsx("div",{children:f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:"Scene"}),f.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",f.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(deleted)"})]}),f.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Its window plays as a plain take. Restore brings the graphic back."}),f.jsx("button",{"data-testid":"restore-scene",style:{...Sn,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>o.restoreScene(e.sceneId),children:"Restore scene"})]})}):f.jsxs("div",{children:[f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:P?"Take":"Scene"}),f.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:e.sceneId}),P?f.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"A continuous stretch of the talking head — no graphic. Frame it below; its window follows the cut."}):null]}),f.jsxs("div",{style:qe,children:[!P&&t.component?f.jsxs("div",{style:Jt,children:[f.jsx("span",{style:De,children:"Component"}),f.jsx("select",{style:Ri,value:t.component,onChange:A=>o.patchComponent(e.sceneId,A.target.value),children:Kl.options.map(A=>f.jsx("option",{value:A,children:A},A))})]}):null,f.jsxs("div",{style:Jt,children:[f.jsx("span",{style:De,children:"Layout"}),f.jsx("select",{style:Ri,"data-testid":"layout-select",value:t.layout,onChange:A=>o.patchLayout(e.sceneId,A.target.value),children:Yl.options.map(A=>f.jsx("option",{value:A,children:A},A))})]})]}),f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:"Video framing"}),f.jsxs("div",{style:Jt,children:[f.jsxs("span",{style:De,children:["zoom"," ",f.jsxs("span",{style:{color:"#EDEDF2"},children:[(((g=t.video)==null?void 0:g.scale)??1).toFixed(2),"×"]})]}),f.jsx("input",{type:"range","data-testid":"zoom-slider",min:.5,max:3,step:.01,value:((y=t.video)==null?void 0:y.scale)??1,onChange:A=>a({sceneId:e.sceneId,patch:{scale:Number(A.target.value)}}),onPointerUp:A=>{const V=Number(A.target.value);o.patchVideo(e.sceneId,{scale:V},`video:${e.sceneId}:scale`),a(null)},onKeyUp:A=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(A.key))return;const _=Number(A.target.value);o.patchVideo(e.sceneId,{scale:_},`video:${e.sceneId}:scale`),a(null)}})]}),f.jsxs("label",{style:{display:"flex",gap:8,alignItems:"center",fontSize:12,color:"#9A9AA3",cursor:"pointer"},children:[f.jsx("input",{type:"checkbox","data-testid":"auto-zoom",checked:((x=t.video)==null?void 0:x.autoZoom)!==!1,onChange:A=>o.patchVideo(e.sceneId,{autoZoom:A.target.checked})}),"auto zoom (the slow push composes on top of your zoom)"]}),f.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Pan: drag the picture on the stage."}),f.jsx(Et,{id:"scale",value:((b=t.video)==null?void 0:b.scale)??1,min:.05,max:4,dragStep:.01,onCommit:A=>o.patchVideo(e.sceneId,{scale:A},`video:${e.sceneId}:scale`)}),f.jsxs("div",{style:di,children:[f.jsx(Et,{id:"dx",value:((k=t.video)==null?void 0:k.dx)??0,dragStep:1,onCommit:A=>o.patchVideo(e.sceneId,{dx:A},`video:${e.sceneId}:dx`)}),f.jsx(Et,{id:"dy",value:((S=t.video)==null?void 0:S.dy)??0,dragStep:1,onCommit:A=>o.patchVideo(e.sceneId,{dy:A},`video:${e.sceneId}:dy`)})]}),t.video?f.jsx("button",{style:Sn,onClick:()=>o.clearVideo(e.sceneId),children:"Reset framing"}):null]}),t.layout==="pip-bubble"?(()=>{const A=jr("pip-bubble",void 0,[],n).video,V=t.pip??{},_=V.cornerRadius??A.cornerRadius;return f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:"PiP bubble"}),f.jsxs("div",{style:Jt,children:[f.jsxs("span",{style:De,children:["roundness"," ",f.jsx("span",{style:{color:"#EDEDF2"},children:_.toFixed(2)})]}),f.jsx("input",{type:"range","data-testid":"pip-roundness",min:0,max:1,step:.01,value:_,onChange:L=>o.patchPip(e.sceneId,{cornerRadius:Number(L.target.value)},`pip:${e.sceneId}:cornerRadius`)})]}),f.jsxs("div",{style:di,children:[f.jsx(Et,{id:"pip-x",value:V.x??A.rect.x,min:0,max:1-A.rect.w,dragStep:.002,onCommit:L=>o.patchPip(e.sceneId,{x:L},`pip:${e.sceneId}:x`)}),f.jsx(Et,{id:"pip-y",value:V.y??A.rect.y,min:0,max:1-A.rect.h,dragStep:.002,onCommit:L=>o.patchPip(e.sceneId,{y:L},`pip:${e.sceneId}:y`)})]}),t.pip?f.jsx("button",{"data-testid":"reset-pip",style:Sn,onClick:()=>o.clearPip(e.sceneId),children:"Reset bubble"}):null]})})():null,(()=>{var _;if(P)return null;const A=Fw(t,n),V=L=>O=>o.patchGraphicRect(e.sceneId,Ja({...A,[L]:O},n),`box:${e.sceneId}:${L}`);return f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:"Graphic box"}),f.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Frame fractions — or drag the handles on the stage."}),f.jsxs("div",{style:di,children:[f.jsx(Et,{id:"box-x",value:A.x,min:0,max:1,dragStep:.002,onCommit:V("x")}),f.jsx(Et,{id:"box-y",value:A.y,min:0,max:1,dragStep:.002,onCommit:V("y")})]}),f.jsxs("div",{style:di,children:[f.jsx(Et,{id:"box-w",value:A.w,min:.08,max:1,dragStep:.002,onCommit:V("w")}),f.jsx(Et,{id:"box-h",value:A.h,min:.05,max:1,dragStep:.002,onCommit:V("h")})]}),(_=o.doc.scenes[e.sceneId])!=null&&_.graphicRect?f.jsx("button",{"data-testid":"reset-box",style:Sn,onClick:()=>o.clearGraphicRect(e.sceneId),children:"Reset box"}):null]})})(),(()=>{const A=jr(t.layout,void 0,[],n).captionAnchor,V=t.captionY??A,_=t.captionScale??1,L=o.doc.scenes[e.sceneId];return f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:"Captions"}),f.jsxs("div",{style:Jt,children:[f.jsxs("span",{style:De,children:["position"," ",f.jsx("span",{style:{color:"#EDEDF2"},children:V.toFixed(2)})]}),f.jsx("input",{type:"range","data-testid":"caption-y-slider",min:.05,max:.95,step:.01,value:V,onChange:O=>o.patchCaptionY(e.sceneId,Number(O.target.value),`captionY:${e.sceneId}`)})]}),f.jsxs("div",{style:Jt,children:[f.jsxs("span",{style:De,children:["scale"," ",f.jsxs("span",{style:{color:"#EDEDF2"},children:[_.toFixed(2),"×"]})]}),f.jsx("input",{type:"range","data-testid":"caption-scale-slider",min:.2,max:3,step:.01,value:_,onChange:O=>o.patchCaptionScale(e.sceneId,Number(O.target.value),`captionScale:${e.sceneId}`)})]}),f.jsx(Et,{id:"caption-scale",value:_,min:.2,max:3,dragStep:.01,onCommit:O=>o.patchCaptionScale(e.sceneId,O,`captionScale:${e.sceneId}`)}),f.jsx("button",{"data-testid":"caption-y-all",style:{...Sn,color:"#EDEDF2",border:"1px solid #2A2A33"},title:"Write this scene's caption position and scale to every scene — one undo step",onClick:()=>o.patchCaptionStyleAll(r,{y:V,scale:_}),children:"Apply to all scenes"}),(L==null?void 0:L.captionY)!==void 0||(L==null?void 0:L.captionScale)!==void 0?f.jsx("button",{"data-testid":"reset-caption-y",style:Sn,onClick:()=>o.clearCaptionStyle(e.sceneId),children:"Reset captions"}):null]})})(),f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:"Timing"}),f.jsxs("div",{"data-testid":"timing-range",style:{fontSize:13,fontFamily:"ui-monospace, 'SF Mono', monospace"},children:[t.startSec.toFixed(2),"s – ",t.endSec.toFixed(2),"s",f.jsxs("span",{style:{color:"#9A9AA3"},children:[" ","(",(t.endSec-t.startSec).toFixed(2),"s)"]})]}),f.jsx("div",{style:{fontSize:12,color:t.pinned?"#FFE14D":"#9A9AA3"},children:P?"Derived from the cut — not movable":t.pinned?"Pinned to these times":"Tracking transcript"}),!t.pinned&&s?f.jsxs("div",{style:{fontSize:12,color:"#9A9AA3",fontStyle:"italic"},children:["“",s,"”"]}):null,t.pinned?f.jsx("button",{style:Sn,onClick:()=>o.clearTiming(e.sceneId),children:"Un-pin (re-anchor to words)"}):null]}),P?null:f.jsx("div",{style:qe,children:f.jsx("button",{"data-testid":"delete-scene",style:Sn,onClick:()=>o.hideScene(e.sceneId),children:"Delete scene"})})]})}const u=o.doc.theme,d=(P,A)=>o.patchTheme({[P]:A}),p=P=>`${Math.floor(P/60)}:${String(Math.floor(P%60)).padStart(2,"0")}`,m=((C=l==null?void 0:l.usage)==null?void 0:C.totals)??null,h=((I=l==null?void 0:l.production)==null?void 0:I.producer)??null,w=((F=l==null?void 0:l.production)==null?void 0:F.clip)??null;return f.jsxs("div",{children:[f.jsxs("div",{style:qe,children:[f.jsx("span",{style:De,children:"Theme"}),f.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Nothing selected — global tokens."})]}),f.jsxs("div",{style:qe,children:[f.jsx(ea,{id:"accent",value:u.accent??i.accent,isColor:!0,onCommit:P=>d("accent",P)}),f.jsx(ea,{id:"bg",value:u.bg??i.bg,isColor:!0,onCommit:P=>d("bg",P)}),f.jsx(ea,{id:"fg",value:u.fg??i.fg,isColor:!0,onCommit:P=>d("fg",P)}),f.jsx(Et,{id:"radiusPx",value:u.radiusPx??i.radiusPx,min:0,dragStep:.5,onCommit:P=>d("radiusPx",P)}),f.jsx(ea,{id:"fontDisplay",value:u.fontDisplay??i.fontDisplay,isColor:!1,onCommit:P=>d("fontDisplay",P)})]}),h||m?f.jsxs("div",{style:qe,"data-testid":"run-info",children:[f.jsx("span",{style:De,children:"This video"}),h?f.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["planned by ",f.jsx("span",{style:{color:"#EDEDF2"},children:h.provider}),h.models.length>0?` (${h.models.join(", ")})`:"",h.cached?" · reused from cache":"",h.at?` · ${new Date(h.at).toLocaleString()}`:""]}):null,m?f.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:[m.calls," LLM call",m.calls===1?"":"s"," ·"," ",m.inputTokens.toLocaleString()," in / ",m.outputTokens.toLocaleString()," out tokens",m.anyEstimated?" (partly estimated)":""]}):null,m&&m.equivalentUsd!==null?f.jsx("div",{style:{fontSize:12,color:"#C9C9D4"},children:m.allUnbilled?`~$${m.equivalentUsd.toFixed(2)} of API-rate work, covered by the subscription`:m.billedUsd!==null?`~$${m.billedUsd.toFixed(2)} charged at API rates`:`~$${m.equivalentUsd.toFixed(2)} at API rates`}):null,w?f.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["clip: ",p(w.startSec),"–",p(w.endSec),(j=l==null?void 0:l.production)!=null&&j.sourceDuration?` of ${p(l.production.sourceDuration)}`:""," ","(--clip ",w.targetSec,")"]}):null]}):null,f.jsx("div",{style:qe,children:f.jsx("div",{"data-testid":"ai-disclaimer",style:{fontSize:12,color:"#9A9AA3"},children:"AI can make mistakes. The cut, captions and graphics are generated — review them before publishing."})})]})},Uu=1.2,tl=.05;function q4(e,t,n,r){return n<=0||r<=0?0:Math.min(1,Math.max(0,(e-t)/n))*r}const Q4=16,J4=e=>Math.min(Q4,Math.max(1,e));function eM(e,t,n,r,o){if(e<=0||n<=0)return 0;const s=(r+o)*(t/e),a=Math.max(0,t*n-n);return Math.min(a,Math.max(0,s-o))}const Gw=e=>e.filter(t=>t.kind!=="plain");function tM(e,t,n,r){const o=Gw(e),i=o.findIndex(h=>h.id===t),s=o[i];if(!s)return null;const a=s.endSec-s.startSec,l=i>0?o[i-1]:void 0,u=i<o.length-1?o[i+1]:void 0,d=l?l.endSec+tl:0,p=u?u.startSec-tl:r,m=Math.min(Math.max(s.startSec+n,d),Math.max(d,p-a));return{startSec:m,endSec:m+a}}function nM(e,t,n,r,o){const i=Gw(e),s=i.findIndex(h=>h.id===t),a=s>0?i[s-1]:void 0,l=s>=0&&s<i.length-1?i[s+1]:void 0,u=a?a.endSec+tl:0,d=l?l.startSec-tl:o;let p=Math.min(Math.max(n,u),Math.max(u,d-Uu)),m=Math.max(Math.min(r,d),p+Uu);return m>d&&(m=d,p=Math.max(u,m-Uu)),{startSec:p,endSec:m}}const rM=10,oM=4,Dh=8,iM=300,sM=e=>{const t=Math.max(0,e),n=Math.floor(t/60),r=(t%60).toFixed(1).padStart(4,"0");return`${n}:${r}`},aM=e=>{const t=Math.max(0,Math.round(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`},lM=(e,t)=>{const[n,r]=J.useState({}),o=J.useRef({}),i=t.map(s=>s.toFixed(1)).join(",");return J.useEffect(()=>{if(!e||t.length===0)return;const s=[...new Set(t.map(p=>p.toFixed(1)))].filter(p=>o.current[p]===void 0);if(s.length===0)return;let a=!1;const l=document.createElement("video");l.src=e,l.muted=!0,l.preload="auto";const u=document.createElement("canvas");return(async()=>{await new Promise((m,h)=>{l.onloadedmetadata=()=>m(),l.onerror=()=>h(new Error("no video for thumbnails"))}),u.width=168,u.height=Math.max(1,Math.round(168*l.videoHeight/Math.max(1,l.videoWidth)));const p=u.getContext("2d");if(p){for(const m of s){if(a)return;await new Promise(h=>{l.onseeked=()=>h(),l.currentTime=Math.max(0,Number(m))}),p.drawImage(l,0,0,u.width,u.height),o.current[m]=u.toDataURL("image/jpeg",.6)}a||r({...o.current})}})().catch(()=>{}),()=>{a=!0,l.removeAttribute("src"),l.load()}},[e,i]),n},uM=({cues:e,ghosts:t,durationSec:n,fps:r,playerRef:o,selection:i,onSelect:s,edits:a,videoSrc:l,toSourceSec:u})=>{const d=c.useRef(null),p=c.useRef(null),m=c.useRef(!1),h=c.useRef(null),[w,v]=c.useState(0),[E,g]=c.useState(null),[y,x]=c.useState(1),b=J.useMemo(()=>u?e.filter(_=>_.kind==="plain").map(_=>u((_.startSec+_.endSec)/2)):[],[e,u]),k=lM(l,b),S=c.useRef(null),C=c.useRef(null),I=c.useCallback((_,L)=>{const O=S.current;x(N=>{const T=J4(_);if(T===N||!O)return T;const z=O.getBoundingClientRect();return C.current={prevZoom:N,anchorX:L!==void 0?L-z.left:z.width/2},T})},[]);c.useLayoutEffect(()=>{const _=S.current,L=C.current;!_||!L||(C.current=null,_.scrollLeft=eM(L.prevZoom,y,_.clientWidth,_.scrollLeft,L.anchorX))},[y]);const F=c.useRef(y);F.current=y,c.useEffect(()=>{const _=S.current;if(!_)return;const L=O=>{O.ctrlKey||O.metaKey?(O.preventDefault(),I(F.current*Math.exp(-O.deltaY*.01),O.clientX)):_.scrollWidth>_.clientWidth&&(O.preventDefault(),_.scrollLeft+=O.deltaY+O.deltaX)};return _.addEventListener("wheel",L,{passive:!1}),()=>_.removeEventListener("wheel",L)},[I]),c.useEffect(()=>{const _=o.current;if(!_)return;v(_.getCurrentFrame());const L=O=>v(O.detail.frame);return _.addEventListener("frameupdate",L),()=>_.removeEventListener("frameupdate",L)},[o]),c.useEffect(()=>{const _=S.current;if(!_||n<=0||_.scrollWidth<=_.clientWidth)return;const L=w/r/n*_.scrollWidth,{scrollLeft:O,clientWidth:N}=_;(L<O||L>O+N)&&(_.scrollLeft=Math.max(0,Math.min(_.scrollWidth-N,L-N*.1)))},[w,r,n]),c.useEffect(()=>{var L,O;if(!i)return;const _=(L=S.current)==null?void 0:L.querySelector(`[data-testid="timeline-block-${i.sceneId}"]`);(O=_==null?void 0:_.scrollIntoView)==null||O.call(_,{inline:"nearest",block:"nearest"})},[i]);const j=c.useCallback(_=>{var N;const L=d.current;if(!L||n<=0)return;const O=L.getBoundingClientRect();(N=o.current)==null||N.seekTo(Math.round(q4(_,O.left,O.width,n)*r))},[o,n,r]),P=c.useCallback((_,L)=>O=>{O.stopPropagation(),O.preventDefault();const N=d.current;N&&(p.current={sceneId:_.id,edge:L,startContentX:O.clientX-N.getBoundingClientRect().left,origStart:_.startSec,origEnd:_.endSec},g({sceneId:_.id,startSec:_.startSec,endSec:_.endSec}))},[]),A=c.useRef(0);c.useEffect(()=>{const _=N=>{const T=S.current;if(!T||T.scrollWidth<=T.clientWidth)return;const z=Date.now();if(z-A.current<iM)return;const R=T.getBoundingClientRect(),$=T.scrollWidth-T.clientWidth;N>=R.right-Dh&&T.scrollLeft<$?(T.scrollLeft=Math.min($,T.scrollLeft+T.clientWidth),A.current=z):N<=R.left+Dh&&T.scrollLeft>0&&(T.scrollLeft=Math.max(0,T.scrollLeft-T.clientWidth),A.current=z)},L=N=>{var G;if((m.current||((G=h.current)==null?void 0:G.moved)===!0||p.current!==null)&&_(N.clientX),m.current){j(N.clientX);return}const z=h.current;if(z&&n>0){if(!z.moved&&Math.abs(N.clientX-z.startX)<oM)return;z.moved=!0;const oe=d.current,ne=oe==null?void 0:oe.getBoundingClientRect(),Z=ne?(N.clientX-ne.left-z.startContentX)/ne.width*n:0,ee=tM(e,z.sceneId,Z,n);ee&&g({sceneId:z.sceneId,...ee});return}const R=p.current;if(!R||n<=0)return;const $=d.current;if(!$)return;const B=$.getBoundingClientRect(),W=(N.clientX-B.left-R.startContentX)/B.width*n,M=R.edge==="start"?R.origStart+W:R.origStart,D=R.edge==="end"?R.origEnd+W:R.origEnd,K=nM(e,R.sceneId,M,D,n);g({sceneId:R.sceneId,...K})},O=N=>{m.current=!1;const T=h.current;if(T){h.current=null,T.moved?g(R=>(R&&R.sceneId===T.sceneId&&a.patchTiming(T.sceneId,R.startSec,R.endSec),null)):j(N.clientX);return}const z=p.current;z&&(g(R=>(R&&R.sceneId===z.sceneId&&(R.startSec!==z.origStart||R.endSec!==z.origEnd)&&a.patchTiming(z.sceneId,R.startSec,R.endSec),null)),p.current=null)};return window.addEventListener("mousemove",L),window.addEventListener("mouseup",O),()=>{window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",O)}},[e,n,a,j]);const V=n>0?Math.min(1,w/r/n)*100:0;return f.jsxs("div",{style:cM,children:[f.jsxs("div",{style:dM,children:[f.jsx("span",{style:pM,children:"ctrl+scroll to zoom"}),f.jsx("button",{"data-testid":"zoom-out",style:Hu,onClick:()=>I(y/2),disabled:y<=1,title:"Zoom out (ctrl/cmd + scroll on the timeline)",children:"−"}),f.jsxs("span",{"data-testid":"zoom-level",style:fM,children:[Math.round(y*10)/10,"×"]}),f.jsx("button",{"data-testid":"zoom-in",style:Hu,onClick:()=>I(y*2),disabled:y>=16,title:"Zoom in (ctrl/cmd + scroll on the timeline)",children:"+"}),f.jsx("button",{"data-testid":"zoom-fit",style:{...Hu,width:"auto",padding:"0 8px"},onClick:()=>I(1),disabled:y<=1,title:"Fit the whole clip in view",children:"fit"})]}),f.jsx("div",{ref:S,"data-testid":"timeline-scroller",style:mM,children:f.jsxs("div",{style:{width:`${y*100}%`,minWidth:"100%",paddingBottom:6},children:[f.jsx("div",{"data-testid":"ruler",style:hM,onMouseDown:_=>{_.preventDefault(),j(_.clientX),m.current=!0},children:(()=>{var R;if(n<=0)return f.jsx("span",{style:Zu,children:"0:00"});const L=(((R=S.current)==null?void 0:R.clientWidth)??1200)*y/n;let N=[.5,1,2,5,10,15,30,60,120,300,600].find($=>$*L>=70)??600;for(;n/(N/5)>600;)N*=2;const T=N/5,z=[];for(let $=0;$<=n+1e-6;$+=T){const B=Math.round($/T)%5===0,W=`${$/n*100}%`;z.push(f.jsx("div",{style:{position:"absolute",left:W,bottom:0,width:1,height:B?8:4,background:B?"#3A3A44":"#26262e",pointerEvents:"none"}},$.toFixed(3))),B&&$+T<=n&&z.push(f.jsx("span",{style:{...Zu,position:"absolute",left:W,top:0,transform:$===0?void 0:"translateX(-50%)",pointerEvents:"none"},children:aM($)},`l${$.toFixed(3)}`))}return f.jsxs(f.Fragment,{children:[z,f.jsx("span",{style:{...Zu,position:"absolute",right:2,top:0,pointerEvents:"none"},children:sM(n)})]})})()}),f.jsxs("div",{ref:d,style:gM,onMouseDown:_=>{_.preventDefault(),j(_.clientX),m.current=!0},children:[e.map(_=>{const L=_.kind==="plain",O=(E==null?void 0:E.sceneId)===_.id,N=O?E.startSec:_.startSec,T=O?E.endSec:_.endSec,z=n>0?N/n*100:0,R=n>0?Math.max(0,(T-N)/n*100):0,$=(i==null?void 0:i.sceneId)===_.id,B=L&&u?k[u((_.startSec+_.endSec)/2).toFixed(1)]:void 0;return f.jsxs("div",{"data-testid":`timeline-block-${_.id}`,onMouseDown:W=>{var M;if(W.stopPropagation(),W.preventDefault(),s({sceneId:_.id,elementId:null}),L){j(W.clientX),m.current=!0;return}h.current={sceneId:_.id,startX:W.clientX,startContentX:W.clientX-(((M=d.current)==null?void 0:M.getBoundingClientRect().left)??0),moved:!1}},style:{...Oh,left:`${z}%`,width:`${R}%`,zIndex:O?4:$?3:1,border:$?"2px solid #5b8cff":L?"1px solid #22222a":"1px solid #2A2A33",backgroundColor:$?"#1c2333":L?"#131318":"#1A1A21",...B?{backgroundImage:`linear-gradient(rgba(10,10,14,0.35), rgba(10,10,14,0.6)), url(${B})`,backgroundSize:"auto 100%, auto 100%",backgroundRepeat:"repeat-x"}:{}},children:[f.jsx("span",{style:L?B?{...ta,color:"#D8D8DE",textShadow:"0 1px 2px rgba(0,0,0,0.9)"}:{...ta,color:"#55555f"}:ta,children:_.id}),!L&&_.pinned?f.jsx("span",{style:vM,children:"PIN"}):null,L?null:f.jsxs(f.Fragment,{children:[f.jsx("div",{onMouseDown:P(_,"start"),style:{...Vh,left:0,cursor:"ew-resize"}}),f.jsx("div",{onMouseDown:P(_,"end"),style:{...Vh,right:0,cursor:"ew-resize"}})]})]},_.id)}),t.map(_=>{const L=n>0?_.startSec/n*100:0,O=n>0?Math.max(0,(_.endSec-_.startSec)/n*100):0,N=(i==null?void 0:i.sceneId)===_.id;return f.jsx("div",{"data-testid":`timeline-block-${_.id}`,onMouseDown:T=>{T.stopPropagation(),T.preventDefault(),s({sceneId:_.id,elementId:null})},style:{...Oh,left:`${L}%`,width:`${O}%`,zIndex:N?3:2,border:N?"2px dashed #5b8cff":"1px dashed #6a6a75",background:"transparent"},children:f.jsx("span",{style:{...ta,color:"#6a6a75",textDecoration:"line-through"},children:_.id})},`ghost-${_.id}`)}),f.jsx("div",{"data-testid":"playhead",style:{...yM,left:`${V}%`},children:f.jsx("div",{"data-testid":"playhead-grab",onMouseDown:_=>{_.stopPropagation(),_.preventDefault(),m.current=!0},style:wM})})]})]})})]})},cM={flexShrink:0,borderTop:"1px solid #1E1E24",background:"#111116",padding:"6px 20px 8px"},dM={display:"flex",justifyContent:"flex-end",alignItems:"center",gap:6,marginBottom:4},Hu={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},fM={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:26,textAlign:"center"},pM={fontSize:10,color:"#55555f",marginRight:4,userSelect:"none"},mM={overflowX:"auto",overflowY:"hidden"},hM={position:"relative",height:18,padding:"0 2px",marginBottom:4,borderBottom:"1px solid #1E1E24",cursor:"ew-resize",userSelect:"none"},Zu={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3"},gM={position:"relative",height:44,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,overflow:"visible",userSelect:"none"},Oh={position:"absolute",top:3,bottom:3,borderRadius:4,boxSizing:"border-box",cursor:"pointer",display:"flex",alignItems:"center",overflow:"hidden"},ta={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",textTransform:"uppercase",letterSpacing:"0.04em",color:"#9A9AA3",padding:"0 8px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pointerEvents:"none"},vM={position:"absolute",top:3,right:3,fontSize:9,fontFamily:"ui-monospace, 'SF Mono', monospace",letterSpacing:"0.04em",textTransform:"uppercase",color:"#0B0B0E",background:"#ffe14d",padding:"1px 5px",borderRadius:3,pointerEvents:"none"},Vh={position:"absolute",top:0,bottom:0,width:rM},yM={position:"absolute",top:-26,bottom:-4,width:2,zIndex:5,background:"#FFE14D",pointerEvents:"none"},wM={position:"absolute",top:0,bottom:0,left:-4,width:10,pointerEvents:"auto",cursor:"ew-resize"},xM=({baseLines:e,liveLines:t,fps:n,playerRef:r,edits:o,width:i})=>{const[s,a]=c.useState(""),[l,u]=c.useState(null),[d,p]=c.useState(null),m=c.useRef(null),h=c.useMemo(()=>{var I;const S=[];let C=0;for(let F=0;F<t.length;F++){const j=t[F],P=e[F];for(let A=0;A<j.words.length;A++){const V=j.words[A];S.push({index:C,base:((I=P==null?void 0:P.words[A])==null?void 0:I.text)??V.text,live:V.text,start:V.start,end:V.end,lineStart:j.start}),C++}}return S},[e,t]);c.useEffect(()=>{const S=r.current;if(!S)return;const C=I=>{const F=I.detail.frame/n,j=h.find(P=>F>=P.start&&F<P.end);p(P=>j?j.index===P?P:j.index:P)};return S.addEventListener("frameupdate",C),()=>S.removeEventListener("frameupdate",C)},[r,n,h]),c.useEffect(()=>{var S,C,I;d!==null&&((I=(C=(S=m.current)==null?void 0:S.querySelector(`[data-testid="transcript-word-${d}"]`))==null?void 0:C.scrollIntoView)==null||I.call(C,{block:"nearest"}))},[d]);const w=s.trim().toLowerCase(),v=c.useMemo(()=>w?h.filter(S=>S.live.toLowerCase().includes(w)).map(S=>S.index):[],[w,h]),E=c.useMemo(()=>w?new Set(v):null,[w,v]),[g,y]=c.useState(0),x=S=>{var C,I,F;(F=(I=(C=m.current)==null?void 0:C.querySelector(`[data-testid="transcript-word-${S}"]`))==null?void 0:I.scrollIntoView)==null||F.call(I,{block:"center"})};c.useEffect(()=>{y(0),v.length>0&&x(v[0])},[v]);const b=S=>{if(v.length===0)return;const C=(g+S+v.length)%v.length;y(C),x(v[C])},k=(S,C,I)=>{const F=I.trim();F&&o.patchCaption(S,F,C),u(null)};return f.jsxs("div",{"data-testid":"transcript-panel",style:{...bM,width:i},children:[f.jsxs("div",{style:SM,children:[f.jsx("span",{style:EM,children:"Transcript"}),f.jsx("div",{style:kM,children:"Click a word to jump the preview there; double-click to retype it. 1:1 retype only — word count and timing stay fixed, so scene anchors and the caption highlight keep working."}),f.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[f.jsx("input",{"data-testid":"transcript-search",style:{...CM,flex:1},placeholder:"Find a word…",value:s,onChange:S=>a(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),b(S.shiftKey?-1:1))}}),f.jsx("button",{"data-testid":"transcript-prev",style:Bh,onClick:()=>b(-1),disabled:v.length===0,title:"Previous match (⇧Enter)","aria-label":"Previous match",children:"‹"}),f.jsx("button",{"data-testid":"transcript-next",style:Bh,onClick:()=>b(1),disabled:v.length===0,title:"Next match (Enter)","aria-label":"Next match",children:"›"})]}),E?f.jsx("div",{"data-testid":"transcript-match-count",style:{fontSize:11,color:"#9A9AA3"},children:v.length===0?"0 matches":`${g+1}/${v.length} match${v.length===1?"":"es"}`}):null]}),f.jsx("div",{style:IM,"data-testid":"transcript-body",ref:m,children:h.map((S,C)=>f.jsxs(J.Fragment,{children:[C>0?" ":null,(l==null?void 0:l.index)===S.index?f.jsx("input",{autoFocus:!0,"data-testid":"transcript-edit",style:MM,value:l.draft,onChange:I=>u({index:S.index,draft:I.target.value}),onBlur:()=>k(S.index,S.base,l.draft),onKeyDown:I=>{I.key==="Enter"&&I.target.blur(),I.key==="Escape"&&u(null)}}):f.jsx("span",{"data-testid":`transcript-word-${S.index}`,onClick:()=>{var I;return(I=r.current)==null?void 0:I.seekTo(Math.round(S.start*n))},onDoubleClick:()=>u({index:S.index,draft:S.live}),title:S.live!==S.base?`edited (was “${S.base}”) — double-click to retype`:"click to jump · double-click to retype",style:{...TM,...E!=null&&E.has(S.index)?_M:{},...v[g]===S.index?RM:{},...S.live!==S.base?PM:{},...d===S.index?FM:{}},children:S.live})]},S.index))})]})},bM={flexShrink:0,display:"flex",flexDirection:"column",background:"#111116",minHeight:0},SM={display:"flex",flexDirection:"column",gap:8,padding:"14px 14px 10px",borderBottom:"1px solid #1E1E24"},EM={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},kM={fontSize:11,lineHeight:1.45,color:"#6a6a75"},CM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px"},IM={flex:1,overflowY:"auto",overflowX:"hidden",overflowWrap:"break-word",padding:"10px 14px 16px",fontSize:13,lineHeight:2,color:"#C9C9D4"},TM={cursor:"pointer",borderRadius:3,padding:"1px 2px"},_M={background:"#2b2b1a",outline:"1px solid #6b6432"},RM={background:"#3d3a17",outline:"2px solid #FFE14D",color:"#fff"},Bh={width:26,height:30,fontSize:16,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,cursor:"pointer",padding:0},PM={color:"#FFE14D"},FM={background:"#1c2333",outline:"1px solid #5b8cff"},MM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,width:110,background:"#0F0F14",border:"1px solid #FFE14D",borderRadius:4,color:"#fff",padding:"1px 4px"},jM=[{title:"transport",rows:[["space","play / pause"],["J / K / L","reverse · pause · forward (tap again to speed up)"],["← / →","step one frame back / forward"],["⌘/ctrl + ← / →","jump to and select the previous / next scene"]]},{title:"selection",rows:[["click","select scene or element"],["⌥ + ← / →","select previous / next scene"],["esc","clear selection · close dialogs"]]},{title:"editing",rows:[["⌘/ctrl + B","split the scene at the playhead"],["delete / backspace","delete the selected scene (restorable)"],["⌘/ctrl + Z","undo"],["⌘/ctrl + ⇧ + Z","redo (⌘Y works too)"],["⌘/ctrl + S","save"],["double-click caption word","retype it in place"],["drag element / corner handles","move · resize"],["drag picture","pan the video framing"]]},{title:"view",rows:[["⌘/ctrl + scroll on preview","zoom the view (never edits)"],["⌥-drag / middle-drag","pan the zoomed view"],["⌘/ctrl + scroll on timeline","zoom the timeline"],["?","this reference"]]}],$M=({onClose:e})=>(c.useEffect(()=>{const t=n=>{n.key==="Escape"&&(n.stopPropagation(),e())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e]),f.jsx("div",{style:AM,onMouseDown:e,children:f.jsxs("div",{"data-testid":"shortcuts-modal",style:NM,onMouseDown:t=>t.stopPropagation(),children:[f.jsxs("div",{style:LM,children:[f.jsx("span",{style:zM,children:"keybinds"}),f.jsx("span",{style:DM,children:"esc close"})]}),f.jsx("div",{style:OM,children:"available commands and configured shortcuts"}),jM.map(t=>f.jsxs("div",{style:{marginTop:18},children:[f.jsx("div",{style:VM,children:t.title}),t.rows.map(([n,r])=>f.jsxs("div",{style:BM,children:[f.jsx("span",{style:WM,children:n}),f.jsx("span",{style:UM,children:r})]},n))]},t.title))]})})),AM={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},NM={width:620,maxWidth:"90vw",maxHeight:"82vh",overflowY:"auto",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},LM={display:"flex",justifyContent:"space-between",alignItems:"center"},zM={fontSize:18,fontWeight:700,color:"#EDEDF2"},DM={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",borderRadius:4,padding:"3px 10px"},OM={fontSize:13,color:"#6a6a75",marginTop:4},VM={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},BM={display:"flex",gap:16,padding:"3px 0"},WM={width:290,flexShrink:0,color:"#c5a3ff",fontWeight:600,fontSize:13},UM={color:"#C9C9D4",fontSize:13},Wh=({recent:e,required:t,onOpen:n,onClose:r})=>{const[o,i]=c.useState(null),[s,a]=c.useState(null),[l,u]=c.useState(!1),d=async m=>{try{const h=await fetch(`/api/fs${m?`?dir=${encodeURIComponent(m)}`:""}`),w=await h.json();if(!h.ok)throw new Error(w.error??`listing failed: ${h.status}`);i(w)}catch(h){a(h instanceof Error?h.message:String(h))}};c.useEffect(()=>{d()},[]),c.useEffect(()=>{if(t)return;const m=h=>{h.key==="Escape"&&(h.stopPropagation(),r())};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[t,r]);const p=m=>{u(!0),a(null),n(m).then(h=>{u(!1),h&&a(h)})};return f.jsx("div",{style:HM,onMouseDown:t?void 0:r,children:f.jsxs("div",{"data-testid":"project-picker",style:ZM,onMouseDown:m=>m.stopPropagation(),children:[f.jsxs("div",{style:YM,children:[f.jsx("span",{style:KM,children:t?"open a project":"switch project"}),t?null:f.jsx("button",{"data-testid":"project-picker-close",style:XM,onClick:r,children:"esc close"})]}),f.jsx("div",{style:GM,children:"A project is a work directory a `ossclip produce` run wrote — the folder holding render-props.json."}),s?f.jsx("div",{"data-testid":"project-picker-error",style:qM,children:s}):null,e.length>0?f.jsxs("div",{style:{marginTop:16},children:[f.jsx("div",{style:Uh,children:"recent"}),e.map(m=>f.jsxs("button",{"data-testid":"project-recent",style:Yu,disabled:l,onClick:()=>p(m),title:m,children:[f.jsx("span",{style:{color:"#FFE14D",marginRight:8},children:"▸"}),m]},m))]}):null,f.jsxs("div",{style:{marginTop:16},children:[f.jsx("div",{style:Uh,children:"browse"}),f.jsxs("div",{style:{color:"#6a6a75",fontSize:12,marginBottom:6},children:["Folders only — hidden ones are omitted, and any projects produced inside a folder show up directly as ",f.jsx("span",{style:{color:"#FFE14D"},children:"▸ .ossclip/…"})," entries."]}),o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:QM,children:[f.jsx("span",{style:JM,title:o.dir,children:o.dir}),o.isWorkdir?f.jsx("button",{"data-testid":"project-open-current",style:ej,disabled:l,onClick:()=>p(o.dir),children:"open this project"}):null]}),f.jsxs("div",{style:tj,"data-testid":"project-fs-list",children:[o.parent?f.jsx("button",{"data-testid":"project-fs-up",style:Yu,disabled:l,onClick:()=>void d(o.parent),children:".."}):null,o.entries.map(m=>f.jsxs("button",{"data-testid":m.isWorkdir?"project-fs-workdir":"project-fs-dir",style:{...Yu,...m.isWorkdir?nj:{}},disabled:l,onClick:()=>m.isWorkdir?p(m.path):void d(m.path),title:m.path,children:[f.jsx("span",{style:{marginRight:8,color:m.isWorkdir?"#FFE14D":"#6a6a75"},children:m.isWorkdir?"▸":"▪"}),m.name,m.isWorkdir?f.jsx("span",{style:rj,children:"project"}):f.jsx("span",{style:{color:"#55555f"},children:"/"})]},m.path)),o.entries.length===0?f.jsx("div",{style:{color:"#6a6a75",fontSize:12,padding:"6px 8px"},children:"no folders here"}):null]})]}):f.jsx("div",{style:{color:"#6a6a75",fontSize:13},children:"loading…"})]})]})})},HM={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},ZM={width:620,maxWidth:"90vw",maxHeight:"82vh",overflowY:"auto",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},YM={display:"flex",justifyContent:"space-between",alignItems:"center"},KM={fontSize:18,fontWeight:700,color:"#EDEDF2"},XM={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",border:"none",borderRadius:4,padding:"3px 10px",cursor:"pointer"},GM={fontSize:13,color:"#6a6a75",marginTop:4},qM={marginTop:12,fontSize:13,color:"#FF5C5C"},Uh={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},QM={display:"flex",alignItems:"center",gap:10,marginBottom:6},JM={fontSize:12,color:"#9A9AA3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ej={flexShrink:0,fontSize:12,fontWeight:700,color:"#0B0B0E",background:"#FFE14D",border:"1px solid #FFE14D",borderRadius:6,padding:"4px 10px",cursor:"pointer"},tj={maxHeight:"34vh",overflowY:"auto",display:"flex",flexDirection:"column",gap:2},Yu={display:"block",width:"100%",textAlign:"left",fontFamily:"inherit",fontSize:13,color:"#C9C9D4",background:"transparent",border:"1px solid transparent",borderRadius:6,padding:"5px 8px",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},nj={color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33"},rj={marginLeft:10,fontSize:11,fontWeight:700,color:"#FFE14D"};function na(e){for(let t=e.length-1;t>=0;t--){const n=/^\s*(\d{1,3})%\s*$/.exec(e[t]);if(n)return Math.min(100,Number(n[1]))}return null}function oj(e){const t=n=>{for(let r=e.length-1;r>=0;r--)if(n.test(e[r]))return e[r]};return[t(/^▸ producing scenes/),t(/^▸ llm:/)].filter(n=>n!==void 0)}function ij(e,t){const n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}const sj=()=>{const e=B4(),[t,n]=c.useState(null),[r,o]=c.useState(null),[i,s]=c.useState(null),[a,l]=c.useState(null),[u,d]=c.useState(!1),[p,m]=c.useState(1),[h,w]=c.useState(null),[v,E]=c.useState(!1),[g,y]=c.useState([]),[x,b]=c.useState(null),[k,S]=c.useState(!1),[C,I]=c.useState(null),F=c.useRef(null);c.useEffect(()=>()=>{F.current!==null&&window.clearInterval(F.current)},[]);const[j,P]=c.useState(null),A=c.useRef(null),V=c.useRef(null),_=c.useRef(null),L=c.useRef(null),[O,N]=c.useState(null),[T,z]=c.useState(null),R=c.useCallback(H=>{var pe;if(_.current=H,z(H),(pe=L.current)==null||pe.disconnect(),L.current=null,!H)return;const X=()=>N({w:Math.max(0,H.clientWidth-Xu*2),h:Math.max(0,H.clientHeight-Xu*2)});X();const Q=new ResizeObserver(X);Q.observe(H),L.current=Q},[]),[$,B]=c.useState(1),W=c.useRef($);W.current=$;const M=c.useRef(null),D=c.useCallback((H,X)=>{const Q=_.current,pe=Math.min(8,Math.max(.25,H)),Ce=W.current;if(Q&&pe!==Ce){const Ot=Q.getBoundingClientRect();M.current={prev:Ce,ax:((X==null?void 0:X.x)??Ot.left+Ot.width/2)-Ot.left,ay:((X==null?void 0:X.y)??Ot.top+Ot.height/2)-Ot.top,sl:Q.scrollLeft,st:Q.scrollTop}}B(pe)},[]);c.useLayoutEffect(()=>{const H=_.current,X=M.current;if(!H||!X)return;M.current=null;const Q=$/X.prev;H.scrollLeft=(X.sl+X.ax)*Q-X.ax,H.scrollTop=(X.st+X.ay)*Q-X.ay},[$]),c.useEffect(()=>{const H=T;if(!H)return;const X=Q=>{(Q.ctrlKey||Q.metaKey)&&(Q.preventDefault(),D(W.current*Math.exp(-Q.deltaY*.01),{x:Q.clientX,y:Q.clientY}))};return H.addEventListener("wheel",X,{passive:!1}),()=>H.removeEventListener("wheel",X)},[T,D]);const K=c.useRef(null);c.useEffect(()=>{const H=Q=>{const pe=K.current,Ce=_.current;!pe||!Ce||(Ce.scrollLeft=pe.sl-(Q.clientX-pe.x),Ce.scrollTop=pe.st-(Q.clientY-pe.y))},X=()=>{K.current=null};return window.addEventListener("mousemove",H),window.addEventListener("mouseup",X),()=>{window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",X)}},[]);const[G,oe]=c.useState(!1),[ne,Z]=c.useState(()=>{const H=Number(window.localStorage.getItem(Hh));return Number.isFinite(H)&&H>0?Zh(H):300}),ee=c.useRef(null);c.useEffect(()=>{const H=Q=>{const pe=ee.current;pe&&Z(Zh(pe.startW+(Q.clientX-pe.startX)))},X=()=>{ee.current&&(ee.current=null,Z(Q=>(window.localStorage.setItem(Hh,String(Q)),Q)))};return window.addEventListener("mousemove",H),window.addEventListener("mouseup",X),()=>{window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",X)}},[]);const[ae,me]=c.useState(!1),[ge,le]=c.useState(!0),q=c.useCallback(H=>{const X=YI({rate:p,playing:u},H);m(X.rate);const Q=V.current;Q&&(X.playing&&!u&&Q.play(),!X.playing&&u&&Q.pause())},[p,u]);c.useEffect(()=>{const H=V.current;if(!H)return;const X=()=>d(!0),Q=()=>d(!1);return H.addEventListener("play",X),H.addEventListener("pause",Q),()=>{H.removeEventListener("play",X),H.removeEventListener("pause",Q)}});const de=c.useCallback(()=>{if(F.current!==null)return;const H=window.setInterval(()=>{(async()=>{try{const Q=await(await fetch("/api/render/status")).json();if(Q.running||Q.exitCode===null){I(pe=>({running:Q.running,lines:Q.lines??[],startedAt:Q.startedAt??(pe==null?void 0:pe.startedAt)}));return}if(F.current!==null&&(window.clearInterval(F.current),F.current=null),Q.exitCode===0){const Ce=await(await fetch("/api/production")).json();n(Ce.renderProps),S(!!Ce.canRender),I(null)}else I({running:!1,lines:Q.lines??[],failed:Q.exitCode,cancelled:Q.cancelled})}catch{}})()},1e3);F.current=H},[]),ye=c.useCallback(async()=>{const H=await fetch("/api/production");if(!H.ok)throw new Error(`GET /api/production failed: ${H.status}`);const X=await H.json();if(y(X.recent??[]),X.noWorkdir){E(!0);return}n(X.renderProps),b(X.workdir??null),S(!!X.canRender),e.load(X.overrides),fetch("/api/usage").then(async Ce=>o(Ce.ok?await Ce.json():null)).catch(()=>o(null));const pe=await(await fetch("/api/render/status")).json();pe.running&&(I({running:!0,lines:pe.lines??[],startedAt:pe.startedAt}),de())},[de]);c.useEffect(()=>{ye().catch(H=>s(H instanceof Error?H.message:String(H)))},[]);const Fe=c.useCallback(async H=>{if(e.dirty&&!window.confirm("Unsaved edits will be lost — switch projects anyway?"))return null;try{const X=await fetch("/api/workdir",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:H})}),Q=await X.json().catch(()=>({}));return X.ok?(l(null),w(null),P(null),I(null),B(1),n(null),E(!1),await ye(),null):Q.error??`open failed: ${X.status}`}catch(X){return X instanceof Error?X.message:String(X)}},[e.dirty,ye]),se=c.useMemo(()=>{if(!t)return null;const H=(t.baseSceneCues??t.sceneCues??[]).filter(St=>St.kind!=="plain"),X=t.baseTheme??t.theme??UP,{cues:Q}=Ou(H,e.doc),{cues:pe}=Sh(Q,e.doc),Ce=vF(pe,{outputDurationSec:t.outputDurationSec,clipStarts:(t.spans??[]).map(St=>St.outIn)}),Ot=lF(Ce,e.doc.splits),{cues:Gl}=Ou(Ot,e.doc),{cues:Ko}=Sh(Gl,e.doc);let Ur=h?Ko.map(St=>St.id===h.sceneId?{...St,video:{...St.video,...h.patch}}:St):Ko;j&&(Ur=Ur.map(St=>St.id===j.sceneId?{...St,graphicRect:j.rect}:St));const ql=t.baseCaptionLines??t.captionLines??[];return{...t,sceneCues:Ur,captionLines:uF(ql,e.doc.captions).lines,theme:cF(X,e.doc),videoFileName:`/media/${t.videoFileName}`}},[t,e.doc,h,j]),We=()=>{e.save().catch(H=>s(H instanceof Error?H.message:String(H)))},zt=c.useCallback(async()=>{try{e.dirty&&await e.save();const H=await fetch("/api/render",{method:"POST"});if(!H.ok){const X=await H.json().catch(()=>({}));throw new Error(X.error??`render failed to start: ${H.status}`)}I({running:!0,lines:[],startedAt:Date.now()}),de()}catch(H){s(H instanceof Error?H.message:String(H))}},[e,de]),nt=c.useMemo(()=>{if(!t)return[];const H=(t.baseSceneCues??t.sceneCues??[]).filter(Q=>Q.kind!=="plain"),{cues:X}=Ou(H,e.doc);return X.filter(Q=>{var pe;return((pe=e.doc.scenes[Q.id])==null?void 0:pe.hidden)===!0})},[t,e.doc]),Ge=c.useMemo(()=>a?(se==null?void 0:se.sceneCues.find(H=>H.id===a.sceneId))??nt.find(H=>H.id===a.sceneId)??null:null,[se,a,nt]),lt=c.useMemo(()=>{if(!Ge||!se)return;const H=se.captionLines.filter(Q=>Q.start<Ge.endSec&&Q.end>Ge.startSec).flatMap(Q=>Q.words).filter(Q=>Q.start<Ge.endSec&&Q.end>Ge.startSec).map(Q=>Q.text);if(H.length===0)return;const X=H.join(" ");return X.length>90?`${X.slice(0,90)}…`:X},[Ge,se]);if(i)return f.jsx("div",{style:Ku,children:f.jsxs("div",{style:{padding:24,color:"#FF5C5C",fontFamily:"ui-monospace, monospace"},children:["Couldn't load the production: ",i]})});if(!se)return f.jsx("div",{style:Ku,children:v?f.jsx(Wh,{recent:g,required:!0,onOpen:Fe,onClose:()=>{}}):f.jsx("div",{style:{padding:24,color:"#9A9AA3"},children:"Loading production…"})});const ut=se.settings.width/se.settings.height,Dt=O?Math.max(220,Math.min(O.w,O.h*ut)):380,Xt=Math.round(Dt*$);return f.jsxs("div",{style:Ku,children:[f.jsxs("div",{style:cj,children:[f.jsx("span",{style:dj,children:"ossclip"}),x?f.jsx("span",{"data-testid":"workdir-label",style:fj,title:x,children:x.split("/").filter(Boolean).slice(-2).join("/")}):null,f.jsxs("div",{style:{display:"flex",gap:8},children:[f.jsx("button",{"data-testid":"open-button",style:dn,onClick:()=>E(!0),title:x?`Open another project — currently ${x}`:"Open another project",children:"Open"}),f.jsx("button",{"data-testid":"undo-button",style:dn,onClick:()=>e.undo(),disabled:!e.canUndo,title:"Undo (⌘Z)","aria-label":"Undo",children:f.jsx(lj,{})}),f.jsx("button",{"data-testid":"redo-button",style:dn,onClick:()=>e.redo(),disabled:!e.canRedo,title:"Redo (⌘⇧Z)","aria-label":"Redo",children:f.jsx(uj,{})}),f.jsx("button",{"data-testid":"transcript-toggle",style:{...dn,...G?{borderColor:"#5b8cff"}:{}},onClick:()=>oe(H=>!H),title:"Find and retype caption words across the whole transcript",children:"Transcript"}),f.jsx("button",{style:{...dn,...e.dirty?mj:{}},onClick:We,disabled:!e.dirty,children:"Save"}),f.jsx("button",{"data-testid":"render-button",style:dn,onClick:()=>void zt(),disabled:!k||(C==null?void 0:C.running)===!0,title:k?"Saves if needed, then replays the last completed produce command — pipeline flags come from that run; your saved edits apply on top":"No command.json in this workdir — run `ossclip produce` once in a terminal; it records the invocation and Render replays it",children:C!=null&&C.running?"Rendering…":"Render"})]}),f.jsx("span",{style:{...pj,color:e.dirty?"#FFE14D":"#5FBF77"},...e.dirty?{"data-testid":"dirty"}:{},children:e.dirty?"● Unsaved changes":"✓ Saved"}),f.jsx("button",{"data-testid":"shortcuts-button",style:{...dn,padding:"7px 10px"},onClick:()=>me(H=>!H),title:"Keyboard shortcuts (?)",children:"?"})]}),ae?f.jsx($M,{onClose:()=>me(!1)}):null,v?f.jsx(Wh,{recent:g,required:!1,onOpen:Fe,onClose:()=>E(!1)}):null,C?f.jsxs("div",{"data-testid":"render-log",style:{...Ej,borderColor:C.failed!==void 0?"#FF5C5C":"#2A2A33"},children:[C.failed!==void 0?f.jsxs("div",{style:{color:C.cancelled?"#9A9AA3":"#FF5C5C",marginBottom:4},"data-testid":C.cancelled?"render-cancelled":"render-failed",children:[C.cancelled?"render cancelled":`render failed (exit ${C.failed})`,f.jsx("button",{style:{...dn,marginLeft:10,padding:"2px 8px"},onClick:()=>I(null),children:"Dismiss"})]}):null,C.running?f.jsxs("div",{"data-testid":"render-status",style:kj,children:[f.jsx("style",{children:"@keyframes ossclip-spin { to { transform: rotate(360deg) } }"}),f.jsx("span",{style:Cj,"aria-hidden":!0}),f.jsxs("span",{style:{color:"#EDEDF2"},children:["rendering",C.startedAt!=null?` · ${ij(C.startedAt,Date.now())}`:"",na(C.lines)!==null?` · ${na(C.lines)}%`:""]}),na(C.lines)!==null?f.jsx("div",{style:Ij,children:f.jsx("div",{"data-testid":"render-progress-bar",style:{...Tj,width:`${na(C.lines)}%`}})}):null,f.jsx("button",{"data-testid":"render-cancel",style:{...dn,padding:"2px 8px"},onClick:()=>void fetch("/api/render/cancel",{method:"POST"}),children:"Cancel"}),f.jsx("button",{"data-testid":"render-logs-toggle",style:{...dn,padding:"2px 8px"},onClick:()=>le(H=>!H),title:ge?"Collapse the log":"Expand the log",children:ge?"▾ logs":"▸ logs"})]}):null,ge?f.jsxs(f.Fragment,{children:[oj(C.lines).map(H=>f.jsx("div",{"data-testid":"render-pinned",style:{color:"#C9C9D4"},children:H},H)),f.jsx(aj,{lines:C.lines})]}):null]}):null,f.jsxs("div",{style:hj,children:[G?f.jsxs(f.Fragment,{children:[f.jsx(xM,{baseLines:(t==null?void 0:t.baseCaptionLines)??(t==null?void 0:t.captionLines)??[],liveLines:se.captionLines,fps:se.settings.fps,playerRef:V,edits:e,width:ne}),f.jsx("div",{"data-testid":"transcript-divider",style:gj,title:"Drag to resize the transcript pane",onMouseDown:H=>{H.preventDefault(),ee.current={startX:H.clientX,startW:ne}}})]}):null,f.jsxs("div",{style:vj,children:[f.jsx("div",{ref:R,style:yj,onMouseDown:H=>{if(H.altKey||H.button===1){H.preventDefault();const X=_.current;X&&(K.current={x:H.clientX,y:H.clientY,sl:X.scrollLeft,st:X.scrollTop})}},children:f.jsx("div",{style:{margin:"auto",padding:Xu},children:f.jsxs("div",{ref:A,"data-testid":"stage","data-playing":u?"true":"false","data-rate":p,style:{position:"relative",display:"inline-block"},children:[f.jsx(OI,{ref:V,component:z4,inputProps:se,durationInFrames:Math.max(1,Math.round(se.outputDurationSec*se.settings.fps)),fps:se.settings.fps,compositionWidth:se.settings.width,compositionHeight:se.settings.height,style:{width:Xt},controls:!0,clickToPlay:!1,playbackRate:p}),f.jsx(K4,{stageRef:A,selection:a,onSelect:l,edits:e,onSave:We,settings:se.settings,cues:se.sceneCues,playerRef:V,cue:Ge,onTransport:q,onVideoPreview:w,onGraphicPreview:P,onToggleHelp:()=>me(H=>!H)}),f.jsx("button",{"data-testid":"rate-chip",onClick:()=>q("L"),title:"Playback rate — click to speed up (J/K/L on the keyboard)",style:_j,children:p<0?`◂◂ ${Math.abs(p)}×`:`${p}×`})]})})}),f.jsxs("div",{style:wj,children:[f.jsx("button",{"data-testid":"view-zoom-out",style:Gu,onClick:()=>D($/2),disabled:$<=.25,title:"Zoom the preview out — below 100% shrinks under the fitted size",children:"−"}),f.jsxs("span",{"data-testid":"view-zoom-level",style:xj,children:[Math.round($*100),"%"]}),f.jsx("button",{"data-testid":"view-zoom-in",style:Gu,onClick:()=>D($*2),disabled:$>=8,title:"Zoom the preview in — a viewing magnifier, it never edits the video",children:"+"}),f.jsx("button",{"data-testid":"view-zoom-fit",style:{...Gu,width:"auto",padding:"0 8px"},onClick:()=>D(1),disabled:Math.abs($-1)<.001,title:"Fit the preview to the window",children:"fit"}),f.jsx("span",{style:bj,children:"⌥-drag pans"})]})]}),f.jsx("div",{style:Sj,children:f.jsx(G4,{selection:a,cue:Ge,frame:{width:se.settings.width,height:se.settings.height},allSceneIds:se.sceneCues.map(H=>H.id),edits:e,resolvedTheme:se.theme,anchorText:lt,onVideoPreview:w,runInfo:r})})]}),f.jsx(uM,{cues:se.sceneCues,ghosts:nt,durationSec:se.outputDurationSec,fps:se.settings.fps,playerRef:V,selection:a,onSelect:l,edits:e,videoSrc:se.videoFileName,toSourceSec:H=>{var X;for(const Q of se.spans??[])if(H>=Q.outIn&&H<Q.outOut)return Q.srcIn+(H-Q.outIn);return((X=(se.spans??[])[0])==null?void 0:X.srcIn)??H}})]})},aj=({lines:e})=>{const t=c.useRef(null),n=c.useRef(!0);return c.useEffect(()=>{const r=t.current;r&&n.current&&(r.scrollTop=r.scrollHeight)},[e]),f.jsx("div",{ref:t,"data-testid":"render-tail",onScroll:r=>{const o=r.currentTarget;n.current=o.scrollTop+o.clientHeight>=o.scrollHeight-8},style:{maxHeight:220,overflowY:"auto"},children:e.map((r,o)=>f.jsx("div",{children:r},o))})},lj=()=>f.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[f.jsx("path",{d:"M9 14 4 9l5-5"}),f.jsx("path",{d:"M4 9h10.5a5.5 5.5 0 0 1 0 11H11"})]}),uj=()=>f.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[f.jsx("path",{d:"m15 14 5-5-5-5"}),f.jsx("path",{d:"M20 9H9.5a5.5 5.5 0 0 0 0 11H13"})]}),Ku={fontFamily:"'Inter', system-ui, sans-serif",background:"#0B0B0E",color:"#EDEDF2",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column"},cj={display:"flex",alignItems:"center",gap:14,padding:"10px 20px",borderBottom:"1px solid #1E1E24",background:"#111116"},dj={fontWeight:800,fontSize:14,letterSpacing:"0.02em",color:"#FFE14D",marginRight:8},fj={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#6a6a75",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},pj={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",marginLeft:"auto"},dn={fontSize:12,fontWeight:600,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,padding:"7px 12px",cursor:"pointer"},mj={background:"#FFE14D",color:"#0B0B0E",border:"1px solid #FFE14D"},hj={display:"flex",flex:1,minHeight:0},Xu=32,Hh="ossclip.transcriptWidth",Zh=e=>Math.min(640,Math.max(220,e)),gj={width:5,flexShrink:0,cursor:"col-resize",background:"#1E1E24",borderLeft:"1px solid #2A2A33"},vj={position:"relative",flex:1,minWidth:0},yj={position:"absolute",inset:0,display:"flex",overflow:"auto"},wj={position:"absolute",top:10,left:10,zIndex:6,display:"flex",alignItems:"center",gap:6,padding:"4px 6px",background:"rgba(17,17,22,0.85)",border:"1px solid #2A2A33",borderRadius:6},Gu={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},xj={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:34,textAlign:"center"},bj={fontSize:10,color:"#55555f",userSelect:"none"},Sj={width:260,flexShrink:0,borderLeft:"1px solid #1E1E24",background:"#111116",overflowY:"auto"},Ej={fontSize:11,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",background:"#0F0F14",borderBottom:"1px solid #2A2A33",padding:"6px 20px",whiteSpace:"pre-wrap",flexShrink:0},kj={display:"flex",alignItems:"center",gap:10,marginBottom:4},Cj={width:12,height:12,flexShrink:0,border:"2px solid #2A2A33",borderTopColor:"#FFE14D",borderRadius:"50%",animation:"ossclip-spin 0.8s linear infinite"},Ij={flex:1,maxWidth:260,height:4,background:"#1E1E24",borderRadius:2,overflow:"hidden"},Tj={height:"100%",background:"#FFE14D",borderRadius:2,transition:"width 0.6s ease"},_j={position:"absolute",top:8,right:8,zIndex:5,fontSize:11,fontWeight:700,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#FFE14D",background:"rgba(11,11,14,0.75)",border:"1px solid #2A2A33",borderRadius:6,padding:"3px 8px",cursor:"pointer"};qu.createRoot(document.getElementById("root")).render(f.jsx(J.StrictMode,{children:f.jsx(sj,{})}));