@cyca/react-timeline-editor 0.2.4-alpha.0 → 0.2.4-alpha.1

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.
package/dist/index.d.ts CHANGED
@@ -218,7 +218,7 @@ export declare interface EffectSourceParam {
218
218
  }
219
219
 
220
220
  export declare function Timeline({ ref, ...props }: TimelineEditor & {
221
- ref?: default_2.RefObject<TimelineState>;
221
+ ref?: default_2.RefObject<TimelineState | null>;
222
222
  }): JSX.Element;
223
223
 
224
224
  /**
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),C=require("./index-HslTC57T.cjs"),fr=require("react-dom");function dr(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const g=dr(k);var Nt={exports:{}},At={};var ln;function hr(){if(ln)return At;ln=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:n,type:r,key:i,ref:s!==void 0?s:null,props:o}}return At.Fragment=e,At.jsx=t,At.jsxs=t,At}var Ct={};var un;function mr(){return un||(un=1,process.env.NODE_ENV!=="production"&&(function(){function n(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===F?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case p:return"Fragment";case b:return"Profiler";case R:return"StrictMode";case D:return"Suspense";case L:return"SuspenseList";case j:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case v:return"Portal";case S:return f.displayName||"Context";case _:return(f._context.displayName||"Context")+".Consumer";case P:var y=f.render;return f=f.displayName,f||(f=y.displayName||y.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case H:return y=f.displayName||null,y!==null?y:n(f.type)||"Memo";case M:y=f._payload,f=f._init;try{return n(f(y))}catch{}}return null}function e(f){return""+f}function t(f){try{e(f);var y=!1}catch{y=!0}if(y){y=console;var I=y.error,Y=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return I.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Y),e(f)}}function r(f){if(f===p)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===M)return"<...>";try{var y=n(f);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var f=G.A;return f===null?null:f.getOwner()}function o(){return Error("react-stack-top-frame")}function i(f){if(x.call(f,"key")){var y=Object.getOwnPropertyDescriptor(f,"key").get;if(y&&y.isReactWarning)return!1}return f.key!==void 0}function c(f,y){function I(){E||(E=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}I.isReactWarning=!0,Object.defineProperty(f,"key",{get:I,configurable:!0})}function a(){var f=n(this.type);return A[f]||(A[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function u(f,y,I,Y,te,q){var X=I.ref;return f={$$typeof:w,type:f,key:y,props:I,_owner:Y},(X!==void 0?X:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:a}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function l(f,y,I,Y,te,q){var X=y.children;if(X!==void 0)if(Y)if(U(X)){for(Y=0;Y<X.length;Y++)h(X[Y]);Object.freeze&&Object.freeze(X)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(X);if(x.call(y,"key")){X=n(f);var O=Object.keys(y).filter(function(B){return B!=="key"});Y=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",ne[X+Y]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),C=require("./index-HslTC57T.cjs"),fr=require("react-dom");function dr(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const b=dr(P);var Nt={exports:{}},At={};var ln;function hr(){if(ln)return At;ln=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:n,type:r,key:i,ref:s!==void 0?s:null,props:o}}return At.Fragment=e,At.jsx=t,At.jsxs=t,At}var Ct={};var un;function mr(){return un||(un=1,process.env.NODE_ENV!=="production"&&(function(){function n(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===V?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case _:return"Fragment";case g:return"Profiler";case p:return"StrictMode";case y:return"Suspense";case D:return"SuspenseList";case U:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case S:return"Portal";case w:return f.displayName||"Context";case v:return(f._context.displayName||"Context")+".Consumer";case A:var R=f.render;return f=f.displayName,f||(f=R.displayName||R.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case F:return R=f.displayName||null,R!==null?R:n(f.type)||"Memo";case N:R=f._payload,f=f._init;try{return n(f(R))}catch{}}return null}function e(f){return""+f}function t(f){try{e(f);var R=!1}catch{R=!0}if(R){R=console;var O=R.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return O.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),e(f)}}function r(f){if(f===_)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===N)return"<...>";try{var R=n(f);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function s(){var f=Z.A;return f===null?null:f.getOwner()}function o(){return Error("react-stack-top-frame")}function i(f){if($.call(f,"key")){var R=Object.getOwnPropertyDescriptor(f,"key").get;if(R&&R.isReactWarning)return!1}return f.key!==void 0}function c(f,R){function O(){x||(x=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",R))}O.isReactWarning=!0,Object.defineProperty(f,"key",{get:O,configurable:!0})}function a(){var f=n(this.type);return I[f]||(I[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function u(f,R,O,j,ee,Y){var B=O.ref;return f={$$typeof:E,type:f,key:R,props:O,_owner:j},(B!==void 0?B:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:a}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function l(f,R,O,j,ee,Y){var B=R.children;if(B!==void 0)if(j)if(Q(B)){for(j=0;j<B.length;j++)h(B[j]);Object.freeze&&Object.freeze(B)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(B);if($.call(R,"key")){B=n(f);var L=Object.keys(R).filter(function(z){return z!=="key"});j=0<L.length?"{key: someKey, "+L.join(": ..., ")+": ...}":"{key: someKey}",se[B+j]||(L=0<L.length?"{"+L.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,Y,X,O,X),ne[X+Y]=!0)}if(X=null,I!==void 0&&(t(I),X=""+I),i(y)&&(t(y.key),X=""+y.key),"key"in y){I={};for(var z in y)z!=="key"&&(I[z]=y[z])}else I=y;return X&&c(I,typeof f=="function"?f.displayName||f.name||"Unknown":f),u(f,X,I,s(),te,q)}function h(f){d(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===M&&(f._payload.status==="fulfilled"?d(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function d(f){return typeof f=="object"&&f!==null&&f.$$typeof===w}var m=k,w=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),S=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),G=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,x=Object.prototype.hasOwnProperty,U=Array.isArray,W=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(f){return f()}};var E,A={},N=m.react_stack_bottom_frame.bind(m,o)(),ee=W(r(o)),ne={};Ct.Fragment=p,Ct.jsx=function(f,y,I){var Y=1e4>G.recentlyCreatedOwnerStacks++;return l(f,y,I,!1,Y?Error("react-stack-top-frame"):N,Y?W(r(f)):ee)},Ct.jsxs=function(f,y,I){var Y=1e4>G.recentlyCreatedOwnerStacks++;return l(f,y,I,!0,Y?Error("react-stack-top-frame"):N,Y?W(r(f)):ee)}})()),Ct}var fn;function pr(){return fn||(fn=1,process.env.NODE_ENV==="production"?Nt.exports=hr():Nt.exports=mr()),Nt.exports}var T=pr();const qt={trace:0,debug:1,info:2,warn:3,error:4,silent:5},gr=["trace","debug","info","warn","error"];var vr=class Wn{s;ls=new Map;lvl;def;n;r;c=console;e;trace;debug;info;warn;error;constructor(e,t,r,s){this.s=e,this.e=t,this.n=r,this.r=s,this.bindMethods()}noop=()=>{};bindMethods(){gr.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>qt[e]>=qt[this.currentLevel()]?t:this.noop,configurable:!0})})}storageKey(){return this.n?`loglevel:${String(this.n)}`:"loglevel"}currentLevel(){if(this.lvl)return this.lvl;const e=this.s.get(this.storageKey());return e&&e in qt?(this.lvl=e,this.lvl):this.def?this.def:this.r?this.r.currentLevel():"trace"}setLevel(e){return this.lvl=e,this.s.set(this.storageKey(),e),this}setDefaultLevel(e){return this.s.get(this.storageKey())||(this.def=e),this}resetLevel(){return this.lvl=void 0,this.s.del(this.storageKey()),this}getLogger(e){if(!e)throw new Error("Logger name required");if(!this.ls.has(e)){const t=new Wn(this.s,this.e,e,this.r||this);this.ls.set(e,zn(t))}return this.ls.get(e)}getLoggers(){const e={};return this.ls.forEach((t,r)=>{e[String(r)]=t}),e}use(e){this.c=e,this.bindMethods()}};function zn(n){return new Proxy(n,{get(e,t,r){if(t in e)return Reflect.get(e,t,r);const s=e.c[t];return typeof s=="function"?s.bind(e.c):s}})}var br=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const _r={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},dn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},Sr={bind(n,e,t){const r=t?`${dn[e]} ${String(t)}:`:`${dn[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${_r[e]}; font-weight: bold;`,"color: inherit")}},qe=zn(new vr(new br,Sr));function wr(n){let{editorData:e=[],effects:t={},scale:r=C.DEFAULT_SCALE,scaleSplitCount:s=C.DEFAULT_SCALE_SPLIT_COUNT,scaleWidth:o=C.DEFAULT_SCALE_WIDTH,startLeft:i=C.DEFAULT_START_LEFT,minScaleCount:c,maxScaleCount:a=1/0,rowHeight:u=C.DEFAULT_ROW_HEIGHT}=n;r<=0&&(qe.error("Error: scale must be greater than 0!"),r=C.DEFAULT_SCALE),s<=0&&(qe.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),o<=0&&(qe.warn("Warning: scaleWidth must be greater than 0!"),o=C.DEFAULT_SCALE_WIDTH),i<0&&(qe.warn("Warning: startLeft cannot be less than 0!"),i=0),c&&typeof c=="number"&&(c<1&&(qe.warn("Warning: minScaleCount must be greater than 1!"),c=C.MIN_SCALE_COUNT),c=parseInt(c+""),a<c&&(qe.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),a=c)),a=a===1/0?1/0:parseInt(a+""),u<=0&&(qe.warn("Warning: rowHeight must be greater than 0!"),u=C.DEFAULT_ROW_HEIGHT);const l={...n};return delete l.style,{...l,editorData:e,effects:t,scale:r,scaleSplitCount:s,scaleWidth:o,startLeft:i,minScaleCount:c,maxScaleCount:a,rowHeight:u}}var It={exports:{}},Kt={};var hn;function Er(){if(hn)return Kt;hn=1;var n=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Kt.c=function(e){return n.H.useMemoCache(e)},Kt}var Jt={};var mn;function yr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){var n=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Jt.c=function(e){var t=n.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
6
+ <%s key={someKey} {...props} />`,j,B,L,B),se[B+j]=!0)}if(B=null,O!==void 0&&(t(O),B=""+O),i(R)&&(t(R.key),B=""+R.key),"key"in R){O={};for(var M in R)M!=="key"&&(O[M]=R[M])}else O=R;return B&&c(O,typeof f=="function"?f.displayName||f.name||"Unknown":f),u(f,B,O,s(),ee,Y)}function h(f){d(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===N&&(f._payload.status==="fulfilled"?d(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function d(f){return typeof f=="object"&&f!==null&&f.$$typeof===E}var m=P,E=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),w=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),Z=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,Q=Array.isArray,H=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(f){return f()}};var x,I={},K=m.react_stack_bottom_frame.bind(m,o)(),ne=H(r(o)),se={};Ct.Fragment=_,Ct.jsx=function(f,R,O){var j=1e4>Z.recentlyCreatedOwnerStacks++;return l(f,R,O,!1,j?Error("react-stack-top-frame"):K,j?H(r(f)):ne)},Ct.jsxs=function(f,R,O){var j=1e4>Z.recentlyCreatedOwnerStacks++;return l(f,R,O,!0,j?Error("react-stack-top-frame"):K,j?H(r(f)):ne)}})()),Ct}var fn;function pr(){return fn||(fn=1,process.env.NODE_ENV==="production"?Nt.exports=hr():Nt.exports=mr()),Nt.exports}var T=pr();const qt={trace:0,debug:1,info:2,warn:3,error:4,silent:5},gr=["trace","debug","info","warn","error"];var vr=class Wn{s;ls=new Map;lvl;def;n;r;c=console;e;trace;debug;info;warn;error;constructor(e,t,r,s){this.s=e,this.e=t,this.n=r,this.r=s,this.bindMethods()}noop=()=>{};bindMethods(){gr.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>qt[e]>=qt[this.currentLevel()]?t:this.noop,configurable:!0})})}storageKey(){return this.n?`loglevel:${String(this.n)}`:"loglevel"}currentLevel(){if(this.lvl)return this.lvl;const e=this.s.get(this.storageKey());return e&&e in qt?(this.lvl=e,this.lvl):this.def?this.def:this.r?this.r.currentLevel():"trace"}setLevel(e){return this.lvl=e,this.s.set(this.storageKey(),e),this}setDefaultLevel(e){return this.s.get(this.storageKey())||(this.def=e),this}resetLevel(){return this.lvl=void 0,this.s.del(this.storageKey()),this}getLogger(e){if(!e)throw new Error("Logger name required");if(!this.ls.has(e)){const t=new Wn(this.s,this.e,e,this.r||this);this.ls.set(e,zn(t))}return this.ls.get(e)}getLoggers(){const e={};return this.ls.forEach((t,r)=>{e[String(r)]=t}),e}use(e){this.c=e,this.bindMethods()}};function zn(n){return new Proxy(n,{get(e,t,r){if(t in e)return Reflect.get(e,t,r);const s=e.c[t];return typeof s=="function"?s.bind(e.c):s}})}var br=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const Sr={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},dn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},_r={bind(n,e,t){const r=t?`${dn[e]} ${String(t)}:`:`${dn[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${Sr[e]}; font-weight: bold;`,"color: inherit")}},qe=zn(new vr(new br,_r));function wr(n){let{editorData:e=[],effects:t={},scale:r=C.DEFAULT_SCALE,scaleSplitCount:s=C.DEFAULT_SCALE_SPLIT_COUNT,scaleWidth:o=C.DEFAULT_SCALE_WIDTH,startLeft:i=C.DEFAULT_START_LEFT,minScaleCount:c,maxScaleCount:a=1/0,rowHeight:u=C.DEFAULT_ROW_HEIGHT}=n;r<=0&&(qe.error("Error: scale must be greater than 0!"),r=C.DEFAULT_SCALE),s<=0&&(qe.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),o<=0&&(qe.warn("Warning: scaleWidth must be greater than 0!"),o=C.DEFAULT_SCALE_WIDTH),i<0&&(qe.warn("Warning: startLeft cannot be less than 0!"),i=0),c&&typeof c=="number"&&(c<1&&(qe.warn("Warning: minScaleCount must be greater than 1!"),c=C.MIN_SCALE_COUNT),c=parseInt(c+""),a<c&&(qe.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),a=c)),a=a===1/0?1/0:parseInt(a+""),u<=0&&(qe.warn("Warning: rowHeight must be greater than 0!"),u=C.DEFAULT_ROW_HEIGHT);const l={...n};return delete l.style,{...l,editorData:e,effects:t,scale:r,scaleSplitCount:s,scaleWidth:o,startLeft:i,minScaleCount:c,maxScaleCount:a,rowHeight:u}}function Er(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.map(function(r){return r.split(" ").map(function(s){return s?""+n+s:""}).join(" ")}).join(" ")}function de(...n){return Er(`${C.PREFIX}-`,...n)}var It={exports:{}},Kt={};var hn;function yr(){if(hn)return Kt;hn=1;var n=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Kt.c=function(e){return n.H.useMemoCache(e)},Kt}var Jt={};var mn;function Tr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){var n=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Jt.c=function(e){var t=n.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
7
7
  1. You might have mismatching versions of React and the renderer (such as React DOM)
8
8
  2. You might be breaking the Rules of Hooks
9
9
  3. You might have more than one copy of React in the same app
10
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t.useMemoCache(e)}})()),Jt}var pn;function Tr(){return pn||(pn=1,process.env.NODE_ENV==="production"?It.exports=Er():It.exports=yr()),It.exports}var Pe=Tr();function Rr(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.map(function(r){return r.split(" ").map(function(s){return s?""+n+s:""}).join(" ")}).join(" ")}function de(...n){return Rr(`${C.PREFIX}-`,...n)}const xr=n=>{const e=Pe.c(11),{isMoving:t,movePositions:r,assistPositions:s}=n;let o,i;if(e[0]!==t||e[1]!==r||e[2]!==s){const a=r===void 0?[]:r;let u;e[5]!==s?(u=s===void 0?[]:s,e[5]=s,e[6]=u):u=e[6];const l=u;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=de("snap-line-container"),e[7]=o):o=e[7],i=t&&a.filter(h=>l.includes(h)).map(Ar),e[0]=t,e[1]=r,e[2]=s,e[3]=o,e[4]=i}else o=e[3],i=e[4];let c;return e[8]!==o||e[9]!==i?(c=T.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c};function Ar(n,e){return T.jsx("div",{className:de("snap-line"),style:{left:n}},e)}const kt=1,gn=10,vn=10;function Cr(n){const e=Pe.c(7),t=k.useRef(Number.MIN_SAFE_INTEGER),r=k.useRef(Number.MAX_SAFE_INTEGER),s=k.useRef(kt),o=k.useRef(void 0);let i;e[0]!==n?(i=()=>{if(n?.current){const{left:v,width:p}=n.current.getBoundingClientRect();t.current=v,r.current=v+p}},e[0]=n,e[1]=i):i=e[1];const c=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(v,p)=>{if(v.clientX>=r.current||v.clientX<=t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const R=Math.abs(v.clientX>=r.current?v.clientX-r.current:v.clientX-t.current);s.current=Math.min(Number((R/vn).toFixed(0))*kt,gn);const _=(v.clientX>=r.current?1:-1)*s.current,S=()=>{p&&p(_),o.current=requestAnimationFrame(S)};return o.current=requestAnimationFrame(S),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[2]=a):a=e[2];const u=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(v,p,R)=>{if(v.clientX>=r.current||v.clientX<t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const b=Math.abs(v.clientX>=r.current?v.clientX-r.current:v.clientX-t.current);s.current=Math.min(Number((b/vn).toFixed(0))*kt,gn);const S=(v.clientX>=r.current?1:-1)*s.current,P=()=>{R&&R(S),o.current=requestAnimationFrame(P)};return o.current=requestAnimationFrame(P),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[3]=l):l=e[3];const h=l;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{t.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=kt,o.current!==void 0&&cancelAnimationFrame(o.current)},e[4]=d):d=e[4];const m=d;let w;return e[5]!==c?(w={initAutoScroll:c,dealDragAutoScroll:u,dealResizeAutoScroll:h,stopAutoScroll:m},e[5]=c,e[6]=w):w=e[6],w}function Dr(n,e,t){return Math.max(e,Math.min(n,t))}const he={toVector(n,e){return n===void 0&&(n=e),Array.isArray(n)?n:[n,n]},add(n,e){return[n[0]+e[0],n[1]+e[1]]},sub(n,e){return[n[0]-e[0],n[1]-e[1]]},addTo(n,e){n[0]+=e[0],n[1]+=e[1]},subTo(n,e){n[0]-=e[0],n[1]-=e[1]}};function bn(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function _n(n,e,t,r=.15){return r===0?Dr(n,e,t):n<e?-bn(e-n,t-e,r)+e:n>t?+bn(n-t,t-e,r)+t:n}function Pr(n,[e,t],[r,s]){const[[o,i],[c,a]]=n;return[_n(e,o,i,r),_n(t,c,a,s)]}function Lr(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Or(n){var e=Lr(n,"string");return typeof e=="symbol"?e:String(e)}function Se(n,e,t){return e=Or(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function re(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sn(Object(t),!0).forEach(function(r){Se(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const jn={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function wn(n){return n?n[0].toUpperCase()+n.slice(1):""}const Mr=["enter","leave"];function Nr(n=!1,e){return n&&!Mr.includes(e)}function Ir(n,e="",t=!1){const r=jn[n],s=r&&r[e]||e;return"on"+wn(n)+wn(s)+(Nr(t,s)?"Capture":"")}const kr=["gotpointercapture","lostpointercapture"];function Wr(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=kr.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function zr(n,e=""){const t=jn[n],r=t&&t[e]||e;return n+r}function Bt(n){return"touches"in n}function Fn(n){return Bt(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function jr(n){return Array.from(n.touches).filter(e=>{var t,r;return e.target===n.currentTarget||((t=n.currentTarget)===null||t===void 0||(r=t.contains)===null||r===void 0?void 0:r.call(t,e.target))})}function Fr(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Un(n){return Bt(n)?Fr(n)[0]:n}function Ur(n){return jr(n).map(e=>e.identifier)}function Zt(n){const e=Un(n);return Bt(n)?e.identifier:e.pointerId}function En(n){const e=Un(n);return[e.clientX,e.clientY]}function Vr(n){const e={};if("buttons"in n&&(e.buttons=n.buttons),"shiftKey"in n){const{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o}=n;Object.assign(e,{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o})}return e}function Vt(n,...e){return typeof n=="function"?n(...e):n}function $r(){}function Hr(...n){return n.length===0?$r:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function yn(n,e){return Object.assign({},e,n||{})}const Br=32;class Yr{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:s}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=s,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?Vt(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:s}=this;t.args=this.args;let o=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,s.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,s.locked=!!document.pointerLockElement,Object.assign(s,Vr(e)),s.down=s.pressed=s.buttons%2===1||s.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const D=t._delta.map(Math.abs);he.addTo(t._distance,D)}this.axisIntent&&this.axisIntent(e);const[i,c]=t._movement,[a,u]=r.threshold,{_step:l,values:h}=t;if(r.hasCustomTransform?(l[0]===!1&&(l[0]=Math.abs(i)>=a&&h[0]),l[1]===!1&&(l[1]=Math.abs(c)>=u&&h[1])):(l[0]===!1&&(l[0]=Math.abs(i)>=a&&Math.sign(i)*a),l[1]===!1&&(l[1]=Math.abs(c)>=u&&Math.sign(c)*u)),t.intentional=l[0]!==!1||l[1]!==!1,!t.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[D,L]=h;d[0]=l[0]!==!1?D-l[0]:0,d[1]=l[1]!==!1?L-l[1]:0}else d[0]=l[0]!==!1?i-l[0]:0,d[1]=l[1]!==!1?c-l[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const m=t.offset,w=t._active&&!t._blocked||t.active;w&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=s[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=Vt(r.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[v,p]=t.offset,[[R,b],[_,S]]=t._bounds;t.overflow=[v<R?-1:v>b?1:0,p<_?-1:p>S?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const P=t._active?r.rubberband||[0,0]:[0,0];if(t.offset=Pr(t._bounds,t.offset,P),t.delta=he.sub(t.offset,m),this.computeMovement(),w&&(!t.last||o>Br)){t.delta=he.sub(t.offset,m);const D=t.delta.map(Math.abs);he.addTo(t.distance,D),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[D[0]/o,D[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const s=this.handler(re(re(re({},t),e),{},{[this.aliasKey]:e.values}));s!==void 0&&(e.memo=s)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Xr([n,e],t){const r=Math.abs(n),s=Math.abs(e);if(r>s&&r>t)return"x";if(s>r&&s>t)return"y"}class Gr extends Yr{constructor(...e){super(...e),Se(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=he.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=he.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const s=typeof r.axisThreshold=="object"?r.axisThreshold[Fn(e)]:r.axisThreshold;t.axis=Xr(t._movement,s)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Tn=n=>n,Rn=.15,sn={enabled(n=!0){return n},eventOptions(n,e,t){return re(re({},t.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[Rn,Rn];case!1:return[0,0];default:return he.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return he.toVector(n)},transform(n,e,t){const r=n||t.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const s=r||Tn;return o=>{const i=s(o);return(!isFinite(i[0])||!isFinite(i[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${i[0]},${[1]}]`),i}}return r||Tn},threshold(n){return he.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(sn,{domTarget(n){if(n!==void 0)throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");return NaN},lockDirection(n){if(n!==void 0)throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");return NaN},initial(n){if(n!==void 0)throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");return NaN}});const qr=0,Dt=re(re({},sn),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=qr){return n},bounds(n={}){if(typeof n=="function")return o=>Dt.bounds(n(o));if("current"in n)return()=>n.current;if(typeof HTMLElement=="function"&&n instanceof HTMLElement)return n;const{left:e=-1/0,right:t=1/0,top:r=-1/0,bottom:s=1/0}=n;return[[e,t],[r,s]]}}),xn={ArrowRight:(n,e=1)=>[n*e,0],ArrowLeft:(n,e=1)=>[-1*n*e,0],ArrowUp:(n,e=1)=>[0,-1*n*e],ArrowDown:(n,e=1)=>[0,n*e]};class Kr extends Gr{constructor(...e){super(...e),Se(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),s={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Dt.bounds(s)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const s=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(s&&s.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=Zt(e),r._pointerActive=!0,this.computeValues(En(e)),this.computeInitial(),t.preventScrollAxis&&Fn(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const o=En(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=he.sub(o,t._values),this.computeValues(o)),he.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{process.env.NODE_ENV==="development"&&console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.")}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=r.tapsThreshold&&i<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[c,a]=t._delta,[u,l]=t._movement,[h,d]=r.swipe.velocity,[m,w]=r.swipe.distance,v=r.swipe.duration;if(t.elapsedTime<v){const p=Math.abs(c/t.timeDelta),R=Math.abs(a/t.timeDelta);p>h&&Math.abs(u)>m&&(t.swipe[0]=Math.sign(c)),R>d&&Math.abs(l)>w&&(t.swipe[1]=Math.sign(a))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;if(process.env.NODE_ENV==="development")try{if(r==="pointer"&&t.preventScrollDelay===void 0){const s="uv"in e?e.sourceEvent.currentTarget:e.currentTarget;window.getComputedStyle(s).touchAction==="auto"&&console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.",s)}}catch{}t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,Jr(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=xn[e.key];if(t){const r=this.state,s=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,s),r._keyboardActive=!0,he.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in xn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Jr(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Pt=typeof window<"u"&&window.document&&window.document.createElement;function Vn(){return Pt&&"ontouchstart"in window}function Zr(){return Vn()||Pt&&window.navigator.maxTouchPoints>1}function Qr(){return Pt&&"onpointerdown"in window}function es(){return Pt&&"exitPointerLock"in window.document}function ts(){try{return"constructor"in GestureEvent}catch{return!1}}const Ee={isBrowser:Pt,gesture:ts(),touch:Vn(),touchscreen:Zr(),pointer:Qr(),pointerLock:es()},ns=250,rs=180,ss=.5,os=50,is=250,cs=10,An={mouse:0,touch:0,pen:8},$n=re(re({},Dt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&Ee.pointerLock,Ee.touch&&t?"touch":this.pointerLock?"mouse":Ee.pointer&&!s?"pointer":Ee.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?ns:void 0,!(!Ee.touchscreen||t===!1))return n||(t!==void 0?"y":void 0)},pointerCapture(n,e,{pointer:{capture:t=!0,buttons:r=1,keys:s=!0}={}}){return this.pointerButtons=r,this.keys=s,!this.pointerLock&&this.device==="pointer"&&t},threshold(n,e,{filterTaps:t=!1,tapsThreshold:r=3,axis:s=void 0}){const o=he.toVector(n,t?r:s?1:0);return this.filterTaps=t,this.tapsThreshold=r,o},swipe({velocity:n=ss,distance:e=os,duration:t=is}={}){return{velocity:this.transform(he.toVector(n)),distance:this.transform(he.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return rs;case!1:return 0;default:return n}},axisThreshold(n){return n?re(re({},An),n):An},keyboardDisplacement(n=cs){return n}});process.env.NODE_ENV==="development"&&Object.assign($n,{useTouch(n){if(n!==void 0)throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");return NaN},experimental_preventWindowScrollY(n){if(n!==void 0)throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");return NaN},swipeVelocity(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");return NaN},swipeDistance(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");return NaN},swipeDuration(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");return NaN}});re(re({},sn),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!Ee.touch&&Ee.gesture)return"gesture";if(Ee.touch&&r)return"touch";if(Ee.touchscreen){if(Ee.pointer)return"pointer";if(Ee.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=i=>{const c=yn(Vt(t,i),{min:-1/0,max:1/0});return[c.min,c.max]},o=i=>{const c=yn(Vt(r,i),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof t!="function"&&typeof r!="function"?[s(),o()]:i=>[s(i),o(i)]},threshold(n,e,t){return this.lockDirection=t.axis==="lock",he.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});re(re({},Dt),{},{mouseOnly:(n=!0)=>n});re(re({},Dt),{},{mouseOnly:(n=!0)=>n});const Hn=new Map,nn=new Map;function as(n){Hn.set(n.key,n.engine),nn.set(n.key,n.resolver)}const ls={key:"drag",engine:Kr,resolver:$n};function us(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}function fs(n,e){if(n==null)return{};var t=us(n,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}const ds={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=Ee.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},hs=["target","eventOptions","window","enabled","transform"];function zt(n={},e){const t={};for(const[r,s]of Object.entries(e))switch(typeof s){case"function":if(process.env.NODE_ENV==="development"){const o=s.call(t,n[r],r,n);Number.isNaN(o)||(t[r]=o)}else t[r]=s.call(t,n[r],r,n);break;case"object":t[r]=zt(n[r],s);break;case"boolean":s&&(t[r]=n[r]);break}return t}function ms(n,e,t={}){const r=n,{target:s,eventOptions:o,window:i,enabled:c,transform:a}=r,u=fs(r,hs);if(t.shared=zt({target:s,eventOptions:o,window:i,enabled:c,transform:a},ds),e){const l=nn.get(e);t[e]=zt(re({shared:t.shared},u),l)}else for(const l in u){const h=nn.get(l);if(h)t[l]=zt(re({shared:t.shared},u[l]),h);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(l)){if(l==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${l}\` was used. Please read the documentation for further information.`)}}return t}class Bn{constructor(e,t){Se(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,o){const i=this._listeners,c=zr(t,r),a=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=re(re({},a),o);e.addEventListener(c,s,u);const l=()=>{e.removeEventListener(c,s,u),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class ps{constructor(){Se(this,"_timeouts",new Map)}add(e,t,r=140,...s){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...s))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class gs{constructor(e){Se(this,"gestures",new Set),Se(this,"_targetEventStore",new Bn(this)),Se(this,"gestureEventStores",{}),Se(this,"gestureTimeoutStores",{}),Se(this,"handlers",{}),Se(this,"config",{}),Se(this,"pointerIds",new Set),Se(this,"touchIds",new Set),Se(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),vs(this,e)}setEventIds(e){if(Bt(e))return this.touchIds=new Set(Ur(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=ms(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let s;if(!(t.target&&(s=t.target(),!s))){if(t.enabled){for(const i of this.gestures){const c=this.config[i],a=Cn(r,c.eventOptions,!!s);if(c.enabled){const u=Hn.get(i);new u(this,e,i).bind(a)}}const o=Cn(r,t.eventOptions,!!s);for(const i in this.nativeHandlers)o(i,"",c=>this.nativeHandlers[i](re(re({},this.state.shared),{},{event:c,args:e})),void 0,!0)}for(const o in r)r[o]=Hr(...r[o]);if(!s)return r;for(const o in r){const{device:i,capture:c,passive:a}=Wr(o);this._targetEventStore.add(s,i,"",r[o],{capture:c,passive:a})}}}}function Et(n,e){n.gestures.add(e),n.gestureEventStores[e]=new Bn(n,e),n.gestureTimeoutStores[e]=new ps}function vs(n,e){e.drag&&Et(n,"drag"),e.wheel&&Et(n,"wheel"),e.scroll&&Et(n,"scroll"),e.move&&Et(n,"move"),e.pinch&&Et(n,"pinch"),e.hover&&Et(n,"hover")}const Cn=(n,e,t)=>(r,s,o,i={},c=!1)=>{var a,u;const l=(a=i.capture)!==null&&a!==void 0?a:e.capture,h=(u=i.passive)!==null&&u!==void 0?u:e.passive;let d=c?r:Ir(r,s,l);t&&h&&(d+="Passive"),n[d]=n[d]||[],n[d].push(o)};function bs(n,e={},t,r){const s=k.useMemo(()=>new gs(n),[]);if(s.applyHandlers(n,r),s.applyConfig(e,t),k.useEffect(s.effect.bind(s)),k.useEffect(()=>s.clean.bind(s),[]),e.target===void 0)return s.bind.bind(s)}function Qt(n,e){return as(ls),bs({drag:n},e||{},"drag")}function Dn(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Yn(...n){return e=>{let t=!1;const r=n.map(s=>{const o=Dn(s,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Dn(n[s],null)}}}}function Ze(...n){return g.useCallback(Yn(...n),n)}function Xn(n){const e=Ss(n),t=g.forwardRef((r,s)=>{const{children:o,...i}=r,c=g.Children.toArray(o),a=c.find(Es);if(a){const u=a.props.children,l=c.map(h=>h===a?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:h);return T.jsx(e,{...i,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,l):null})}return T.jsx(e,{...i,ref:s,children:o})});return t.displayName=`${n}.Slot`,t}var _s=Xn("Slot");function Ss(n){const e=g.forwardRef((t,r)=>{const{children:s,...o}=t;if(g.isValidElement(s)){const i=Ts(s),c=ys(o,s.props);return s.type!==g.Fragment&&(c.ref=r?Yn(r,i):i),g.cloneElement(s,c)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var ws=Symbol("radix.slottable");function Es(n){return g.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===ws}function ys(n,e){const t={...e};for(const r in e){const s=n[r],o=e[r];/^on[A-Z]/.test(r)?s&&o?t[r]=(...c)=>{const a=o(...c);return s(...c),a}:s&&(t[r]=s):r==="style"?t[r]={...s,...o}:r==="className"&&(t[r]=[s,o].filter(Boolean).join(" "))}return{...n,...t}}function Ts(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Rs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=Rs.reduce((n,e)=>{const t=Xn(`Primitive.${e}`),r=g.forwardRef((s,o)=>{const{asChild:i,...c}=s,a=i?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(a,{...c,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function xs(n,e=[]){let t=[];function r(o,i){const c=g.createContext(i),a=t.length;t=[...t,i];const u=h=>{const{scope:d,children:m,...w}=h,v=d?.[n]?.[a]||c,p=g.useMemo(()=>w,Object.values(w));return T.jsx(v.Provider,{value:p,children:m})};u.displayName=o+"Provider";function l(h,d){const m=d?.[n]?.[a]||c,w=g.useContext(m);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,l]}const s=()=>{const o=t.map(i=>g.createContext(i));return function(c){const a=c?.[n]||o;return g.useMemo(()=>({[`__scope${n}`]:{...c,[n]:a}}),[c,a])}};return s.scopeName=n,[r,As(s,...e)]}function As(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((c,{useScope:a,scopeName:u})=>{const h=a(o)[`__scope${u}`];return{...c,...h}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}function Je(n,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(n?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}var rn=globalThis?.document?g.useLayoutEffect:()=>{};function Cs(n,e){return g.useReducer((t,r)=>e[t][r]??t,n)}var Ot=n=>{const{present:e,children:t}=n,r=Ds(e),s=typeof t=="function"?t({present:r.isPresent}):g.Children.only(t),o=Ze(r.ref,Ps(s));return typeof t=="function"||r.isPresent?g.cloneElement(s,{ref:o}):null};Ot.displayName="Presence";function Ds(n){const[e,t]=g.useState(),r=g.useRef(null),s=g.useRef(n),o=g.useRef("none"),i=n?"mounted":"unmounted",[c,a]=Cs(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=Wt(r.current);o.current=c==="mounted"?u:"none"},[c]),rn(()=>{const u=r.current,l=s.current;if(l!==n){const d=o.current,m=Wt(u);n?a("MOUNT"):m==="none"||u?.display==="none"?a("UNMOUNT"):a(l&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,a]),rn(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,h=m=>{const v=Wt(r.current).includes(CSS.escape(m.animationName));if(m.target===e&&v&&(a("ANIMATION_END"),!s.current)){const p=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=p)})}},d=m=>{m.target===e&&(o.current=Wt(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,t(u)},[])}}function Wt(n){return n?.animationName||"none"}function Ps(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Ls=g.createContext(void 0);function Os(n){const e=g.useContext(Ls);return n||e||"ltr"}function Ke(n){const e=g.useRef(n);return g.useEffect(()=>{e.current=n}),g.useMemo(()=>(...t)=>e.current?.(...t),[])}function Ms(n,[e,t]){return Math.min(t,Math.max(e,n))}function Ns(n,e){return g.useReducer((t,r)=>e[t][r]??t,n)}var on="ScrollArea",[Gn]=xs(on),[Is,ye]=Gn(on),qn=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=n,[c,a]=g.useState(null),[u,l]=g.useState(null),[h,d]=g.useState(null),[m,w]=g.useState(null),[v,p]=g.useState(null),[R,b]=g.useState(0),[_,S]=g.useState(0),[P,D]=g.useState(!1),[L,H]=g.useState(!1),M=Ze(e,F=>a(F)),j=Os(s);return T.jsx(Is,{scope:t,type:r,dir:j,scrollHideDelay:o,scrollArea:c,viewport:u,onViewportChange:l,content:h,onContentChange:d,scrollbarX:m,onScrollbarXChange:w,scrollbarXEnabled:P,onScrollbarXEnabledChange:D,scrollbarY:v,onScrollbarYChange:p,scrollbarYEnabled:L,onScrollbarYEnabledChange:H,onCornerWidthChange:b,onCornerHeightChange:S,children:T.jsx(Lt.div,{dir:j,...i,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":R+"px","--radix-scroll-area-corner-height":_+"px",...n.style}})})});qn.displayName=on;var Kn="ScrollAreaViewport",Jn=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...o}=n,i=ye(Kn,t),c=g.useRef(null),a=Ze(e,c,i.onViewportChange);return T.jsxs(T.Fragment,{children:[T.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),T.jsx(Lt.div,{"data-radix-scroll-area-viewport":"",...o,ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...n.style},children:T.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Jn.displayName=Kn;var Le="ScrollAreaScrollbar",Zn=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,c=n.orientation==="horizontal";return g.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),s.type==="hover"?T.jsx(ks,{...r,ref:e,forceMount:t}):s.type==="scroll"?T.jsx(Ws,{...r,ref:e,forceMount:t}):s.type==="auto"?T.jsx(Qn,{...r,ref:e,forceMount:t}):s.type==="always"?T.jsx(cn,{...r,ref:e}):null});Zn.displayName=Le;var ks=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),[o,i]=g.useState(!1);return g.useEffect(()=>{const c=s.scrollArea;let a=0;if(c){const u=()=>{window.clearTimeout(a),i(!0)},l=()=>{a=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",l),()=>{window.clearTimeout(a),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",l)}}},[s.scrollArea,s.scrollHideDelay]),T.jsx(Ot,{present:t||o,children:T.jsx(Qn,{"data-state":o?"visible":"hidden",...r,ref:e})})}),Ws=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),o=n.orientation==="horizontal",i=Xt(()=>a("SCROLL_END"),100),[c,a]=Ns("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,s.scrollHideDelay,a]),g.useEffect(()=>{const u=s.viewport,l=o?"scrollLeft":"scrollTop";if(u){let h=u[l];const d=()=>{const m=u[l];h!==m&&(a("SCROLL"),i()),h=m};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[s.viewport,o,a,i]),T.jsx(Ot,{present:t||c!=="hidden",children:T.jsx(cn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Je(n.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:Je(n.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Qn=g.forwardRef((n,e)=>{const t=ye(Le,n.__scopeScrollArea),{forceMount:r,...s}=n,[o,i]=g.useState(!1),c=n.orientation==="horizontal",a=Xt(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,l=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?u:l)}},10);return Rt(t.viewport,a),Rt(t.content,a),T.jsx(Ot,{present:r||o,children:T.jsx(cn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),cn=g.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=ye(Le,n.__scopeScrollArea),o=g.useRef(null),i=g.useRef(0),[c,a]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=sr(c.viewport,c.content),l={...r,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:d=>o.current=d,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:d=>i.current=d};function h(d,m){return $s(d,i.current,c,m)}return t==="horizontal"?T.jsx(zs,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const d=s.viewport.scrollLeft,m=Pn(d,c,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollLeft=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollLeft=h(d,s.dir))}}):t==="vertical"?T.jsx(js,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const d=s.viewport.scrollTop,m=Pn(d,c);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollTop=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollTop=h(d))}}):null}),zs=g.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=ye(Le,n.__scopeScrollArea),[i,c]=g.useState(),a=g.useRef(null),u=Ze(e,a,o.onScrollbarXChange);return g.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"horizontal",...s,ref:u,sizes:t,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Yt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.x),onDragScroll:l=>n.onDragScroll(l.x),onWheelScroll:(l,h)=>{if(o.viewport){const d=o.viewport.scrollLeft+l.deltaX;n.onWheelScroll(d),ir(d,h)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Ht(i.paddingLeft),paddingEnd:Ht(i.paddingRight)}})}})}),js=g.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=ye(Le,n.__scopeScrollArea),[i,c]=g.useState(),a=g.useRef(null),u=Ze(e,a,o.onScrollbarYChange);return g.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"vertical",...s,ref:u,sizes:t,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Yt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.y),onDragScroll:l=>n.onDragScroll(l.y),onWheelScroll:(l,h)=>{if(o.viewport){const d=o.viewport.scrollTop+l.deltaY;n.onWheelScroll(d),ir(d,h)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Ht(i.paddingTop),paddingEnd:Ht(i.paddingBottom)}})}})}),[Fs,er]=Gn(Le),tr=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:l,onResize:h,...d}=n,m=ye(Le,t),[w,v]=g.useState(null),p=Ze(e,M=>v(M)),R=g.useRef(null),b=g.useRef(""),_=m.viewport,S=r.content-r.viewport,P=Ke(l),D=Ke(a),L=Xt(h,10);function H(M){if(R.current){const j=M.clientX-R.current.left,F=M.clientY-R.current.top;u({x:j,y:F})}}return g.useEffect(()=>{const M=j=>{const F=j.target;w?.contains(F)&&P(j,S)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[_,w,S,P]),g.useEffect(D,[r,D]),Rt(w,L),Rt(m.content,L),T.jsx(Fs,{scope:t,scrollbar:w,hasThumb:s,onThumbChange:Ke(o),onThumbPointerUp:Ke(i),onThumbPositionChange:D,onThumbPointerDown:Ke(c),children:T.jsx(Lt.div,{...d,ref:p,style:{position:"absolute",...d.style},onPointerDown:Je(n.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),R.current=w.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),H(M))}),onPointerMove:Je(n.onPointerMove,H),onPointerUp:Je(n.onPointerUp,M=>{const j=M.target;j.hasPointerCapture(M.pointerId)&&j.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=""),R.current=null})})})}),$t="ScrollAreaThumb",nr=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=er($t,n.__scopeScrollArea);return T.jsx(Ot,{present:t||s.hasThumb,children:T.jsx(Us,{ref:e,...r})})}),Us=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,o=ye($t,t),i=er($t,t),{onThumbPositionChange:c}=i,a=Ze(e,h=>i.onThumbChange(h)),u=g.useRef(void 0),l=Xt(()=>{u.current&&(u.current(),u.current=void 0)},100);return g.useEffect(()=>{const h=o.viewport;if(h){const d=()=>{if(l(),!u.current){const m=Hs(h,c);u.current=m,c()}};return c(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[o.viewport,l,c]),T.jsx(Lt.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Je(n.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),w=h.clientX-m.left,v=h.clientY-m.top;i.onThumbPointerDown({x:w,y:v})}),onPointerUp:Je(n.onPointerUp,i.onThumbPointerUp)})});nr.displayName=$t;var an="ScrollAreaCorner",rr=g.forwardRef((n,e)=>{const t=ye(an,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?T.jsx(Vs,{...n,ref:e}):null});rr.displayName=an;var Vs=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=ye(an,t),[o,i]=g.useState(0),[c,a]=g.useState(0),u=!!(o&&c);return Rt(s.scrollbarX,()=>{const l=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(l),a(l)}),Rt(s.scrollbarY,()=>{const l=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(l),i(l)}),u?T.jsx(Lt.div,{...r,ref:e,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Ht(n){return n?parseInt(n,10):0}function sr(n,e){const t=n/e;return isNaN(t)?0:t}function Yt(n){const e=sr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function $s(n,e,t,r="ltr"){const s=Yt(t),o=s/2,i=e||o,c=s-i,a=t.scrollbar.paddingStart+i,u=t.scrollbar.size-t.scrollbar.paddingEnd-c,l=t.content-t.viewport,h=r==="ltr"?[0,l]:[l*-1,0];return or([a,u],h)(n)}function Pn(n,e,t="ltr"){const r=Yt(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,c=o-r,a=t==="ltr"?[0,i]:[i*-1,0],u=Ms(n,a);return or([0,i],[0,c])(u)}function or(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function ir(n,e){return n>0&&n<e}var Hs=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const o={left:n.scrollLeft,top:n.scrollTop},i=t.left!==o.left,c=t.top!==o.top;(i||c)&&e(),t=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Xt(n,e){const t=Ke(n),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Rt(n,e){const t=Ke(e);rn(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var Bs=qn,Ys=Jn,Xs=rr;const en=(n,e,t,r,s)=>({target:n,dx:e[0],dy:e[1],clientX:t[0],clientY:t[1],...r&&{edges:r},...s&&{deltaRect:s}}),Gs=(n,e,t)=>n?n===e||n===t||(e?.contains(n)??!1)||(t?.contains(n)??!1):!1,qs=n=>{const e=Pe.c(34),{children:t,style:r,draggable:s,resizable:o,draggableOptions:i,resizableOptions:c,ref:a}=n,u=k.useRef(void 0),l=k.useRef(void 0),h=k.useRef(null),d=k.useRef(null),m=k.useRef(void 0),w=k.useRef(void 0);let v,p;e[0]!==i||e[1]!==a||e[2]!==c?(v=()=>{if(u.current=i,l.current=c,!a?.current)return;const E=c?.edges?.left,A=c?.edges?.right;E&&E!==m.current&&(m.current=E,h.current=a.current.querySelector(E)),A&&A!==w.current&&(w.current=A,d.current=a.current.querySelector(A))},p=[i,a,c],e[0]=i,e[1]=a,e[2]=c,e[3]=v,e[4]=p):(v=e[3],p=e[4]),k.useEffect(v,p);let R;e[5]!==a?(R=E=>{const{active:A,delta:N,xy:ee,event:ne,first:f,last:y}=E,I=a?.current;if(!I||Gs(ne?.target,h.current,d.current))return;const Y=en(I,N,ee);f?u.current?.onstart?.(Y):y?u.current?.onend?.(Y):A&&u.current?.onmove?.(Y)},e[5]=a,e[6]=R):R=e[6];const b=i?.lockAxis==="x"?"x":void 0;let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_={capture:!0},e[7]=_):_=e[7];let S;e[8]!==s||e[9]!==a||e[10]!==b?(S={enabled:s,axis:b,pointer:_,target:a,threshold:0},e[8]=s,e[9]=a,e[10]=b,e[11]=S):S=e[11],Qt(R,S);let P;e[12]!==a?(P=E=>{const{active:A,delta:N,xy:ee,first:ne,last:f}=E,y=a?.current;if(!y)return;const I=en(y,N,ee,{left:!0},{left:N[0]});ne?l.current?.onstart?.(I):f?l.current?.onend?.(I):A&&l.current?.onmove?.(I)},e[12]=a,e[13]=P):P=e[13];let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D={capture:!0},e[14]=D):D=e[14];let L;e[15]!==o?(L={enabled:o,target:h,pointer:D,threshold:0},e[15]=o,e[16]=L):L=e[16],Qt(P,L);let H;e[17]!==a?(H=E=>{const{active:A,delta:N,xy:ee,first:ne,last:f}=E,y=a?.current;if(!y)return;const I=en(y,N,ee,{right:!0},{right:N[0]});ne?l.current?.onstart?.(I):f?l.current?.onend?.(I):A&&l.current?.onmove?.(I)},e[17]=a,e[18]=H):H=e[18];let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M={capture:!0},e[19]=M):M=e[19];let j;e[20]!==o?(j={enabled:o,target:d,pointer:M,threshold:0},e[20]=o,e[21]=j):j=e[21],Qt(H,j);let F,G;e[22]!==a?(F=()=>{const E=a?.current;if(!E)return;const A=l.current?.edges?.left,N=l.current?.edges?.right;A&&(h.current=E.querySelector(A)),N&&(d.current=E.querySelector(N))},G=[a],e[22]=a,e[23]=F,e[24]=G):(F=e[23],G=e[24]),k.useLayoutEffect(F,G);let x;e[25]!==s?(x=s?{touchAction:"none"}:{},e[25]=s,e[26]=x):x=e[26];let U;e[27]!==r||e[28]!==x?(U={...x,...r},e[27]=r,e[28]=x,e[29]=U):U=e[29];let W;return e[30]!==t||e[31]!==a||e[32]!==U?(W=T.jsx(_s,{ref:a,style:U,draggable:!1,children:t}),e[30]=t,e[31]=a,e[32]=U,e[33]=W):W=e[33],W},_e=(n,e=0)=>n?parseFloat(n):e,tn=(n,e,t,r=Number.MAX_SAFE_INTEGER)=>{let s=n,o=r;for(const i of e){const c=Math.abs(i-n);c<t&&c<o&&(s=i,o=c)}return{snap:s,minDis:o}},cr=k.forwardRef((n,e)=>{const t=Pe.c(68),{children:r,edges:s,left:o,width:i,start:c,grid:a,getBounds:u,enableResizing:l,enableDragging:h,snapDistance:d,snapPositions:m,onResizeStart:w,onResize:v,onResizeEnd:p,onDragStart:R,onDragEnd:b,onDrag:_,parentRef:S,autoScroll:P}=n,D=c===void 0?C.DEFAULT_START_LEFT:c,L=a===void 0?C.DEFAULT_MOVE_GRID:a,H=u===void 0?Ks:u,M=l===void 0?!0:l,j=h===void 0?!0:h,F=d===void 0?C.DEFAULT_SNAP_DISTANCE:d;let G;t[0]!==m?(G=m===void 0?[]:m,t[0]=m,t[1]=G):G=t[1];const x=G,U=P===void 0?!0:P,W=k.useRef(null),E=k.useRef(0),A=k.useRef(!1),{initAutoScroll:N,stopAutoScroll:ee,dealDragAutoScroll:ne,dealResizeAutoScroll:f}=Cr(S);let y;t[2]===Symbol.for("react.memo_cache_sentinel")?(y=($,Z)=>{const K=Z===void 0?!0:Z;if(!W.current)return;K&&(E.current=0);const J=W.current;J.style.left=`${$}px`,J.dataset.left=String($)},t[2]=y):y=t[2];const I=y;let Y;t[3]===Symbol.for("react.memo_cache_sentinel")?(Y=($,Z)=>{const K=Z===void 0?!0:Z;if(!W.current)return;K&&(E.current=0);const J=W.current;J.style.width=`${$}px`,J.dataset.width=String($)},t[3]=Y):Y=t[3];const te=Y;let q;t[4]===Symbol.for("react.memo_cache_sentinel")?(q=()=>W.current?_e(W.current.dataset.left):0,t[4]=q):q=t[4];const X=q;let O;t[5]===Symbol.for("react.memo_cache_sentinel")?(O=()=>W.current?_e(W.current.dataset.width):0,t[5]=O):O=t[5];const z=O;let B,Qe;t[6]!==i?(B=()=>{if(!W.current)return;const $=W.current;te(typeof i>"u"?$.offsetWidth:i,!1)},Qe=[i],t[6]=i,t[7]=B,t[8]=Qe):(B=t[7],Qe=t[8]),k.useEffect(B,Qe);let et,ze;t[9]!==o?(et=()=>{I(o||0,!1)},ze=[o],t[9]=o,t[10]=et,t[11]=ze):(et=t[10],ze=t[11]),k.useEffect(et,ze);let Oe;t[12]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>({updateLeft:$=>I($||0,!1),updateWidth:$=>te($,!1),getLeft:X,getWidth:z}),t[12]=Oe):Oe=t[12],k.useImperativeHandle(e,Oe);let xe;t[13]!==N||t[14]!==R?(xe=()=>{E.current=0,A.current=!1,N(),R?.()},t[13]=N,t[14]=R,t[15]=xe):xe=t[15];const Xe=xe;let Me;t[16]!==H||t[17]!==L||t[18]!==_||t[19]!==F||t[20]!==x||t[21]!==D?(Me=$=>{const{preLeft:Z,preWidth:K,scrollDelta:J}=$;J&&(E.current=E.current+J);const me=A.current?F:L;if(Math.abs(E.current)<me)return;const pe=Math.trunc(E.current/me);let Q=Z+pe*me;const oe=E.current>0,V=oe?Q+K:Q,{snap:se}=tn(V,x,F);if(se!==V)A.current=!0,Q=oe?se-K:se;else{const le=Q-D;le%L!==0&&(Q=D+L*Math.round(le/L)),A.current=!1}E.current=E.current%me;const ie=H();Q<ie.left?Q=ie.left:Q+K>ie.right&&(Q=ie.right-K),!(_&&_({lastLeft:Z,left:Q,lastWidth:K,width:K},J)===!1)&&I(Q,!1)},t[16]=H,t[17]=L,t[18]=_,t[19]=F,t[20]=x,t[21]=D,t[22]=Me):Me=t[22];const Ae=Me;let Ne;t[23]!==U||t[24]!==ne||t[25]!==Ae||t[26]!==S?(Ne=$=>{const Z=$.target,K=_e(Z.dataset.left),J=_e(Z.dataset.width);E.current=E.current+$.dx,!(U&&S?.current&&!ne($,Q=>{if(!S?.current||!W.current)return;S.current.scrollLeft=S.current.scrollLeft+Q;const oe=W.current,V=_e(oe.dataset.left),se=_e(oe.dataset.width);Ae({preLeft:V,preWidth:se,scrollDelta:Q})}))&&Ae({preLeft:K,preWidth:J})},t[23]=U,t[24]=ne,t[25]=Ae,t[26]=S,t[27]=Ne):Ne=t[27];const xt=Ne;let tt;t[28]!==b||t[29]!==ee?(tt=$=>{E.current=0,A.current=!1,ee();const Z=$.target;b?.({left:_e(Z.dataset.left),width:_e(Z.dataset.width)})},t[28]=b,t[29]=ee,t[30]=tt):tt=t[30];const je=tt;let we;t[31]!==N||t[32]!==w?(we=$=>{E.current=0,A.current=!1,N();const Z=$.edges?.right?"right":"left";w?.(Z)},t[31]=N,t[32]=w,t[33]=we):we=t[33];const Fe=we;let Ie;t[34]!==H||t[35]!==L||t[36]!==v||t[37]!==F||t[38]!==x||t[39]!==D?(Ie=$=>{const{dir:Z,preWidth:K,preLeft:J,scrollDelta:me}=$;me&&(E.current=E.current+me);const pe=A.current?F:L;if(Math.abs(E.current)<pe)return;const Q=H();if(Z==="left"){const oe=Math.trunc(E.current/pe);let V=J+oe*pe;const{snap:se}=tn(V,x,F);if(se!==V)A.current=!0,V=se;else{const ge=V-D;ge%L!==0&&(V=D+L*Math.round(ge/L)),A.current=!1}E.current=E.current%pe,V<Q.left&&(V=Q.left);const ie=J+K,le=ie-V;if(V>=ie||v&&v("left",{lastLeft:J,lastWidth:K,left:V,width:le})===!1)return;I(V,!1),te(le,!1)}else{const oe=Math.trunc(E.current/pe);let V=K+oe*pe;const se=J+V,{snap:ie}=tn(se,x,F);if(ie!==se)A.current=!0,V=ie-J;else{let le=J+V;const ge=le-D;ge%L!==0&&(le=D+L*Math.round(ge/L),V=le-J),A.current=!1}if(E.current=E.current%pe,J+V>Q.right&&(V=Q.right-J),V<=0||v&&v("right",{lastLeft:J,lastWidth:K,left:J,width:V})===!1)return;te(V,!1)}},t[34]=H,t[35]=L,t[36]=v,t[37]=F,t[38]=x,t[39]=D,t[40]=Ie):Ie=t[40];const Ue=Ie;let ke;t[41]!==U||t[42]!==f||t[43]!==S||t[44]!==Ue?(ke=$=>{const Z=$.target,K=$.edges?.left?"left":"right",J=_e(Z.dataset.left),me=_e(Z.dataset.width);E.current=E.current+(K==="left"?$.deltaRect?.left||0:$.deltaRect?.right||0),!(U&&S?.current&&!f($,K,oe=>{if(!S?.current||!W.current)return;S.current.scrollLeft=S.current.scrollLeft+oe;const V=W.current,se=_e(V.dataset.left),ie=_e(V.dataset.width);Ue({preLeft:se,preWidth:ie,dir:K,scrollDelta:oe})}))&&Ue({preLeft:J,preWidth:me,dir:K})},t[41]=U,t[42]=f,t[43]=S,t[44]=Ue,t[45]=ke):ke=t[45];const Ce=ke;let We;t[46]!==p||t[47]!==ee?(We=$=>{E.current=0,A.current=!1,ee();const Z=$.target,K=$.edges?.right?"right":"left";p?.(K,{left:_e(Z.dataset.left),width:_e(Z.dataset.width)})},t[46]=p,t[47]=ee,t[48]=We):We=t[48];const Ge=We;let Te;t[49]!==o||t[50]!==i?(Te={left:o,width:i},t[49]=o,t[50]=i,t[51]=Te):Te=t[51];let De;t[52]!==xt||t[53]!==Xe||t[54]!==je?(De={lockAxis:"x",onmove:xt,onstart:Xe,onend:je,cursorChecker:Js},t[52]=xt,t[53]=Xe,t[54]=je,t[55]=De):De=t[55];let Re;t[56]!==s||t[57]!==Ce||t[58]!==Fe||t[59]!==Ge?(Re={axis:"x",invert:"none",edges:s,onmove:Ce,onstart:Fe,onend:Ge},t[56]=s,t[57]=Ce,t[58]=Fe,t[59]=Ge,t[60]=Re):Re=t[60];let Ve;return t[61]!==r||t[62]!==j||t[63]!==M||t[64]!==Te||t[65]!==De||t[66]!==Re?(Ve=T.jsx(qs,{style:Te,ref:W,draggable:j,resizable:M,draggableOptions:De,resizableOptions:Re,children:r}),t[61]=r,t[62]=j,t[63]=M,t[64]=Te,t[65]=De,t[66]=Re,t[67]=Ve):Ve=t[67],Ve});function Ks(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function Js(){return""}function Zs(){let n=0,e,t="",r=arguments.length;for(;n<r;n++)(e=arguments[n])&&typeof e=="string"&&(t+=(t&&" ")+e);return t}const Qs=n=>{const e=Pe.c(191),{editorData:t,row:r,action:s,effects:o,rowHeight:i,scale:c,scaleWidth:a,scaleSplitCount:u,startLeft:l,gridSnap:h,disableDrag:d,scaleCount:m,maxScaleCount:w,setScaleCount:v,onActionMoveStart:p,onActionMoving:R,onActionMoveEnd:b,onActionResizeStart:_,onActionResizeEnd:S,onActionResizing:P,snapData:D,setEditorData:L,onClickAction:H,onClickActionOnly:M,onDoubleClickAction:j,onContextMenuAction:F,getActionRender:G,handleTime:x,scrollContainerRef:U}=n,W=k.useRef(null),E=k.useRef(!1),{id:A,maxEnd:N,minStart:ee,end:ne,start:f,selected:y,flexible:I,movable:Y,effectId:te}=s,q=I===void 0?!0:I,X=Y===void 0?!0:Y,O=c??C.DEFAULT_SCALE,z=a??C.DEFAULT_SCALE_WIDTH,B=l??C.DEFAULT_START_LEFT,Qe=u??C.DEFAULT_SCALE_SPLIT_COUNT,et=w??Number.MAX_SAFE_INTEGER,ze=ee||0;let Oe;e[0]!==O||e[1]!==z||e[2]!==B||e[3]!==ze?(Oe=C.parserTimeToPixel(ze,{startLeft:B,scale:O,scaleWidth:z}),e[0]=O,e[1]=z,e[2]=B,e[3]=ze,e[4]=Oe):Oe=e[4];const xe=Oe,Xe=N||Number.MAX_VALUE;let Me;e[5]!==O||e[6]!==z||e[7]!==B||e[8]!==Xe?(Me=C.parserTimeToPixel(Xe,{startLeft:B,scale:O,scaleWidth:z}),e[5]=O,e[6]=z,e[7]=B,e[8]=Xe,e[9]=Me):Me=e[9];const Ae=Math.min(et*z+B,Me);let Ne;e[10]!==ne||e[11]!==O||e[12]!==z||e[13]!==B||e[14]!==f?(Ne=C.parserTimeToTransform({start:f,end:ne},{startLeft:B,scale:O,scaleWidth:z}),e[10]=ne,e[11]=O,e[12]=z,e[13]=B,e[14]=f,e[15]=Ne):Ne=e[15];const xt=Ne,[tt,je]=k.useState(null),we=tt??xt,Fe=z/Qe;let Ie;e[16]!==te||e[17]!==o||e[18]!==q||e[19]!==X||e[20]!==y?(Ie=de(Zs("action",X&&"action-movable",y&&"action-selected",q&&"action-flexible",o[te]&&`action-effect-${te}`)),e[16]=te,e[17]=o,e[18]=q,e[19]=X,e[20]=y,e[21]=Ie):Ie=e[21];const Ue=Ie;let ke;e[22]!==z||e[23]!==B||e[24]!==m||e[25]!==v?(ke=(ve,be)=>{console.log("handleScaleCount",ve,be);const ce=C.getScaleCountByPixel(ve+be,{startLeft:B,scaleCount:m,scaleWidth:z});ce!==m&&v(ce)},e[22]=z,e[23]=B,e[24]=m,e[25]=v,e[26]=ke):ke=e[26];const Ce=ke;let We;e[27]!==s||e[28]!==p||e[29]!==r?(We=()=>{p&&p({action:s,row:r})},e[27]=s,e[28]=p,e[29]=r,e[30]=We):We=e[30];const Ge=We;let Te;e[31]!==s||e[32]!==Ce||e[33]!==R||e[34]!==r||e[35]!==O||e[36]!==z||e[37]!==B?(Te=ve=>{const{left:be,width:ce}=ve;if(E.current=!0,R){const{start:fe,end:ae}=C.parserTransformToTime({left:be,width:ce},{scaleWidth:z,scale:O,startLeft:B});if(R({action:s,row:r,start:fe,end:ae})===!1)return!1}je({left:be,width:ce}),Ce(be,ce)},e[31]=s,e[32]=Ce,e[33]=R,e[34]=r,e[35]=O,e[36]=z,e[37]=B,e[38]=Te):Te=e[38];const De=Te;let Re;e[39]!==t||e[40]!==A||e[41]!==b||e[42]!==r||e[43]!==O||e[44]!==z||e[45]!==B||e[46]!==L?(Re=ve=>{const{left:be,width:ce}=ve,{start:fe,end:ae}=C.parserTransformToTime({left:be,width:ce},{scaleWidth:z,scale:O,startLeft:B}),ue=t.find(Ye=>Ye.id===r.id);if(!ue)return;const Be=ue.actions.find(Ye=>Ye.id===A);Be&&(Be.start=fe,Be.end=ae,L(t),b&&b({action:Be,row:r,start:fe,end:ae}),je(null))},e[39]=t,e[40]=A,e[41]=b,e[42]=r,e[43]=O,e[44]=z,e[45]=B,e[46]=L,e[47]=Re):Re=e[47];const Ve=Re;let $;e[48]!==s||e[49]!==_||e[50]!==r?($=ve=>{_&&_({action:s,row:r,dir:ve})},e[48]=s,e[49]=_,e[50]=r,e[51]=$):$=e[51];const Z=$;let K;e[52]!==s||e[53]!==Ce||e[54]!==P||e[55]!==r||e[56]!==O||e[57]!==z||e[58]!==B?(K=(ve,be)=>{const{left:ce,width:fe}=be;if(E.current=!0,P){const{start:ae,end:ue}=C.parserTransformToTime({left:ce,width:fe},{scaleWidth:z,scale:O,startLeft:B});if(P({action:s,row:r,start:ae,end:ue,dir:ve})===!1)return!1}je({left:ce,width:fe}),Ce(ce,fe)},e[52]=s,e[53]=Ce,e[54]=P,e[55]=r,e[56]=O,e[57]=z,e[58]=B,e[59]=K):K=e[59];const J=K;let me;e[60]!==t||e[61]!==A||e[62]!==S||e[63]!==r||e[64]!==O||e[65]!==z||e[66]!==B||e[67]!==L?(me=(ve,be)=>{const{left:ce,width:fe}=be,{start:ae,end:ue}=C.parserTransformToTime({left:ce,width:fe},{scaleWidth:z,scale:O,startLeft:B}),Be=t.find(Gt=>Gt.id===r.id);if(!Be)return;const Ye=Be.actions.find(Gt=>Gt.id===A);Ye&&(Ye.start=ae,Ye.end=ue,L(t),S&&S({action:Ye,row:r,start:ae,end:ue,dir:ve}),je(null))},e[60]=t,e[61]=A,e[62]=S,e[63]=r,e[64]=O,e[65]=z,e[66]=B,e[67]=L,e[68]=me):me=e[68];const pe=me;let Q,oe,V,se,ie,le,ge,nt,rt,st,ot,it,ct,at,lt,ut,$e,He,ft,dt,ht,mt,pt,gt,vt,bt;if(e[69]!==s||e[70]!==Ue||e[71]!==d||e[72]!==q||e[73]!==G||e[74]!==Fe||e[75]!==h||e[76]!==De||e[77]!==Ve||e[78]!==Ge||e[79]!==pe||e[80]!==Z||e[81]!==J||e[82]!==x||e[83]!==xe||e[84]!==X||e[85]!==H||e[86]!==M||e[87]!==F||e[88]!==j||e[89]!==Ae||e[90]!==r||e[91]!==i||e[92]!==O||e[93]!==z||e[94]!==B||e[95]!==U||e[96]!==D.assistPositions||e[97]!==we.left||e[98]!==we.width){const ve={...s,...C.parserTransformToTime({left:we.left,width:we.width},{startLeft:B,scaleWidth:z,scale:O})},be={...r,actions:[...r.actions]};r.actions.includes(s)&&(be.actions[r.actions.indexOf(s)]=ve),Q=cr,rt=W,st=U,ot=B,it=we.left,ct=we.width,at=h&&Fe||C.DEFAULT_MOVE_GRID,lt=h?Math.max((Fe||C.DEFAULT_MOVE_GRID)/2,C.DEFAULT_SNAP_DISTANCE):C.DEFAULT_SNAP_DISTANCE,ut=D.assistPositions,e[125]!==xe||e[126]!==Ae?($e=()=>({left:xe,right:Ae}),e[125]=xe,e[126]=Ae,e[127]=$e):$e=e[127];let ce;e[128]!==d||e[129]!==q?(ce=!d&&q&&`.${de("action-left-stretch")}`,e[128]=d,e[129]=q,e[130]=ce):ce=e[130];let fe;e[131]!==d||e[132]!==q?(fe=!d&&q&&`.${de("action-right-stretch")}`,e[131]=d,e[132]=q,e[133]=fe):fe=e[133],e[134]!==ce||e[135]!==fe?(He={left:ce,right:fe},e[134]=ce,e[135]=fe,e[136]=He):He=e[136],ft=!d&&X,dt=!d&&q,ht=Ge,mt=De,pt=Ve,gt=Z,vt=J,bt=pe,e[137]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>{E.current=!1},e[137]=oe):oe=e[137],e[138]!==s||e[139]!==x||e[140]!==H||e[141]!==M||e[142]!==r?(V=ae=>{let ue;H&&(ue=x(ae),H(ae,{row:r,action:s,time:ue})),!E.current&&M&&(ue===void 0&&(ue=x(ae)),M(ae,{row:r,action:s,time:ue}))},e[138]=s,e[139]=x,e[140]=H,e[141]=M,e[142]=r,e[143]=V):V=e[143],e[144]!==s||e[145]!==x||e[146]!==j||e[147]!==r?(se=ae=>{if(j){const ue=x(ae);j(ae,{row:r,action:s,time:ue})}},e[144]=s,e[145]=x,e[146]=j,e[147]=r,e[148]=se):se=e[148],e[149]!==s||e[150]!==x||e[151]!==F||e[152]!==r?(ie=ae=>{if(F){const ue=x(ae);F(ae,{row:r,action:s,time:ue})}},e[149]=s,e[150]=x,e[151]=F,e[152]=r,e[153]=ie):ie=e[153],le=Ue,e[154]!==i?(ge={height:i},e[154]=i,e[155]=ge):ge=e[155],nt=G&&G(ve,be),e[69]=s,e[70]=Ue,e[71]=d,e[72]=q,e[73]=G,e[74]=Fe,e[75]=h,e[76]=De,e[77]=Ve,e[78]=Ge,e[79]=pe,e[80]=Z,e[81]=J,e[82]=x,e[83]=xe,e[84]=X,e[85]=H,e[86]=M,e[87]=F,e[88]=j,e[89]=Ae,e[90]=r,e[91]=i,e[92]=O,e[93]=z,e[94]=B,e[95]=U,e[96]=D.assistPositions,e[97]=we.left,e[98]=we.width,e[99]=Q,e[100]=oe,e[101]=V,e[102]=se,e[103]=ie,e[104]=le,e[105]=ge,e[106]=nt,e[107]=rt,e[108]=st,e[109]=ot,e[110]=it,e[111]=ct,e[112]=at,e[113]=lt,e[114]=ut,e[115]=$e,e[116]=He,e[117]=ft,e[118]=dt,e[119]=ht,e[120]=mt,e[121]=pt,e[122]=gt,e[123]=vt,e[124]=bt}else Q=e[99],oe=e[100],V=e[101],se=e[102],ie=e[103],le=e[104],ge=e[105],nt=e[106],rt=e[107],st=e[108],ot=e[109],it=e[110],ct=e[111],at=e[112],lt=e[113],ut=e[114],$e=e[115],He=e[116],ft=e[117],dt=e[118],ht=e[119],mt=e[120],pt=e[121],gt=e[122],vt=e[123],bt=e[124];let _t;e[156]!==q?(_t=q&&T.jsx("div",{className:de("action-left-stretch"),style:{touchAction:"none"}}),e[156]=q,e[157]=_t):_t=e[157];let St;e[158]!==q?(St=q&&T.jsx("div",{className:de("action-right-stretch"),style:{touchAction:"none"}}),e[158]=q,e[159]=St):St=e[159];let wt;e[160]!==oe||e[161]!==V||e[162]!==se||e[163]!==ie||e[164]!==le||e[165]!==ge||e[166]!==nt||e[167]!==_t||e[168]!==St?(wt=T.jsxs("div",{onMouseDown:oe,onClick:V,onDoubleClick:se,onContextMenu:ie,className:le,style:ge,children:[nt,_t,St]}),e[160]=oe,e[161]=V,e[162]=se,e[163]=ie,e[164]=le,e[165]=ge,e[166]=nt,e[167]=_t,e[168]=St,e[169]=wt):wt=e[169];let Mt;return e[170]!==Q||e[171]!==rt||e[172]!==st||e[173]!==ot||e[174]!==it||e[175]!==ct||e[176]!==at||e[177]!==lt||e[178]!==ut||e[179]!==$e||e[180]!==He||e[181]!==ft||e[182]!==dt||e[183]!==ht||e[184]!==mt||e[185]!==pt||e[186]!==gt||e[187]!==vt||e[188]!==bt||e[189]!==wt?(Mt=T.jsx(Q,{ref:rt,parentRef:st,start:ot,left:it,width:ct,grid:at,snapDistance:lt,snapPositions:ut,getBounds:$e,edges:He,enableDragging:ft,enableResizing:dt,onDragStart:ht,onDrag:mt,onDragEnd:pt,onResizeStart:gt,onResize:vt,onResizeEnd:bt,children:wt}),e[170]=Q,e[171]=rt,e[172]=st,e[173]=ot,e[174]=it,e[175]=ct,e[176]=at,e[177]=lt,e[178]=ut,e[179]=$e,e[180]=He,e[181]=ft,e[182]=dt,e[183]=ht,e[184]=mt,e[185]=pt,e[186]=gt,e[187]=vt,e[188]=bt,e[189]=wt,e[190]=Mt):Mt=e[190],Mt};function yt(n,e,t){let r=t.initialDeps??[],s;function o(){var i,c,a,u;let l;t.key&&((i=t.debug)!=null&&i.call(t))&&(l=Date.now());const h=n();if(!(h.length!==r.length||h.some((w,v)=>r[v]!==w)))return s;r=h;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),s=e(...h),t.key&&((a=t.debug)!=null&&a.call(t))){const w=Math.round((Date.now()-l)*100)/100,v=Math.round((Date.now()-m)*100)/100,p=v/16,R=(b,_)=>{for(b=String(b);b.length<_;)b=" "+b;return b};console.info(`%c⏱ ${R(v,5)} /${R(w,5)} ms`,`
10
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t.useMemoCache(e)}})()),Jt}var pn;function Rr(){return pn||(pn=1,process.env.NODE_ENV==="production"?It.exports=yr():It.exports=Tr()),It.exports}var De=Rr();const xr=n=>{const e=De.c(11),{isMoving:t,movePositions:r,assistPositions:s}=n;let o,i;if(e[0]!==t||e[1]!==r||e[2]!==s){const a=r===void 0?[]:r;let u;e[5]!==s?(u=s===void 0?[]:s,e[5]=s,e[6]=u):u=e[6];const l=u;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=de("snap-line-container"),e[7]=o):o=e[7],i=t&&a.filter(h=>l.includes(h)).map(Ar),e[0]=t,e[1]=r,e[2]=s,e[3]=o,e[4]=i}else o=e[3],i=e[4];let c;return e[8]!==o||e[9]!==i?(c=T.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c};function Ar(n,e){return T.jsx("div",{className:de("snap-line"),style:{left:n}},e)}const kt=1,gn=10,vn=10;function Cr(n){const e=De.c(7),t=P.useRef(Number.MIN_SAFE_INTEGER),r=P.useRef(Number.MAX_SAFE_INTEGER),s=P.useRef(kt),o=P.useRef(void 0);let i;e[0]!==n?(i=()=>{if(n?.current){const{left:S,width:_}=n.current.getBoundingClientRect();t.current=S,r.current=S+_}},e[0]=n,e[1]=i):i=e[1];const c=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(S,_)=>{if(S.clientX>=r.current||S.clientX<=t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const p=Math.abs(S.clientX>=r.current?S.clientX-r.current:S.clientX-t.current);s.current=Math.min(Number((p/vn).toFixed(0))*kt,gn);const v=(S.clientX>=r.current?1:-1)*s.current,w=()=>{_&&_(v),o.current=requestAnimationFrame(w)};return o.current=requestAnimationFrame(w),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[2]=a):a=e[2];const u=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(S,_,p)=>{if(S.clientX>=r.current||S.clientX<t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const g=Math.abs(S.clientX>=r.current?S.clientX-r.current:S.clientX-t.current);s.current=Math.min(Number((g/vn).toFixed(0))*kt,gn);const w=(S.clientX>=r.current?1:-1)*s.current,A=()=>{p&&p(w),o.current=requestAnimationFrame(A)};return o.current=requestAnimationFrame(A),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[3]=l):l=e[3];const h=l;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{t.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=kt,o.current!==void 0&&cancelAnimationFrame(o.current)},e[4]=d):d=e[4];const m=d;let E;return e[5]!==c?(E={initAutoScroll:c,dealDragAutoScroll:u,dealResizeAutoScroll:h,stopAutoScroll:m},e[5]=c,e[6]=E):E=e[6],E}function Pr(n,e,t){return Math.max(e,Math.min(n,t))}const he={toVector(n,e){return n===void 0&&(n=e),Array.isArray(n)?n:[n,n]},add(n,e){return[n[0]+e[0],n[1]+e[1]]},sub(n,e){return[n[0]-e[0],n[1]-e[1]]},addTo(n,e){n[0]+=e[0],n[1]+=e[1]},subTo(n,e){n[0]-=e[0],n[1]-=e[1]}};function bn(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function Sn(n,e,t,r=.15){return r===0?Pr(n,e,t):n<e?-bn(e-n,t-e,r)+e:n>t?+bn(n-t,t-e,r)+t:n}function Dr(n,[e,t],[r,s]){const[[o,i],[c,a]]=n;return[Sn(e,o,i,r),Sn(t,c,a,s)]}function Lr(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Or(n){var e=Lr(n,"string");return typeof e=="symbol"?e:String(e)}function _e(n,e,t){return e=Or(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _n(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function te(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_n(Object(t),!0).forEach(function(r){_e(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_n(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const jn={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function wn(n){return n?n[0].toUpperCase()+n.slice(1):""}const Mr=["enter","leave"];function Nr(n=!1,e){return n&&!Mr.includes(e)}function Ir(n,e="",t=!1){const r=jn[n],s=r&&r[e]||e;return"on"+wn(n)+wn(s)+(Nr(t,s)?"Capture":"")}const kr=["gotpointercapture","lostpointercapture"];function Wr(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=kr.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function zr(n,e=""){const t=jn[n],r=t&&t[e]||e;return n+r}function Bt(n){return"touches"in n}function Fn(n){return Bt(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function jr(n){return Array.from(n.touches).filter(e=>{var t,r;return e.target===n.currentTarget||((t=n.currentTarget)===null||t===void 0||(r=t.contains)===null||r===void 0?void 0:r.call(t,e.target))})}function Fr(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Un(n){return Bt(n)?Fr(n)[0]:n}function Ur(n){return jr(n).map(e=>e.identifier)}function Zt(n){const e=Un(n);return Bt(n)?e.identifier:e.pointerId}function En(n){const e=Un(n);return[e.clientX,e.clientY]}function Vr(n){const e={};if("buttons"in n&&(e.buttons=n.buttons),"shiftKey"in n){const{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o}=n;Object.assign(e,{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o})}return e}function Vt(n,...e){return typeof n=="function"?n(...e):n}function $r(){}function Hr(...n){return n.length===0?$r:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function yn(n,e){return Object.assign({},e,n||{})}const Br=32;class Yr{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:s}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=s,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?Vt(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:s}=this;t.args=this.args;let o=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,s.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,s.locked=!!document.pointerLockElement,Object.assign(s,Vr(e)),s.down=s.pressed=s.buttons%2===1||s.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const y=t._delta.map(Math.abs);he.addTo(t._distance,y)}this.axisIntent&&this.axisIntent(e);const[i,c]=t._movement,[a,u]=r.threshold,{_step:l,values:h}=t;if(r.hasCustomTransform?(l[0]===!1&&(l[0]=Math.abs(i)>=a&&h[0]),l[1]===!1&&(l[1]=Math.abs(c)>=u&&h[1])):(l[0]===!1&&(l[0]=Math.abs(i)>=a&&Math.sign(i)*a),l[1]===!1&&(l[1]=Math.abs(c)>=u&&Math.sign(c)*u)),t.intentional=l[0]!==!1||l[1]!==!1,!t.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[y,D]=h;d[0]=l[0]!==!1?y-l[0]:0,d[1]=l[1]!==!1?D-l[1]:0}else d[0]=l[0]!==!1?i-l[0]:0,d[1]=l[1]!==!1?c-l[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const m=t.offset,E=t._active&&!t._blocked||t.active;E&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=s[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=Vt(r.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[S,_]=t.offset,[[p,g],[v,w]]=t._bounds;t.overflow=[S<p?-1:S>g?1:0,_<v?-1:_>w?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const A=t._active?r.rubberband||[0,0]:[0,0];if(t.offset=Dr(t._bounds,t.offset,A),t.delta=he.sub(t.offset,m),this.computeMovement(),E&&(!t.last||o>Br)){t.delta=he.sub(t.offset,m);const y=t.delta.map(Math.abs);he.addTo(t.distance,y),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[y[0]/o,y[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const s=this.handler(te(te(te({},t),e),{},{[this.aliasKey]:e.values}));s!==void 0&&(e.memo=s)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Xr([n,e],t){const r=Math.abs(n),s=Math.abs(e);if(r>s&&r>t)return"x";if(s>r&&s>t)return"y"}class Gr extends Yr{constructor(...e){super(...e),_e(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=he.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=he.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const s=typeof r.axisThreshold=="object"?r.axisThreshold[Fn(e)]:r.axisThreshold;t.axis=Xr(t._movement,s)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Tn=n=>n,Rn=.15,sn={enabled(n=!0){return n},eventOptions(n,e,t){return te(te({},t.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[Rn,Rn];case!1:return[0,0];default:return he.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return he.toVector(n)},transform(n,e,t){const r=n||t.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const s=r||Tn;return o=>{const i=s(o);return(!isFinite(i[0])||!isFinite(i[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${i[0]},${[1]}]`),i}}return r||Tn},threshold(n){return he.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(sn,{domTarget(n){if(n!==void 0)throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");return NaN},lockDirection(n){if(n!==void 0)throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");return NaN},initial(n){if(n!==void 0)throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");return NaN}});const qr=0,Pt=te(te({},sn),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=qr){return n},bounds(n={}){if(typeof n=="function")return o=>Pt.bounds(n(o));if("current"in n)return()=>n.current;if(typeof HTMLElement=="function"&&n instanceof HTMLElement)return n;const{left:e=-1/0,right:t=1/0,top:r=-1/0,bottom:s=1/0}=n;return[[e,t],[r,s]]}}),xn={ArrowRight:(n,e=1)=>[n*e,0],ArrowLeft:(n,e=1)=>[-1*n*e,0],ArrowUp:(n,e=1)=>[0,-1*n*e],ArrowDown:(n,e=1)=>[0,n*e]};class Kr extends Gr{constructor(...e){super(...e),_e(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),s={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Pt.bounds(s)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const s=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(s&&s.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=Zt(e),r._pointerActive=!0,this.computeValues(En(e)),this.computeInitial(),t.preventScrollAxis&&Fn(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const o=En(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=he.sub(o,t._values),this.computeValues(o)),he.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{process.env.NODE_ENV==="development"&&console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.")}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=r.tapsThreshold&&i<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[c,a]=t._delta,[u,l]=t._movement,[h,d]=r.swipe.velocity,[m,E]=r.swipe.distance,S=r.swipe.duration;if(t.elapsedTime<S){const _=Math.abs(c/t.timeDelta),p=Math.abs(a/t.timeDelta);_>h&&Math.abs(u)>m&&(t.swipe[0]=Math.sign(c)),p>d&&Math.abs(l)>E&&(t.swipe[1]=Math.sign(a))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;if(process.env.NODE_ENV==="development")try{if(r==="pointer"&&t.preventScrollDelay===void 0){const s="uv"in e?e.sourceEvent.currentTarget:e.currentTarget;window.getComputedStyle(s).touchAction==="auto"&&console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.",s)}}catch{}t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,Jr(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=xn[e.key];if(t){const r=this.state,s=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,s),r._keyboardActive=!0,he.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in xn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Jr(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Dt=typeof window<"u"&&window.document&&window.document.createElement;function Vn(){return Dt&&"ontouchstart"in window}function Zr(){return Vn()||Dt&&window.navigator.maxTouchPoints>1}function Qr(){return Dt&&"onpointerdown"in window}function es(){return Dt&&"exitPointerLock"in window.document}function ts(){try{return"constructor"in GestureEvent}catch{return!1}}const Ee={isBrowser:Dt,gesture:ts(),touch:Vn(),touchscreen:Zr(),pointer:Qr(),pointerLock:es()},ns=250,rs=180,ss=.5,os=50,is=250,cs=10,An={mouse:0,touch:0,pen:8},$n=te(te({},Pt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&Ee.pointerLock,Ee.touch&&t?"touch":this.pointerLock?"mouse":Ee.pointer&&!s?"pointer":Ee.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?ns:void 0,!(!Ee.touchscreen||t===!1))return n||(t!==void 0?"y":void 0)},pointerCapture(n,e,{pointer:{capture:t=!0,buttons:r=1,keys:s=!0}={}}){return this.pointerButtons=r,this.keys=s,!this.pointerLock&&this.device==="pointer"&&t},threshold(n,e,{filterTaps:t=!1,tapsThreshold:r=3,axis:s=void 0}){const o=he.toVector(n,t?r:s?1:0);return this.filterTaps=t,this.tapsThreshold=r,o},swipe({velocity:n=ss,distance:e=os,duration:t=is}={}){return{velocity:this.transform(he.toVector(n)),distance:this.transform(he.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return rs;case!1:return 0;default:return n}},axisThreshold(n){return n?te(te({},An),n):An},keyboardDisplacement(n=cs){return n}});process.env.NODE_ENV==="development"&&Object.assign($n,{useTouch(n){if(n!==void 0)throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");return NaN},experimental_preventWindowScrollY(n){if(n!==void 0)throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");return NaN},swipeVelocity(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");return NaN},swipeDistance(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");return NaN},swipeDuration(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");return NaN}});te(te({},sn),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!Ee.touch&&Ee.gesture)return"gesture";if(Ee.touch&&r)return"touch";if(Ee.touchscreen){if(Ee.pointer)return"pointer";if(Ee.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=i=>{const c=yn(Vt(t,i),{min:-1/0,max:1/0});return[c.min,c.max]},o=i=>{const c=yn(Vt(r,i),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof t!="function"&&typeof r!="function"?[s(),o()]:i=>[s(i),o(i)]},threshold(n,e,t){return this.lockDirection=t.axis==="lock",he.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});te(te({},Pt),{},{mouseOnly:(n=!0)=>n});te(te({},Pt),{},{mouseOnly:(n=!0)=>n});const Hn=new Map,nn=new Map;function as(n){Hn.set(n.key,n.engine),nn.set(n.key,n.resolver)}const ls={key:"drag",engine:Kr,resolver:$n};function us(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}function fs(n,e){if(n==null)return{};var t=us(n,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}const ds={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=Ee.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},hs=["target","eventOptions","window","enabled","transform"];function zt(n={},e){const t={};for(const[r,s]of Object.entries(e))switch(typeof s){case"function":if(process.env.NODE_ENV==="development"){const o=s.call(t,n[r],r,n);Number.isNaN(o)||(t[r]=o)}else t[r]=s.call(t,n[r],r,n);break;case"object":t[r]=zt(n[r],s);break;case"boolean":s&&(t[r]=n[r]);break}return t}function ms(n,e,t={}){const r=n,{target:s,eventOptions:o,window:i,enabled:c,transform:a}=r,u=fs(r,hs);if(t.shared=zt({target:s,eventOptions:o,window:i,enabled:c,transform:a},ds),e){const l=nn.get(e);t[e]=zt(te({shared:t.shared},u),l)}else for(const l in u){const h=nn.get(l);if(h)t[l]=zt(te({shared:t.shared},u[l]),h);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(l)){if(l==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${l}\` was used. Please read the documentation for further information.`)}}return t}class Bn{constructor(e,t){_e(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,o){const i=this._listeners,c=zr(t,r),a=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=te(te({},a),o);e.addEventListener(c,s,u);const l=()=>{e.removeEventListener(c,s,u),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class ps{constructor(){_e(this,"_timeouts",new Map)}add(e,t,r=140,...s){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...s))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class gs{constructor(e){_e(this,"gestures",new Set),_e(this,"_targetEventStore",new Bn(this)),_e(this,"gestureEventStores",{}),_e(this,"gestureTimeoutStores",{}),_e(this,"handlers",{}),_e(this,"config",{}),_e(this,"pointerIds",new Set),_e(this,"touchIds",new Set),_e(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),vs(this,e)}setEventIds(e){if(Bt(e))return this.touchIds=new Set(Ur(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=ms(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let s;if(!(t.target&&(s=t.target(),!s))){if(t.enabled){for(const i of this.gestures){const c=this.config[i],a=Cn(r,c.eventOptions,!!s);if(c.enabled){const u=Hn.get(i);new u(this,e,i).bind(a)}}const o=Cn(r,t.eventOptions,!!s);for(const i in this.nativeHandlers)o(i,"",c=>this.nativeHandlers[i](te(te({},this.state.shared),{},{event:c,args:e})),void 0,!0)}for(const o in r)r[o]=Hr(...r[o]);if(!s)return r;for(const o in r){const{device:i,capture:c,passive:a}=Wr(o);this._targetEventStore.add(s,i,"",r[o],{capture:c,passive:a})}}}}function Et(n,e){n.gestures.add(e),n.gestureEventStores[e]=new Bn(n,e),n.gestureTimeoutStores[e]=new ps}function vs(n,e){e.drag&&Et(n,"drag"),e.wheel&&Et(n,"wheel"),e.scroll&&Et(n,"scroll"),e.move&&Et(n,"move"),e.pinch&&Et(n,"pinch"),e.hover&&Et(n,"hover")}const Cn=(n,e,t)=>(r,s,o,i={},c=!1)=>{var a,u;const l=(a=i.capture)!==null&&a!==void 0?a:e.capture,h=(u=i.passive)!==null&&u!==void 0?u:e.passive;let d=c?r:Ir(r,s,l);t&&h&&(d+="Passive"),n[d]=n[d]||[],n[d].push(o)};function bs(n,e={},t,r){const s=P.useMemo(()=>new gs(n),[]);if(s.applyHandlers(n,r),s.applyConfig(e,t),P.useEffect(s.effect.bind(s)),P.useEffect(()=>s.clean.bind(s),[]),e.target===void 0)return s.bind.bind(s)}function Qt(n,e){return as(ls),bs({drag:n},e||{},"drag")}function Pn(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Yn(...n){return e=>{let t=!1;const r=n.map(s=>{const o=Pn(s,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Pn(n[s],null)}}}}function Ze(...n){return b.useCallback(Yn(...n),n)}function Xn(n){const e=_s(n),t=b.forwardRef((r,s)=>{const{children:o,...i}=r,c=b.Children.toArray(o),a=c.find(Es);if(a){const u=a.props.children,l=c.map(h=>h===a?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:h);return T.jsx(e,{...i,ref:s,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(e,{...i,ref:s,children:o})});return t.displayName=`${n}.Slot`,t}var Ss=Xn("Slot");function _s(n){const e=b.forwardRef((t,r)=>{const{children:s,...o}=t;if(b.isValidElement(s)){const i=Ts(s),c=ys(o,s.props);return s.type!==b.Fragment&&(c.ref=r?Yn(r,i):i),b.cloneElement(s,c)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var ws=Symbol("radix.slottable");function Es(n){return b.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===ws}function ys(n,e){const t={...e};for(const r in e){const s=n[r],o=e[r];/^on[A-Z]/.test(r)?s&&o?t[r]=(...c)=>{const a=o(...c);return s(...c),a}:s&&(t[r]=s):r==="style"?t[r]={...s,...o}:r==="className"&&(t[r]=[s,o].filter(Boolean).join(" "))}return{...n,...t}}function Ts(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Rs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=Rs.reduce((n,e)=>{const t=Xn(`Primitive.${e}`),r=b.forwardRef((s,o)=>{const{asChild:i,...c}=s,a=i?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(a,{...c,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function xs(n,e=[]){let t=[];function r(o,i){const c=b.createContext(i),a=t.length;t=[...t,i];const u=h=>{const{scope:d,children:m,...E}=h,S=d?.[n]?.[a]||c,_=b.useMemo(()=>E,Object.values(E));return T.jsx(S.Provider,{value:_,children:m})};u.displayName=o+"Provider";function l(h,d){const m=d?.[n]?.[a]||c,E=b.useContext(m);if(E)return E;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,l]}const s=()=>{const o=t.map(i=>b.createContext(i));return function(c){const a=c?.[n]||o;return b.useMemo(()=>({[`__scope${n}`]:{...c,[n]:a}}),[c,a])}};return s.scopeName=n,[r,As(s,...e)]}function As(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((c,{useScope:a,scopeName:u})=>{const h=a(o)[`__scope${u}`];return{...c,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}function Je(n,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(n?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}var rn=globalThis?.document?b.useLayoutEffect:()=>{};function Cs(n,e){return b.useReducer((t,r)=>e[t][r]??t,n)}var Ot=n=>{const{present:e,children:t}=n,r=Ps(e),s=typeof t=="function"?t({present:r.isPresent}):b.Children.only(t),o=Ze(r.ref,Ds(s));return typeof t=="function"||r.isPresent?b.cloneElement(s,{ref:o}):null};Ot.displayName="Presence";function Ps(n){const[e,t]=b.useState(),r=b.useRef(null),s=b.useRef(n),o=b.useRef("none"),i=n?"mounted":"unmounted",[c,a]=Cs(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Wt(r.current);o.current=c==="mounted"?u:"none"},[c]),rn(()=>{const u=r.current,l=s.current;if(l!==n){const d=o.current,m=Wt(u);n?a("MOUNT"):m==="none"||u?.display==="none"?a("UNMOUNT"):a(l&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,a]),rn(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,h=m=>{const S=Wt(r.current).includes(CSS.escape(m.animationName));if(m.target===e&&S&&(a("ANIMATION_END"),!s.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},d=m=>{m.target===e&&(o.current=Wt(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,t(u)},[])}}function Wt(n){return n?.animationName||"none"}function Ds(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Ls=b.createContext(void 0);function Os(n){const e=b.useContext(Ls);return n||e||"ltr"}function Ke(n){const e=b.useRef(n);return b.useEffect(()=>{e.current=n}),b.useMemo(()=>(...t)=>e.current?.(...t),[])}function Ms(n,[e,t]){return Math.min(t,Math.max(e,n))}function Ns(n,e){return b.useReducer((t,r)=>e[t][r]??t,n)}var on="ScrollArea",[Gn]=xs(on),[Is,ye]=Gn(on),qn=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=n,[c,a]=b.useState(null),[u,l]=b.useState(null),[h,d]=b.useState(null),[m,E]=b.useState(null),[S,_]=b.useState(null),[p,g]=b.useState(0),[v,w]=b.useState(0),[A,y]=b.useState(!1),[D,F]=b.useState(!1),N=Ze(e,V=>a(V)),U=Os(s);return T.jsx(Is,{scope:t,type:r,dir:U,scrollHideDelay:o,scrollArea:c,viewport:u,onViewportChange:l,content:h,onContentChange:d,scrollbarX:m,onScrollbarXChange:E,scrollbarXEnabled:A,onScrollbarXEnabledChange:y,scrollbarY:S,onScrollbarYChange:_,scrollbarYEnabled:D,onScrollbarYEnabledChange:F,onCornerWidthChange:g,onCornerHeightChange:w,children:T.jsx(Lt.div,{dir:U,...i,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":v+"px",...n.style}})})});qn.displayName=on;var Kn="ScrollAreaViewport",Jn=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...o}=n,i=ye(Kn,t),c=b.useRef(null),a=Ze(e,c,i.onViewportChange);return T.jsxs(T.Fragment,{children:[T.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),T.jsx(Lt.div,{"data-radix-scroll-area-viewport":"",...o,ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...n.style},children:T.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Jn.displayName=Kn;var Le="ScrollAreaScrollbar",Zn=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,c=n.orientation==="horizontal";return b.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),s.type==="hover"?T.jsx(ks,{...r,ref:e,forceMount:t}):s.type==="scroll"?T.jsx(Ws,{...r,ref:e,forceMount:t}):s.type==="auto"?T.jsx(Qn,{...r,ref:e,forceMount:t}):s.type==="always"?T.jsx(cn,{...r,ref:e}):null});Zn.displayName=Le;var ks=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),[o,i]=b.useState(!1);return b.useEffect(()=>{const c=s.scrollArea;let a=0;if(c){const u=()=>{window.clearTimeout(a),i(!0)},l=()=>{a=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",l),()=>{window.clearTimeout(a),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",l)}}},[s.scrollArea,s.scrollHideDelay]),T.jsx(Ot,{present:t||o,children:T.jsx(Qn,{"data-state":o?"visible":"hidden",...r,ref:e})})}),Ws=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),o=n.orientation==="horizontal",i=Xt(()=>a("SCROLL_END"),100),[c,a]=Ns("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,s.scrollHideDelay,a]),b.useEffect(()=>{const u=s.viewport,l=o?"scrollLeft":"scrollTop";if(u){let h=u[l];const d=()=>{const m=u[l];h!==m&&(a("SCROLL"),i()),h=m};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[s.viewport,o,a,i]),T.jsx(Ot,{present:t||c!=="hidden",children:T.jsx(cn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Je(n.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:Je(n.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Qn=b.forwardRef((n,e)=>{const t=ye(Le,n.__scopeScrollArea),{forceMount:r,...s}=n,[o,i]=b.useState(!1),c=n.orientation==="horizontal",a=Xt(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,l=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?u:l)}},10);return Rt(t.viewport,a),Rt(t.content,a),T.jsx(Ot,{present:r||o,children:T.jsx(cn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),cn=b.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=ye(Le,n.__scopeScrollArea),o=b.useRef(null),i=b.useRef(0),[c,a]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=sr(c.viewport,c.content),l={...r,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:d=>o.current=d,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:d=>i.current=d};function h(d,m){return $s(d,i.current,c,m)}return t==="horizontal"?T.jsx(zs,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const d=s.viewport.scrollLeft,m=Dn(d,c,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollLeft=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollLeft=h(d,s.dir))}}):t==="vertical"?T.jsx(js,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const d=s.viewport.scrollTop,m=Dn(d,c);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollTop=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollTop=h(d))}}):null}),zs=b.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=ye(Le,n.__scopeScrollArea),[i,c]=b.useState(),a=b.useRef(null),u=Ze(e,a,o.onScrollbarXChange);return b.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"horizontal",...s,ref:u,sizes:t,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Yt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.x),onDragScroll:l=>n.onDragScroll(l.x),onWheelScroll:(l,h)=>{if(o.viewport){const d=o.viewport.scrollLeft+l.deltaX;n.onWheelScroll(d),ir(d,h)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Ht(i.paddingLeft),paddingEnd:Ht(i.paddingRight)}})}})}),js=b.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=ye(Le,n.__scopeScrollArea),[i,c]=b.useState(),a=b.useRef(null),u=Ze(e,a,o.onScrollbarYChange);return b.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"vertical",...s,ref:u,sizes:t,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Yt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.y),onDragScroll:l=>n.onDragScroll(l.y),onWheelScroll:(l,h)=>{if(o.viewport){const d=o.viewport.scrollTop+l.deltaY;n.onWheelScroll(d),ir(d,h)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Ht(i.paddingTop),paddingEnd:Ht(i.paddingBottom)}})}})}),[Fs,er]=Gn(Le),tr=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:l,onResize:h,...d}=n,m=ye(Le,t),[E,S]=b.useState(null),_=Ze(e,N=>S(N)),p=b.useRef(null),g=b.useRef(""),v=m.viewport,w=r.content-r.viewport,A=Ke(l),y=Ke(a),D=Xt(h,10);function F(N){if(p.current){const U=N.clientX-p.current.left,V=N.clientY-p.current.top;u({x:U,y:V})}}return b.useEffect(()=>{const N=U=>{const V=U.target;E?.contains(V)&&A(U,w)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[v,E,w,A]),b.useEffect(y,[r,y]),Rt(E,D),Rt(m.content,D),T.jsx(Fs,{scope:t,scrollbar:E,hasThumb:s,onThumbChange:Ke(o),onThumbPointerUp:Ke(i),onThumbPositionChange:y,onThumbPointerDown:Ke(c),children:T.jsx(Lt.div,{...d,ref:_,style:{position:"absolute",...d.style},onPointerDown:Je(n.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),p.current=E.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),F(N))}),onPointerMove:Je(n.onPointerMove,F),onPointerUp:Je(n.onPointerUp,N=>{const U=N.target;U.hasPointerCapture(N.pointerId)&&U.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=g.current,m.viewport&&(m.viewport.style.scrollBehavior=""),p.current=null})})})}),$t="ScrollAreaThumb",nr=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=er($t,n.__scopeScrollArea);return T.jsx(Ot,{present:t||s.hasThumb,children:T.jsx(Us,{ref:e,...r})})}),Us=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,o=ye($t,t),i=er($t,t),{onThumbPositionChange:c}=i,a=Ze(e,h=>i.onThumbChange(h)),u=b.useRef(void 0),l=Xt(()=>{u.current&&(u.current(),u.current=void 0)},100);return b.useEffect(()=>{const h=o.viewport;if(h){const d=()=>{if(l(),!u.current){const m=Hs(h,c);u.current=m,c()}};return c(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[o.viewport,l,c]),T.jsx(Lt.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Je(n.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),E=h.clientX-m.left,S=h.clientY-m.top;i.onThumbPointerDown({x:E,y:S})}),onPointerUp:Je(n.onPointerUp,i.onThumbPointerUp)})});nr.displayName=$t;var an="ScrollAreaCorner",rr=b.forwardRef((n,e)=>{const t=ye(an,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?T.jsx(Vs,{...n,ref:e}):null});rr.displayName=an;var Vs=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=ye(an,t),[o,i]=b.useState(0),[c,a]=b.useState(0),u=!!(o&&c);return Rt(s.scrollbarX,()=>{const l=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(l),a(l)}),Rt(s.scrollbarY,()=>{const l=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(l),i(l)}),u?T.jsx(Lt.div,{...r,ref:e,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Ht(n){return n?parseInt(n,10):0}function sr(n,e){const t=n/e;return isNaN(t)?0:t}function Yt(n){const e=sr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function $s(n,e,t,r="ltr"){const s=Yt(t),o=s/2,i=e||o,c=s-i,a=t.scrollbar.paddingStart+i,u=t.scrollbar.size-t.scrollbar.paddingEnd-c,l=t.content-t.viewport,h=r==="ltr"?[0,l]:[l*-1,0];return or([a,u],h)(n)}function Dn(n,e,t="ltr"){const r=Yt(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,c=o-r,a=t==="ltr"?[0,i]:[i*-1,0],u=Ms(n,a);return or([0,i],[0,c])(u)}function or(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function ir(n,e){return n>0&&n<e}var Hs=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const o={left:n.scrollLeft,top:n.scrollTop},i=t.left!==o.left,c=t.top!==o.top;(i||c)&&e(),t=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Xt(n,e){const t=Ke(n),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Rt(n,e){const t=Ke(e);rn(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var Bs=qn,Ys=Jn,Xs=rr;const en=(n,e,t,r,s)=>({target:n,dx:e[0],dy:e[1],clientX:t[0],clientY:t[1],...r&&{edges:r},...s&&{deltaRect:s}}),Gs=(n,e,t)=>n?n===e||n===t||(e?.contains(n)??!1)||(t?.contains(n)??!1):!1,qs=n=>{const e=De.c(34),{children:t,style:r,draggable:s,resizable:o,draggableOptions:i,resizableOptions:c,ref:a}=n,u=P.useRef(void 0),l=P.useRef(void 0),h=P.useRef(null),d=P.useRef(null),m=P.useRef(void 0),E=P.useRef(void 0);let S,_;e[0]!==i||e[1]!==a||e[2]!==c?(S=()=>{if(u.current=i,l.current=c,!a?.current)return;const x=c?.edges?.left,I=c?.edges?.right;x&&x!==m.current&&(m.current=x,h.current=a.current.querySelector(x)),I&&I!==E.current&&(E.current=I,d.current=a.current.querySelector(I))},_=[i,a,c],e[0]=i,e[1]=a,e[2]=c,e[3]=S,e[4]=_):(S=e[3],_=e[4]),P.useEffect(S,_);let p;e[5]!==a?(p=x=>{const{active:I,delta:K,xy:ne,event:se,first:f,last:R}=x,O=a?.current;if(!O||Gs(se?.target,h.current,d.current))return;const j=en(O,K,ne);f?u.current?.onstart?.(j):R?u.current?.onend?.(j):I&&u.current?.onmove?.(j)},e[5]=a,e[6]=p):p=e[6];const g=i?.lockAxis==="x"?"x":void 0;let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v={capture:!0},e[7]=v):v=e[7];let w;e[8]!==s||e[9]!==a||e[10]!==g?(w={enabled:s,axis:g,pointer:v,target:a,threshold:0},e[8]=s,e[9]=a,e[10]=g,e[11]=w):w=e[11],Qt(p,w);let A;e[12]!==a?(A=x=>{const{active:I,delta:K,xy:ne,first:se,last:f}=x,R=a?.current;if(!R)return;const O=en(R,K,ne,{left:!0},{left:K[0]});se?l.current?.onstart?.(O):f?l.current?.onend?.(O):I&&l.current?.onmove?.(O)},e[12]=a,e[13]=A):A=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y={capture:!0},e[14]=y):y=e[14];let D;e[15]!==o?(D={enabled:o,target:h,pointer:y,threshold:0},e[15]=o,e[16]=D):D=e[16],Qt(A,D);let F;e[17]!==a?(F=x=>{const{active:I,delta:K,xy:ne,first:se,last:f}=x,R=a?.current;if(!R)return;const O=en(R,K,ne,{right:!0},{right:K[0]});se?l.current?.onstart?.(O):f?l.current?.onend?.(O):I&&l.current?.onmove?.(O)},e[17]=a,e[18]=F):F=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N={capture:!0},e[19]=N):N=e[19];let U;e[20]!==o?(U={enabled:o,target:d,pointer:N,threshold:0},e[20]=o,e[21]=U):U=e[21],Qt(F,U);let V,Z;e[22]!==a?(V=()=>{const x=a?.current;if(!x)return;const I=l.current?.edges?.left,K=l.current?.edges?.right;I&&(h.current=x.querySelector(I)),K&&(d.current=x.querySelector(K))},Z=[a],e[22]=a,e[23]=V,e[24]=Z):(V=e[23],Z=e[24]),P.useLayoutEffect(V,Z);let $;e[25]!==s?($=s?{touchAction:"none"}:{},e[25]=s,e[26]=$):$=e[26];let Q;e[27]!==r||e[28]!==$?(Q={...$,...r},e[27]=r,e[28]=$,e[29]=Q):Q=e[29];let H;return e[30]!==t||e[31]!==a||e[32]!==Q?(H=T.jsx(Ss,{ref:a,style:Q,draggable:!1,children:t}),e[30]=t,e[31]=a,e[32]=Q,e[33]=H):H=e[33],H},Se=(n,e=0)=>n?parseFloat(n):e,tn=(n,e,t,r=Number.MAX_SAFE_INTEGER)=>{let s=n,o=r;for(const i of e){const c=Math.abs(i-n);c<t&&c<o&&(s=i,o=c)}return{snap:s,minDis:o}},cr=P.forwardRef((n,e)=>{const t=De.c(68),{children:r,edges:s,left:o,width:i,start:c,grid:a,getBounds:u,enableResizing:l,enableDragging:h,snapDistance:d,snapPositions:m,onResizeStart:E,onResize:S,onResizeEnd:_,onDragStart:p,onDragEnd:g,onDrag:v,parentRef:w,autoScroll:A}=n,y=c===void 0?C.DEFAULT_START_LEFT:c,D=a===void 0?C.DEFAULT_MOVE_GRID:a,F=u===void 0?Ks:u,N=l===void 0?!0:l,U=h===void 0?!0:h,V=d===void 0?C.DEFAULT_SNAP_DISTANCE:d;let Z;t[0]!==m?(Z=m===void 0?[]:m,t[0]=m,t[1]=Z):Z=t[1];const $=Z,Q=A===void 0?!0:A,H=P.useRef(null),x=P.useRef(0),I=P.useRef(!1),{initAutoScroll:K,stopAutoScroll:ne,dealDragAutoScroll:se,dealResizeAutoScroll:f}=Cr(w);let R;t[2]===Symbol.for("react.memo_cache_sentinel")?(R=(W,q)=>{const X=q===void 0?!0:q;if(!H.current)return;X&&(x.current=0);const G=H.current;G.style.left=`${W}px`,G.dataset.left=String(W)},t[2]=R):R=t[2];const O=R;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=(W,q)=>{const X=q===void 0?!0:q;if(!H.current)return;X&&(x.current=0);const G=H.current;G.style.width=`${W}px`,G.dataset.width=String(W)},t[3]=j):j=t[3];const ee=j;let Y;t[4]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>H.current?Se(H.current.dataset.left):0,t[4]=Y):Y=t[4];const B=Y;let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=()=>H.current?Se(H.current.dataset.width):0,t[5]=L):L=t[5];const M=L;let z,Qe;t[6]!==i?(z=()=>{if(!H.current)return;const W=H.current;ee(typeof i>"u"?W.offsetWidth:i,!1)},Qe=[i],t[6]=i,t[7]=z,t[8]=Qe):(z=t[7],Qe=t[8]),P.useEffect(z,Qe);let et,ze;t[9]!==o?(et=()=>{O(o||0,!1)},ze=[o],t[9]=o,t[10]=et,t[11]=ze):(et=t[10],ze=t[11]),P.useEffect(et,ze);let Oe;t[12]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>({updateLeft:W=>O(W||0,!1),updateWidth:W=>ee(W,!1),getLeft:B,getWidth:M}),t[12]=Oe):Oe=t[12],P.useImperativeHandle(e,Oe);let xe;t[13]!==K||t[14]!==p?(xe=()=>{x.current=0,I.current=!1,K(),p?.()},t[13]=K,t[14]=p,t[15]=xe):xe=t[15];const Xe=xe;let Me;t[16]!==F||t[17]!==D||t[18]!==v||t[19]!==V||t[20]!==$||t[21]!==y?(Me=W=>{const{preLeft:q,preWidth:X,scrollDelta:G}=W;G&&(x.current=x.current+G);const me=I.current?V:D;if(Math.abs(x.current)<me)return;const pe=Math.trunc(x.current/me);let J=q+pe*me;const oe=x.current>0,k=oe?J+X:J,{snap:re}=tn(k,$,V);if(re!==k)I.current=!0,J=oe?re-X:re;else{const le=J-y;le%D!==0&&(J=y+D*Math.round(le/D)),I.current=!1}x.current=x.current%me;const ie=F();J<ie.left?J=ie.left:J+X>ie.right&&(J=ie.right-X),!(v&&v({lastLeft:q,left:J,lastWidth:X,width:X},G)===!1)&&O(J,!1)},t[16]=F,t[17]=D,t[18]=v,t[19]=V,t[20]=$,t[21]=y,t[22]=Me):Me=t[22];const Ae=Me;let Ne;t[23]!==Q||t[24]!==se||t[25]!==Ae||t[26]!==w?(Ne=W=>{const q=W.target,X=Se(q.dataset.left),G=Se(q.dataset.width);x.current=x.current+W.dx,!(Q&&w?.current&&!se(W,J=>{if(!w?.current||!H.current)return;w.current.scrollLeft=w.current.scrollLeft+J;const oe=H.current,k=Se(oe.dataset.left),re=Se(oe.dataset.width);Ae({preLeft:k,preWidth:re,scrollDelta:J})}))&&Ae({preLeft:X,preWidth:G})},t[23]=Q,t[24]=se,t[25]=Ae,t[26]=w,t[27]=Ne):Ne=t[27];const xt=Ne;let tt;t[28]!==g||t[29]!==ne?(tt=W=>{x.current=0,I.current=!1,ne();const q=W.target;g?.({left:Se(q.dataset.left),width:Se(q.dataset.width)})},t[28]=g,t[29]=ne,t[30]=tt):tt=t[30];const je=tt;let we;t[31]!==K||t[32]!==E?(we=W=>{x.current=0,I.current=!1,K();const q=W.edges?.right?"right":"left";E?.(q)},t[31]=K,t[32]=E,t[33]=we):we=t[33];const Fe=we;let Ie;t[34]!==F||t[35]!==D||t[36]!==S||t[37]!==V||t[38]!==$||t[39]!==y?(Ie=W=>{const{dir:q,preWidth:X,preLeft:G,scrollDelta:me}=W;me&&(x.current=x.current+me);const pe=I.current?V:D;if(Math.abs(x.current)<pe)return;const J=F();if(q==="left"){const oe=Math.trunc(x.current/pe);let k=G+oe*pe;const{snap:re}=tn(k,$,V);if(re!==k)I.current=!0,k=re;else{const ge=k-y;ge%D!==0&&(k=y+D*Math.round(ge/D)),I.current=!1}x.current=x.current%pe,k<J.left&&(k=J.left);const ie=G+X,le=ie-k;if(k>=ie||S&&S("left",{lastLeft:G,lastWidth:X,left:k,width:le})===!1)return;O(k,!1),ee(le,!1)}else{const oe=Math.trunc(x.current/pe);let k=X+oe*pe;const re=G+k,{snap:ie}=tn(re,$,V);if(ie!==re)I.current=!0,k=ie-G;else{let le=G+k;const ge=le-y;ge%D!==0&&(le=y+D*Math.round(ge/D),k=le-G),I.current=!1}if(x.current=x.current%pe,G+k>J.right&&(k=J.right-G),k<=0||S&&S("right",{lastLeft:G,lastWidth:X,left:G,width:k})===!1)return;ee(k,!1)}},t[34]=F,t[35]=D,t[36]=S,t[37]=V,t[38]=$,t[39]=y,t[40]=Ie):Ie=t[40];const Ue=Ie;let ke;t[41]!==Q||t[42]!==f||t[43]!==w||t[44]!==Ue?(ke=W=>{const q=W.target,X=W.edges?.left?"left":"right",G=Se(q.dataset.left),me=Se(q.dataset.width);x.current=x.current+(X==="left"?W.deltaRect?.left||0:W.deltaRect?.right||0),!(Q&&w?.current&&!f(W,X,oe=>{if(!w?.current||!H.current)return;w.current.scrollLeft=w.current.scrollLeft+oe;const k=H.current,re=Se(k.dataset.left),ie=Se(k.dataset.width);Ue({preLeft:re,preWidth:ie,dir:X,scrollDelta:oe})}))&&Ue({preLeft:G,preWidth:me,dir:X})},t[41]=Q,t[42]=f,t[43]=w,t[44]=Ue,t[45]=ke):ke=t[45];const Ce=ke;let We;t[46]!==_||t[47]!==ne?(We=W=>{x.current=0,I.current=!1,ne();const q=W.target,X=W.edges?.right?"right":"left";_?.(X,{left:Se(q.dataset.left),width:Se(q.dataset.width)})},t[46]=_,t[47]=ne,t[48]=We):We=t[48];const Ge=We;let Te;t[49]!==o||t[50]!==i?(Te={left:o,width:i},t[49]=o,t[50]=i,t[51]=Te):Te=t[51];let Pe;t[52]!==xt||t[53]!==Xe||t[54]!==je?(Pe={lockAxis:"x",onmove:xt,onstart:Xe,onend:je,cursorChecker:Js},t[52]=xt,t[53]=Xe,t[54]=je,t[55]=Pe):Pe=t[55];let Re;t[56]!==s||t[57]!==Ce||t[58]!==Fe||t[59]!==Ge?(Re={axis:"x",invert:"none",edges:s,onmove:Ce,onstart:Fe,onend:Ge},t[56]=s,t[57]=Ce,t[58]=Fe,t[59]=Ge,t[60]=Re):Re=t[60];let Ve;return t[61]!==r||t[62]!==U||t[63]!==N||t[64]!==Te||t[65]!==Pe||t[66]!==Re?(Ve=T.jsx(qs,{style:Te,ref:H,draggable:U,resizable:N,draggableOptions:Pe,resizableOptions:Re,children:r}),t[61]=r,t[62]=U,t[63]=N,t[64]=Te,t[65]=Pe,t[66]=Re,t[67]=Ve):Ve=t[67],Ve});function Ks(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function Js(){return""}function Zs(){let n=0,e,t="",r=arguments.length;for(;n<r;n++)(e=arguments[n])&&typeof e=="string"&&(t+=(t&&" ")+e);return t}const Qs=n=>{const e=De.c(191),{editorData:t,row:r,action:s,effects:o,rowHeight:i,scale:c,scaleWidth:a,scaleSplitCount:u,startLeft:l,gridSnap:h,disableDrag:d,scaleCount:m,maxScaleCount:E,setScaleCount:S,onActionMoveStart:_,onActionMoving:p,onActionMoveEnd:g,onActionResizeStart:v,onActionResizeEnd:w,onActionResizing:A,snapData:y,setEditorData:D,onClickAction:F,onClickActionOnly:N,onDoubleClickAction:U,onContextMenuAction:V,getActionRender:Z,handleTime:$,scrollContainerRef:Q}=n,H=P.useRef(null),x=P.useRef(!1),{id:I,maxEnd:K,minStart:ne,end:se,start:f,selected:R,flexible:O,movable:j,effectId:ee}=s,Y=O===void 0?!0:O,B=j===void 0?!0:j,L=c??C.DEFAULT_SCALE,M=a??C.DEFAULT_SCALE_WIDTH,z=l??C.DEFAULT_START_LEFT,Qe=u??C.DEFAULT_SCALE_SPLIT_COUNT,et=E??Number.MAX_SAFE_INTEGER,ze=ne||0;let Oe;e[0]!==L||e[1]!==M||e[2]!==z||e[3]!==ze?(Oe=C.parserTimeToPixel(ze,{startLeft:z,scale:L,scaleWidth:M}),e[0]=L,e[1]=M,e[2]=z,e[3]=ze,e[4]=Oe):Oe=e[4];const xe=Oe,Xe=K||Number.MAX_VALUE;let Me;e[5]!==L||e[6]!==M||e[7]!==z||e[8]!==Xe?(Me=C.parserTimeToPixel(Xe,{startLeft:z,scale:L,scaleWidth:M}),e[5]=L,e[6]=M,e[7]=z,e[8]=Xe,e[9]=Me):Me=e[9];const Ae=Math.min(et*M+z,Me);let Ne;e[10]!==se||e[11]!==L||e[12]!==M||e[13]!==z||e[14]!==f?(Ne=C.parserTimeToTransform({start:f,end:se},{startLeft:z,scale:L,scaleWidth:M}),e[10]=se,e[11]=L,e[12]=M,e[13]=z,e[14]=f,e[15]=Ne):Ne=e[15];const xt=Ne,[tt,je]=P.useState(null),we=tt??xt,Fe=M/Qe;let Ie;e[16]!==ee||e[17]!==o||e[18]!==Y||e[19]!==B||e[20]!==R?(Ie=de(Zs("action",B&&"action-movable",R&&"action-selected",Y&&"action-flexible",o[ee]&&`action-effect-${ee}`)),e[16]=ee,e[17]=o,e[18]=Y,e[19]=B,e[20]=R,e[21]=Ie):Ie=e[21];const Ue=Ie;let ke;e[22]!==M||e[23]!==z||e[24]!==m||e[25]!==S?(ke=(ve,be)=>{const ce=C.getScaleCountByPixel(ve+be,{startLeft:z,scaleCount:m,scaleWidth:M});ce!==m&&S(ce)},e[22]=M,e[23]=z,e[24]=m,e[25]=S,e[26]=ke):ke=e[26];const Ce=ke;let We;e[27]!==s||e[28]!==_||e[29]!==r?(We=()=>{_&&_({action:s,row:r})},e[27]=s,e[28]=_,e[29]=r,e[30]=We):We=e[30];const Ge=We;let Te;e[31]!==s||e[32]!==Ce||e[33]!==p||e[34]!==r||e[35]!==L||e[36]!==M||e[37]!==z?(Te=ve=>{const{left:be,width:ce}=ve;if(x.current=!0,p){const{start:fe,end:ae}=C.parserTransformToTime({left:be,width:ce},{scaleWidth:M,scale:L,startLeft:z});if(p({action:s,row:r,start:fe,end:ae})===!1)return!1}je({left:be,width:ce}),Ce(be,ce)},e[31]=s,e[32]=Ce,e[33]=p,e[34]=r,e[35]=L,e[36]=M,e[37]=z,e[38]=Te):Te=e[38];const Pe=Te;let Re;e[39]!==t||e[40]!==I||e[41]!==g||e[42]!==r||e[43]!==L||e[44]!==M||e[45]!==z||e[46]!==D?(Re=ve=>{const{left:be,width:ce}=ve,{start:fe,end:ae}=C.parserTransformToTime({left:be,width:ce},{scaleWidth:M,scale:L,startLeft:z}),ue=t.find(Ye=>Ye.id===r.id);if(!ue)return;const Be=ue.actions.find(Ye=>Ye.id===I);Be&&(Be.start=fe,Be.end=ae,D(t),g&&g({action:Be,row:r,start:fe,end:ae}),je(null))},e[39]=t,e[40]=I,e[41]=g,e[42]=r,e[43]=L,e[44]=M,e[45]=z,e[46]=D,e[47]=Re):Re=e[47];const Ve=Re;let W;e[48]!==s||e[49]!==v||e[50]!==r?(W=ve=>{v&&v({action:s,row:r,dir:ve})},e[48]=s,e[49]=v,e[50]=r,e[51]=W):W=e[51];const q=W;let X;e[52]!==s||e[53]!==Ce||e[54]!==A||e[55]!==r||e[56]!==L||e[57]!==M||e[58]!==z?(X=(ve,be)=>{const{left:ce,width:fe}=be;if(x.current=!0,A){const{start:ae,end:ue}=C.parserTransformToTime({left:ce,width:fe},{scaleWidth:M,scale:L,startLeft:z});if(A({action:s,row:r,start:ae,end:ue,dir:ve})===!1)return!1}je({left:ce,width:fe}),Ce(ce,fe)},e[52]=s,e[53]=Ce,e[54]=A,e[55]=r,e[56]=L,e[57]=M,e[58]=z,e[59]=X):X=e[59];const G=X;let me;e[60]!==t||e[61]!==I||e[62]!==w||e[63]!==r||e[64]!==L||e[65]!==M||e[66]!==z||e[67]!==D?(me=(ve,be)=>{const{left:ce,width:fe}=be,{start:ae,end:ue}=C.parserTransformToTime({left:ce,width:fe},{scaleWidth:M,scale:L,startLeft:z}),Be=t.find(Gt=>Gt.id===r.id);if(!Be)return;const Ye=Be.actions.find(Gt=>Gt.id===I);Ye&&(Ye.start=ae,Ye.end=ue,D(t),w&&w({action:Ye,row:r,start:ae,end:ue,dir:ve}),je(null))},e[60]=t,e[61]=I,e[62]=w,e[63]=r,e[64]=L,e[65]=M,e[66]=z,e[67]=D,e[68]=me):me=e[68];const pe=me;let J,oe,k,re,ie,le,ge,nt,rt,st,ot,it,ct,at,lt,ut,$e,He,ft,dt,ht,mt,pt,gt,vt,bt;if(e[69]!==s||e[70]!==Ue||e[71]!==d||e[72]!==Y||e[73]!==Z||e[74]!==Fe||e[75]!==h||e[76]!==Pe||e[77]!==Ve||e[78]!==Ge||e[79]!==pe||e[80]!==q||e[81]!==G||e[82]!==$||e[83]!==xe||e[84]!==B||e[85]!==F||e[86]!==N||e[87]!==V||e[88]!==U||e[89]!==Ae||e[90]!==r||e[91]!==i||e[92]!==L||e[93]!==M||e[94]!==z||e[95]!==Q||e[96]!==y.assistPositions||e[97]!==we.left||e[98]!==we.width){const ve={...s,...C.parserTransformToTime({left:we.left,width:we.width},{startLeft:z,scaleWidth:M,scale:L})},be={...r,actions:[...r.actions]};r.actions.includes(s)&&(be.actions[r.actions.indexOf(s)]=ve),J=cr,rt=H,st=Q,ot=z,it=we.left,ct=we.width,at=h&&Fe||C.DEFAULT_MOVE_GRID,lt=h?Math.max((Fe||C.DEFAULT_MOVE_GRID)/2,C.DEFAULT_SNAP_DISTANCE):C.DEFAULT_SNAP_DISTANCE,ut=y.assistPositions,e[125]!==xe||e[126]!==Ae?($e=()=>({left:xe,right:Ae}),e[125]=xe,e[126]=Ae,e[127]=$e):$e=e[127];let ce;e[128]!==d||e[129]!==Y?(ce=!d&&Y&&`.${de("action-left-stretch")}`,e[128]=d,e[129]=Y,e[130]=ce):ce=e[130];let fe;e[131]!==d||e[132]!==Y?(fe=!d&&Y&&`.${de("action-right-stretch")}`,e[131]=d,e[132]=Y,e[133]=fe):fe=e[133],e[134]!==ce||e[135]!==fe?(He={left:ce,right:fe},e[134]=ce,e[135]=fe,e[136]=He):He=e[136],ft=!d&&B,dt=!d&&Y,ht=Ge,mt=Pe,pt=Ve,gt=q,vt=G,bt=pe,e[137]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>{x.current=!1},e[137]=oe):oe=e[137],e[138]!==s||e[139]!==$||e[140]!==F||e[141]!==N||e[142]!==r?(k=ae=>{let ue;F&&(ue=$(ae),F(ae,{row:r,action:s,time:ue})),!x.current&&N&&(ue===void 0&&(ue=$(ae)),N(ae,{row:r,action:s,time:ue}))},e[138]=s,e[139]=$,e[140]=F,e[141]=N,e[142]=r,e[143]=k):k=e[143],e[144]!==s||e[145]!==$||e[146]!==U||e[147]!==r?(re=ae=>{if(U){const ue=$(ae);U(ae,{row:r,action:s,time:ue})}},e[144]=s,e[145]=$,e[146]=U,e[147]=r,e[148]=re):re=e[148],e[149]!==s||e[150]!==$||e[151]!==V||e[152]!==r?(ie=ae=>{if(V){const ue=$(ae);V(ae,{row:r,action:s,time:ue})}},e[149]=s,e[150]=$,e[151]=V,e[152]=r,e[153]=ie):ie=e[153],le=Ue,e[154]!==i?(ge={height:i},e[154]=i,e[155]=ge):ge=e[155],nt=Z&&Z(ve,be),e[69]=s,e[70]=Ue,e[71]=d,e[72]=Y,e[73]=Z,e[74]=Fe,e[75]=h,e[76]=Pe,e[77]=Ve,e[78]=Ge,e[79]=pe,e[80]=q,e[81]=G,e[82]=$,e[83]=xe,e[84]=B,e[85]=F,e[86]=N,e[87]=V,e[88]=U,e[89]=Ae,e[90]=r,e[91]=i,e[92]=L,e[93]=M,e[94]=z,e[95]=Q,e[96]=y.assistPositions,e[97]=we.left,e[98]=we.width,e[99]=J,e[100]=oe,e[101]=k,e[102]=re,e[103]=ie,e[104]=le,e[105]=ge,e[106]=nt,e[107]=rt,e[108]=st,e[109]=ot,e[110]=it,e[111]=ct,e[112]=at,e[113]=lt,e[114]=ut,e[115]=$e,e[116]=He,e[117]=ft,e[118]=dt,e[119]=ht,e[120]=mt,e[121]=pt,e[122]=gt,e[123]=vt,e[124]=bt}else J=e[99],oe=e[100],k=e[101],re=e[102],ie=e[103],le=e[104],ge=e[105],nt=e[106],rt=e[107],st=e[108],ot=e[109],it=e[110],ct=e[111],at=e[112],lt=e[113],ut=e[114],$e=e[115],He=e[116],ft=e[117],dt=e[118],ht=e[119],mt=e[120],pt=e[121],gt=e[122],vt=e[123],bt=e[124];let St;e[156]!==Y?(St=Y&&T.jsx("div",{className:de("action-left-stretch"),style:{touchAction:"none"}}),e[156]=Y,e[157]=St):St=e[157];let _t;e[158]!==Y?(_t=Y&&T.jsx("div",{className:de("action-right-stretch"),style:{touchAction:"none"}}),e[158]=Y,e[159]=_t):_t=e[159];let wt;e[160]!==oe||e[161]!==k||e[162]!==re||e[163]!==ie||e[164]!==le||e[165]!==ge||e[166]!==nt||e[167]!==St||e[168]!==_t?(wt=T.jsxs("div",{onMouseDown:oe,onClick:k,onDoubleClick:re,onContextMenu:ie,className:le,style:ge,children:[nt,St,_t]}),e[160]=oe,e[161]=k,e[162]=re,e[163]=ie,e[164]=le,e[165]=ge,e[166]=nt,e[167]=St,e[168]=_t,e[169]=wt):wt=e[169];let Mt;return e[170]!==J||e[171]!==rt||e[172]!==st||e[173]!==ot||e[174]!==it||e[175]!==ct||e[176]!==at||e[177]!==lt||e[178]!==ut||e[179]!==$e||e[180]!==He||e[181]!==ft||e[182]!==dt||e[183]!==ht||e[184]!==mt||e[185]!==pt||e[186]!==gt||e[187]!==vt||e[188]!==bt||e[189]!==wt?(Mt=T.jsx(J,{ref:rt,parentRef:st,start:ot,left:it,width:ct,grid:at,snapDistance:lt,snapPositions:ut,getBounds:$e,edges:He,enableDragging:ft,enableResizing:dt,onDragStart:ht,onDrag:mt,onDragEnd:pt,onResizeStart:gt,onResize:vt,onResizeEnd:bt,children:wt}),e[170]=J,e[171]=rt,e[172]=st,e[173]=ot,e[174]=it,e[175]=ct,e[176]=at,e[177]=lt,e[178]=ut,e[179]=$e,e[180]=He,e[181]=ft,e[182]=dt,e[183]=ht,e[184]=mt,e[185]=pt,e[186]=gt,e[187]=vt,e[188]=bt,e[189]=wt,e[190]=Mt):Mt=e[190],Mt};function yt(n,e,t){let r=t.initialDeps??[],s;function o(){var i,c,a,u;let l;t.key&&((i=t.debug)!=null&&i.call(t))&&(l=Date.now());const h=n();if(!(h.length!==r.length||h.some((E,S)=>r[S]!==E)))return s;r=h;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),s=e(...h),t.key&&((a=t.debug)!=null&&a.call(t))){const E=Math.round((Date.now()-l)*100)/100,S=Math.round((Date.now()-m)*100)/100,_=S/16,p=(g,v)=>{for(g=String(g);g.length<v;)g=" "+g;return g};console.info(`%c⏱ ${p(S,5)} /${p(E,5)} ms`,`
11
11
  font-size: .6rem;
12
12
  font-weight: bold;
13
- color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,s),s}return o.updateDeps=i=>{r=i},o}function Ln(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const eo=(n,e)=>Math.abs(n-e)<1.01,to=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},On=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},no=n=>n,ro=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),r=[];for(let s=e;s<=t;s++)r.push(s);return r},so=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=i=>{const{width:c,height:a}=i;e({width:Math.round(c),height:Math.round(a)})};if(s(On(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const c=()=>{const a=i[0];if(a?.borderBoxSize){const u=a.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(On(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Mn={passive:!0},Nn=typeof window>"u"?!0:"onscrollend"in window,oo=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const o=n.options.useScrollendEvent&&Nn?()=>{}:to(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),i=l=>()=>{const{horizontal:h,isRtl:d}=n.options;s=h?t.scrollLeft*(d&&-1||1):t.scrollTop,o(),e(s,l)},c=i(!0),a=i(!1);a(),t.addEventListener("scroll",c,Mn);const u=n.options.useScrollendEvent&&Nn;return u&&t.addEventListener("scrollend",a,Mn),()=>{t.removeEventListener("scroll",c),u&&t.removeEventListener("scrollend",a)}},io=(n,e,t)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},co=(n,{adjustments:e=0,behavior:t},r)=>{var s,o;const i=n+e;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class ao{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:no,rangeExtractor:ro,onChange:()=>{},measureElement:io,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=yt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const c=t[i];if(s.has(c.lane))continue;const a=o.get(c.lane);if(a==null||c.end>a.end?o.set(c.lane,c):c.end<a.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,c)=>i.end===c.end?i.index-c.index:i.end-c.end)[0]:void 0},this.getMeasurementOptions=yt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,s,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=yt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i},c)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(l=>{this.itemSizeCache.set(l.key,l.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,a);for(let l=a;l<t;l++){const h=o(l),d=this.options.lanes===1?u[l-1]:this.getFurthestMeasurement(u,l),m=d?d.end+this.options.gap:r+s,w=c.get(h),v=typeof w=="number"?w:this.options.estimateSize(l),p=m+v,R=d?d.lane:l%this.options.lanes;u[l]={index:l,start:m,size:v,end:p,key:h,lane:R}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=yt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?lo({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=yt(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,c=this.elementsCache.get(i);c!==t&&(c&&this.observer.unobserve(c),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=yt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const c=t[o],a=r[c];s.push(a)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return Ln(r[ar(0,r.length-1,s=>Ln(r[s]).start,t)])},this.getOffsetForAlignment=(t,r,s=0)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const c=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];const c=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let o=0;const i=10,c=u=>{if(!this.targetWindow)return;const l=this.getOffsetForIndex(t,u);if(!l){console.warn("Failed to get offset for index:",t);return}const[h,d]=l;this._scrollToOffset(h,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const m=this.getScrollOffset(),w=this.getOffsetForIndex(t,d);if(!w){console.warn("Failed to get offset for index:",t);return}eo(w[0],m)||a(d)})},a=u=>{this.targetWindow&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>c(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};c(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(c=>c===null);){const c=r[i];o[c.lane]===null&&(o[c.lane]=c.end),i--}s=Math.max(...o.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const ar=(n,e,t,r)=>{for(;n<=e;){const s=(n+e)/2|0,o=t(s);if(o<r)n=s+1;else if(o>r)e=s-1;else return s}return n>0?n-1:0};function lo({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,o=a=>n[a].start;if(n.length<=r)return{startIndex:0,endIndex:s};let i=ar(0,s,o,t),c=i;if(r===1)for(;c<s&&n[c].end<t+e;)c++;else if(r>1){const a=Array(r).fill(0);for(;c<s&&a.some(l=>l<t+e);){const l=n[c];a[l.lane]=l.end,c++}const u=Array(r).fill(t+e);for(;i>=0&&u.some(l=>l>=t);){const l=n[i];u[l.lane]=l.start,i--}i=Math.max(0,i-i%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:i,endIndex:c}}const In=typeof document<"u"?g.useLayoutEffect:g.useEffect;function uo(n){const e=g.useReducer(()=>({}),{})[1],t={...n,onChange:(s,o)=>{var i;o?fr.flushSync(e):e(),(i=n.onChange)==null||i.call(n,s,o)}},[r]=g.useState(()=>new ao(t));return r.setOptions(t),In(()=>r._didMount(),[]),In(()=>r._willUpdate()),r}function lr(n){return uo({observeElementRect:so,observeElementOffset:oo,scrollToFn:co,...n})}const fo=n=>{const{rowData:e,style:t={},onClickRow:r,onDoubleClickRow:s,onContextMenuRow:o,scrollContainerRef:i,startLeft:c,scale:a,scaleWidth:u}=n,l=["edit-row"];e?.selected&&l.push("edit-row-selected");const h=a??C.DEFAULT_SCALE,d=u??C.DEFAULT_SCALE_WIDTH,m=c??C.DEFAULT_START_LEFT,w=b=>{if(!i.current)return 0;const S=b.currentTarget.getBoundingClientRect(),D=b.clientX-S.x;return C.parserPixelToTime(D,{startLeft:m,scale:h,scaleWidth:d})},v=k.useMemo(()=>(e?.actions?[...e.actions]:[]).sort((b,_)=>b.start-_.start),[e]),p=k.useCallback(b=>v[b]?.id??b,[v]),R=lr({horizontal:!0,count:v.length,getItemKey:p,getScrollElement:()=>i.current,estimateSize:b=>{if(!v[b])return 0;let _=b>0?v[b-1].end:0,S=v[b].end;if(_>S)return 0;let{width:P}=C.parserTimeToTransform({start:_,end:S},{startLeft:m,scale:h,scaleWidth:d});return P},overscan:5});return k.useLayoutEffect(()=>{R.measure()},[u,c,R]),T.jsx("div",{className:`${de(...l)} ${(e?.classNames||[]).join(" ")}`,style:t,onClick:b=>{if(e&&r){const _=w(b);r(b,{row:e,time:_})}},onDoubleClick:b=>{if(e&&s){const _=w(b);s(b,{row:e,time:_})}},onContextMenu:b=>{if(e&&o){const _=w(b);o(b,{row:e,time:_})}},children:e&&R.getVirtualItems().map(b=>{const _=v[b.index];if(!_)throw new Error("Action not found");return T.jsx(Qs,{...n,handleTime:w,row:e,action:_},_.id)})})};function ho(){const n=Pe.c(7);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={isMoving:!1,movePositions:[],assistPositions:[]},n[0]=e):e=n[0];const[t,r]=k.useState(e),s=k.useRef(null),o=po,i=mo;let c;n[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const{movePositions:R,assistPositions:b,action:_,row:S,assistActionIds:P}=p;s.current={action:_,row:S,assistActionIds:P},r({isMoving:!0,movePositions:R||[],assistPositions:b||[]})},n[1]=c):c=n[1];const a=c;let u;n[2]===Symbol.for("react.memo_cache_sentinel")?(u=p=>{const{movePositions:R,assistPositions:b}=p;r(_=>({..._,movePositions:R||_.movePositions,assistPositions:b||_.assistPositions}))},n[2]=u):u=n[2];const l=u;let h;n[3]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{s.current=null,r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=h):h=n[3];const d=h;let m;n[4]===Symbol.for("react.memo_cache_sentinel")?(m=()=>s.current,n[4]=m):m=n[4];const w=m;let v;return n[5]!==t?(v={initSnap:a,updateSnap:l,disposeSnap:d,snapData:t,getActiveDragState:w,defaultGetAssistPosition:o,defaultGetMovePosition:i},n[5]=t,n[6]=v):v=n[6],v}function mo(n){const{start:e,end:t,dir:r,scale:s,scaleWidth:o,startLeft:i}=n,{left:c,width:a}=C.parserTimeToTransform({start:e,end:t},{startLeft:i,scaleWidth:o,scale:s});return r?r==="right"?[c+a]:[c]:[c,c+a]}function po(n){const{editorData:e,assistActionIds:t,action:r,row:s,scale:o,scaleWidth:i,startLeft:c,cursorLeft:a,hideCursor:u}=n,l=[];t?e.forEach(d=>{d.actions.forEach(m=>{t.includes(m.id)&&l.push(m)})}):e.forEach(d=>{d.id!==s.id?l.push(...d.actions):d.actions.forEach(m=>{m.id!==r.id&&l.push(m)})});const h=C.parserActionsToPositions(l,{startLeft:c,scale:o,scaleWidth:i});return u||h.push(a),h}const go=n=>{const e=Pe.c(50);let t,r;e[0]!==n?({ref:r,...t}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const{snapData:s,initSnap:o,updateSnap:i,disposeSnap:c,getActiveDragState:a,defaultGetAssistPosition:u,defaultGetMovePosition:l}=ho();let h;e[3]!==u||e[4]!==a||e[5]!==t.cursorTime||e[6]!==t.editorData||e[7]!==t.hideCursor||e[8]!==t.scale||e[9]!==t.scaleWidth||e[10]!==t.snap||e[11]!==t.startLeft||e[12]!==s.isMoving||e[13]!==i?(h=()=>{const x=a();if(t.snap&&x&&s.isMoving){const U=t.scaleWidth??160,W=t.scale??1,E=t.startLeft??20,A=t.hideCursor??!1,N=C.parserTimeToPixel(t.cursorTime,{scaleWidth:U,scale:W,startLeft:E}),ee=u({editorData:t.editorData,assistActionIds:x.assistActionIds,action:x.action,row:x.row,scale:W,scaleWidth:U,startLeft:E,hideCursor:A,cursorLeft:N});i({assistPositions:ee})}else!t.snap&&s.isMoving&&i({assistPositions:[]})},e[3]=u,e[4]=a,e[5]=t.cursorTime,e[6]=t.editorData,e[7]=t.hideCursor,e[8]=t.scale,e[9]=t.scaleWidth,e[10]=t.snap,e[11]=t.startLeft,e[12]=s.isMoving,e[13]=i,e[14]=h):h=e[14];let d;e[15]!==t.snap||e[16]!==s.isMoving?(d=[t.snap,s.isMoving],e[15]=t.snap,e[16]=s.isMoving,e[17]=d):d=e[17],k.useEffect(h,d);let m;e[18]!==u||e[19]!==o||e[20]!==t?(m=x=>{const U=t.getAssistDragLineActionIds&&t.getAssistDragLineActionIds({action:x.action,row:x.row,editorData:t.editorData});if(t.snap){const W=t.scaleWidth??160,E=t.scale??1,A=t.startLeft??20,N=t.hideCursor??!1,ee=C.parserTimeToPixel(t.cursorTime,{scaleWidth:W,scale:E,startLeft:A}),ne=u({editorData:t.editorData,assistActionIds:U,action:x.action,row:x.row,scale:E,scaleWidth:W,startLeft:A,hideCursor:N,cursorLeft:ee});o({assistPositions:ne,action:x.action,row:x.row,assistActionIds:U})}else o({assistPositions:[],action:x.action,row:x.row,assistActionIds:U})},e[18]=u,e[19]=o,e[20]=t,e[21]=m):m=e[21];const w=m;let v;e[22]!==l||e[23]!==t.scale||e[24]!==t.scaleWidth||e[25]!==t.snap||e[26]!==t.startLeft||e[27]!==i?(v=x=>{if(t.snap){const U=t.scaleWidth??160,W=t.scale??1,E=t.startLeft??20,A=l({...x,startLeft:E,scaleWidth:U,scale:W});i({movePositions:A})}},e[22]=l,e[23]=t.scale,e[24]=t.scaleWidth,e[25]=t.snap,e[26]=t.startLeft,e[27]=i,e[28]=v):v=e[28];const p=v,R=t.rowHeight??32,b=t.scaleWidth??160,_=t.startLeft??20,S=Math.max(t.scaleCount*b+_,t.timelineWidth);let P;if(e[29]!==S||e[30]!==R||e[31]!==c||e[32]!==w||e[33]!==p||e[34]!==t||e[35]!==s){const x=[];let U=0;for(let W=0;W<t.editorData.length;W++){const E=t.editorData[W];if(!E)continue;const A=E.rowHeight||R;x.push(k.createElement(fo,{...t,key:E.id,rowData:E,snapData:s,scrollContainerRef:t.scrollElementRef,style:{position:"absolute",top:0,left:0,width:S,height:`${A}px`,transform:`translateY(${U}px)`},onActionMoveStart:N=>(w(N),t.onActionMoveStart&&t.onActionMoveStart(N)),onActionResizeStart:N=>(w(N),t.onActionResizeStart&&t.onActionResizeStart(N)),onActionMoving:N=>(p(N),t.onActionMoving&&t.onActionMoving(N)),onActionResizing:N=>(p(N),t.onActionResizing&&t.onActionResizing(N)),onActionResizeEnd:N=>(c(),t.onActionResizeEnd&&t.onActionResizeEnd(N)),onActionMoveEnd:N=>(c(),t.onActionMoveEnd&&t.onActionMoveEnd(N))})),U=U+A}P=[U,x],e[29]=S,e[30]=R,e[31]=c,e[32]=w,e[33]=p,e[34]=t,e[35]=s,e[36]=P}else P=e[36];const[D,L]=P,H=`0, ${t.startLeft??20}px`,M=`${t.startLeft??20}px, ${t.scaleWidth??160}px`;let j;e[37]!==S||e[38]!==H||e[39]!==M||e[40]!==D?(j={width:S,height:D,position:"relative",backgroundPositionX:H,backgroundSize:M},e[37]=S,e[38]=H,e[39]=M,e[40]=D,e[41]=j):j=e[41];let F;e[42]!==t.snap||e[43]!==s?(F=t.snap&&T.jsx(xr,{...s}),e[42]=t.snap,e[43]=s,e[44]=F):F=e[44];let G;return e[45]!==r||e[46]!==L||e[47]!==j||e[48]!==F?(G=T.jsxs("div",{ref:r,style:j,className:"timeline-editor-edit-area",children:[L,F]}),e[45]=r,e[46]=L,e[47]=j,e[48]=F,e[49]=G):G=e[49],G};function vo({scaleSplitCount:n,scaleWidth:e,startLeft:t,scaleCount:r,maxScaleCount:s,scale:o,scrollElementRef:i,onClickTimeArea:c,setCursor:a,getScaleRender:u}){const l=n??1,h=e??160,d=t??20,m=(n??0)>0,w=m?r*(n??1)+1:r,v=(m?h/l:h)*(w-1)+d,R=lr({horizontal:!0,count:w,getScrollElement:()=>i.current,estimateSize:b=>{switch(b){case 0:return d;default:return m?h/l:h}},overscan:10});return k.useEffect(()=>R.measure(),[e,t,R]),T.jsx("div",{style:{width:`${v}px`},className:de("time-area"),onClick:b=>{const _=t??20,S=e??160,P=o??1,D=s??1/0,L=b.currentTarget.getBoundingClientRect(),H=b.clientX-L.x,M=Math.max(H,_);if(M>D*S+_)return;const j=C.parserPixelToTime(M,{startLeft:_,scale:P,scaleWidth:S});c&&c(j,b),!b.defaultPrevented&&a({time:j})},children:R.getVirtualItems().map(b=>{const _=b.index,S=n??1,P=o??1,D=m?_%S===0:!0,L=[de("time-unit"),de(D?"time-unit-big":"time-unit-small")],H=(m?_/S:_)*P;return T.jsx("div",{"data-index":b.index,style:{width:`${b.size}px`,transform:`translateX(${b.start}px)`},className:L.join(" "),children:D&&T.jsx("div",{className:de("time-unit-scale"),children:u?.(H)??H})},b.key)})})}function bo(n){return typeof n=="object"&&n!==null}function _o(n,e,t){if(n instanceof EventTarget)return[n];if(typeof n=="string"){const s=document.querySelectorAll(n);return s?Array.from(s):[]}return Array.from(n)}function So(n){return bo(n)&&"ownerSVGElement"in n}const jt=new WeakMap;let Ft;const ur=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:So(r)&&"getBBox"in r?r.getBBox()[e]:r[t],wo=ur("inline","width","offsetWidth"),Eo=ur("block","height","offsetHeight");function yo({target:n,borderBoxSize:e}){jt.get(n)?.forEach(t=>{t(n,{get width(){return wo(n,e)},get height(){return Eo(n,e)}})})}function To(n){n.forEach(yo)}function Ro(){typeof ResizeObserver>"u"||(Ft=new ResizeObserver(To))}function xo(n,e){Ft||Ro();const t=_o(n);return t.forEach(r=>{let s=jt.get(r);s||(s=new Set,jt.set(r,s)),s.add(e),Ft?.observe(r)}),()=>{t.forEach(r=>{const s=jt.get(r);s?.delete(e),s?.size||Ft?.unobserve(r)})}}const Ut=new Set;let Tt;function Ao(){Tt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ut.forEach(e=>e(n))},window.addEventListener("resize",Tt)}function Co(n){return Ut.add(n),Tt||Ao(),()=>{Ut.delete(n),!Ut.size&&typeof Tt=="function"&&(window.removeEventListener("resize",Tt),Tt=void 0)}}function Do(n,e){return typeof n=="function"?Co(n):xo(n,e)}function Po(n){const e=Pe.c(4),{elementRef:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={width:0,height:0},e[0]=r):r=e[0];const[s,o]=k.useState(r);let i,c;return e[1]!==t?(i=()=>{t.current&&Do(t.current,(a,u)=>{o({width:u.width,height:u.height})})},c=[t],e[1]=t,e[2]=i,e[3]=c):(i=e[2],c=e[3]),k.useLayoutEffect(i,c),s}const Lo=n=>{const e=Pe.c(42),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:o,scaleWidth:i,scale:c,scaleCount:a,scaleSplitCount:u,scrollElementRef:l,maxScaleCount:h,onCursorDragStart:d,onCursorDrag:m,onCursorDragEnd:w}=n,v=k.useRef(null),p=k.useRef(void 0);let R,b;e[0]!==r||e[1]!==c||e[2]!==i||e[3]!==o?(R=()=>{if(typeof p.current>"u"&&v.current){const f=o??20,y=i??160,I=c??1;v.current.updateLeft(C.parserTimeToPixel(r,{startLeft:f,scaleWidth:y,scale:I}))}},b=[r,o,i,c],e[0]=r,e[1]=c,e[2]=i,e[3]=o,e[4]=R,e[5]=b):(R=e[4],b=e[5]),k.useEffect(R,b);const _=o??20,S=i??160,P=c??1,D=h??1/0,L=(u??0)>0,H=u??1,M=L?a*(u??1)+1:a,j=o??20,F=(L?S/H:S)*(M-1)+j;let G;e[6]!==_||e[7]!==D||e[8]!==l||e[9]!==F||e[10]!==S?(G=()=>({left:0,right:Math.min(F,D*S+_-(l.current?.scrollLeft??0))}),e[6]=_,e[7]=D,e[8]=l,e[9]=F,e[10]=S,e[11]=G):G=e[11];const x=!t;let U;e[12]!==r||e[13]!==_||e[14]!==d||e[15]!==P||e[16]!==S?(U=()=>{const f=v.current?.getLeft()??C.parserTimeToPixel(r,{startLeft:_,scaleWidth:S,scale:P});p.current=f;const y=C.parserPixelToTime(f,{startLeft:_,scale:P,scaleWidth:S});d&&d(y),v.current?.updateLeft(f)},e[12]=r,e[13]=_,e[14]=d,e[15]=P,e[16]=S,e[17]=U):U=e[17];let W;e[18]!==_||e[19]!==w||e[20]!==P||e[21]!==s||e[22]!==S?(W=()=>{if(typeof p.current<"u"){const f=C.parserPixelToTime(p.current,{startLeft:_,scale:P,scaleWidth:S});s({time:f}),w&&w(f)}p.current=void 0},e[18]=_,e[19]=w,e[20]=P,e[21]=s,e[22]=S,e[23]=W):W=e[23];let E;e[24]!==_||e[25]!==m||e[26]!==P||e[27]!==l||e[28]!==s||e[29]!==S?(E=(f,y)=>{const{left:I}=f,Y=y===void 0?0:y,te=l.current?.scrollLeft??0,q=l.current,X=q?.clientWidth??0;if(Y!==0)if(typeof p.current<"u"){p.current=p.current+Y;const O=te,z=te+X;p.current<O+10?p.current=O+10:p.current>z-10&&(p.current=z-10),p.current<_-te&&(p.current=_-te)}else{p.current=I+Y;const O=te,z=te+X;p.current<O+10?p.current=O+10:p.current>z-10&&(p.current=z-10)}else if(I<_-te?p.current=_-te:p.current=I,q&&X>0){const O=te,z=te+X;p.current<O+10?p.current=O+10:p.current>z-10&&(p.current=z-10)}if(typeof p.current<"u"){v.current?.updateLeft(p.current);const O=C.parserPixelToTime(p.current,{startLeft:_,scale:P,scaleWidth:S});s({time:O}),m&&m(O)}return!1},e[24]=_,e[25]=m,e[26]=P,e[27]=l,e[28]=s,e[29]=S,e[30]=E):E=e[30];let A,N;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=de("cursor"),N=de("cursor-top"),e[31]=A,e[32]=N):(A=e[31],N=e[32]);let ee;e[33]===Symbol.for("react.memo_cache_sentinel")?(ee=T.jsxs("div",{className:A,children:[T.jsx("svg",{className:N,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:T.jsx("path",{d:"M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",fill:"currentColor"})}),T.jsx("div",{className:de("cursor-area")})]}),e[33]=ee):ee=e[33];let ne;return e[34]!==_||e[35]!==l||e[36]!==G||e[37]!==x||e[38]!==U||e[39]!==W||e[40]!==E?(ne=T.jsx(cr,{start:_,ref:v,parentRef:l,getBounds:G,autoScroll:!0,enableDragging:x,enableResizing:!1,onDragStart:U,onDragEnd:W,onDrag:E,children:ee}),e[34]=_,e[35]=l,e[36]=G,e[37]=x,e[38]=U,e[39]=W,e[40]=E,e[41]=ne):ne=e[41],ne};function kn(n){const e=Pe.c(9);let t,r,s;e[0]!==n?({className:t,orientation:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);const o=s===void 0?"vertical":s;let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=T.jsx(nr,{"data-slot":"scroll-area-thumb"}),e[4]=i):i=e[4];let c;return e[5]!==t||e[6]!==o||e[7]!==r?(c=T.jsx(Zn,{"data-slot":"scroll-area-scrollbar",orientation:o,className:t,...r,children:i}),e[5]=t,e[6]=o,e[7]=r,e[8]=c):c=e[8],c}function Oo({ref:n,...e}){const t=wr(e),r=k.useRef(null),{width:s,height:o}=Po({elementRef:r}),i=Math.min(t.maxScaleCount,t.minScaleCount??Math.max(C.getScaleCountByRows(t.editorData,{scale:t.scale,pad:.2}),Math.ceil((s-t.startLeft)/t.scaleWidth))),[c,a]=k.useState(i),u=Math.max(i,c),[l,h]=k.useState(C.START_CURSOR_TIME),d=k.useRef(C.START_CURSOR_TIME),m=p=>{a(Math.min(t.maxScaleCount,Math.max(i,p)))},w=p=>{t.onChange?.(p)},v=p=>{let{left:R,time:b}=p;return typeof b<"u"?(h(b),d.current=b,!0):typeof R<"u"?(h(d.current=C.parserPixelToTime(R,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth})),!0):!1};return k.useImperativeHandle(n,()=>({get target(){return r.current},set time(p){v({time:p})},get time(){return d.current},setScrollLeft:p=>{r.current&&(r.current.scrollLeft=p)},setScrollTop:p=>{r.current&&(r.current.scrollTop=p)}})),T.jsxs(Bs,{style:t.style,className:`${C.PREFIX} ${t.disableDrag?C.PREFIX+"-disable":""}`,"data-slot":"scroll-area",children:[T.jsxs(Ys,{"data-slot":"scroll-area-viewport",ref:r,onScroll:p=>{t.onScroll?.(p.currentTarget)},children:[T.jsx(vo,{...t,setCursor:v,scaleCount:u,scrollElementRef:r}),T.jsx(go,{...t,scrollElementRef:r,timelineWidth:s,timelineHeight:o,disableDrag:t.disableDrag,editorData:t.editorData,cursorTime:l,scaleCount:u,setScaleCount:m,setEditorData:w}),!t.hideCursor&&T.jsx(Lo,{...t,timelineWidth:s,height:o,scaleCount:u,setScaleCount:m,setCursor:v,cursorTime:l,editorData:t.editorData,scrollElementRef:r})]}),T.jsx(kn,{orientation:"horizontal"}),T.jsx(kn,{orientation:"vertical"}),T.jsx(Xs,{})]})}exports.Timeline=Oo;
13
+ color: hsl(${Math.max(0,Math.min(120-120*_,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,s),s}return o.updateDeps=i=>{r=i},o}function Ln(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const eo=(n,e)=>Math.abs(n-e)<1.01,to=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},On=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},no=n=>n,ro=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),r=[];for(let s=e;s<=t;s++)r.push(s);return r},so=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=i=>{const{width:c,height:a}=i;e({width:Math.round(c),height:Math.round(a)})};if(s(On(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const c=()=>{const a=i[0];if(a?.borderBoxSize){const u=a.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(On(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Mn={passive:!0},Nn=typeof window>"u"?!0:"onscrollend"in window,oo=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const o=n.options.useScrollendEvent&&Nn?()=>{}:to(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),i=l=>()=>{const{horizontal:h,isRtl:d}=n.options;s=h?t.scrollLeft*(d&&-1||1):t.scrollTop,o(),e(s,l)},c=i(!0),a=i(!1);a(),t.addEventListener("scroll",c,Mn);const u=n.options.useScrollendEvent&&Nn;return u&&t.addEventListener("scrollend",a,Mn),()=>{t.removeEventListener("scroll",c),u&&t.removeEventListener("scrollend",a)}},io=(n,e,t)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},co=(n,{adjustments:e=0,behavior:t},r)=>{var s,o;const i=n+e;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class ao{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:no,rangeExtractor:ro,onChange:()=>{},measureElement:io,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=yt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const c=t[i];if(s.has(c.lane))continue;const a=o.get(c.lane);if(a==null||c.end>a.end?o.set(c.lane,c):c.end<a.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,c)=>i.end===c.end?i.index-c.index:i.end-c.end)[0]:void 0},this.getMeasurementOptions=yt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,s,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=yt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i},c)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(l=>{this.itemSizeCache.set(l.key,l.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,a);for(let l=a;l<t;l++){const h=o(l),d=this.options.lanes===1?u[l-1]:this.getFurthestMeasurement(u,l),m=d?d.end+this.options.gap:r+s,E=c.get(h),S=typeof E=="number"?E:this.options.estimateSize(l),_=m+S,p=d?d.lane:l%this.options.lanes;u[l]={index:l,start:m,size:S,end:_,key:h,lane:p}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=yt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?lo({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=yt(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,c=this.elementsCache.get(i);c!==t&&(c&&this.observer.unobserve(c),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=yt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const c=t[o],a=r[c];s.push(a)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return Ln(r[ar(0,r.length-1,s=>Ln(r[s]).start,t)])},this.getOffsetForAlignment=(t,r,s=0)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const c=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];const c=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let o=0;const i=10,c=u=>{if(!this.targetWindow)return;const l=this.getOffsetForIndex(t,u);if(!l){console.warn("Failed to get offset for index:",t);return}const[h,d]=l;this._scrollToOffset(h,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const m=this.getScrollOffset(),E=this.getOffsetForIndex(t,d);if(!E){console.warn("Failed to get offset for index:",t);return}eo(E[0],m)||a(d)})},a=u=>{this.targetWindow&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>c(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};c(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(c=>c===null);){const c=r[i];o[c.lane]===null&&(o[c.lane]=c.end),i--}s=Math.max(...o.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const ar=(n,e,t,r)=>{for(;n<=e;){const s=(n+e)/2|0,o=t(s);if(o<r)n=s+1;else if(o>r)e=s-1;else return s}return n>0?n-1:0};function lo({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,o=a=>n[a].start;if(n.length<=r)return{startIndex:0,endIndex:s};let i=ar(0,s,o,t),c=i;if(r===1)for(;c<s&&n[c].end<t+e;)c++;else if(r>1){const a=Array(r).fill(0);for(;c<s&&a.some(l=>l<t+e);){const l=n[c];a[l.lane]=l.end,c++}const u=Array(r).fill(t+e);for(;i>=0&&u.some(l=>l>=t);){const l=n[i];u[l.lane]=l.start,i--}i=Math.max(0,i-i%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:i,endIndex:c}}const In=typeof document<"u"?b.useLayoutEffect:b.useEffect;function uo(n){const e=b.useReducer(()=>({}),{})[1],t={...n,onChange:(s,o)=>{var i;o?fr.flushSync(e):e(),(i=n.onChange)==null||i.call(n,s,o)}},[r]=b.useState(()=>new ao(t));return r.setOptions(t),In(()=>r._didMount(),[]),In(()=>r._willUpdate()),r}function lr(n){return uo({observeElementRect:so,observeElementOffset:oo,scrollToFn:co,...n})}const fo=n=>{const{rowData:e,style:t={},onClickRow:r,onDoubleClickRow:s,onContextMenuRow:o,scrollContainerRef:i,startLeft:c,scale:a,scaleWidth:u}=n,l=["edit-row"];e?.selected&&l.push("edit-row-selected");const h=a??C.DEFAULT_SCALE,d=u??C.DEFAULT_SCALE_WIDTH,m=c??C.DEFAULT_START_LEFT,E=g=>{if(!i.current)return 0;const w=g.currentTarget.getBoundingClientRect(),y=g.clientX-w.x;return C.parserPixelToTime(y,{startLeft:m,scale:h,scaleWidth:d})},S=P.useMemo(()=>(e?.actions?[...e.actions]:[]).sort((g,v)=>g.start-v.start),[e]),_=P.useCallback(g=>S[g]?.id??g,[S]),p=lr({horizontal:!0,count:S.length,getItemKey:_,getScrollElement:()=>i.current,estimateSize:g=>{if(!S[g])return 0;let v=g>0?S[g-1].end:0,w=S[g].end;if(v>w)return 0;let{width:A}=C.parserTimeToTransform({start:v,end:w},{startLeft:m,scale:h,scaleWidth:d});return A},overscan:5});return P.useLayoutEffect(()=>{p.measure()},[u,c,p]),T.jsx("div",{className:`${de(...l)} ${(e?.classNames||[]).join(" ")}`,style:t,onClick:g=>{if(e&&r){const v=E(g);r(g,{row:e,time:v})}},onDoubleClick:g=>{if(e&&s){const v=E(g);s(g,{row:e,time:v})}},onContextMenu:g=>{if(e&&o){const v=E(g);o(g,{row:e,time:v})}},children:e&&p.getVirtualItems().map(g=>{const v=S[g.index];if(!v)throw new Error("Action not found");return T.jsx(Qs,{...n,handleTime:E,row:e,action:v},v.id)})})};function ho(){const n=De.c(7);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={isMoving:!1,movePositions:[],assistPositions:[]},n[0]=e):e=n[0];const[t,r]=P.useState(e),s=P.useRef(null),o=po,i=mo;let c;n[1]===Symbol.for("react.memo_cache_sentinel")?(c=_=>{const{movePositions:p,assistPositions:g,action:v,row:w,assistActionIds:A}=_;s.current={action:v,row:w,assistActionIds:A},r({isMoving:!0,movePositions:p||[],assistPositions:g||[]})},n[1]=c):c=n[1];const a=c;let u;n[2]===Symbol.for("react.memo_cache_sentinel")?(u=_=>{const{movePositions:p,assistPositions:g}=_;r(v=>({...v,movePositions:p||v.movePositions,assistPositions:g||v.assistPositions}))},n[2]=u):u=n[2];const l=u;let h;n[3]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{s.current=null,r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=h):h=n[3];const d=h;let m;n[4]===Symbol.for("react.memo_cache_sentinel")?(m=()=>s.current,n[4]=m):m=n[4];const E=m;let S;return n[5]!==t?(S={initSnap:a,updateSnap:l,disposeSnap:d,snapData:t,getActiveDragState:E,defaultGetAssistPosition:o,defaultGetMovePosition:i},n[5]=t,n[6]=S):S=n[6],S}function mo(n){const{start:e,end:t,dir:r,scale:s,scaleWidth:o,startLeft:i}=n,{left:c,width:a}=C.parserTimeToTransform({start:e,end:t},{startLeft:i,scaleWidth:o,scale:s});return r?r==="right"?[c+a]:[c]:[c,c+a]}function po(n){const{editorData:e,assistActionIds:t,action:r,row:s,scale:o,scaleWidth:i,startLeft:c,cursorLeft:a,hideCursor:u}=n,l=[];t?e.forEach(d=>{d.actions.forEach(m=>{t.includes(m.id)&&l.push(m)})}):e.forEach(d=>{d.id!==s.id?l.push(...d.actions):d.actions.forEach(m=>{m.id!==r.id&&l.push(m)})});const h=C.parserActionsToPositions(l,{startLeft:c,scale:o,scaleWidth:i});return u||h.push(a),h}const go=({ref:n,...e})=>{const{snapData:t,initSnap:r,updateSnap:s,disposeSnap:o,getActiveDragState:i,defaultGetAssistPosition:c,defaultGetMovePosition:a}=ho();P.useEffect(()=>{const p=i();if(e.snap&&p&&t.isMoving){const g=e.scaleWidth??160,v=e.scale??1,w=e.startLeft??20,A=e.hideCursor??!1,y=C.parserTimeToPixel(e.cursorTime,{scaleWidth:g,scale:v,startLeft:w}),D=c({editorData:e.editorData,assistActionIds:p.assistActionIds,action:p.action,row:p.row,scale:v,scaleWidth:g,startLeft:w,hideCursor:A,cursorLeft:y});s({assistPositions:D})}else!e.snap&&t.isMoving&&s({assistPositions:[]})},[e.snap,t.isMoving]);const u=p=>{const g=e.getAssistDragLineActionIds&&e.getAssistDragLineActionIds({action:p.action,row:p.row,editorData:e.editorData});if(e.snap){const v=e.scaleWidth??160,w=e.scale??1,A=e.startLeft??20,y=e.hideCursor??!1,D=C.parserTimeToPixel(e.cursorTime,{scaleWidth:v,scale:w,startLeft:A}),F=c({editorData:e.editorData,assistActionIds:g,action:p.action,row:p.row,scale:w,scaleWidth:v,startLeft:A,hideCursor:y,cursorLeft:D});r({assistPositions:F,action:p.action,row:p.row,assistActionIds:g})}else r({assistPositions:[],action:p.action,row:p.row,assistActionIds:g})},l=p=>{if(e.snap){const g=e.scaleWidth??160,v=e.scale??1,w=e.startLeft??20,A=a({...p,startLeft:w,scaleWidth:g,scale:v});s({movePositions:A})}},h=e.rowHeight??32,d=e.scaleWidth??160,m=e.startLeft??20,E=Math.max(e.scaleCount*d+m,e.timelineWidth),[S,_]=(()=>{let p=[],g=0;for(let v=0;v<e.editorData.length;v++){const w=e.editorData[v];if(!w)continue;const A=w.rowHeight||h;p.push(P.createElement(fo,{...e,key:w.id,rowData:w,snapData:t,scrollContainerRef:e.scrollElementRef,style:{position:"absolute",top:0,left:0,width:E,height:`${A}px`,transform:`translateY(${g}px)`},onActionMoveStart:y=>(u(y),e.onActionMoveStart&&e.onActionMoveStart(y)),onActionResizeStart:y=>(u(y),e.onActionResizeStart&&e.onActionResizeStart(y)),onActionMoving:y=>(l(y),e.onActionMoving&&e.onActionMoving(y)),onActionResizing:y=>(l(y),e.onActionResizing&&e.onActionResizing(y)),onActionResizeEnd:y=>(o(),e.onActionResizeEnd&&e.onActionResizeEnd(y)),onActionMoveEnd:y=>(o(),e.onActionMoveEnd&&e.onActionMoveEnd(y))})),g+=A}return[g,p]})();return T.jsxs("div",{ref:n,style:{width:E,height:S,position:"relative",backgroundPositionX:`0, ${e.startLeft??20}px`,backgroundSize:`${e.startLeft??20}px, ${e.scaleWidth??160}px`},className:"timeline-editor-edit-area",children:[_,e.snap&&T.jsx(xr,{...t})]})};function vo({scaleSplitCount:n,scaleWidth:e,startLeft:t,scaleCount:r,maxScaleCount:s,scale:o,scrollElementRef:i,onClickTimeArea:c,setCursor:a,getScaleRender:u}){const l=n??1,h=e??160,d=t??20,m=(n??0)>0,E=m?r*(n??1)+1:r,S=(m?h/l:h)*(E-1)+d,p=lr({horizontal:!0,count:E,getScrollElement:()=>i.current,estimateSize:g=>{switch(g){case 0:return d;default:return m?h/l:h}},overscan:10});return P.useEffect(()=>p.measure(),[e,t,p]),T.jsx("div",{style:{width:`${S}px`},className:de("time-area"),onClick:g=>{const v=t??20,w=e??160,A=o??1,y=s??1/0,D=g.currentTarget.getBoundingClientRect(),F=g.clientX-D.x,N=Math.max(F,v);if(N>y*w+v)return;const U=C.parserPixelToTime(N,{startLeft:v,scale:A,scaleWidth:w});c&&c(U,g),!g.defaultPrevented&&a({time:U})},children:p.getVirtualItems().map(g=>{const v=g.index,w=n??1,A=o??1,y=m?v%w===0:!0,D=[de("time-unit"),de(y?"time-unit-big":"time-unit-small")],F=(m?v/w:v)*A;return T.jsx("div",{"data-index":g.index,style:{width:`${g.size}px`,transform:`translateX(${g.start}px)`},className:D.join(" "),children:T.jsx(P.Activity,{mode:y?"visible":"hidden",children:T.jsx("div",{className:de("time-unit-scale"),children:u?.(F)??F})})},g.key)})})}function bo(n){return typeof n=="object"&&n!==null}function So(n,e,t){if(n instanceof EventTarget)return[n];if(typeof n=="string"){const s=document.querySelectorAll(n);return s?Array.from(s):[]}return Array.from(n)}function _o(n){return bo(n)&&"ownerSVGElement"in n}const jt=new WeakMap;let Ft;const ur=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:_o(r)&&"getBBox"in r?r.getBBox()[e]:r[t],wo=ur("inline","width","offsetWidth"),Eo=ur("block","height","offsetHeight");function yo({target:n,borderBoxSize:e}){jt.get(n)?.forEach(t=>{t(n,{get width(){return wo(n,e)},get height(){return Eo(n,e)}})})}function To(n){n.forEach(yo)}function Ro(){typeof ResizeObserver>"u"||(Ft=new ResizeObserver(To))}function xo(n,e){Ft||Ro();const t=So(n);return t.forEach(r=>{let s=jt.get(r);s||(s=new Set,jt.set(r,s)),s.add(e),Ft?.observe(r)}),()=>{t.forEach(r=>{const s=jt.get(r);s?.delete(e),s?.size||Ft?.unobserve(r)})}}const Ut=new Set;let Tt;function Ao(){Tt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ut.forEach(e=>e(n))},window.addEventListener("resize",Tt)}function Co(n){return Ut.add(n),Tt||Ao(),()=>{Ut.delete(n),!Ut.size&&typeof Tt=="function"&&(window.removeEventListener("resize",Tt),Tt=void 0)}}function Po(n,e){return typeof n=="function"?Co(n):xo(n,e)}function Do(n){const e=De.c(4),{elementRef:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={width:0,height:0},e[0]=r):r=e[0];const[s,o]=P.useState(r);let i,c;return e[1]!==t?(i=()=>{t.current&&Po(t.current,(a,u)=>{o({width:u.width,height:u.height})})},c=[t],e[1]=t,e[2]=i,e[3]=c):(i=e[2],c=e[3]),P.useLayoutEffect(i,c),s}const Lo=n=>{const e=De.c(42),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:o,scaleWidth:i,scale:c,scaleCount:a,scaleSplitCount:u,scrollElementRef:l,maxScaleCount:h,onCursorDragStart:d,onCursorDrag:m,onCursorDragEnd:E}=n,S=P.useRef(null),_=P.useRef(void 0);let p,g;e[0]!==r||e[1]!==c||e[2]!==i||e[3]!==o?(p=()=>{if(typeof _.current>"u"&&S.current){const f=o??20,R=i??160,O=c??1;S.current.updateLeft(C.parserTimeToPixel(r,{startLeft:f,scaleWidth:R,scale:O}))}},g=[r,o,i,c],e[0]=r,e[1]=c,e[2]=i,e[3]=o,e[4]=p,e[5]=g):(p=e[4],g=e[5]),P.useEffect(p,g);const v=o??20,w=i??160,A=c??1,y=h??1/0,D=(u??0)>0,F=u??1,N=D?a*(u??1)+1:a,U=o??20,V=(D?w/F:w)*(N-1)+U;let Z;e[6]!==v||e[7]!==y||e[8]!==l||e[9]!==V||e[10]!==w?(Z=()=>({left:0,right:Math.min(V,y*w+v-(l.current?.scrollLeft??0))}),e[6]=v,e[7]=y,e[8]=l,e[9]=V,e[10]=w,e[11]=Z):Z=e[11];const $=!t;let Q;e[12]!==r||e[13]!==v||e[14]!==d||e[15]!==A||e[16]!==w?(Q=()=>{const f=S.current?.getLeft()??C.parserTimeToPixel(r,{startLeft:v,scaleWidth:w,scale:A});_.current=f;const R=C.parserPixelToTime(f,{startLeft:v,scale:A,scaleWidth:w});d&&d(R),S.current?.updateLeft(f)},e[12]=r,e[13]=v,e[14]=d,e[15]=A,e[16]=w,e[17]=Q):Q=e[17];let H;e[18]!==v||e[19]!==E||e[20]!==A||e[21]!==s||e[22]!==w?(H=()=>{if(typeof _.current<"u"){const f=C.parserPixelToTime(_.current,{startLeft:v,scale:A,scaleWidth:w});s({time:f}),E&&E(f)}_.current=void 0},e[18]=v,e[19]=E,e[20]=A,e[21]=s,e[22]=w,e[23]=H):H=e[23];let x;e[24]!==v||e[25]!==m||e[26]!==A||e[27]!==l||e[28]!==s||e[29]!==w?(x=(f,R)=>{const{left:O}=f,j=R===void 0?0:R,ee=l.current?.scrollLeft??0,Y=l.current,B=Y?.clientWidth??0;if(j!==0)if(typeof _.current<"u"){_.current=_.current+j;const L=ee,M=ee+B;_.current<L+10?_.current=L+10:_.current>M-10&&(_.current=M-10),_.current<v-ee&&(_.current=v-ee)}else{_.current=O+j;const L=ee,M=ee+B;_.current<L+10?_.current=L+10:_.current>M-10&&(_.current=M-10)}else if(O<v-ee?_.current=v-ee:_.current=O,Y&&B>0){const L=ee,M=ee+B;_.current<L+10?_.current=L+10:_.current>M-10&&(_.current=M-10)}if(typeof _.current<"u"){S.current?.updateLeft(_.current);const L=C.parserPixelToTime(_.current,{startLeft:v,scale:A,scaleWidth:w});s({time:L}),m&&m(L)}return!1},e[24]=v,e[25]=m,e[26]=A,e[27]=l,e[28]=s,e[29]=w,e[30]=x):x=e[30];let I,K;e[31]===Symbol.for("react.memo_cache_sentinel")?(I=de("cursor"),K=de("cursor-top"),e[31]=I,e[32]=K):(I=e[31],K=e[32]);let ne;e[33]===Symbol.for("react.memo_cache_sentinel")?(ne=T.jsxs("div",{className:I,children:[T.jsx("svg",{className:K,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:T.jsx("path",{d:"M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",fill:"currentColor"})}),T.jsx("div",{className:de("cursor-area")})]}),e[33]=ne):ne=e[33];let se;return e[34]!==v||e[35]!==l||e[36]!==Z||e[37]!==$||e[38]!==Q||e[39]!==H||e[40]!==x?(se=T.jsx(cr,{start:v,ref:S,parentRef:l,getBounds:Z,autoScroll:!0,enableDragging:$,enableResizing:!1,onDragStart:Q,onDragEnd:H,onDrag:x,children:ne}),e[34]=v,e[35]=l,e[36]=Z,e[37]=$,e[38]=Q,e[39]=H,e[40]=x,e[41]=se):se=e[41],se};function kn(n){const e=De.c(9);let t,r,s;e[0]!==n?({className:t,orientation:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);const o=s===void 0?"vertical":s;let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=T.jsx(nr,{"data-slot":"scroll-area-thumb"}),e[4]=i):i=e[4];let c;return e[5]!==t||e[6]!==o||e[7]!==r?(c=T.jsx(Zn,{"data-slot":"scroll-area-scrollbar",orientation:o,className:t,...r,children:i}),e[5]=t,e[6]=o,e[7]=r,e[8]=c):c=e[8],c}function Oo(n){const e=De.c(7),{scrollElementRef:t,scale:r,scaleWidth:s,startLeft:o,cursorTimeRef:i}=n,c=P.useRef(null),a=P.useRef(null);let u,l;e[0]!==i||e[1]!==r||e[2]!==s||e[3]!==t||e[4]!==o?(u=()=>{const h=t.current;if(c.current!==null&&a.current!==null&&h&&(c.current!==r||a.current!==s)){const d=h.scrollLeft,m=i.current,E=C.parserTimeToPixel(m,{startLeft:o,scale:c.current,scaleWidth:a.current}),S=C.parserTimeToPixel(m,{startLeft:o,scale:r,scaleWidth:s}),_=E-d,p=S-_;h.scrollLeft=p}c.current=r,a.current=s},l=[r,s,o,t,i],e[0]=i,e[1]=r,e[2]=s,e[3]=t,e[4]=o,e[5]=u,e[6]=l):(u=e[5],l=e[6]),P.useLayoutEffect(u,l)}function Mo({ref:n,...e}){const t=wr(e),r=P.useRef(null),{width:s,height:o}=Do({elementRef:r}),i=t.minScaleCount??Math.max(C.getScaleCountByRows(t.editorData,{scale:t.scale,pad:.1}),Math.ceil((s-t.startLeft)/t.scaleWidth)),c=Math.min(t.maxScaleCount,i),[a,u]=P.useState(null);P.useLayoutEffect(()=>{u(null)},[c]);const l=a??c,h=p=>{const g=Math.min(t.maxScaleCount,p);u(g)},[d,m]=P.useState(C.START_CURSOR_TIME),E=P.useRef(C.START_CURSOR_TIME);Oo({scrollElementRef:r,scale:t.scale,scaleWidth:t.scaleWidth,startLeft:t.startLeft,cursorTimeRef:E});const S=p=>{t.onChange?.(p)},_=p=>{let{left:g,time:v}=p;return typeof v<"u"?(m(v),E.current=v,!0):typeof g<"u"?(m(E.current=C.parserPixelToTime(g,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth})),!0):!1};return P.useImperativeHandle(n,()=>({get target(){return r.current},set time(p){_({time:p})},get time(){return E.current},getTime(){return E.current},setTime(p){_({time:p})},setScrollLeft:p=>{r.current&&(r.current.scrollLeft=p)},setScrollTop:p=>{r.current&&(r.current.scrollTop=p)},get scrollLeft(){return r.current?r.current.scrollLeft:0},get scrollTop(){return r.current?r.current.scrollTop:0},set scrollLeft(p){r.current&&(r.current.scrollLeft=p)},set scrollTop(p){r.current&&(r.current.scrollTop=p)}})),T.jsxs(Bs,{style:t.style,className:`${C.PREFIX} ${t.disableDrag?C.PREFIX+"-disable":""}`,"data-slot":"scroll-area",children:[T.jsxs(Ys,{"data-slot":"scroll-area-viewport",ref:r,onScroll:p=>{t.onScroll?.(p.currentTarget)},children:[T.jsx(vo,{...t,setCursor:_,scaleCount:l,scrollElementRef:r}),T.jsx(go,{...t,scrollElementRef:r,timelineWidth:s,timelineHeight:o,disableDrag:t.disableDrag,editorData:t.editorData,cursorTime:d,scaleCount:l,setScaleCount:h,setEditorData:S}),!t.hideCursor&&T.jsx(Lo,{...t,timelineWidth:s,height:o,scaleCount:l,setScaleCount:h,setCursor:_,cursorTime:d,editorData:t.editorData,scrollElementRef:r})]}),T.jsx(kn,{orientation:"horizontal"}),T.jsx(kn,{orientation:"vertical"}),T.jsx(Xs,{})]})}exports.Timeline=Mo;