@cyca/react-timeline-editor 0.2.3-alpha.5 → 0.2.3-alpha.6

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.
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),Er=require("react-dom");function Rr(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 p=Rr(A);var Nt={exports:{}},Ct={};var vn;function xr(){if(vn)return Ct;vn=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 Ct.Fragment=e,Ct.jsx=t,Ct.jsxs=t,Ct}var Tt={};var bn;function Cr(){return bn||(bn=1,process.env.NODE_ENV!=="production"&&(function(){function n(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===M?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case g:return"Fragment";case _:return"Profiler";case S:return"StrictMode";case x:return"Suspense";case R:return"SuspenseList";case P:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case v:return"Portal";case y:return d.displayName||"Context";case w:return(d._context.displayName||"Context")+".Consumer";case C:var T=d.render;return d=d.displayName,d||(d=T.displayName||T.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case W:return T=d.displayName||null,T!==null?T:n(d.type)||"Memo";case L:T=d._payload,d=d._init;try{return n(d(T))}catch{}}return null}function e(d){return""+d}function t(d){try{e(d);var T=!1}catch{T=!0}if(T){T=console;var V=T.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return V.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),e(d)}}function r(d){if(d===g)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===L)return"<...>";try{var T=n(d);return T?"<"+T+">":"<...>"}catch{return"<...>"}}function s(){var d=H.A;return d===null?null:d.getOwner()}function o(){return Error("react-stack-top-frame")}function i(d){if(F.call(d,"key")){var T=Object.getOwnPropertyDescriptor(d,"key").get;if(T&&T.isReactWarning)return!1}return d.key!==void 0}function c(d,T){function V(){I||(I=!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)",T))}V.isReactWarning=!0,Object.defineProperty(d,"key",{get:V,configurable:!0})}function a(){var d=n(this.type);return K[d]||(K[d]=!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.")),d=this.props.ref,d!==void 0?d:null}function u(d,T,V,B,J,Y){var U=V.ref;return d={$$typeof:b,type:d,key:T,props:V,_owner:B},(U!==void 0?U:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:a}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function l(d,T,V,B,J,Y){var U=T.children;if(U!==void 0)if(B)if(q(U)){for(B=0;B<U.length;B++)h(U[B]);Object.freeze&&Object.freeze(U)}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(U);if(F.call(T,"key")){U=n(d);var O=Object.keys(T).filter(function($){return $!=="key"});B=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",me[U+B]||(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 T=require("react"),xr=require("react-dom");function Cr(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 p=Cr(T);var Nt={exports:{}},Ct={};var bn;function Tr(){if(bn)return Ct;bn=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 Ct.Fragment=e,Ct.jsx=t,Ct.jsxs=t,Ct}var Tt={};var _n;function Ar(){return _n||(_n=1,process.env.NODE_ENV!=="production"&&(function(){function n(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===L?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case v:return"Fragment";case _:return"Profiler";case w:return"StrictMode";case x:return"Suspense";case C:return"SuspenseList";case O:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case b:return"Portal";case y:return d.displayName||"Context";case S:return(d._context.displayName||"Context")+".Consumer";case P:var A=d.render;return d=d.displayName,d||(d=A.displayName||A.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case D:return A=d.displayName||null,A!==null?A:n(d.type)||"Memo";case E:A=d._payload,d=d._init;try{return n(d(A))}catch{}}return null}function e(d){return""+d}function t(d){try{e(d);var A=!1}catch{A=!0}if(A){A=console;var U=A.error,B=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return U.call(A,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),e(d)}}function r(d){if(d===v)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===E)return"<...>";try{var A=n(d);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function s(){var d=W.A;return d===null?null:d.getOwner()}function o(){return Error("react-stack-top-frame")}function i(d){if(V.call(d,"key")){var A=Object.getOwnPropertyDescriptor(d,"key").get;if(A&&A.isReactWarning)return!1}return d.key!==void 0}function c(d,A){function U(){k||(k=!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)",A))}U.isReactWarning=!0,Object.defineProperty(d,"key",{get:U,configurable:!0})}function l(){var d=n(this.type);return K[d]||(K[d]=!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.")),d=this.props.ref,d!==void 0?d:null}function u(d,A,U,B,J,Y){var $=U.ref;return d={$$typeof:g,type:d,key:A,props:U,_owner:B},($!==void 0?$:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:l}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function a(d,A,U,B,J,Y){var $=A.children;if($!==void 0)if(B)if(q($)){for(B=0;B<$.length;B++)h($[B]);Object.freeze&&Object.freeze($)}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($);if(V.call(A,"key")){$=n(d);var N=Object.keys(A).filter(function(H){return H!=="key"});B=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",me[$+B]||(N=0<N.length?"{"+N.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} />`,B,U,O,U),me[U+B]=!0)}if(U=null,V!==void 0&&(t(V),U=""+V),i(T)&&(t(T.key),U=""+T.key),"key"in T){V={};for(var N in T)N!=="key"&&(V[N]=T[N])}else V=T;return U&&c(V,typeof d=="function"?d.displayName||d.name||"Unknown":d),u(d,U,V,s(),J,Y)}function h(d){f(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===L&&(d._payload.status==="fulfilled"?f(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function f(d){return typeof d=="object"&&d!==null&&d.$$typeof===b}var m=A,b=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),y=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),H=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,q=Array.isArray,D=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(d){return d()}};var I,K={},ue=m.react_stack_bottom_frame.bind(m,o)(),fe=D(r(o)),me={};Tt.Fragment=g,Tt.jsx=function(d,T,V){var B=1e4>H.recentlyCreatedOwnerStacks++;return l(d,T,V,!1,B?Error("react-stack-top-frame"):ue,B?D(r(d)):fe)},Tt.jsxs=function(d,T,V){var B=1e4>H.recentlyCreatedOwnerStacks++;return l(d,T,V,!0,B?Error("react-stack-top-frame"):ue,B?D(r(d)):fe)}})()),Tt}var _n;function Tr(){return _n||(_n=1,process.env.NODE_ENV==="production"?Nt.exports=xr():Nt.exports=Cr()),Nt.exports}var E=Tr();const on="timeline-editor",Ar=0,$t=1,Xn=10,Ht=160,Gt=20,cn=1,an=8,wn=32,ln=20,Gn=5,en={trace:0,debug:1,info:2,warn:3,error:4,silent:5},Pr=["trace","debug","info","warn","error"];var Dr=class Kn{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(){Pr.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>en[e]>=en[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 en?(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 Kn(this.s,this.e,e,this.r||this);this.ls.set(e,qn(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 qn(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 Or=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const Lr={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},Sn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},Mr={bind(n,e,t){const r=t?`${Sn[e]} ${String(t)}:`:`${Sn[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${Lr[e]}; font-weight: bold;`,"color: inherit")}},Ze=qn(new Dr(new Or,Mr));function Nr(n){let{editorData:e=[],effects:t={},scale:r=$t,scaleSplitCount:s=Xn,scaleWidth:o=Ht,startLeft:i=Gt,minScaleCount:c=ln,maxScaleCount:a=1/0,rowHeight:u=wn}=n;r<=0&&(Ze.error("Error: scale must be greater than 0!"),r=$t),s<=0&&(Ze.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),o<=0&&(Ze.warn("Warning: scaleWidth must be greater than 0!"),o=Ht),i<0&&(Ze.warn("Warning: startLeft cannot be less than 0!"),i=0),c<1&&(Ze.warn("Warning: minScaleCount must be greater than 1!"),c=ln),c=parseInt(c+""),a<c&&(Ze.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),a=c),a=a===1/0?1/0:parseInt(a+""),u<=0&&(Ze.warn("Warning: rowHeight must be greater than 0!"),u=wn);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 je(n,e){const{startLeft:t,scale:r,scaleWidth:s}=e;return t+n/r*s}function tt(n,e){const{startLeft:t,scale:r,scaleWidth:s}=e;return(n-t)/s*r}function At(n,e){const{left:t,width:r}=n,s=tt(t,e),o=tt(t+r,e);return{start:s,end:o}}function dn(n,e){const{start:t,end:r}=n,s=je(t,e),o=je(r,e)-s;return{left:s,width:o}}function Ir(n,e){let t=0;return n.forEach(s=>{s.actions.forEach(o=>{t=Math.max(t,o.end)})}),Math.ceil(t/e.scale)+Gn}function kr(n,e){const{startLeft:t,scaleWidth:r}=e,s=Math.ceil((n-t)/r);return Math.max(s+Gn,e.scaleCount)}function Wr(n,e){const t=[];return n.forEach(r=>{t.push(je(r.start,e)),t.push(je(r.end,e))}),t}var It={exports:{}},tn={};var yn;function jr(){if(yn)return tn;yn=1;var n=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return tn.c=function(e){return n.H.useMemoCache(e)},tn}var nn={};var En;function zr(){return En||(En=1,process.env.NODE_ENV!=="production"&&(function(){var n=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;nn.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} />`,B,$,N,$),me[$+B]=!0)}if($=null,U!==void 0&&(t(U),$=""+U),i(A)&&(t(A.key),$=""+A.key),"key"in A){U={};for(var I in A)I!=="key"&&(U[I]=A[I])}else U=A;return $&&c(U,typeof d=="function"?d.displayName||d.name||"Unknown":d),u(d,$,U,s(),J,Y)}function h(d){f(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===E&&(d._payload.status==="fulfilled"?f(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function f(d){return typeof d=="object"&&d!==null&&d.$$typeof===g}var m=T,g=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),y=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),W=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,q=Array.isArray,M=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(d){return d()}};var k,K={},ue=m.react_stack_bottom_frame.bind(m,o)(),fe=M(r(o)),me={};Tt.Fragment=v,Tt.jsx=function(d,A,U){var B=1e4>W.recentlyCreatedOwnerStacks++;return a(d,A,U,!1,B?Error("react-stack-top-frame"):ue,B?M(r(d)):fe)},Tt.jsxs=function(d,A,U){var B=1e4>W.recentlyCreatedOwnerStacks++;return a(d,A,U,!0,B?Error("react-stack-top-frame"):ue,B?M(r(d)):fe)}})()),Tt}var wn;function Pr(){return wn||(wn=1,process.env.NODE_ENV==="production"?Nt.exports=Tr():Nt.exports=Ar()),Nt.exports}var R=Pr();const cn="timeline-editor",Sn=0,$t=1,Kn=10,Ht=160,Gt=20,an=1,ln=8,yn=32,un=20,qn=5,en={trace:0,debug:1,info:2,warn:3,error:4,silent:5},Dr=["trace","debug","info","warn","error"];var Or=class Jn{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(){Dr.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>en[e]>=en[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 en?(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 Jn(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 Lr=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const Mr={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},En={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},Nr={bind(n,e,t){const r=t?`${En[e]} ${String(t)}:`:`${En[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${Mr[e]}; font-weight: bold;`,"color: inherit")}},Ze=Zn(new Or(new Lr,Nr));function Ir(n){let{editorData:e=[],effects:t={},scale:r=$t,scaleSplitCount:s=Kn,scaleWidth:o=Ht,startLeft:i=Gt,minScaleCount:c=un,maxScaleCount:l=1/0,rowHeight:u=yn}=n;r<=0&&(Ze.error("Error: scale must be greater than 0!"),r=$t),s<=0&&(Ze.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),o<=0&&(Ze.warn("Warning: scaleWidth must be greater than 0!"),o=Ht),i<0&&(Ze.warn("Warning: startLeft cannot be less than 0!"),i=0),c<1&&(Ze.warn("Warning: minScaleCount must be greater than 1!"),c=un),c=parseInt(c+""),l<c&&(Ze.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),l=c),l=l===1/0?1/0:parseInt(l+""),u<=0&&(Ze.warn("Warning: rowHeight must be greater than 0!"),u=yn);const a={...n};return delete a.style,{...a,editorData:e,effects:t,scale:r,scaleSplitCount:s,scaleWidth:o,startLeft:i,minScaleCount:c,maxScaleCount:l,rowHeight:u}}function je(n,e){const{startLeft:t,scale:r,scaleWidth:s}=e;return t+n/r*s}function tt(n,e){const{startLeft:t,scale:r,scaleWidth:s}=e;return(n-t)/s*r}function At(n,e){const{left:t,width:r}=n,s=tt(t,e),o=tt(t+r,e);return{start:s,end:o}}function hn(n,e){const{start:t,end:r}=n,s=je(t,e),o=je(r,e)-s;return{left:s,width:o}}function kr(n,e){let t=0;return n.forEach(s=>{s.actions.forEach(o=>{t=Math.max(t,o.end)})}),Math.ceil(t/e.scale)+qn}function Wr(n,e){const{startLeft:t,scaleWidth:r}=e,s=Math.ceil((n-t)/r);return Math.max(s+qn,e.scaleCount)}function jr(n,e){const t=[];return n.forEach(r=>{t.push(je(r.start,e)),t.push(je(r.end,e))}),t}var It={exports:{}},tn={};var Rn;function zr(){if(Rn)return tn;Rn=1;var n=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return tn.c=function(e){return n.H.useMemoCache(e)},tn}var nn={};var xn;function Fr(){return xn||(xn=1,process.env.NODE_ENV!=="production"&&(function(){var n=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;nn.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)}})()),nn}var Rn;function Fr(){return Rn||(Rn=1,process.env.NODE_ENV==="production"?It.exports=jr():It.exports=zr()),It.exports}var ze=Fr();function Vr(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 Vr(`${on}-`,...n)}const Ur=n=>{const e=ze.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("drag-line-container"),e[7]=o):o=e[7],i=t&&a.filter(h=>l.includes(h)).map($r),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=E.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c};function $r(n,e){return E.jsx("div",{className:de("drag-line"),style:{left:n}},e)}const kt=1,xn=10,Cn=10;function Hr(n){const e=ze.c(7),t=A.useRef(Number.MIN_SAFE_INTEGER),r=A.useRef(Number.MAX_SAFE_INTEGER),s=A.useRef(kt),o=A.useRef(void 0);let i;e[0]!==n?(i=()=>{if(n?.current){const{left:v,width:g}=n.current.getBoundingClientRect();t.current=v,r.current=v+g}},e[0]=n,e[1]=i):i=e[1];const c=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(v,g)=>{if(v.clientX>=r.current||v.clientX<=t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const S=Math.abs(v.clientX>=r.current?v.clientX-r.current:v.clientX-t.current);s.current=Math.min(Number((S/Cn).toFixed(0))*kt,xn);const w=(v.clientX>=r.current?1:-1)*s.current,y=()=>{g&&g(w),o.current=requestAnimationFrame(y)};return o.current=requestAnimationFrame(y),!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,g,S)=>{if(v.clientX>=r.current||v.clientX<t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const _=Math.abs(v.clientX>=r.current?v.clientX-r.current:v.clientX-t.current);s.current=Math.min(Number((_/Cn).toFixed(0))*kt,xn);const y=(v.clientX>=r.current?1:-1)*s.current,C=()=>{S&&S(y),o.current=requestAnimationFrame(C)};return o.current=requestAnimationFrame(C),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[3]=l):l=e[3];const h=l;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{t.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=kt,o.current!==void 0&&cancelAnimationFrame(o.current)},e[4]=f):f=e[4];const m=f;let b;return e[5]!==c?(b={initAutoScroll:c,dealDragAutoScroll:u,dealResizeAutoScroll:h,stopAutoScroll:m},e[5]=c,e[6]=b):b=e[6],b}function Br(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 Tn(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function An(n,e,t,r=.15){return r===0?Br(n,e,t):n<e?-Tn(e-n,t-e,r)+e:n>t?+Tn(n-t,t-e,r)+t:n}function Yr(n,[e,t],[r,s]){const[[o,i],[c,a]]=n;return[An(e,o,i,r),An(t,c,a,s)]}function Xr(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 Gr(n){var e=Xr(n,"string");return typeof e=="symbol"?e:String(e)}function ve(n,e,t){return e=Gr(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pn(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?Pn(Object(t),!0).forEach(function(r){ve(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pn(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 Dn(n){return n?n[0].toUpperCase()+n.slice(1):""}const Kr=["enter","leave"];function qr(n=!1,e){return n&&!Kr.includes(e)}function Jr(n,e="",t=!1){const r=Jn[n],s=r&&r[e]||e;return"on"+Dn(n)+Dn(s)+(qr(t,s)?"Capture":"")}const Zr=["gotpointercapture","lostpointercapture"];function Qr(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=Zr.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function es(n,e=""){const t=Jn[n],r=t&&t[e]||e;return n+r}function Kt(n){return"touches"in n}function Zn(n){return Kt(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function ts(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 ns(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Qn(n){return Kt(n)?ns(n)[0]:n}function rs(n){return ts(n).map(e=>e.identifier)}function rn(n){const e=Qn(n);return Kt(n)?e.identifier:e.pointerId}function On(n){const e=Qn(n);return[e.clientX,e.clientY]}function ss(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 Bt(n,...e){return typeof n=="function"?n(...e):n}function os(){}function is(...n){return n.length===0?os:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function Ln(n,e){return Object.assign({},e,n||{})}const cs=32;class as{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?Bt(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,ss(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 x=t._delta.map(Math.abs);he.addTo(t._distance,x)}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 f=[0,0];if(r.hasCustomTransform){const[x,R]=h;f[0]=l[0]!==!1?x-l[0]:0,f[1]=l[1]!==!1?R-l[1]:0}else f[0]=l[0]!==!1?i-l[0]:0,f[1]=l[1]!==!1?c-l[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);const m=t.offset,b=t._active&&!t._blocked||t.active;b&&(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=Bt(r.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));const[v,g]=t.offset,[[S,_],[w,y]]=t._bounds;t.overflow=[v<S?-1:v>_?1:0,g<w?-1:g>y?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 C=t._active?r.rubberband||[0,0]:[0,0];if(t.offset=Yr(t._bounds,t.offset,C),t.delta=he.sub(t.offset,m),this.computeMovement(),b&&(!t.last||o>cs)){t.delta=he.sub(t.offset,m);const x=t.delta.map(Math.abs);he.addTo(t.distance,x),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[x[0]/o,x[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 ls([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 us extends as{constructor(...e){super(...e),ve(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[Zn(e)]:r.axisThreshold;t.axis=ls(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 Mn=n=>n,Nn=.15,hn={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[Nn,Nn];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||Mn;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||Mn},threshold(n){return he.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(hn,{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 fs=0,Pt=te(te({},hn),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=fs){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]]}}),In={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 ds extends us{constructor(...e){super(...e),ve(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=rn(e),r._pointerActive=!0,this.computeValues(On(e)),this.computeInitial(),t.preventScrollAxis&&Zn(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=rn(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const o=On(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=rn(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,f]=r.swipe.velocity,[m,b]=r.swipe.distance,v=r.swipe.duration;if(t.elapsedTime<v){const g=Math.abs(c/t.timeDelta),S=Math.abs(a/t.timeDelta);g>h&&Math.abs(u)>m&&(t.swipe[0]=Math.sign(c)),S>f&&Math.abs(l)>b&&(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,hs(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=In[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 In&&(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 hs(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Dt=typeof window<"u"&&window.document&&window.document.createElement;function er(){return Dt&&"ontouchstart"in window}function ms(){return er()||Dt&&window.navigator.maxTouchPoints>1}function ps(){return Dt&&"onpointerdown"in window}function gs(){return Dt&&"exitPointerLock"in window.document}function vs(){try{return"constructor"in GestureEvent}catch{return!1}}const we={isBrowser:Dt,gesture:vs(),touch:er(),touchscreen:ms(),pointer:ps(),pointerLock:gs()},bs=250,_s=180,ws=.5,Ss=50,ys=250,Es=10,kn={mouse:0,touch:0,pen:8},tr=te(te({},Pt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&we.pointerLock,we.touch&&t?"touch":this.pointerLock?"mouse":we.pointer&&!s?"pointer":we.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?bs:void 0,!(!we.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=ws,distance:e=Ss,duration:t=ys}={}){return{velocity:this.transform(he.toVector(n)),distance:this.transform(he.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return _s;case!1:return 0;default:return n}},axisThreshold(n){return n?te(te({},kn),n):kn},keyboardDisplacement(n=Es){return n}});process.env.NODE_ENV==="development"&&Object.assign(tr,{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({},hn),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!we.touch&&we.gesture)return"gesture";if(we.touch&&r)return"touch";if(we.touchscreen){if(we.pointer)return"pointer";if(we.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=i=>{const c=Ln(Bt(t,i),{min:-1/0,max:1/0});return[c.min,c.max]},o=i=>{const c=Ln(Bt(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 nr=new Map,un=new Map;function Rs(n){nr.set(n.key,n.engine),un.set(n.key,n.resolver)}const xs={key:"drag",engine:ds,resolver:tr};function Cs(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 Ts(n,e){if(n==null)return{};var t=Cs(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 As={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=we.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},Ps=["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 Ds(n,e,t={}){const r=n,{target:s,eventOptions:o,window:i,enabled:c,transform:a}=r,u=Ts(r,Ps);if(t.shared=zt({target:s,eventOptions:o,window:i,enabled:c,transform:a},As),e){const l=un.get(e);t[e]=zt(te({shared:t.shared},u),l)}else for(const l in u){const h=un.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 rr{constructor(e,t){ve(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,o){const i=this._listeners,c=es(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 Os{constructor(){ve(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 Ls{constructor(e){ve(this,"gestures",new Set),ve(this,"_targetEventStore",new rr(this)),ve(this,"gestureEventStores",{}),ve(this,"gestureTimeoutStores",{}),ve(this,"handlers",{}),ve(this,"config",{}),ve(this,"pointerIds",new Set),ve(this,"touchIds",new Set),ve(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Ms(this,e)}setEventIds(e){if(Kt(e))return this.touchIds=new Set(rs(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=Ds(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=Wn(r,c.eventOptions,!!s);if(c.enabled){const u=nr.get(i);new u(this,e,i).bind(a)}}const o=Wn(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]=is(...r[o]);if(!s)return r;for(const o in r){const{device:i,capture:c,passive:a}=Qr(o);this._targetEventStore.add(s,i,"",r[o],{capture:c,passive:a})}}}}function yt(n,e){n.gestures.add(e),n.gestureEventStores[e]=new rr(n,e),n.gestureTimeoutStores[e]=new Os}function Ms(n,e){e.drag&&yt(n,"drag"),e.wheel&&yt(n,"wheel"),e.scroll&&yt(n,"scroll"),e.move&&yt(n,"move"),e.pinch&&yt(n,"pinch"),e.hover&&yt(n,"hover")}const Wn=(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 f=c?r:Jr(r,s,l);t&&h&&(f+="Passive"),n[f]=n[f]||[],n[f].push(o)};function Ns(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 Is(n){var e=Ns(n,"string");return typeof e=="symbol"?e:String(e)}function ks(n,e,t){return e=Is(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function jn(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 Wt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jn(Object(t),!0).forEach(function(r){ks(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class Ws{constructor(e,t,r,s,o){this._target=e,this._gestureKey=s,this._ctrl=new Ls(t),this._ctrl.applyHandlers(t,o),this._ctrl.applyConfig(Wt(Wt({},r),{},{target:e}),s),this._ctrl.effect()}destroy(){this._ctrl.clean()}setConfig(e){this._ctrl.clean(),this._ctrl.applyConfig(Wt(Wt({},e),{},{target:this._target}),this._gestureKey),this._ctrl.effect()}}const sn=function(e,t,r){return Rs(xs),new Ws(e,{drag:t},r||{},"drag")};function js(...n){const e=n.filter(Boolean);return e.length<=1?e[0]||null:function(r){for(const s of e)typeof s=="function"?s(r):s&&(s.current=r)}}const sr=({children:n,...e})=>{const t=A.Children.only(n),r=zs(t),s=t.props||{},o=s.style||{},i={...e,...s,style:{...e.style??{},...o},ref:js(r,e.ref)};return A.cloneElement(t,i)};function zs(n){let e=Object.getOwnPropertyDescriptor(n,"ref")?.get;return e&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref}const Fs=({children:n,interactRef:e,draggable:t,resizable:r,draggableOptions:s,resizableOptions:o})=>{const i=A.useRef(null),c=A.useRef(void 0),a=A.useRef(void 0),u=A.useRef(void 0),l=A.useRef(void 0),h=A.useRef(void 0),f=A.useRef(null),m=A.useRef(null);A.useEffect(()=>{c.current=s,a.current=o},[s,o]);const b=A.useEffectEvent(()=>{i.current&&(t&&c.current&&(u.current=new sn(i.current,v=>{const{active:g,delta:S,xy:_,event:w,first:y,last:C}=v,x=w?.target;if(x&&(x===f.current||x===m.current||f.current&&f.current.contains(x)||m.current&&m.current.contains(x)))return;const R={target:i.current,dx:S[0],dy:S[1],clientX:_[0],clientY:_[1]};y?c.current?.onstart?.(R):C?c.current?.onend?.(R):g&&c.current?.onmove?.(R)},{axis:c.current?.lockAxis==="x"?"x":void 0,threshold:0,pointer:{capture:!0}})),r&&a.current?.edges&&(a.current.edges.left&&(f.current||(f.current=i.current.querySelector(a.current.edges.left)),l.current=new sn(f.current,v=>{const{active:g,delta:S,xy:_,first:w,last:y}=v,C={target:i.current,dx:S[0],dy:0,clientX:_[0],clientY:_[1],edges:{left:!0},deltaRect:{left:S[0]}};y?a.current?.onend?.(C):w?a.current?.onstart?.(C):g&&a.current?.onmove?.(C)},{pointer:{capture:!0},threshold:0})),a.current.edges.right&&(m.current||(m.current=i.current.querySelector(a.current.edges.right)),h.current=new sn(m.current,v=>{const{active:g,delta:S,xy:_,first:w,last:y}=v,C={target:i.current,dx:S[0],dy:0,clientX:_[0],clientY:_[1],edges:{right:!0},deltaRect:{right:S[0]}};y?a.current?.onend?.(C):w?a.current?.onstart?.(C):g&&a.current?.onmove?.(C)},{pointer:{capture:!0},threshold:0}))))});return A.useEffect(()=>{if(!i.current)return;u.current?.destroy(),l.current?.destroy(),h.current?.destroy();const v={target:i.current,unset:()=>{u.current?.destroy(),l.current?.destroy(),h.current?.destroy()}};e&&(e.current=v),b()},[t,r,e]),sr({children:n,ref:i,draggable:!1,style:{...t&&{touchAction:"none"}}})},or=A.forwardRef((n,e)=>{const t=ze.c(70),{children:r,edges:s,left:o,width:i,start:c,grid:a,getBounds:u,enableResizing:l,enableDragging:h,adsorptionDistance:f,adsorptionPositions:m,onResizeStart:b,onResize:v,onResizeEnd:g,onDragStart:S,onDragEnd:_,onDrag:w,parentRef:y,autoScroll:C}=n,x=c===void 0?Gt:c,R=a===void 0?cn:a,W=u===void 0?Vs:u,L=l===void 0?!0:l,P=h===void 0?!0:h,M=f===void 0?an:f;let H;t[0]!==m?(H=m===void 0?[]:m,t[0]=m,t[1]=H):H=t[1];const F=H,q=C===void 0?!0:C,D=A.useRef(void 0),I=A.useRef(0),K=A.useRef(!1),{initAutoScroll:ue,stopAutoScroll:fe,dealDragAutoScroll:me,dealResizeAutoScroll:d}=Hr(y);let T,V;t[2]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{const k=D.current;return()=>{k?.unset()}},V=[],t[2]=T,t[3]=V):(T=t[2],V=t[3]),A.useEffect(T,V);let B;t[4]===Symbol.for("react.memo_cache_sentinel")?(B=(k,Z)=>{const X=Z===void 0?!0:Z;if(!D.current||!D.current.target)return;X&&(I.current=0);const z=D.current.target;z.style.left=`${k}px`,Object.assign(z.dataset,{left:k})},t[4]=B):B=t[4];const J=B;let Y;t[5]===Symbol.for("react.memo_cache_sentinel")?(Y=(k,Z)=>{const X=Z===void 0?!0:Z;if(!D.current||!D.current.target)return;X&&(I.current=0);const z=D.current.target;z.style.width=`${k}px`,Object.assign(z.dataset,{width:k})},t[5]=Y):Y=t[5];const U=Y;let O;t[6]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{if(!D.current?.target)return 0;const k=D.current.target;return parseFloat(k?.dataset?.left||"0")},t[6]=O):O=t[6];const N=O;let $;t[7]===Symbol.for("react.memo_cache_sentinel")?($=()=>{if(!D.current?.target)return 0;const k=D.current.target;return parseFloat(k?.dataset?.width||"0")},t[7]=$):$=t[7];const Zt=$;let rt,Fe;t[8]!==i?(rt=()=>{if(!D.current?.target)return;const k=D.current.target;U(typeof i>"u"?k.offsetWidth:i,!1)},Fe=[i],t[8]=i,t[9]=rt,t[10]=Fe):(rt=t[9],Fe=t[10]),A.useEffect(rt,Fe);let Ae,Re;t[11]!==o?(Ae=()=>{J(o||0,!1)},Re=[o],t[11]=o,t[12]=Ae,t[13]=Re):(Ae=t[12],Re=t[13]),A.useEffect(Ae,Re);let Ve;t[14]===Symbol.for("react.memo_cache_sentinel")?(Ve=()=>({updateLeft:k=>J(k||0,!1),updateWidth:k=>U(k,!1),getLeft:N,getWidth:Zt}),t[14]=Ve):Ve=t[14],A.useImperativeHandle(e,Ve);let Pe;t[15]!==ue||t[16]!==S?(Pe=()=>{I.current=0,K.current=!1,ue(),S&&S()},t[15]=ue,t[16]=S,t[17]=Pe):Pe=t[17];const De=Pe;let Oe;t[18]!==M||t[19]!==F||t[20]!==W||t[21]!==R||t[22]!==w||t[23]!==x?(Oe=k=>{const{preLeft:Z,preWidth:X,scrollDelta:z}=k;z&&(I.current=I.current+z);const ne=K.current?M:R;if(Math.abs(I.current)>=ne){const re=parseInt(I.current/ne+"");let G=Z+re*ne,j=G;const se=Number.MAX_SAFE_INTEGER;if(F.forEach(ee=>{const Q=Math.abs(ee-G);Q<M&&Q<se&&(j=ee);const ce=Math.abs(ee-(G+X));ce<M&&ce<se&&(j=ee-X)}),j!==G?(K.current=!0,G=j):((G-x)%R!==0&&(G=x+R*Math.round((G-x)/R)),K.current=!1),I.current=I.current%ne,G<W().left?G=W().left:G+X>W().right&&(G=W().right-X),w&&w({lastLeft:Z,left:G,lastWidth:X,width:X},z)===!1)return;J(G,!1)}},t[18]=M,t[19]=F,t[20]=W,t[21]=R,t[22]=w,t[23]=x,t[24]=Oe):Oe=t[24];const st=Oe;let ot;t[25]!==q||t[26]!==me||t[27]!==st||t[28]!==y?(ot=k=>{const Z=k.target,{left:X,width:z}=Z.dataset,ne=parseFloat(X||"0"),re=parseFloat(z||"0");I.current=I.current+k.dx,!(q&&y?.current&&!me(k,se=>{if(!y?.current||!D.current?.target)return;y.current.scrollLeft=y.current.scrollLeft+se;const ee=D.current.target,Q=parseFloat(ee.dataset.left||"0"),ce=parseFloat(ee.dataset.width||"0");st({preLeft:Q,preWidth:ce,scrollDelta:se})}))&&st({preLeft:ne,preWidth:re})},t[25]=q,t[26]=me,t[27]=st,t[28]=y,t[29]=ot):ot=t[29];const Ue=ot;let be;t[30]!==_||t[31]!==fe?(be=k=>{I.current=0,K.current=!1,fe();const Z=k.target,{left:X,width:z}=Z.dataset;_&&_({left:parseFloat(X||"0"),width:parseFloat(z||"0")})},t[30]=_,t[31]=fe,t[32]=be):be=t[32];const $e=be;let Le;t[33]!==ue||t[34]!==b?(Le=k=>{I.current=0,K.current=!1,ue();const Z=k.edges?.right?"right":"left";b&&b(Z)},t[33]=ue,t[34]=b,t[35]=Le):Le=t[35];const Ke=Le;let Me;t[36]!==M||t[37]!==F||t[38]!==W||t[39]!==R||t[40]!==v||t[41]!==x?(Me=k=>{const{dir:Z,preWidth:X,preLeft:z,scrollDelta:ne}=k;ne&&(I.current=I.current+ne);const re=K.current?M:R;if(Z==="left"){if(Math.abs(I.current)>=re){const G=parseInt(I.current/re+"");let j=z+G*re,se=j;const ee=Number.MAX_SAFE_INTEGER;F.forEach(_e=>{const We=Math.abs(_e-j);We<M&&We<ee&&(se=_e)}),se!==j?(K.current=!0,j=se):((j-x)%R!==0&&(j=x+R*Math.round((j-x)/R)),K.current=!1),I.current=I.current%re;const Q=z+X;j<W().left&&(j=W().left);const ce=Q-j;if(v&&v("left",{lastLeft:z,lastWidth:X,left:j,width:ce})===!1)return;J(j,!1),U(ce,!1)}}else if(Z==="right"&&Math.abs(I.current)>=re){const G=parseInt(I.current/R+"");let j=X+G*R,se=z+j;const ee=Number.MAX_SAFE_INTEGER;if(F.forEach(Q=>{const ce=Math.abs(Q-(z+j));ce<M&&ce<ee&&(se=Q)}),se!==z+j)K.current=!0,j=se-z;else{let Q=z+j;(Q-x)%R!==0&&(Q=x+R*Math.round((Q-x)/R),j=Q-z),K.current=!1}if(I.current=I.current%re,z+j>W().right&&(j=W().right-z),v&&v("right",{lastLeft:z,lastWidth:X,left:z,width:j})===!1)return;U(j,!1)}},t[36]=M,t[37]=F,t[38]=W,t[39]=R,t[40]=v,t[41]=x,t[42]=Me):Me=t[42];const ye=Me;let Ne;t[43]!==q||t[44]!==d||t[45]!==y||t[46]!==ye?(Ne=k=>{const Z=k.target,X=k.edges?.left?"left":"right",{left:z,width:ne}=Z.dataset,re=parseFloat(z||"0"),G=parseFloat(ne||"0");I.current=I.current+(X==="left"?k.deltaRect?.left||0:k.deltaRect?.right||0),!(q&&y?.current&&!d(k,X,ee=>{if(!y?.current||!D.current?.target)return;y.current.scrollLeft=y.current.scrollLeft+ee;const Q=D.current.target,ce=parseFloat(Q.dataset.left||"0"),_e=parseFloat(Q.dataset.width||"0");ye({preLeft:ce,preWidth:_e,dir:X,scrollDelta:ee})}))&&ye({preLeft:re,preWidth:G,dir:X})},t[43]=q,t[44]=d,t[45]=y,t[46]=ye,t[47]=Ne):Ne=t[47];const qe=Ne;let Ie;t[48]!==g||t[49]!==fe?(Ie=k=>{I.current=0,K.current=!1,fe();const Z=k.target,{left:X,width:z}=Z.dataset,ne=k.edges?.right?"right":"left";g&&g(ne,{left:parseFloat(X||"0"),width:parseFloat(z||"0")})},t[48]=g,t[49]=fe,t[50]=Ie):Ie=t[50];const Je=Ie;let Ee;t[51]!==Ue||t[52]!==De||t[53]!==$e?(Ee={lockAxis:"x",onmove:Ue,onstart:De,onend:$e,cursorChecker:Us},t[51]=Ue,t[52]=De,t[53]=$e,t[54]=Ee):Ee=t[54];let xe;t[55]!==s||t[56]!==qe||t[57]!==Ke||t[58]!==Je?(xe={axis:"x",invert:"none",edges:s,onmove:qe,onstart:Ke,onend:Je},t[55]=s,t[56]=qe,t[57]=Ke,t[58]=Je,t[59]=xe):xe=t[59];const He=r;let Ce;t[60]!==o||t[61]!==He||t[62]!==i?(Ce=sr({children:He,style:{left:o,width:i}}),t[60]=o,t[61]=He,t[62]=i,t[63]=Ce):Ce=t[63];let ke;return t[64]!==P||t[65]!==L||t[66]!==Ee||t[67]!==xe||t[68]!==Ce?(ke=E.jsx(Fs,{interactRef:D,draggable:P,resizable:L,draggableOptions:Ee,resizableOptions:xe,children:Ce}),t[64]=P,t[65]=L,t[66]=Ee,t[67]=xe,t[68]=Ce,t[69]=ke):ke=t[69],ke});function Vs(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function Us(){return""}function $s(){let n=0,e,t="",r=arguments.length;for(;n<r;n++)(e=arguments[n])&&typeof e=="string"&&(t+=(t&&" ")+e);return t}const Hs=n=>{const e=ze.c(191),{editorData:t,row:r,action:s,effects:o,rowHeight:i,scale:c,scaleWidth:a,scaleSplitCount:u,startLeft:l,gridSnap:h,disableDrag:f,scaleCount:m,maxScaleCount:b,setScaleCount:v,onActionMoveStart:g,onActionMoving:S,onActionMoveEnd:_,onActionResizeStart:w,onActionResizeEnd:y,onActionResizing:C,dragLineData:x,setEditorData:R,onClickAction:W,onClickActionOnly:L,onDoubleClickAction:P,onContextMenuAction:M,getActionRender:H,handleTime:F,scrollContainerRef:q}=n,D=A.useRef(null),I=A.useRef(!1),{id:K,maxEnd:ue,minStart:fe,end:me,start:d,selected:T,flexible:V,movable:B,effectId:J}=s,Y=V===void 0?!0:V,U=B===void 0?!0:B,O=c??$t,N=a??Ht,$=l??Gt,Zt=u??Xn,rt=b??Number.MAX_SAFE_INTEGER,Fe=fe||0;let Ae;e[0]!==O||e[1]!==N||e[2]!==$||e[3]!==Fe?(Ae=je(Fe,{startLeft:$,scale:O,scaleWidth:N}),e[0]=O,e[1]=N,e[2]=$,e[3]=Fe,e[4]=Ae):Ae=e[4];const Re=Ae,Ve=ue||Number.MAX_VALUE;let Pe;e[5]!==O||e[6]!==N||e[7]!==$||e[8]!==Ve?(Pe=je(Ve,{startLeft:$,scale:O,scaleWidth:N}),e[5]=O,e[6]=N,e[7]=$,e[8]=Ve,e[9]=Pe):Pe=e[9];const De=Math.min(rt*N+$,Pe);let Oe;e[10]!==me||e[11]!==O||e[12]!==N||e[13]!==$||e[14]!==d?(Oe=dn({start:d,end:me},{startLeft:$,scale:O,scaleWidth:N}),e[10]=me,e[11]=O,e[12]=N,e[13]=$,e[14]=d,e[15]=Oe):Oe=e[15];const st=Oe,[ot,Ue]=A.useState(null),be=ot??st,$e=N/Zt;let Le;e[16]!==J||e[17]!==o||e[18]!==Y||e[19]!==U||e[20]!==T?(Le=de($s("action",U&&"action-movable",T&&"action-selected",Y&&"action-flexible",o[J]&&`action-effect-${J}`)),e[16]=J,e[17]=o,e[18]=Y,e[19]=U,e[20]=T,e[21]=Le):Le=e[21];const Ke=Le;let Me;e[22]!==N||e[23]!==$||e[24]!==m||e[25]!==v?(Me=(pe,ge)=>{const oe=kr(pe+ge,{startLeft:$,scaleCount:m,scaleWidth:N});oe!==m&&v(oe)},e[22]=N,e[23]=$,e[24]=m,e[25]=v,e[26]=Me):Me=e[26];const ye=Me;let Ne;e[27]!==s||e[28]!==g||e[29]!==r?(Ne=()=>{g&&g({action:s,row:r})},e[27]=s,e[28]=g,e[29]=r,e[30]=Ne):Ne=e[30];const qe=Ne;let Ie;e[31]!==s||e[32]!==ye||e[33]!==S||e[34]!==r||e[35]!==O||e[36]!==N||e[37]!==$?(Ie=pe=>{const{left:ge,width:oe}=pe;if(I.current=!0,S){const{start:le,end:ie}=At({left:ge,width:oe},{scaleWidth:N,scale:O,startLeft:$});if(S({action:s,row:r,start:le,end:ie})===!1)return!1}Ue({left:ge,width:oe}),ye(ge,oe)},e[31]=s,e[32]=ye,e[33]=S,e[34]=r,e[35]=O,e[36]=N,e[37]=$,e[38]=Ie):Ie=e[38];const Je=Ie;let Ee;e[39]!==t||e[40]!==K||e[41]!==_||e[42]!==r||e[43]!==O||e[44]!==N||e[45]!==$||e[46]!==R?(Ee=pe=>{const{left:ge,width:oe}=pe,{start:le,end:ie}=At({left:ge,width:oe},{scaleWidth:N,scale:O,startLeft:$}),ae=t.find(Ge=>Ge.id===r.id);if(!ae)return;const Xe=ae.actions.find(Ge=>Ge.id===K);Xe&&(Xe.start=le,Xe.end=ie,R(t),_&&_({action:Xe,row:r,start:le,end:ie}),Ue(null))},e[39]=t,e[40]=K,e[41]=_,e[42]=r,e[43]=O,e[44]=N,e[45]=$,e[46]=R,e[47]=Ee):Ee=e[47];const xe=Ee;let He;e[48]!==s||e[49]!==w||e[50]!==r?(He=pe=>{w&&w({action:s,row:r,dir:pe})},e[48]=s,e[49]=w,e[50]=r,e[51]=He):He=e[51];const Ce=He;let ke;e[52]!==s||e[53]!==ye||e[54]!==C||e[55]!==r||e[56]!==O||e[57]!==N||e[58]!==$?(ke=(pe,ge)=>{const{left:oe,width:le}=ge;if(I.current=!0,C){const{start:ie,end:ae}=At({left:oe,width:le},{scaleWidth:N,scale:O,startLeft:$});if(C({action:s,row:r,start:ie,end:ae,dir:pe})===!1)return!1}Ue({left:oe,width:le}),ye(oe,le)},e[52]=s,e[53]=ye,e[54]=C,e[55]=r,e[56]=O,e[57]=N,e[58]=$,e[59]=ke):ke=e[59];const k=ke;let Z;e[60]!==t||e[61]!==K||e[62]!==y||e[63]!==r||e[64]!==O||e[65]!==N||e[66]!==$||e[67]!==R?(Z=(pe,ge)=>{const{left:oe,width:le}=ge,{start:ie,end:ae}=At({left:oe,width:le},{scaleWidth:N,scale:O,startLeft:$}),Xe=t.find(Qt=>Qt.id===r.id);if(!Xe)return;const Ge=Xe.actions.find(Qt=>Qt.id===K);Ge&&(Ge.start=ie,Ge.end=ae,R(t),y&&y({action:Ge,row:r,start:ie,end:ae,dir:pe}),Ue(null))},e[60]=t,e[61]=K,e[62]=y,e[63]=r,e[64]=O,e[65]=N,e[66]=$,e[67]=R,e[68]=Z):Z=e[68];const X=Z;let z,ne,re,G,j,se,ee,Q,ce,_e,We,it,ct,at,lt,ut,Be,Ye,ft,dt,ht,mt,pt,gt,vt,bt;if(e[69]!==s||e[70]!==Ke||e[71]!==f||e[72]!==x.assistPositions||e[73]!==Y||e[74]!==H||e[75]!==$e||e[76]!==h||e[77]!==Je||e[78]!==xe||e[79]!==qe||e[80]!==X||e[81]!==Ce||e[82]!==k||e[83]!==F||e[84]!==Re||e[85]!==U||e[86]!==W||e[87]!==L||e[88]!==M||e[89]!==P||e[90]!==De||e[91]!==r||e[92]!==i||e[93]!==O||e[94]!==N||e[95]!==$||e[96]!==q||e[97]!==be.left||e[98]!==be.width){const pe={...s,...At({left:be.left,width:be.width},{startLeft:$,scaleWidth:N,scale:O})},ge={...r,actions:[...r.actions]};r.actions.includes(s)&&(ge.actions[r.actions.indexOf(s)]=pe),z=or,ce=D,_e=q,We=$,it=be.left,ct=be.width,at=h&&$e||cn,lt=h?Math.max(($e||cn)/2,an):an,ut=x.assistPositions,e[125]!==Re||e[126]!==De?(Be=()=>({left:Re,right:De}),e[125]=Re,e[126]=De,e[127]=Be):Be=e[127];let oe;e[128]!==f||e[129]!==Y?(oe=!f&&Y&&`.${de("action-left-stretch")}`,e[128]=f,e[129]=Y,e[130]=oe):oe=e[130];let le;e[131]!==f||e[132]!==Y?(le=!f&&Y&&`.${de("action-right-stretch")}`,e[131]=f,e[132]=Y,e[133]=le):le=e[133],e[134]!==oe||e[135]!==le?(Ye={left:oe,right:le},e[134]=oe,e[135]=le,e[136]=Ye):Ye=e[136],ft=!f&&U,dt=!f&&Y,ht=qe,mt=Je,pt=xe,gt=Ce,vt=k,bt=X,e[137]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>{I.current=!1},e[137]=ne):ne=e[137],e[138]!==s||e[139]!==F||e[140]!==W||e[141]!==L||e[142]!==r?(re=ie=>{let ae;W&&(ae=F(ie),W(ie,{row:r,action:s,time:ae})),!I.current&&L&&(ae===void 0&&(ae=F(ie)),L(ie,{row:r,action:s,time:ae}))},e[138]=s,e[139]=F,e[140]=W,e[141]=L,e[142]=r,e[143]=re):re=e[143],e[144]!==s||e[145]!==F||e[146]!==P||e[147]!==r?(G=ie=>{if(P){const ae=F(ie);P(ie,{row:r,action:s,time:ae})}},e[144]=s,e[145]=F,e[146]=P,e[147]=r,e[148]=G):G=e[148],e[149]!==s||e[150]!==F||e[151]!==M||e[152]!==r?(j=ie=>{if(M){const ae=F(ie);M(ie,{row:r,action:s,time:ae})}},e[149]=s,e[150]=F,e[151]=M,e[152]=r,e[153]=j):j=e[153],se=Ke,e[154]!==i?(ee={height:i},e[154]=i,e[155]=ee):ee=e[155],Q=H&&H(pe,ge),e[69]=s,e[70]=Ke,e[71]=f,e[72]=x.assistPositions,e[73]=Y,e[74]=H,e[75]=$e,e[76]=h,e[77]=Je,e[78]=xe,e[79]=qe,e[80]=X,e[81]=Ce,e[82]=k,e[83]=F,e[84]=Re,e[85]=U,e[86]=W,e[87]=L,e[88]=M,e[89]=P,e[90]=De,e[91]=r,e[92]=i,e[93]=O,e[94]=N,e[95]=$,e[96]=q,e[97]=be.left,e[98]=be.width,e[99]=z,e[100]=ne,e[101]=re,e[102]=G,e[103]=j,e[104]=se,e[105]=ee,e[106]=Q,e[107]=ce,e[108]=_e,e[109]=We,e[110]=it,e[111]=ct,e[112]=at,e[113]=lt,e[114]=ut,e[115]=Be,e[116]=Ye,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 z=e[99],ne=e[100],re=e[101],G=e[102],j=e[103],se=e[104],ee=e[105],Q=e[106],ce=e[107],_e=e[108],We=e[109],it=e[110],ct=e[111],at=e[112],lt=e[113],ut=e[114],Be=e[115],Ye=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]!==Y?(_t=Y&&E.jsx("div",{className:de("action-left-stretch"),style:{touchAction:"none"}}),e[156]=Y,e[157]=_t):_t=e[157];let wt;e[158]!==Y?(wt=Y&&E.jsx("div",{className:de("action-right-stretch"),style:{touchAction:"none"}}),e[158]=Y,e[159]=wt):wt=e[159];let St;e[160]!==ne||e[161]!==re||e[162]!==G||e[163]!==j||e[164]!==se||e[165]!==ee||e[166]!==Q||e[167]!==_t||e[168]!==wt?(St=E.jsxs("div",{onMouseDown:ne,onClick:re,onDoubleClick:G,onContextMenu:j,className:se,style:ee,children:[Q,_t,wt]}),e[160]=ne,e[161]=re,e[162]=G,e[163]=j,e[164]=se,e[165]=ee,e[166]=Q,e[167]=_t,e[168]=wt,e[169]=St):St=e[169];let Mt;return e[170]!==z||e[171]!==ce||e[172]!==_e||e[173]!==We||e[174]!==it||e[175]!==ct||e[176]!==at||e[177]!==lt||e[178]!==ut||e[179]!==Be||e[180]!==Ye||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]!==St?(Mt=E.jsx(z,{ref:ce,parentRef:_e,start:We,left:it,width:ct,grid:at,adsorptionDistance:lt,adsorptionPositions:ut,getBounds:Be,edges:Ye,enableDragging:ft,enableResizing:dt,onDragStart:ht,onDrag:mt,onDragEnd:pt,onResizeStart:gt,onResize:vt,onResizeEnd:bt,children:St}),e[170]=z,e[171]=ce,e[172]=_e,e[173]=We,e[174]=it,e[175]=ct,e[176]=at,e[177]=lt,e[178]=ut,e[179]=Be,e[180]=Ye,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]=St,e[190]=Mt):Mt=e[190],Mt};function Et(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((b,v)=>r[v]!==b)))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 b=Math.round((Date.now()-l)*100)/100,v=Math.round((Date.now()-m)*100)/100,g=v/16,S=(_,w)=>{for(_=String(_);_.length<w;)_=" "+_;return _};console.info(`%c⏱ ${S(v,5)} /${S(b,5)} ms`,`
10
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t.useMemoCache(e)}})()),nn}var Cn;function Vr(){return Cn||(Cn=1,process.env.NODE_ENV==="production"?It.exports=zr():It.exports=Fr()),It.exports}var ze=Vr();function Ur(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 Ur(`${cn}-`,...n)}const $r=n=>{const e=ze.c(11),{isMoving:t,movePositions:r,assistPositions:s}=n;let o,i;if(e[0]!==t||e[1]!==r||e[2]!==s){const l=r===void 0?[]:r;let u;e[5]!==s?(u=s===void 0?[]:s,e[5]=s,e[6]=u):u=e[6];const a=u;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=de("drag-line-container"),e[7]=o):o=e[7],i=t&&l.filter(h=>a.includes(h)).map(Hr),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=R.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c};function Hr(n,e){return R.jsx("div",{className:de("drag-line"),style:{left:n}},e)}const kt=1,Tn=10,An=10;function Br(n){const e=ze.c(7),t=T.useRef(Number.MIN_SAFE_INTEGER),r=T.useRef(Number.MAX_SAFE_INTEGER),s=T.useRef(kt),o=T.useRef(void 0);let i;e[0]!==n?(i=()=>{if(n?.current){const{left:b,width:v}=n.current.getBoundingClientRect();t.current=b,r.current=b+v}},e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=(b,v)=>{if(b.clientX>=r.current||b.clientX<=t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const w=Math.abs(b.clientX>=r.current?b.clientX-r.current:b.clientX-t.current);s.current=Math.min(Number((w/An).toFixed(0))*kt,Tn);const S=(b.clientX>=r.current?1:-1)*s.current,y=()=>{v&&v(S),o.current=requestAnimationFrame(y)};return o.current=requestAnimationFrame(y),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[2]=l):l=e[2];const u=l;let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=(b,v,w)=>{if(b.clientX>=r.current||b.clientX<t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const _=Math.abs(b.clientX>=r.current?b.clientX-r.current:b.clientX-t.current);s.current=Math.min(Number((_/An).toFixed(0))*kt,Tn);const y=(b.clientX>=r.current?1:-1)*s.current,P=()=>{w&&w(y),o.current=requestAnimationFrame(P)};return o.current=requestAnimationFrame(P),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[3]=a):a=e[3];const h=a;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{t.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=kt,o.current!==void 0&&cancelAnimationFrame(o.current)},e[4]=f):f=e[4];const m=f;let g;return e[5]!==c?(g={initAutoScroll:c,dealDragAutoScroll:u,dealResizeAutoScroll:h,stopAutoScroll:m},e[5]=c,e[6]=g):g=e[6],g}function Yr(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 Pn(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function Dn(n,e,t,r=.15){return r===0?Yr(n,e,t):n<e?-Pn(e-n,t-e,r)+e:n>t?+Pn(n-t,t-e,r)+t:n}function Xr(n,[e,t],[r,s]){const[[o,i],[c,l]]=n;return[Dn(e,o,i,r),Dn(t,c,l,s)]}function Gr(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 Kr(n){var e=Gr(n,"string");return typeof e=="symbol"?e:String(e)}function ve(n,e,t){return e=Kr(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function On(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?On(Object(t),!0).forEach(function(r){ve(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):On(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const Qn={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 Ln(n){return n?n[0].toUpperCase()+n.slice(1):""}const qr=["enter","leave"];function Jr(n=!1,e){return n&&!qr.includes(e)}function Zr(n,e="",t=!1){const r=Qn[n],s=r&&r[e]||e;return"on"+Ln(n)+Ln(s)+(Jr(t,s)?"Capture":"")}const Qr=["gotpointercapture","lostpointercapture"];function es(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=Qr.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function ts(n,e=""){const t=Qn[n],r=t&&t[e]||e;return n+r}function Kt(n){return"touches"in n}function er(n){return Kt(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function ns(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 rs(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function tr(n){return Kt(n)?rs(n)[0]:n}function ss(n){return ns(n).map(e=>e.identifier)}function rn(n){const e=tr(n);return Kt(n)?e.identifier:e.pointerId}function Mn(n){const e=tr(n);return[e.clientX,e.clientY]}function os(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 Bt(n,...e){return typeof n=="function"?n(...e):n}function is(){}function cs(...n){return n.length===0?is:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function Nn(n,e){return Object.assign({},e,n||{})}const as=32;class ls{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?Bt(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,os(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 x=t._delta.map(Math.abs);he.addTo(t._distance,x)}this.axisIntent&&this.axisIntent(e);const[i,c]=t._movement,[l,u]=r.threshold,{_step:a,values:h}=t;if(r.hasCustomTransform?(a[0]===!1&&(a[0]=Math.abs(i)>=l&&h[0]),a[1]===!1&&(a[1]=Math.abs(c)>=u&&h[1])):(a[0]===!1&&(a[0]=Math.abs(i)>=l&&Math.sign(i)*l),a[1]===!1&&(a[1]=Math.abs(c)>=u&&Math.sign(c)*u)),t.intentional=a[0]!==!1||a[1]!==!1,!t.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[x,C]=h;f[0]=a[0]!==!1?x-a[0]:0,f[1]=a[1]!==!1?C-a[1]:0}else f[0]=a[0]!==!1?i-a[0]:0,f[1]=a[1]!==!1?c-a[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);const m=t.offset,g=t._active&&!t._blocked||t.active;g&&(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=Bt(r.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));const[b,v]=t.offset,[[w,_],[S,y]]=t._bounds;t.overflow=[b<w?-1:b>_?1:0,v<S?-1:v>y?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=Xr(t._bounds,t.offset,P),t.delta=he.sub(t.offset,m),this.computeMovement(),g&&(!t.last||o>as)){t.delta=he.sub(t.offset,m);const x=t.delta.map(Math.abs);he.addTo(t.distance,x),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[x[0]/o,x[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 us([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 fs extends ls{constructor(...e){super(...e),ve(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[er(e)]:r.axisThreshold;t.axis=us(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 In=n=>n,kn=.15,mn={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[kn,kn];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||In;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||In},threshold(n){return he.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(mn,{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 ds=0,Pt=te(te({},mn),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=ds){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]]}}),Wn={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 hs extends fs{constructor(...e){super(...e),ve(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=rn(e),r._pointerActive=!0,this.computeValues(Mn(e)),this.computeInitial(),t.preventScrollAxis&&er(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=rn(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const o=Mn(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=rn(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,l]=t._delta,[u,a]=t._movement,[h,f]=r.swipe.velocity,[m,g]=r.swipe.distance,b=r.swipe.duration;if(t.elapsedTime<b){const v=Math.abs(c/t.timeDelta),w=Math.abs(l/t.timeDelta);v>h&&Math.abs(u)>m&&(t.swipe[0]=Math.sign(c)),w>f&&Math.abs(a)>g&&(t.swipe[1]=Math.sign(l))}}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,ms(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=Wn[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 Wn&&(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 ms(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Dt=typeof window<"u"&&window.document&&window.document.createElement;function nr(){return Dt&&"ontouchstart"in window}function ps(){return nr()||Dt&&window.navigator.maxTouchPoints>1}function gs(){return Dt&&"onpointerdown"in window}function vs(){return Dt&&"exitPointerLock"in window.document}function bs(){try{return"constructor"in GestureEvent}catch{return!1}}const we={isBrowser:Dt,gesture:bs(),touch:nr(),touchscreen:ps(),pointer:gs(),pointerLock:vs()},_s=250,ws=180,Ss=.5,ys=50,Es=250,Rs=10,jn={mouse:0,touch:0,pen:8},rr=te(te({},Pt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&we.pointerLock,we.touch&&t?"touch":this.pointerLock?"mouse":we.pointer&&!s?"pointer":we.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?_s:void 0,!(!we.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=ys,duration:t=Es}={}){return{velocity:this.transform(he.toVector(n)),distance:this.transform(he.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return ws;case!1:return 0;default:return n}},axisThreshold(n){return n?te(te({},jn),n):jn},keyboardDisplacement(n=Rs){return n}});process.env.NODE_ENV==="development"&&Object.assign(rr,{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({},mn),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!we.touch&&we.gesture)return"gesture";if(we.touch&&r)return"touch";if(we.touchscreen){if(we.pointer)return"pointer";if(we.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=i=>{const c=Nn(Bt(t,i),{min:-1/0,max:1/0});return[c.min,c.max]},o=i=>{const c=Nn(Bt(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 sr=new Map,fn=new Map;function xs(n){sr.set(n.key,n.engine),fn.set(n.key,n.resolver)}const Cs={key:"drag",engine:hs,resolver:rr};function Ts(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 As(n,e){if(n==null)return{};var t=Ts(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 Ps={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=we.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},Ds=["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 Os(n,e,t={}){const r=n,{target:s,eventOptions:o,window:i,enabled:c,transform:l}=r,u=As(r,Ds);if(t.shared=zt({target:s,eventOptions:o,window:i,enabled:c,transform:l},Ps),e){const a=fn.get(e);t[e]=zt(te({shared:t.shared},u),a)}else for(const a in u){const h=fn.get(a);if(h)t[a]=zt(te({shared:t.shared},u[a]),h);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(a)){if(a==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${a}\` was used. Please read the documentation for further information.`)}}return t}class or{constructor(e,t){ve(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,o){const i=this._listeners,c=ts(t,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=te(te({},l),o);e.addEventListener(c,s,u);const a=()=>{e.removeEventListener(c,s,u),i.delete(a)};return i.add(a),a}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Ls{constructor(){ve(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 Ms{constructor(e){ve(this,"gestures",new Set),ve(this,"_targetEventStore",new or(this)),ve(this,"gestureEventStores",{}),ve(this,"gestureTimeoutStores",{}),ve(this,"handlers",{}),ve(this,"config",{}),ve(this,"pointerIds",new Set),ve(this,"touchIds",new Set),ve(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Ns(this,e)}setEventIds(e){if(Kt(e))return this.touchIds=new Set(ss(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=Os(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],l=zn(r,c.eventOptions,!!s);if(c.enabled){const u=sr.get(i);new u(this,e,i).bind(l)}}const o=zn(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]=cs(...r[o]);if(!s)return r;for(const o in r){const{device:i,capture:c,passive:l}=es(o);this._targetEventStore.add(s,i,"",r[o],{capture:c,passive:l})}}}}function yt(n,e){n.gestures.add(e),n.gestureEventStores[e]=new or(n,e),n.gestureTimeoutStores[e]=new Ls}function Ns(n,e){e.drag&&yt(n,"drag"),e.wheel&&yt(n,"wheel"),e.scroll&&yt(n,"scroll"),e.move&&yt(n,"move"),e.pinch&&yt(n,"pinch"),e.hover&&yt(n,"hover")}const zn=(n,e,t)=>(r,s,o,i={},c=!1)=>{var l,u;const a=(l=i.capture)!==null&&l!==void 0?l:e.capture,h=(u=i.passive)!==null&&u!==void 0?u:e.passive;let f=c?r:Zr(r,s,a);t&&h&&(f+="Passive"),n[f]=n[f]||[],n[f].push(o)};function Is(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 ks(n){var e=Is(n,"string");return typeof e=="symbol"?e:String(e)}function Ws(n,e,t){return e=ks(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Fn(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 Wt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fn(Object(t),!0).forEach(function(r){Ws(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class js{constructor(e,t,r,s,o){this._target=e,this._gestureKey=s,this._ctrl=new Ms(t),this._ctrl.applyHandlers(t,o),this._ctrl.applyConfig(Wt(Wt({},r),{},{target:e}),s),this._ctrl.effect()}destroy(){this._ctrl.clean()}setConfig(e){this._ctrl.clean(),this._ctrl.applyConfig(Wt(Wt({},e),{},{target:this._target}),this._gestureKey),this._ctrl.effect()}}const sn=function(e,t,r){return xs(Cs),new js(e,{drag:t},r||{},"drag")};function zs(...n){const e=n.filter(Boolean);return e.length<=1?e[0]||null:function(r){for(const s of e)typeof s=="function"?s(r):s&&(s.current=r)}}const ir=({children:n,...e})=>{const t=T.Children.only(n),r=Fs(t),s=t.props||{},o=s.style||{},i={...e,...s,style:{...e.style??{},...o},ref:zs(r,e.ref)};return T.cloneElement(t,i)};function Fs(n){let e=Object.getOwnPropertyDescriptor(n,"ref")?.get;return e&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref}const on=(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}}),Vs=(n,e,t)=>n?n===e||n===t||(e?.contains(n)??!1)||(t?.contains(n)??!1):!1,Us=({children:n,interactRef:e,draggable:t,resizable:r,draggableOptions:s,resizableOptions:o})=>{const i=T.useRef(null),c=T.useRef(void 0),l=T.useRef(void 0),u=T.useRef(void 0),a=T.useRef(void 0),h=T.useRef(void 0),f=T.useRef(null),m=T.useRef(null),g=T.useRef(void 0),b=T.useRef(void 0);T.useEffect(()=>{c.current=s,l.current=o},[s,o]);const v=T.useEffectEvent(()=>{const w=i.current;if(!w)return;u.current?.destroy(),a.current?.destroy(),h.current?.destroy(),u.current=void 0,a.current=void 0,h.current=void 0;const _=l.current?.edges?.left,S=l.current?.edges?.right;_!==g.current&&(g.current=_,f.current=_?w.querySelector(_):null),S!==b.current&&(b.current=S,m.current=S?w.querySelector(S):null),t&&c.current&&(u.current=new sn(w,P=>{const{active:x,delta:C,xy:D,event:E,first:O,last:L}=P;if(Vs(E?.target,f.current,m.current))return;const W=on(w,C,D);O?c.current?.onstart?.(W):L?c.current?.onend?.(W):x&&c.current?.onmove?.(W)},{axis:c.current?.lockAxis==="x"?"x":void 0,threshold:0,pointer:{capture:!0}}));const y=l.current;if(r&&y?.edges){const P=y.edges;P.left&&f.current&&(a.current=new sn(f.current,x=>{const{active:C,delta:D,xy:E,first:O,last:L}=x,W=on(w,D,E,{left:!0},{left:D[0]});O?y.onstart?.(W):L?y.onend?.(W):C&&y.onmove?.(W)},{pointer:{capture:!0},threshold:0})),P.right&&m.current&&(h.current=new sn(m.current,x=>{const{active:C,delta:D,xy:E,first:O,last:L}=x,W=on(w,D,E,{right:!0},{right:D[0]});O?y.onstart?.(W):L?y.onend?.(W):C&&y.onmove?.(W)},{pointer:{capture:!0},threshold:0}))}});return T.useEffect(()=>{if(!i.current)return;const w={target:i.current,unset:()=>{u.current?.destroy(),a.current?.destroy(),h.current?.destroy()}};e&&(e.current=w),v()},[t,r]),ir({children:n,ref:i,draggable:!1,style:{...t&&{touchAction:"none"}}})},cr=T.forwardRef((n,e)=>{const t=ze.c(70),{children:r,edges:s,left:o,width:i,start:c,grid:l,getBounds:u,enableResizing:a,enableDragging:h,adsorptionDistance:f,adsorptionPositions:m,onResizeStart:g,onResize:b,onResizeEnd:v,onDragStart:w,onDragEnd:_,onDrag:S,parentRef:y,autoScroll:P}=n,x=c===void 0?Gt:c,C=l===void 0?an:l,D=u===void 0?$s:u,E=a===void 0?!0:a,O=h===void 0?!0:h,L=f===void 0?ln:f;let W;t[0]!==m?(W=m===void 0?[]:m,t[0]=m,t[1]=W):W=t[1];const V=W,q=P===void 0?!0:P,M=T.useRef(void 0),k=T.useRef(0),K=T.useRef(!1),{initAutoScroll:ue,stopAutoScroll:fe,dealDragAutoScroll:me,dealResizeAutoScroll:d}=Br(y);let A,U;t[2]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{const j=M.current;return()=>{j?.unset()}},U=[],t[2]=A,t[3]=U):(A=t[2],U=t[3]),T.useEffect(A,U);let B;t[4]===Symbol.for("react.memo_cache_sentinel")?(B=(j,Z)=>{const X=Z===void 0?!0:Z;if(!M.current||!M.current.target)return;X&&(k.current=0);const F=M.current.target;F.style.left=`${j}px`,Object.assign(F.dataset,{left:j})},t[4]=B):B=t[4];const J=B;let Y;t[5]===Symbol.for("react.memo_cache_sentinel")?(Y=(j,Z)=>{const X=Z===void 0?!0:Z;if(!M.current||!M.current.target)return;X&&(k.current=0);const F=M.current.target;F.style.width=`${j}px`,Object.assign(F.dataset,{width:j})},t[5]=Y):Y=t[5];const $=Y;let N;t[6]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{if(!M.current?.target)return 0;const j=M.current.target;return parseFloat(j?.dataset?.left||"0")},t[6]=N):N=t[6];const I=N;let H;t[7]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{if(!M.current?.target)return 0;const j=M.current.target;return parseFloat(j?.dataset?.width||"0")},t[7]=H):H=t[7];const Zt=H;let rt,Fe;t[8]!==i?(rt=()=>{if(!M.current?.target)return;const j=M.current.target;$(typeof i>"u"?j.offsetWidth:i,!1)},Fe=[i],t[8]=i,t[9]=rt,t[10]=Fe):(rt=t[9],Fe=t[10]),T.useEffect(rt,Fe);let Ae,Re;t[11]!==o?(Ae=()=>{J(o||0,!1)},Re=[o],t[11]=o,t[12]=Ae,t[13]=Re):(Ae=t[12],Re=t[13]),T.useEffect(Ae,Re);let Ve;t[14]===Symbol.for("react.memo_cache_sentinel")?(Ve=()=>({updateLeft:j=>J(j||0,!1),updateWidth:j=>$(j,!1),getLeft:I,getWidth:Zt}),t[14]=Ve):Ve=t[14],T.useImperativeHandle(e,Ve);let Pe;t[15]!==ue||t[16]!==w?(Pe=()=>{k.current=0,K.current=!1,ue(),w&&w()},t[15]=ue,t[16]=w,t[17]=Pe):Pe=t[17];const De=Pe;let Oe;t[18]!==L||t[19]!==V||t[20]!==D||t[21]!==C||t[22]!==S||t[23]!==x?(Oe=j=>{const{preLeft:Z,preWidth:X,scrollDelta:F}=j;F&&(k.current=k.current+F);const ne=K.current?L:C;if(Math.abs(k.current)>=ne){const re=parseInt(k.current/ne+"");let G=Z+re*ne,z=G;const se=Number.MAX_SAFE_INTEGER;if(V.forEach(ee=>{const Q=Math.abs(ee-G);Q<L&&Q<se&&(z=ee);const ce=Math.abs(ee-(G+X));ce<L&&ce<se&&(z=ee-X)}),z!==G?(K.current=!0,G=z):((G-x)%C!==0&&(G=x+C*Math.round((G-x)/C)),K.current=!1),k.current=k.current%ne,G<D().left?G=D().left:G+X>D().right&&(G=D().right-X),S&&S({lastLeft:Z,left:G,lastWidth:X,width:X},F)===!1)return;J(G,!1)}},t[18]=L,t[19]=V,t[20]=D,t[21]=C,t[22]=S,t[23]=x,t[24]=Oe):Oe=t[24];const st=Oe;let ot;t[25]!==q||t[26]!==me||t[27]!==st||t[28]!==y?(ot=j=>{const Z=j.target,{left:X,width:F}=Z.dataset,ne=parseFloat(X||"0"),re=parseFloat(F||"0");k.current=k.current+j.dx,!(q&&y?.current&&!me(j,se=>{if(!y?.current||!M.current?.target)return;y.current.scrollLeft=y.current.scrollLeft+se;const ee=M.current.target,Q=parseFloat(ee.dataset.left||"0"),ce=parseFloat(ee.dataset.width||"0");st({preLeft:Q,preWidth:ce,scrollDelta:se})}))&&st({preLeft:ne,preWidth:re})},t[25]=q,t[26]=me,t[27]=st,t[28]=y,t[29]=ot):ot=t[29];const Ue=ot;let be;t[30]!==_||t[31]!==fe?(be=j=>{k.current=0,K.current=!1,fe();const Z=j.target,{left:X,width:F}=Z.dataset;_&&_({left:parseFloat(X||"0"),width:parseFloat(F||"0")})},t[30]=_,t[31]=fe,t[32]=be):be=t[32];const $e=be;let Le;t[33]!==ue||t[34]!==g?(Le=j=>{k.current=0,K.current=!1,ue();const Z=j.edges?.right?"right":"left";g&&g(Z)},t[33]=ue,t[34]=g,t[35]=Le):Le=t[35];const Ke=Le;let Me;t[36]!==L||t[37]!==V||t[38]!==D||t[39]!==C||t[40]!==b||t[41]!==x?(Me=j=>{const{dir:Z,preWidth:X,preLeft:F,scrollDelta:ne}=j;ne&&(k.current=k.current+ne);const re=K.current?L:C;if(Z==="left"){if(Math.abs(k.current)>=re){const G=parseInt(k.current/re+"");let z=F+G*re,se=z;const ee=Number.MAX_SAFE_INTEGER;V.forEach(_e=>{const We=Math.abs(_e-z);We<L&&We<ee&&(se=_e)}),se!==z?(K.current=!0,z=se):((z-x)%C!==0&&(z=x+C*Math.round((z-x)/C)),K.current=!1),k.current=k.current%re;const Q=F+X;z<D().left&&(z=D().left);const ce=Q-z;if(z>=Q||b&&b("left",{lastLeft:F,lastWidth:X,left:z,width:ce})===!1)return;J(z,!1),$(ce,!1)}}else if(Z==="right"&&Math.abs(k.current)>=re){const G=parseInt(k.current/C+"");let z=X+G*C,se=F+z;const ee=Number.MAX_SAFE_INTEGER;if(V.forEach(Q=>{const ce=Math.abs(Q-(F+z));ce<L&&ce<ee&&(se=Q)}),se!==F+z)K.current=!0,z=se-F;else{let Q=F+z;(Q-x)%C!==0&&(Q=x+C*Math.round((Q-x)/C),z=Q-F),K.current=!1}if(k.current=k.current%re,F+z>D().right&&(z=D().right-F),z<=0||b&&b("right",{lastLeft:F,lastWidth:X,left:F,width:z})===!1)return;$(z,!1)}},t[36]=L,t[37]=V,t[38]=D,t[39]=C,t[40]=b,t[41]=x,t[42]=Me):Me=t[42];const ye=Me;let Ne;t[43]!==q||t[44]!==d||t[45]!==y||t[46]!==ye?(Ne=j=>{const Z=j.target,X=j.edges?.left?"left":"right",{left:F,width:ne}=Z.dataset,re=parseFloat(F||"0"),G=parseFloat(ne||"0");k.current=k.current+(X==="left"?j.deltaRect?.left||0:j.deltaRect?.right||0),!(q&&y?.current&&!d(j,X,ee=>{if(!y?.current||!M.current?.target)return;y.current.scrollLeft=y.current.scrollLeft+ee;const Q=M.current.target,ce=parseFloat(Q.dataset.left||"0"),_e=parseFloat(Q.dataset.width||"0");ye({preLeft:ce,preWidth:_e,dir:X,scrollDelta:ee})}))&&ye({preLeft:re,preWidth:G,dir:X})},t[43]=q,t[44]=d,t[45]=y,t[46]=ye,t[47]=Ne):Ne=t[47];const qe=Ne;let Ie;t[48]!==v||t[49]!==fe?(Ie=j=>{k.current=0,K.current=!1,fe();const Z=j.target,{left:X,width:F}=Z.dataset,ne=j.edges?.right?"right":"left";v&&v(ne,{left:parseFloat(X||"0"),width:parseFloat(F||"0")})},t[48]=v,t[49]=fe,t[50]=Ie):Ie=t[50];const Je=Ie;let Ee;t[51]!==Ue||t[52]!==De||t[53]!==$e?(Ee={lockAxis:"x",onmove:Ue,onstart:De,onend:$e,cursorChecker:Hs},t[51]=Ue,t[52]=De,t[53]=$e,t[54]=Ee):Ee=t[54];let xe;t[55]!==s||t[56]!==qe||t[57]!==Ke||t[58]!==Je?(xe={axis:"x",invert:"none",edges:s,onmove:qe,onstart:Ke,onend:Je},t[55]=s,t[56]=qe,t[57]=Ke,t[58]=Je,t[59]=xe):xe=t[59];const He=r;let Ce;t[60]!==o||t[61]!==He||t[62]!==i?(Ce=ir({children:He,style:{left:o,width:i}}),t[60]=o,t[61]=He,t[62]=i,t[63]=Ce):Ce=t[63];let ke;return t[64]!==O||t[65]!==E||t[66]!==Ee||t[67]!==xe||t[68]!==Ce?(ke=R.jsx(Us,{interactRef:M,draggable:O,resizable:E,draggableOptions:Ee,resizableOptions:xe,children:Ce}),t[64]=O,t[65]=E,t[66]=Ee,t[67]=xe,t[68]=Ce,t[69]=ke):ke=t[69],ke});function $s(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function Hs(){return""}function Bs(){let n=0,e,t="",r=arguments.length;for(;n<r;n++)(e=arguments[n])&&typeof e=="string"&&(t+=(t&&" ")+e);return t}const Ys=n=>{const e=ze.c(191),{editorData:t,row:r,action:s,effects:o,rowHeight:i,scale:c,scaleWidth:l,scaleSplitCount:u,startLeft:a,gridSnap:h,disableDrag:f,scaleCount:m,maxScaleCount:g,setScaleCount:b,onActionMoveStart:v,onActionMoving:w,onActionMoveEnd:_,onActionResizeStart:S,onActionResizeEnd:y,onActionResizing:P,dragLineData:x,setEditorData:C,onClickAction:D,onClickActionOnly:E,onDoubleClickAction:O,onContextMenuAction:L,getActionRender:W,handleTime:V,scrollContainerRef:q}=n,M=T.useRef(null),k=T.useRef(!1),{id:K,maxEnd:ue,minStart:fe,end:me,start:d,selected:A,flexible:U,movable:B,effectId:J}=s,Y=U===void 0?!0:U,$=B===void 0?!0:B,N=c??$t,I=l??Ht,H=a??Gt,Zt=u??Kn,rt=g??Number.MAX_SAFE_INTEGER,Fe=fe||0;let Ae;e[0]!==N||e[1]!==I||e[2]!==H||e[3]!==Fe?(Ae=je(Fe,{startLeft:H,scale:N,scaleWidth:I}),e[0]=N,e[1]=I,e[2]=H,e[3]=Fe,e[4]=Ae):Ae=e[4];const Re=Ae,Ve=ue||Number.MAX_VALUE;let Pe;e[5]!==N||e[6]!==I||e[7]!==H||e[8]!==Ve?(Pe=je(Ve,{startLeft:H,scale:N,scaleWidth:I}),e[5]=N,e[6]=I,e[7]=H,e[8]=Ve,e[9]=Pe):Pe=e[9];const De=Math.min(rt*I+H,Pe);let Oe;e[10]!==me||e[11]!==N||e[12]!==I||e[13]!==H||e[14]!==d?(Oe=hn({start:d,end:me},{startLeft:H,scale:N,scaleWidth:I}),e[10]=me,e[11]=N,e[12]=I,e[13]=H,e[14]=d,e[15]=Oe):Oe=e[15];const st=Oe,[ot,Ue]=T.useState(null),be=ot??st,$e=I/Zt;let Le;e[16]!==J||e[17]!==o||e[18]!==Y||e[19]!==$||e[20]!==A?(Le=de(Bs("action",$&&"action-movable",A&&"action-selected",Y&&"action-flexible",o[J]&&`action-effect-${J}`)),e[16]=J,e[17]=o,e[18]=Y,e[19]=$,e[20]=A,e[21]=Le):Le=e[21];const Ke=Le;let Me;e[22]!==I||e[23]!==H||e[24]!==m||e[25]!==b?(Me=(pe,ge)=>{const oe=Wr(pe+ge,{startLeft:H,scaleCount:m,scaleWidth:I});oe!==m&&b(oe)},e[22]=I,e[23]=H,e[24]=m,e[25]=b,e[26]=Me):Me=e[26];const ye=Me;let Ne;e[27]!==s||e[28]!==v||e[29]!==r?(Ne=()=>{v&&v({action:s,row:r})},e[27]=s,e[28]=v,e[29]=r,e[30]=Ne):Ne=e[30];const qe=Ne;let Ie;e[31]!==s||e[32]!==ye||e[33]!==w||e[34]!==r||e[35]!==N||e[36]!==I||e[37]!==H?(Ie=pe=>{const{left:ge,width:oe}=pe;if(k.current=!0,w){const{start:le,end:ie}=At({left:ge,width:oe},{scaleWidth:I,scale:N,startLeft:H});if(w({action:s,row:r,start:le,end:ie})===!1)return!1}Ue({left:ge,width:oe}),ye(ge,oe)},e[31]=s,e[32]=ye,e[33]=w,e[34]=r,e[35]=N,e[36]=I,e[37]=H,e[38]=Ie):Ie=e[38];const Je=Ie;let Ee;e[39]!==t||e[40]!==K||e[41]!==_||e[42]!==r||e[43]!==N||e[44]!==I||e[45]!==H||e[46]!==C?(Ee=pe=>{const{left:ge,width:oe}=pe,{start:le,end:ie}=At({left:ge,width:oe},{scaleWidth:I,scale:N,startLeft:H}),ae=t.find(Ge=>Ge.id===r.id);if(!ae)return;const Xe=ae.actions.find(Ge=>Ge.id===K);Xe&&(Xe.start=le,Xe.end=ie,C(t),_&&_({action:Xe,row:r,start:le,end:ie}),Ue(null))},e[39]=t,e[40]=K,e[41]=_,e[42]=r,e[43]=N,e[44]=I,e[45]=H,e[46]=C,e[47]=Ee):Ee=e[47];const xe=Ee;let He;e[48]!==s||e[49]!==S||e[50]!==r?(He=pe=>{S&&S({action:s,row:r,dir:pe})},e[48]=s,e[49]=S,e[50]=r,e[51]=He):He=e[51];const Ce=He;let ke;e[52]!==s||e[53]!==ye||e[54]!==P||e[55]!==r||e[56]!==N||e[57]!==I||e[58]!==H?(ke=(pe,ge)=>{const{left:oe,width:le}=ge;if(k.current=!0,P){const{start:ie,end:ae}=At({left:oe,width:le},{scaleWidth:I,scale:N,startLeft:H});if(P({action:s,row:r,start:ie,end:ae,dir:pe})===!1)return!1}Ue({left:oe,width:le}),ye(oe,le)},e[52]=s,e[53]=ye,e[54]=P,e[55]=r,e[56]=N,e[57]=I,e[58]=H,e[59]=ke):ke=e[59];const j=ke;let Z;e[60]!==t||e[61]!==K||e[62]!==y||e[63]!==r||e[64]!==N||e[65]!==I||e[66]!==H||e[67]!==C?(Z=(pe,ge)=>{const{left:oe,width:le}=ge,{start:ie,end:ae}=At({left:oe,width:le},{scaleWidth:I,scale:N,startLeft:H}),Xe=t.find(Qt=>Qt.id===r.id);if(!Xe)return;const Ge=Xe.actions.find(Qt=>Qt.id===K);Ge&&(Ge.start=ie,Ge.end=ae,C(t),y&&y({action:Ge,row:r,start:ie,end:ae,dir:pe}),Ue(null))},e[60]=t,e[61]=K,e[62]=y,e[63]=r,e[64]=N,e[65]=I,e[66]=H,e[67]=C,e[68]=Z):Z=e[68];const X=Z;let F,ne,re,G,z,se,ee,Q,ce,_e,We,it,ct,at,lt,ut,Be,Ye,ft,dt,ht,mt,pt,gt,vt,bt;if(e[69]!==s||e[70]!==Ke||e[71]!==f||e[72]!==x.assistPositions||e[73]!==Y||e[74]!==W||e[75]!==$e||e[76]!==h||e[77]!==Je||e[78]!==xe||e[79]!==qe||e[80]!==X||e[81]!==Ce||e[82]!==j||e[83]!==V||e[84]!==Re||e[85]!==$||e[86]!==D||e[87]!==E||e[88]!==L||e[89]!==O||e[90]!==De||e[91]!==r||e[92]!==i||e[93]!==N||e[94]!==I||e[95]!==H||e[96]!==q||e[97]!==be.left||e[98]!==be.width){const pe={...s,...At({left:be.left,width:be.width},{startLeft:H,scaleWidth:I,scale:N})},ge={...r,actions:[...r.actions]};r.actions.includes(s)&&(ge.actions[r.actions.indexOf(s)]=pe),F=cr,ce=M,_e=q,We=H,it=be.left,ct=be.width,at=h&&$e||an,lt=h?Math.max(($e||an)/2,ln):ln,ut=x.assistPositions,e[125]!==Re||e[126]!==De?(Be=()=>({left:Re,right:De}),e[125]=Re,e[126]=De,e[127]=Be):Be=e[127];let oe;e[128]!==f||e[129]!==Y?(oe=!f&&Y&&`.${de("action-left-stretch")}`,e[128]=f,e[129]=Y,e[130]=oe):oe=e[130];let le;e[131]!==f||e[132]!==Y?(le=!f&&Y&&`.${de("action-right-stretch")}`,e[131]=f,e[132]=Y,e[133]=le):le=e[133],e[134]!==oe||e[135]!==le?(Ye={left:oe,right:le},e[134]=oe,e[135]=le,e[136]=Ye):Ye=e[136],ft=!f&&$,dt=!f&&Y,ht=qe,mt=Je,pt=xe,gt=Ce,vt=j,bt=X,e[137]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>{k.current=!1},e[137]=ne):ne=e[137],e[138]!==s||e[139]!==V||e[140]!==D||e[141]!==E||e[142]!==r?(re=ie=>{let ae;D&&(ae=V(ie),D(ie,{row:r,action:s,time:ae})),!k.current&&E&&(ae===void 0&&(ae=V(ie)),E(ie,{row:r,action:s,time:ae}))},e[138]=s,e[139]=V,e[140]=D,e[141]=E,e[142]=r,e[143]=re):re=e[143],e[144]!==s||e[145]!==V||e[146]!==O||e[147]!==r?(G=ie=>{if(O){const ae=V(ie);O(ie,{row:r,action:s,time:ae})}},e[144]=s,e[145]=V,e[146]=O,e[147]=r,e[148]=G):G=e[148],e[149]!==s||e[150]!==V||e[151]!==L||e[152]!==r?(z=ie=>{if(L){const ae=V(ie);L(ie,{row:r,action:s,time:ae})}},e[149]=s,e[150]=V,e[151]=L,e[152]=r,e[153]=z):z=e[153],se=Ke,e[154]!==i?(ee={height:i},e[154]=i,e[155]=ee):ee=e[155],Q=W&&W(pe,ge),e[69]=s,e[70]=Ke,e[71]=f,e[72]=x.assistPositions,e[73]=Y,e[74]=W,e[75]=$e,e[76]=h,e[77]=Je,e[78]=xe,e[79]=qe,e[80]=X,e[81]=Ce,e[82]=j,e[83]=V,e[84]=Re,e[85]=$,e[86]=D,e[87]=E,e[88]=L,e[89]=O,e[90]=De,e[91]=r,e[92]=i,e[93]=N,e[94]=I,e[95]=H,e[96]=q,e[97]=be.left,e[98]=be.width,e[99]=F,e[100]=ne,e[101]=re,e[102]=G,e[103]=z,e[104]=se,e[105]=ee,e[106]=Q,e[107]=ce,e[108]=_e,e[109]=We,e[110]=it,e[111]=ct,e[112]=at,e[113]=lt,e[114]=ut,e[115]=Be,e[116]=Ye,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 F=e[99],ne=e[100],re=e[101],G=e[102],z=e[103],se=e[104],ee=e[105],Q=e[106],ce=e[107],_e=e[108],We=e[109],it=e[110],ct=e[111],at=e[112],lt=e[113],ut=e[114],Be=e[115],Ye=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]!==Y?(_t=Y&&R.jsx("div",{className:de("action-left-stretch"),style:{touchAction:"none"}}),e[156]=Y,e[157]=_t):_t=e[157];let wt;e[158]!==Y?(wt=Y&&R.jsx("div",{className:de("action-right-stretch"),style:{touchAction:"none"}}),e[158]=Y,e[159]=wt):wt=e[159];let St;e[160]!==ne||e[161]!==re||e[162]!==G||e[163]!==z||e[164]!==se||e[165]!==ee||e[166]!==Q||e[167]!==_t||e[168]!==wt?(St=R.jsxs("div",{onMouseDown:ne,onClick:re,onDoubleClick:G,onContextMenu:z,className:se,style:ee,children:[Q,_t,wt]}),e[160]=ne,e[161]=re,e[162]=G,e[163]=z,e[164]=se,e[165]=ee,e[166]=Q,e[167]=_t,e[168]=wt,e[169]=St):St=e[169];let Mt;return e[170]!==F||e[171]!==ce||e[172]!==_e||e[173]!==We||e[174]!==it||e[175]!==ct||e[176]!==at||e[177]!==lt||e[178]!==ut||e[179]!==Be||e[180]!==Ye||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]!==St?(Mt=R.jsx(F,{ref:ce,parentRef:_e,start:We,left:it,width:ct,grid:at,adsorptionDistance:lt,adsorptionPositions:ut,getBounds:Be,edges:Ye,enableDragging:ft,enableResizing:dt,onDragStart:ht,onDrag:mt,onDragEnd:pt,onResizeStart:gt,onResize:vt,onResizeEnd:bt,children:St}),e[170]=F,e[171]=ce,e[172]=_e,e[173]=We,e[174]=it,e[175]=ct,e[176]=at,e[177]=lt,e[178]=ut,e[179]=Be,e[180]=Ye,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]=St,e[190]=Mt):Mt=e[190],Mt};function Et(n,e,t){let r=t.initialDeps??[],s;function o(){var i,c,l,u;let a;t.key&&((i=t.debug)!=null&&i.call(t))&&(a=Date.now());const h=n();if(!(h.length!==r.length||h.some((g,b)=>r[b]!==g)))return s;r=h;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),s=e(...h),t.key&&((l=t.debug)!=null&&l.call(t))){const g=Math.round((Date.now()-a)*100)/100,b=Math.round((Date.now()-m)*100)/100,v=b/16,w=(_,S)=>{for(_=String(_);_.length<S;)_=" "+_;return _};console.info(`%c⏱ ${w(b,5)} /${w(g,5)} ms`,`
11
11
  font-size: .6rem;
12
12
  font-weight: bold;
13
- color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,s),s}return o.updateDeps=i=>{r=i},o}function zn(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const Bs=(n,e)=>Math.abs(n-e)<1.01,Ys=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},Fn=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},Xs=n=>n,Gs=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},Ks=(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(Fn(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(Fn(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Vn={passive:!0},Un=typeof window>"u"?!0:"onscrollend"in window,qs=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const o=n.options.useScrollendEvent&&Un?()=>{}:Ys(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),i=l=>()=>{const{horizontal:h,isRtl:f}=n.options;s=h?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(s,l)},c=i(!0),a=i(!1);a(),t.addEventListener("scroll",c,Vn);const u=n.options.useScrollendEvent&&Un;return u&&t.addEventListener("scrollend",a,Vn),()=>{t.removeEventListener("scroll",c),u&&t.removeEventListener("scrollend",a)}},Js=(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"]},Zs=(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 Qs{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:Xs,rangeExtractor:Gs,onChange:()=>{},measureElement:Js,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=Et(()=>(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=Et(()=>[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=Et(()=>[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),f=this.options.lanes===1?u[l-1]:this.getFurthestMeasurement(u,l),m=f?f.end+this.options.gap:r+s,b=c.get(h),v=typeof b=="number"?b:this.options.estimateSize(l),g=m+v,S=f?f.lane:l%this.options.lanes;u[l]={index:l,start:m,size:v,end:g,key:h,lane:S}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Et(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?eo({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Et(()=>{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=Et(()=>[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 zn(r[ir(0,r.length-1,s=>zn(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,f]=l;this._scrollToOffset(h,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const m=this.getScrollOffset(),b=this.getOffsetForIndex(t,f);if(!b){console.warn("Failed to get offset for index:",t);return}Bs(b[0],m)||a(f)})},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 ir=(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 eo({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=ir(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 $n=typeof document<"u"?p.useLayoutEffect:p.useEffect;function to(n){const e=p.useReducer(()=>({}),{})[1],t={...n,onChange:(s,o)=>{var i;o?Er.flushSync(e):e(),(i=n.onChange)==null||i.call(n,s,o)}},[r]=p.useState(()=>new Qs(t));return r.setOptions(t),$n(()=>r._didMount(),[]),$n(()=>r._willUpdate()),r}function cr(n){return to({observeElementRect:Ks,observeElementOffset:qs,scrollToFn:Zs,...n})}const no=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??$t,f=u??Ht,m=c??Gt,b=_=>{if(!i.current)return 0;const y=_.currentTarget.getBoundingClientRect(),x=_.clientX-y.x;return tt(x,{startLeft:m,scale:h,scaleWidth:f})},v=A.useMemo(()=>(e?.actions?[...e.actions]:[]).sort((_,w)=>_.start-w.start),[e]),g=A.useCallback(_=>v[_]?.id??_,[v]),S=cr({horizontal:!0,count:v.length,getItemKey:g,getScrollElement:()=>i.current,estimateSize:_=>{if(!v[_])return 0;let{width:w}=dn({start:v[_].start,end:v[_].end},{startLeft:m,scale:h,scaleWidth:f});return w},overscan:3});return A.useLayoutEffect(()=>{S.measure()},[u,c,S]),E.jsx("div",{className:`${de(...l)} ${(e?.classNames||[]).join(" ")}`,style:t,onClick:_=>{if(e&&r){const w=b(_);r(_,{row:e,time:w})}},onDoubleClick:_=>{if(e&&s){const w=b(_);s(_,{row:e,time:w})}},onContextMenu:_=>{if(e&&o){const w=b(_);o(_,{row:e,time:w})}},children:e&&S.getVirtualItems().map(_=>{const w=v[_.index];if(!w)throw new Error("Action not found");return E.jsx(Hs,{...n,handleTime:b,row:e,action:w},w.id)})})};function ro(){const n=ze.c(6);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={isMoving:!1,movePositions:[],assistPositions:[]},n[0]=e):e=n[0];const[t,r]=A.useState(e),s=oo,o=so;let i;n[1]===Symbol.for("react.memo_cache_sentinel")?(i=m=>{const{movePositions:b,assistPositions:v}=m;r({isMoving:!0,movePositions:b||[],assistPositions:v||[]})},n[1]=i):i=n[1];const c=i;let a;n[2]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{const{movePositions:b,assistPositions:v}=m;r(g=>({...g,movePositions:b||g.movePositions,assistPositions:v||g.assistPositions}))},n[2]=a):a=n[2];const u=a;let l;n[3]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=l):l=n[3];const h=l;let f;return n[4]!==t?(f={initDragLine:c,updateDragLine:u,disposeDragLine:h,dragLineData:t,defaultGetAssistPosition:s,defaultGetMovePosition:o},n[4]=t,n[5]=f):f=n[5],f}function so(n){const{start:e,end:t,dir:r,scale:s,scaleWidth:o,startLeft:i}=n,{left:c,width:a}=dn({start:e,end:t},{startLeft:i,scaleWidth:o,scale:s});return r?r==="right"?[c+a]:[c]:[c,c+a]}function oo(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(f=>{f.actions.forEach(m=>{t.includes(m.id)&&l.push(m)})}):e.forEach(f=>{f.id!==s.id?l.push(...f.actions):f.actions.forEach(m=>{m.id!==r.id&&l.push(m)})});const h=Wr(l,{startLeft:c,scale:o,scaleWidth:i});return u||h.push(a),h}const io=n=>{const e=ze.c(35);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{dragLineData:s,initDragLine:o,updateDragLine:i,disposeDragLine:c,defaultGetAssistPosition:a,defaultGetMovePosition:u}=ro();let l;e[3]!==a||e[4]!==o||e[5]!==t?(l=P=>{if(t.dragLine){const M=t.getAssistDragLineActionIds&&t.getAssistDragLineActionIds({action:P.action,row:P.row,editorData:t.editorData}),H=t.scaleWidth??160,F=t.scale??1,q=t.startLeft??20,D=t.hideCursor??!1,I=je(t.cursorTime,{scaleWidth:H,scale:F,startLeft:q}),K=a({editorData:t.editorData,assistActionIds:M,action:P.action,row:P.row,scale:F,scaleWidth:H,startLeft:q,hideCursor:D,cursorLeft:I});o({assistPositions:K})}},e[3]=a,e[4]=o,e[5]=t,e[6]=l):l=e[6];const h=l;let f;e[7]!==u||e[8]!==t.dragLine||e[9]!==t.scale||e[10]!==t.scaleWidth||e[11]!==t.startLeft||e[12]!==i?(f=P=>{if(t.dragLine){const M=t.scaleWidth??160,H=t.scale??1,F=t.startLeft??20,q=u({...P,startLeft:F,scaleWidth:M,scale:H});i({movePositions:q})}},e[7]=u,e[8]=t.dragLine,e[9]=t.scale,e[10]=t.scaleWidth,e[11]=t.startLeft,e[12]=i,e[13]=f):f=e[13];const m=f,b=t.rowHeight??32,v=t.scaleWidth??160,g=t.startLeft??20,S=Math.max(t.scaleCount*v+g,t.timelineWidth);let _;if(e[14]!==S||e[15]!==b||e[16]!==c||e[17]!==s||e[18]!==h||e[19]!==m||e[20]!==t){const P=[];let M=0;for(let H=0;H<t.editorData.length;H++){const F=t.editorData[H];if(!F)continue;const q=F.rowHeight||b;P.push(A.createElement(no,{...t,key:F.id,rowData:F,dragLineData:s,scrollContainerRef:t.scrollElementRef,style:{position:"absolute",top:0,left:0,width:S,height:`${q}px`,transform:`translateY(${M}px)`},onActionMoveStart:D=>(h(D),t.onActionMoveStart&&t.onActionMoveStart(D)),onActionResizeStart:D=>(h(D),t.onActionResizeStart&&t.onActionResizeStart(D)),onActionMoving:D=>(m(D),t.onActionMoving&&t.onActionMoving(D)),onActionResizing:D=>(m(D),t.onActionResizing&&t.onActionResizing(D)),onActionResizeEnd:D=>(c(),t.onActionResizeEnd&&t.onActionResizeEnd(D)),onActionMoveEnd:D=>(c(),t.onActionMoveEnd&&t.onActionMoveEnd(D))})),M=M+q}_=[M,P],e[14]=S,e[15]=b,e[16]=c,e[17]=s,e[18]=h,e[19]=m,e[20]=t,e[21]=_}else _=e[21];const[w,y]=_,C=`0, ${t.startLeft??20}px`,x=`${t.startLeft??20}px, ${t.scaleWidth??160}px`;let R;e[22]!==S||e[23]!==C||e[24]!==x||e[25]!==w?(R={width:S,height:w,position:"relative",backgroundPositionX:C,backgroundSize:x},e[22]=S,e[23]=C,e[24]=x,e[25]=w,e[26]=R):R=e[26];let W;e[27]!==s||e[28]!==t.dragLine?(W=t.dragLine&&E.jsx(Ur,{...s}),e[27]=s,e[28]=t.dragLine,e[29]=W):W=e[29];let L;return e[30]!==r||e[31]!==y||e[32]!==R||e[33]!==W?(L=E.jsxs("div",{ref:r,style:R,className:"timeline-editor-edit-area",children:[y,W]}),e[30]=r,e[31]=y,e[32]=R,e[33]=W,e[34]=L):L=e[34],L};function co({scaleSplitCount:n,scaleWidth:e,startLeft:t,scaleCount:r,maxScaleCount:s,scale:o,scrollElementRef:i,onClickTimeArea:c,setCursor:a}){const u=n??1,l=e??160,h=t??20,f=(n??0)>0,m=f?r*(n??1)+1:r,b=(f?l/u:l)*(m-1)+h,g=cr({horizontal:!0,count:m,getScrollElement:()=>i.current,estimateSize:S=>{switch(S){case 0:return h;default:return f?l/u:l}},overscan:10});return A.useEffect(()=>g.measure(),[e,t,g]),E.jsx("div",{style:{width:`${b}px`},className:de("time-area"),onClick:S=>{const _=t??20,w=e??160,y=o??1,C=s??1/0,x=S.currentTarget.getBoundingClientRect(),R=S.clientX-x.x,W=Math.max(R,_);if(W>C*w+_)return;const L=tt(W,{startLeft:_,scale:y,scaleWidth:w});c&&c(L,S),!S.defaultPrevented&&a({time:L})},children:g.getVirtualItems().map(S=>{const _=S.index,w=n??1,y=o??1,C=f?_%w===0:!0,x=[de("time-unit"),de(C?"time-unit-big":"time-unit-small")],R=(f?_/w:_)*y;return E.jsx("div",{"data-index":S.index,style:{width:`${S.size}px`,transform:`translateX(${S.start}px)`},className:x.join(" "),children:C&&E.jsx("div",{className:de("time-unit-scale"),children:R})},S.key)})})}function ao(n){return typeof n=="object"&&n!==null}function lo(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 uo(n){return ao(n)&&"ownerSVGElement"in n}const Ft=new WeakMap;let Vt;const ar=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:uo(r)&&"getBBox"in r?r.getBBox()[e]:r[t],fo=ar("inline","width","offsetWidth"),ho=ar("block","height","offsetHeight");function mo({target:n,borderBoxSize:e}){Ft.get(n)?.forEach(t=>{t(n,{get width(){return fo(n,e)},get height(){return ho(n,e)}})})}function po(n){n.forEach(mo)}function go(){typeof ResizeObserver>"u"||(Vt=new ResizeObserver(po))}function vo(n,e){Vt||go();const t=lo(n);return t.forEach(r=>{let s=Ft.get(r);s||(s=new Set,Ft.set(r,s)),s.add(e),Vt?.observe(r)}),()=>{t.forEach(r=>{const s=Ft.get(r);s?.delete(e),s?.size||Vt?.unobserve(r)})}}const Ut=new Set;let Rt;function bo(){Rt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ut.forEach(e=>e(n))},window.addEventListener("resize",Rt)}function _o(n){return Ut.add(n),Rt||bo(),()=>{Ut.delete(n),!Ut.size&&typeof Rt=="function"&&(window.removeEventListener("resize",Rt),Rt=void 0)}}function wo(n,e){return typeof n=="function"?_o(n):vo(n,e)}function So(n){const e=ze.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={width:0,height:0},e[0]=t):t=e[0];const[r,s]=A.useState(t);let o;e[1]!==n?(o=()=>{n.current&&wo(n.current,(c,a)=>{s({width:a.width,height:a.height})})},e[1]=n,e[2]=o):o=e[2];let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[3]=i):i=e[3],A.useLayoutEffect(o,i),r}const yo=n=>{const e=ze.c(42),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:o,scaleWidth:i,scale:c,scaleCount:a,scaleSplitCount:u,scrollElementRef:l,maxScaleCount:h,onCursorDragStart:f,onCursorDrag:m,onCursorDragEnd:b}=n,v=A.useRef(null),g=A.useRef(void 0);let S,_;e[0]!==r||e[1]!==c||e[2]!==i||e[3]!==o?(S=()=>{if(typeof g.current>"u"&&v.current){const d=o??20,T=i??160,V=c??1;v.current.updateLeft(je(r,{startLeft:d,scaleWidth:T,scale:V}))}},_=[r,o,i,c],e[0]=r,e[1]=c,e[2]=i,e[3]=o,e[4]=S,e[5]=_):(S=e[4],_=e[5]),A.useEffect(S,_);const w=o??20,y=i??160,C=c??1,x=h??1/0,R=(u??0)>0,W=u??1,L=R?a*(u??1)+1:a,P=o??20,M=(R?y/W:y)*(L-1)+P;let H;e[6]!==w||e[7]!==x||e[8]!==l||e[9]!==M||e[10]!==y?(H=()=>({left:0,right:Math.min(M,x*y+w-(l.current?.scrollLeft??0))}),e[6]=w,e[7]=x,e[8]=l,e[9]=M,e[10]=y,e[11]=H):H=e[11];const F=!t;let q;e[12]!==r||e[13]!==w||e[14]!==f||e[15]!==C||e[16]!==y?(q=()=>{f&&f(r),g.current=je(r,{startLeft:w,scaleWidth:y,scale:C}),v.current?.updateLeft(g.current)},e[12]=r,e[13]=w,e[14]=f,e[15]=C,e[16]=y,e[17]=q):q=e[17];let D;e[18]!==w||e[19]!==b||e[20]!==C||e[21]!==s||e[22]!==y?(D=()=>{if(typeof g.current<"u"){const d=tt(g.current,{startLeft:w,scale:C,scaleWidth:y});s({time:d}),b&&b(d)}g.current=void 0},e[18]=w,e[19]=b,e[20]=C,e[21]=s,e[22]=y,e[23]=D):D=e[23];let I;e[24]!==w||e[25]!==m||e[26]!==C||e[27]!==l||e[28]!==s||e[29]!==y?(I=(d,T)=>{const{left:V}=d,B=T===void 0?0:T,J=l.current?.scrollLeft??0,Y=l.current,U=Y?.clientWidth??0;if(B!==0)if(typeof g.current<"u"){g.current=g.current+B;const O=J,N=J+U;g.current<O+10?g.current=O+10:g.current>N-10&&(g.current=N-10),g.current<w-J&&(g.current=w-J)}else{g.current=V+B;const O=J,N=J+U;g.current<O+10?g.current=O+10:g.current>N-10&&(g.current=N-10)}else if(V<w-J?g.current=w-J:g.current=V,Y&&U>0){const O=J,N=J+U;g.current<O+10?g.current=O+10:g.current>N-10&&(g.current=N-10)}if(typeof g.current<"u"){v.current?.updateLeft(g.current);const O=tt(g.current+J,{startLeft:w,scale:C,scaleWidth:y});s({time:O}),m&&m(O)}return!1},e[24]=w,e[25]=m,e[26]=C,e[27]=l,e[28]=s,e[29]=y,e[30]=I):I=e[30];let K,ue;e[31]===Symbol.for("react.memo_cache_sentinel")?(K=de("cursor"),ue=de("cursor-top"),e[31]=K,e[32]=ue):(K=e[31],ue=e[32]);let fe;e[33]===Symbol.for("react.memo_cache_sentinel")?(fe=E.jsxs("div",{className:K,children:[E.jsx("svg",{className:ue,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:E.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"})}),E.jsx("div",{className:de("cursor-area")})]}),e[33]=fe):fe=e[33];let me;return e[34]!==w||e[35]!==l||e[36]!==H||e[37]!==F||e[38]!==q||e[39]!==D||e[40]!==I?(me=E.jsx(or,{start:w,ref:v,parentRef:l,getBounds:H,autoScroll:!0,enableDragging:F,enableResizing:!1,onDragStart:q,onDragEnd:D,onDrag:I,children:fe}),e[34]=w,e[35]=l,e[36]=H,e[37]=F,e[38]=q,e[39]=D,e[40]=I,e[41]=me):me=e[41],me};function Hn(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function lr(...n){return e=>{let t=!1;const r=n.map(s=>{const o=Hn(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():Hn(n[s],null)}}}}function nt(...n){return p.useCallback(lr(...n),n)}function Eo(n){const e=Ro(n),t=p.forwardRef((r,s)=>{const{children:o,...i}=r,c=p.Children.toArray(o),a=c.find(Co);if(a){const u=a.props.children,l=c.map(h=>h===a?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:h);return E.jsx(e,{...i,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,l):null})}return E.jsx(e,{...i,ref:s,children:o})});return t.displayName=`${n}.Slot`,t}function Ro(n){const e=p.forwardRef((t,r)=>{const{children:s,...o}=t;if(p.isValidElement(s)){const i=Ao(s),c=To(o,s.props);return s.type!==p.Fragment&&(c.ref=r?lr(r,i):i),p.cloneElement(s,c)}return p.Children.count(s)>1?p.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var xo=Symbol("radix.slottable");function Co(n){return p.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===xo}function To(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 Ao(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 Po=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ot=Po.reduce((n,e)=>{const t=Eo(`Primitive.${e}`),r=p.forwardRef((s,o)=>{const{asChild:i,...c}=s,a=i?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(a,{...c,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function Do(n,e=[]){let t=[];function r(o,i){const c=p.createContext(i),a=t.length;t=[...t,i];const u=h=>{const{scope:f,children:m,...b}=h,v=f?.[n]?.[a]||c,g=p.useMemo(()=>b,Object.values(b));return E.jsx(v.Provider,{value:g,children:m})};u.displayName=o+"Provider";function l(h,f){const m=f?.[n]?.[a]||c,b=p.useContext(m);if(b)return b;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=>p.createContext(i));return function(c){const a=c?.[n]||o;return p.useMemo(()=>({[`__scope${n}`]:{...c,[n]:a}}),[c,a])}};return s.scopeName=n,[r,Oo(s,...e)]}function Oo(...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 p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}function et(n,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(n?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}var fn=globalThis?.document?p.useLayoutEffect:()=>{};function Lo(n,e){return p.useReducer((t,r)=>e[t][r]??t,n)}var Lt=n=>{const{present:e,children:t}=n,r=Mo(e),s=typeof t=="function"?t({present:r.isPresent}):p.Children.only(t),o=nt(r.ref,No(s));return typeof t=="function"||r.isPresent?p.cloneElement(s,{ref:o}):null};Lt.displayName="Presence";function Mo(n){const[e,t]=p.useState(),r=p.useRef(null),s=p.useRef(n),o=p.useRef("none"),i=n?"mounted":"unmounted",[c,a]=Lo(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=jt(r.current);o.current=c==="mounted"?u:"none"},[c]),fn(()=>{const u=r.current,l=s.current;if(l!==n){const f=o.current,m=jt(u);n?a("MOUNT"):m==="none"||u?.display==="none"?a("UNMOUNT"):a(l&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,a]),fn(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,h=m=>{const v=jt(r.current).includes(CSS.escape(m.animationName));if(m.target===e&&v&&(a("ANIMATION_END"),!s.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=m=>{m.target===e&&(o.current=jt(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,t(u)},[])}}function jt(n){return n?.animationName||"none"}function No(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 Io=p.createContext(void 0);function ko(n){const e=p.useContext(Io);return n||e||"ltr"}function Qe(n){const e=p.useRef(n);return p.useEffect(()=>{e.current=n}),p.useMemo(()=>(...t)=>e.current?.(...t),[])}function Wo(n,[e,t]){return Math.min(t,Math.max(e,n))}function jo(n,e){return p.useReducer((t,r)=>e[t][r]??t,n)}var mn="ScrollArea",[ur]=Do(mn),[zo,Se]=ur(mn),fr=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=n,[c,a]=p.useState(null),[u,l]=p.useState(null),[h,f]=p.useState(null),[m,b]=p.useState(null),[v,g]=p.useState(null),[S,_]=p.useState(0),[w,y]=p.useState(0),[C,x]=p.useState(!1),[R,W]=p.useState(!1),L=nt(e,M=>a(M)),P=ko(s);return E.jsx(zo,{scope:t,type:r,dir:P,scrollHideDelay:o,scrollArea:c,viewport:u,onViewportChange:l,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:b,scrollbarXEnabled:C,onScrollbarXEnabledChange:x,scrollbarY:v,onScrollbarYChange:g,scrollbarYEnabled:R,onScrollbarYEnabledChange:W,onCornerWidthChange:_,onCornerHeightChange:y,children:E.jsx(Ot.div,{dir:P,...i,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":w+"px",...n.style}})})});fr.displayName=mn;var dr="ScrollAreaViewport",hr=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...o}=n,i=Se(dr,t),c=p.useRef(null),a=nt(e,c,i.onViewportChange);return E.jsxs(E.Fragment,{children:[E.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}),E.jsx(Ot.div,{"data-radix-scroll-area-viewport":"",...o,ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...n.style},children:E.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});hr.displayName=dr;var Te="ScrollAreaScrollbar",mr=p.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Se(Te,n.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,c=n.orientation==="horizontal";return p.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),s.type==="hover"?E.jsx(Fo,{...r,ref:e,forceMount:t}):s.type==="scroll"?E.jsx(Vo,{...r,ref:e,forceMount:t}):s.type==="auto"?E.jsx(pr,{...r,ref:e,forceMount:t}):s.type==="always"?E.jsx(pn,{...r,ref:e}):null});mr.displayName=Te;var Fo=p.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Se(Te,n.__scopeScrollArea),[o,i]=p.useState(!1);return p.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]),E.jsx(Lt,{present:t||o,children:E.jsx(pr,{"data-state":o?"visible":"hidden",...r,ref:e})})}),Vo=p.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Se(Te,n.__scopeScrollArea),o=n.orientation==="horizontal",i=Jt(()=>a("SCROLL_END"),100),[c,a]=jo("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 p.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,s.scrollHideDelay,a]),p.useEffect(()=>{const u=s.viewport,l=o?"scrollLeft":"scrollTop";if(u){let h=u[l];const f=()=>{const m=u[l];h!==m&&(a("SCROLL"),i()),h=m};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,o,a,i]),E.jsx(Lt,{present:t||c!=="hidden",children:E.jsx(pn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:et(n.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:et(n.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),pr=p.forwardRef((n,e)=>{const t=Se(Te,n.__scopeScrollArea),{forceMount:r,...s}=n,[o,i]=p.useState(!1),c=n.orientation==="horizontal",a=Jt(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,l=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?u:l)}},10);return xt(t.viewport,a),xt(t.content,a),E.jsx(Lt,{present:r||o,children:E.jsx(pn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),pn=p.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=Se(Te,n.__scopeScrollArea),o=p.useRef(null),i=p.useRef(0),[c,a]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=wr(c.viewport,c.content),l={...r,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function h(f,m){return Xo(f,i.current,c,m)}return t==="horizontal"?E.jsx(Uo,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollLeft,m=Bn(f,c,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=h(f,s.dir))}}):t==="vertical"?E.jsx($o,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollTop,m=Bn(f,c);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=h(f))}}):null}),Uo=p.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=Se(Te,n.__scopeScrollArea),[i,c]=p.useState(),a=p.useRef(null),u=nt(e,a,o.onScrollbarXChange);return p.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),E.jsx(vr,{"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":qt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.x),onDragScroll:l=>n.onDragScroll(l.x),onWheelScroll:(l,h)=>{if(o.viewport){const f=o.viewport.scrollLeft+l.deltaX;n.onWheelScroll(f),yr(f,h)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Xt(i.paddingLeft),paddingEnd:Xt(i.paddingRight)}})}})}),$o=p.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=Se(Te,n.__scopeScrollArea),[i,c]=p.useState(),a=p.useRef(null),u=nt(e,a,o.onScrollbarYChange);return p.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),E.jsx(vr,{"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":qt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.y),onDragScroll:l=>n.onDragScroll(l.y),onWheelScroll:(l,h)=>{if(o.viewport){const f=o.viewport.scrollTop+l.deltaY;n.onWheelScroll(f),yr(f,h)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Xt(i.paddingTop),paddingEnd:Xt(i.paddingBottom)}})}})}),[Ho,gr]=ur(Te),vr=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:l,onResize:h,...f}=n,m=Se(Te,t),[b,v]=p.useState(null),g=nt(e,L=>v(L)),S=p.useRef(null),_=p.useRef(""),w=m.viewport,y=r.content-r.viewport,C=Qe(l),x=Qe(a),R=Jt(h,10);function W(L){if(S.current){const P=L.clientX-S.current.left,M=L.clientY-S.current.top;u({x:P,y:M})}}return p.useEffect(()=>{const L=P=>{const M=P.target;b?.contains(M)&&C(P,y)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[w,b,y,C]),p.useEffect(x,[r,x]),xt(b,R),xt(m.content,R),E.jsx(Ho,{scope:t,scrollbar:b,hasThumb:s,onThumbChange:Qe(o),onThumbPointerUp:Qe(i),onThumbPositionChange:x,onThumbPointerDown:Qe(c),children:E.jsx(Ot.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:et(n.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),S.current=b.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),W(L))}),onPointerMove:et(n.onPointerMove,W),onPointerUp:et(n.onPointerUp,L=>{const P=L.target;P.hasPointerCapture(L.pointerId)&&P.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=_.current,m.viewport&&(m.viewport.style.scrollBehavior=""),S.current=null})})})}),Yt="ScrollAreaThumb",br=p.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=gr(Yt,n.__scopeScrollArea);return E.jsx(Lt,{present:t||s.hasThumb,children:E.jsx(Bo,{ref:e,...r})})}),Bo=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,o=Se(Yt,t),i=gr(Yt,t),{onThumbPositionChange:c}=i,a=nt(e,h=>i.onThumbChange(h)),u=p.useRef(void 0),l=Jt(()=>{u.current&&(u.current(),u.current=void 0)},100);return p.useEffect(()=>{const h=o.viewport;if(h){const f=()=>{if(l(),!u.current){const m=Go(h,c);u.current=m,c()}};return c(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[o.viewport,l,c]),E.jsx(Ot.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:et(n.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),b=h.clientX-m.left,v=h.clientY-m.top;i.onThumbPointerDown({x:b,y:v})}),onPointerUp:et(n.onPointerUp,i.onThumbPointerUp)})});br.displayName=Yt;var gn="ScrollAreaCorner",_r=p.forwardRef((n,e)=>{const t=Se(gn,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?E.jsx(Yo,{...n,ref:e}):null});_r.displayName=gn;var Yo=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=Se(gn,t),[o,i]=p.useState(0),[c,a]=p.useState(0),u=!!(o&&c);return xt(s.scrollbarX,()=>{const l=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(l),a(l)}),xt(s.scrollbarY,()=>{const l=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(l),i(l)}),u?E.jsx(Ot.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 Xt(n){return n?parseInt(n,10):0}function wr(n,e){const t=n/e;return isNaN(t)?0:t}function qt(n){const e=wr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function Xo(n,e,t,r="ltr"){const s=qt(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 Sr([a,u],h)(n)}function Bn(n,e,t="ltr"){const r=qt(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=Wo(n,a);return Sr([0,i],[0,c])(u)}function Sr(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 yr(n,e){return n>0&&n<e}var Go=(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 Jt(n,e){const t=Qe(n),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function xt(n,e){const t=Qe(e);fn(()=>{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 Ko=fr,qo=hr,Jo=_r;function Yn(n){const e=ze.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=E.jsx(br,{"data-slot":"scroll-area-thumb"}),e[4]=i):i=e[4];let c;return e[5]!==t||e[6]!==o||e[7]!==r?(c=E.jsx(mr,{"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}const Zo=A.forwardRef((n,e)=>{const t=Nr(n),{style:r}=n;let{editorData:s,hideCursor:o,disableDrag:i,scale:c=1,scaleWidth:a=160,startLeft:u=20,minScaleCount:l=20,maxScaleCount:h=1/0,onChange:f,onScroll:m}=t;const b=A.useRef(null),[v,g]=A.useState(s),[S,_]=A.useState(ln),[w,y]=A.useState(Ar),C=A.useCallback(P=>{const M=Math.min(h,Math.max(l,P));_(M)},[h,l]);A.useLayoutEffect(()=>{C(Ir(s,{scale:c})),g(s)},[s,l,h,c,C]);const x=P=>{f?.(P)},R=P=>{let{left:M,time:H}=P;return typeof H<"u"?(y(H),!0):typeof M<"u"?(y(tt(M,{startLeft:u,scale:c,scaleWidth:a})),!0):!1};A.useImperativeHandle(e,()=>({get target(){return b.current},set time(P){R({time:P})},get time(){return w},setScrollLeft:P=>{b.current&&(b.current.scrollLeft=P)},setScrollTop:P=>{b.current&&(b.current.scrollTop=P)}}));const{width:W,height:L}=So(b);return E.jsxs(Ko,{style:r,className:`${on} ${i?on+"-disable":""}`,"data-slot":"scroll-area",children:[E.jsxs(qo,{"data-slot":"scroll-area-viewport",ref:b,onScroll:P=>{m?.(P.currentTarget)},children:[E.jsx(co,{...t,setCursor:R,scaleCount:S,scrollElementRef:b}),E.jsx(io,{...t,scrollElementRef:b,timelineWidth:W,timelineHeight:L,disableDrag:i,editorData:v,cursorTime:w,scaleCount:S,setScaleCount:C,setEditorData:x}),!o&&E.jsx(yo,{...t,timelineWidth:W,height:L,scaleCount:S,setScaleCount:C,setCursor:R,cursorTime:w,editorData:v,scrollElementRef:b})]}),E.jsx(Yn,{orientation:"horizontal"}),E.jsx(Yn,{orientation:"vertical"}),E.jsx(Jo,{})]})});exports.Timeline=Zo;
13
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,s),s}return o.updateDeps=i=>{r=i},o}function Vn(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const Xs=(n,e)=>Math.abs(n-e)<1.01,Gs=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},Un=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},Ks=n=>n,qs=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},Js=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=i=>{const{width:c,height:l}=i;e({width:Math.round(c),height:Math.round(l)})};if(s(Un(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const c=()=>{const l=i[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(Un(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},$n={passive:!0},Hn=typeof window>"u"?!0:"onscrollend"in window,Zs=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const o=n.options.useScrollendEvent&&Hn?()=>{}:Gs(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),i=a=>()=>{const{horizontal:h,isRtl:f}=n.options;s=h?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(s,a)},c=i(!0),l=i(!1);l(),t.addEventListener("scroll",c,$n);const u=n.options.useScrollendEvent&&Hn;return u&&t.addEventListener("scrollend",l,$n),()=>{t.removeEventListener("scroll",c),u&&t.removeEventListener("scrollend",l)}},Qs=(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"]},eo=(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 to{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:Ks,rangeExtractor:qs,onChange:()=>{},measureElement:Qs,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=Et(()=>(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 l=o.get(c.lane);if(l==null||c.end>l.end?o.set(c.lane,c):c.end<l.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=Et(()=>[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=Et(()=>[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(a=>{this.itemSizeCache.set(a.key,a.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let a=l;a<t;a++){const h=o(a),f=this.options.lanes===1?u[a-1]:this.getFurthestMeasurement(u,a),m=f?f.end+this.options.gap:r+s,g=c.get(h),b=typeof g=="number"?g:this.options.estimateSize(a),v=m+b,w=f?f.lane:a%this.options.lanes;u[a]={index:a,start:m,size:b,end:v,key:h,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Et(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?no({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Et(()=>{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=Et(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const c=t[o],l=r[c];s.push(l)}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 Vn(r[ar(0,r.length-1,s=>Vn(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 a=this.getOffsetForIndex(t,u);if(!a){console.warn("Failed to get offset for index:",t);return}const[h,f]=a;this._scrollToOffset(h,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const m=this.getScrollOffset(),g=this.getOffsetForIndex(t,f);if(!g){console.warn("Failed to get offset for index:",t);return}Xs(g[0],m)||l(f)})},l=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 no({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,o=l=>n[l].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 l=Array(r).fill(0);for(;c<s&&l.some(a=>a<t+e);){const a=n[c];l[a.lane]=a.end,c++}const u=Array(r).fill(t+e);for(;i>=0&&u.some(a=>a>=t);){const a=n[i];u[a.lane]=a.start,i--}i=Math.max(0,i-i%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:i,endIndex:c}}const Bn=typeof document<"u"?p.useLayoutEffect:p.useEffect;function ro(n){const e=p.useReducer(()=>({}),{})[1],t={...n,onChange:(s,o)=>{var i;o?xr.flushSync(e):e(),(i=n.onChange)==null||i.call(n,s,o)}},[r]=p.useState(()=>new to(t));return r.setOptions(t),Bn(()=>r._didMount(),[]),Bn(()=>r._willUpdate()),r}function lr(n){return ro({observeElementRect:Js,observeElementOffset:Zs,scrollToFn:eo,...n})}const so=n=>{const{rowData:e,style:t={},onClickRow:r,onDoubleClickRow:s,onContextMenuRow:o,scrollContainerRef:i,startLeft:c,scale:l,scaleWidth:u}=n,a=["edit-row"];e?.selected&&a.push("edit-row-selected");const h=l??$t,f=u??Ht,m=c??Gt,g=_=>{if(!i.current)return 0;const y=_.currentTarget.getBoundingClientRect(),x=_.clientX-y.x;return tt(x,{startLeft:m,scale:h,scaleWidth:f})},b=T.useMemo(()=>(e?.actions?[...e.actions]:[]).sort((_,S)=>_.start-S.start),[e]),v=T.useCallback(_=>b[_]?.id??_,[b]),w=lr({horizontal:!0,count:b.length,getItemKey:v,getScrollElement:()=>i.current,estimateSize:_=>{if(!b[_])return 0;let S=_>0?b[_-1].end:0,y=b[_].end;if(S>y)return 0;let{width:P}=hn({start:S,end:y},{startLeft:m,scale:h,scaleWidth:f});return P},overscan:5});return T.useLayoutEffect(()=>{w.measure()},[u,c,w]),R.jsx("div",{className:`${de(...a)} ${(e?.classNames||[]).join(" ")}`,style:t,onClick:_=>{if(e&&r){const S=g(_);r(_,{row:e,time:S})}},onDoubleClick:_=>{if(e&&s){const S=g(_);s(_,{row:e,time:S})}},onContextMenu:_=>{if(e&&o){const S=g(_);o(_,{row:e,time:S})}},children:e&&w.getVirtualItems().map(_=>{const S=b[_.index];if(!S)throw new Error("Action not found");return R.jsx(Ys,{...n,handleTime:g,row:e,action:S},S.id)})})};function oo(){const n=ze.c(6);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={isMoving:!1,movePositions:[],assistPositions:[]},n[0]=e):e=n[0];const[t,r]=T.useState(e),s=co,o=io;let i;n[1]===Symbol.for("react.memo_cache_sentinel")?(i=m=>{const{movePositions:g,assistPositions:b}=m;r({isMoving:!0,movePositions:g||[],assistPositions:b||[]})},n[1]=i):i=n[1];const c=i;let l;n[2]===Symbol.for("react.memo_cache_sentinel")?(l=m=>{const{movePositions:g,assistPositions:b}=m;r(v=>({...v,movePositions:g||v.movePositions,assistPositions:b||v.assistPositions}))},n[2]=l):l=n[2];const u=l;let a;n[3]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=a):a=n[3];const h=a;let f;return n[4]!==t?(f={initDragLine:c,updateDragLine:u,disposeDragLine:h,dragLineData:t,defaultGetAssistPosition:s,defaultGetMovePosition:o},n[4]=t,n[5]=f):f=n[5],f}function io(n){const{start:e,end:t,dir:r,scale:s,scaleWidth:o,startLeft:i}=n,{left:c,width:l}=hn({start:e,end:t},{startLeft:i,scaleWidth:o,scale:s});return r?r==="right"?[c+l]:[c]:[c,c+l]}function co(n){const{editorData:e,assistActionIds:t,action:r,row:s,scale:o,scaleWidth:i,startLeft:c,cursorLeft:l,hideCursor:u}=n,a=[];t?e.forEach(f=>{f.actions.forEach(m=>{t.includes(m.id)&&a.push(m)})}):e.forEach(f=>{f.id!==s.id?a.push(...f.actions):f.actions.forEach(m=>{m.id!==r.id&&a.push(m)})});const h=jr(a,{startLeft:c,scale:o,scaleWidth:i});return u||h.push(l),h}const ao=n=>{const e=ze.c(35);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{dragLineData:s,initDragLine:o,updateDragLine:i,disposeDragLine:c,defaultGetAssistPosition:l,defaultGetMovePosition:u}=oo();let a;e[3]!==l||e[4]!==o||e[5]!==t?(a=O=>{if(t.dragLine){const L=t.getAssistDragLineActionIds&&t.getAssistDragLineActionIds({action:O.action,row:O.row,editorData:t.editorData}),W=t.scaleWidth??160,V=t.scale??1,q=t.startLeft??20,M=t.hideCursor??!1,k=je(t.cursorTime,{scaleWidth:W,scale:V,startLeft:q}),K=l({editorData:t.editorData,assistActionIds:L,action:O.action,row:O.row,scale:V,scaleWidth:W,startLeft:q,hideCursor:M,cursorLeft:k});o({assistPositions:K})}},e[3]=l,e[4]=o,e[5]=t,e[6]=a):a=e[6];const h=a;let f;e[7]!==u||e[8]!==t.dragLine||e[9]!==t.scale||e[10]!==t.scaleWidth||e[11]!==t.startLeft||e[12]!==i?(f=O=>{if(t.dragLine){const L=t.scaleWidth??160,W=t.scale??1,V=t.startLeft??20,q=u({...O,startLeft:V,scaleWidth:L,scale:W});i({movePositions:q})}},e[7]=u,e[8]=t.dragLine,e[9]=t.scale,e[10]=t.scaleWidth,e[11]=t.startLeft,e[12]=i,e[13]=f):f=e[13];const m=f,g=t.rowHeight??32,b=t.scaleWidth??160,v=t.startLeft??20,w=Math.max(t.scaleCount*b+v,t.timelineWidth);let _;if(e[14]!==w||e[15]!==g||e[16]!==c||e[17]!==s||e[18]!==h||e[19]!==m||e[20]!==t){const O=[];let L=0;for(let W=0;W<t.editorData.length;W++){const V=t.editorData[W];if(!V)continue;const q=V.rowHeight||g;O.push(T.createElement(so,{...t,key:V.id,rowData:V,dragLineData:s,scrollContainerRef:t.scrollElementRef,style:{position:"absolute",top:0,left:0,width:w,height:`${q}px`,transform:`translateY(${L}px)`},onActionMoveStart:M=>(h(M),t.onActionMoveStart&&t.onActionMoveStart(M)),onActionResizeStart:M=>(h(M),t.onActionResizeStart&&t.onActionResizeStart(M)),onActionMoving:M=>(m(M),t.onActionMoving&&t.onActionMoving(M)),onActionResizing:M=>(m(M),t.onActionResizing&&t.onActionResizing(M)),onActionResizeEnd:M=>(c(),t.onActionResizeEnd&&t.onActionResizeEnd(M)),onActionMoveEnd:M=>(c(),t.onActionMoveEnd&&t.onActionMoveEnd(M))})),L=L+q}_=[L,O],e[14]=w,e[15]=g,e[16]=c,e[17]=s,e[18]=h,e[19]=m,e[20]=t,e[21]=_}else _=e[21];const[S,y]=_,P=`0, ${t.startLeft??20}px`,x=`${t.startLeft??20}px, ${t.scaleWidth??160}px`;let C;e[22]!==w||e[23]!==P||e[24]!==x||e[25]!==S?(C={width:w,height:S,position:"relative",backgroundPositionX:P,backgroundSize:x},e[22]=w,e[23]=P,e[24]=x,e[25]=S,e[26]=C):C=e[26];let D;e[27]!==s||e[28]!==t.dragLine?(D=t.dragLine&&R.jsx($r,{...s}),e[27]=s,e[28]=t.dragLine,e[29]=D):D=e[29];let E;return e[30]!==r||e[31]!==y||e[32]!==C||e[33]!==D?(E=R.jsxs("div",{ref:r,style:C,className:"timeline-editor-edit-area",children:[y,D]}),e[30]=r,e[31]=y,e[32]=C,e[33]=D,e[34]=E):E=e[34],E};function lo({scaleSplitCount:n,scaleWidth:e,startLeft:t,scaleCount:r,maxScaleCount:s,scale:o,scrollElementRef:i,onClickTimeArea:c,setCursor:l}){const u=n??1,a=e??160,h=t??20,f=(n??0)>0,m=f?r*(n??1)+1:r,g=(f?a/u:a)*(m-1)+h,v=lr({horizontal:!0,count:m,getScrollElement:()=>i.current,estimateSize:w=>{switch(w){case 0:return h;default:return f?a/u:a}},overscan:10});return T.useEffect(()=>v.measure(),[e,t,v]),R.jsx("div",{style:{width:`${g}px`},className:de("time-area"),onClick:w=>{const _=t??20,S=e??160,y=o??1,P=s??1/0,x=w.currentTarget.getBoundingClientRect(),C=w.clientX-x.x,D=Math.max(C,_);if(D>P*S+_)return;const E=tt(D,{startLeft:_,scale:y,scaleWidth:S});c&&c(E,w),!w.defaultPrevented&&l({time:E})},children:v.getVirtualItems().map(w=>{const _=w.index,S=n??1,y=o??1,P=f?_%S===0:!0,x=[de("time-unit"),de(P?"time-unit-big":"time-unit-small")],C=(f?_/S:_)*y;return R.jsx("div",{"data-index":w.index,style:{width:`${w.size}px`,transform:`translateX(${w.start}px)`},className:x.join(" "),children:P&&R.jsx("div",{className:de("time-unit-scale"),children:C})},w.key)})})}function uo(n){return typeof n=="object"&&n!==null}function fo(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 ho(n){return uo(n)&&"ownerSVGElement"in n}const Ft=new WeakMap;let Vt;const ur=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:ho(r)&&"getBBox"in r?r.getBBox()[e]:r[t],mo=ur("inline","width","offsetWidth"),po=ur("block","height","offsetHeight");function go({target:n,borderBoxSize:e}){Ft.get(n)?.forEach(t=>{t(n,{get width(){return mo(n,e)},get height(){return po(n,e)}})})}function vo(n){n.forEach(go)}function bo(){typeof ResizeObserver>"u"||(Vt=new ResizeObserver(vo))}function _o(n,e){Vt||bo();const t=fo(n);return t.forEach(r=>{let s=Ft.get(r);s||(s=new Set,Ft.set(r,s)),s.add(e),Vt?.observe(r)}),()=>{t.forEach(r=>{const s=Ft.get(r);s?.delete(e),s?.size||Vt?.unobserve(r)})}}const Ut=new Set;let Rt;function wo(){Rt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ut.forEach(e=>e(n))},window.addEventListener("resize",Rt)}function So(n){return Ut.add(n),Rt||wo(),()=>{Ut.delete(n),!Ut.size&&typeof Rt=="function"&&(window.removeEventListener("resize",Rt),Rt=void 0)}}function yo(n,e){return typeof n=="function"?So(n):_o(n,e)}function Eo(n){const e=({children:t,...r})=>{const s=n(r);return t(s)};return e.displayName=`withHooks(${n.name||"Hook"})`,e}function Ro(n){const e=ze.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]=T.useState(r);let i,c;return e[1]!==t?(i=()=>{t.current&&yo(t.current,(l,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]),T.useLayoutEffect(i,c),s}const xo=Eo(Ro),Co=n=>{const e=ze.c(42),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:o,scaleWidth:i,scale:c,scaleCount:l,scaleSplitCount:u,scrollElementRef:a,maxScaleCount:h,onCursorDragStart:f,onCursorDrag:m,onCursorDragEnd:g}=n,b=T.useRef(null),v=T.useRef(void 0);let w,_;e[0]!==r||e[1]!==c||e[2]!==i||e[3]!==o?(w=()=>{if(typeof v.current>"u"&&b.current){const d=o??20,A=i??160,U=c??1;b.current.updateLeft(je(r,{startLeft:d,scaleWidth:A,scale:U}))}},_=[r,o,i,c],e[0]=r,e[1]=c,e[2]=i,e[3]=o,e[4]=w,e[5]=_):(w=e[4],_=e[5]),T.useEffect(w,_);const S=o??20,y=i??160,P=c??1,x=h??1/0,C=(u??0)>0,D=u??1,E=C?l*(u??1)+1:l,O=o??20,L=(C?y/D:y)*(E-1)+O;let W;e[6]!==S||e[7]!==x||e[8]!==a||e[9]!==L||e[10]!==y?(W=()=>({left:0,right:Math.min(L,x*y+S-(a.current?.scrollLeft??0))}),e[6]=S,e[7]=x,e[8]=a,e[9]=L,e[10]=y,e[11]=W):W=e[11];const V=!t;let q;e[12]!==r||e[13]!==S||e[14]!==f||e[15]!==P||e[16]!==y?(q=()=>{f&&f(r),v.current=je(r,{startLeft:S,scaleWidth:y,scale:P}),b.current?.updateLeft(v.current)},e[12]=r,e[13]=S,e[14]=f,e[15]=P,e[16]=y,e[17]=q):q=e[17];let M;e[18]!==S||e[19]!==g||e[20]!==P||e[21]!==s||e[22]!==y?(M=()=>{if(typeof v.current<"u"){const d=tt(v.current,{startLeft:S,scale:P,scaleWidth:y});s({time:d}),g&&g(d)}v.current=void 0},e[18]=S,e[19]=g,e[20]=P,e[21]=s,e[22]=y,e[23]=M):M=e[23];let k;e[24]!==S||e[25]!==m||e[26]!==P||e[27]!==a||e[28]!==s||e[29]!==y?(k=(d,A)=>{const{left:U}=d,B=A===void 0?0:A,J=a.current?.scrollLeft??0,Y=a.current,$=Y?.clientWidth??0;if(B!==0)if(typeof v.current<"u"){v.current=v.current+B;const N=J,I=J+$;v.current<N+10?v.current=N+10:v.current>I-10&&(v.current=I-10),v.current<S-J&&(v.current=S-J)}else{v.current=U+B;const N=J,I=J+$;v.current<N+10?v.current=N+10:v.current>I-10&&(v.current=I-10)}else if(U<S-J?v.current=S-J:v.current=U,Y&&$>0){const N=J,I=J+$;v.current<N+10?v.current=N+10:v.current>I-10&&(v.current=I-10)}if(typeof v.current<"u"){b.current?.updateLeft(v.current);const N=tt(v.current+J,{startLeft:S,scale:P,scaleWidth:y});s({time:N}),m&&m(N)}return!1},e[24]=S,e[25]=m,e[26]=P,e[27]=a,e[28]=s,e[29]=y,e[30]=k):k=e[30];let K,ue;e[31]===Symbol.for("react.memo_cache_sentinel")?(K=de("cursor"),ue=de("cursor-top"),e[31]=K,e[32]=ue):(K=e[31],ue=e[32]);let fe;e[33]===Symbol.for("react.memo_cache_sentinel")?(fe=R.jsxs("div",{className:K,children:[R.jsx("svg",{className:ue,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:R.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"})}),R.jsx("div",{className:de("cursor-area")})]}),e[33]=fe):fe=e[33];let me;return e[34]!==S||e[35]!==a||e[36]!==W||e[37]!==V||e[38]!==q||e[39]!==M||e[40]!==k?(me=R.jsx(cr,{start:S,ref:b,parentRef:a,getBounds:W,autoScroll:!0,enableDragging:V,enableResizing:!1,onDragStart:q,onDragEnd:M,onDrag:k,children:fe}),e[34]=S,e[35]=a,e[36]=W,e[37]=V,e[38]=q,e[39]=M,e[40]=k,e[41]=me):me=e[41],me};function Yn(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function fr(...n){return e=>{let t=!1;const r=n.map(s=>{const o=Yn(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():Yn(n[s],null)}}}}function nt(...n){return p.useCallback(fr(...n),n)}function To(n){const e=Ao(n),t=p.forwardRef((r,s)=>{const{children:o,...i}=r,c=p.Children.toArray(o),l=c.find(Do);if(l){const u=l.props.children,a=c.map(h=>h===l?p.Children.count(u)>1?p.Children.only(null):p.isValidElement(u)?u.props.children:null:h);return R.jsx(e,{...i,ref:s,children:p.isValidElement(u)?p.cloneElement(u,void 0,a):null})}return R.jsx(e,{...i,ref:s,children:o})});return t.displayName=`${n}.Slot`,t}function Ao(n){const e=p.forwardRef((t,r)=>{const{children:s,...o}=t;if(p.isValidElement(s)){const i=Lo(s),c=Oo(o,s.props);return s.type!==p.Fragment&&(c.ref=r?fr(r,i):i),p.cloneElement(s,c)}return p.Children.count(s)>1?p.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var Po=Symbol("radix.slottable");function Do(n){return p.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Po}function Oo(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 l=o(...c);return s(...c),l}:s&&(t[r]=s):r==="style"?t[r]={...s,...o}:r==="className"&&(t[r]=[s,o].filter(Boolean).join(" "))}return{...n,...t}}function Lo(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 Mo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ot=Mo.reduce((n,e)=>{const t=To(`Primitive.${e}`),r=p.forwardRef((s,o)=>{const{asChild:i,...c}=s,l=i?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(l,{...c,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function No(n,e=[]){let t=[];function r(o,i){const c=p.createContext(i),l=t.length;t=[...t,i];const u=h=>{const{scope:f,children:m,...g}=h,b=f?.[n]?.[l]||c,v=p.useMemo(()=>g,Object.values(g));return R.jsx(b.Provider,{value:v,children:m})};u.displayName=o+"Provider";function a(h,f){const m=f?.[n]?.[l]||c,g=p.useContext(m);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,a]}const s=()=>{const o=t.map(i=>p.createContext(i));return function(c){const l=c?.[n]||o;return p.useMemo(()=>({[`__scope${n}`]:{...c,[n]:l}}),[c,l])}};return s.scopeName=n,[r,Io(s,...e)]}function Io(...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:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...c,...h}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}function et(n,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(n?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}var dn=globalThis?.document?p.useLayoutEffect:()=>{};function ko(n,e){return p.useReducer((t,r)=>e[t][r]??t,n)}var Lt=n=>{const{present:e,children:t}=n,r=Wo(e),s=typeof t=="function"?t({present:r.isPresent}):p.Children.only(t),o=nt(r.ref,jo(s));return typeof t=="function"||r.isPresent?p.cloneElement(s,{ref:o}):null};Lt.displayName="Presence";function Wo(n){const[e,t]=p.useState(),r=p.useRef(null),s=p.useRef(n),o=p.useRef("none"),i=n?"mounted":"unmounted",[c,l]=ko(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=jt(r.current);o.current=c==="mounted"?u:"none"},[c]),dn(()=>{const u=r.current,a=s.current;if(a!==n){const f=o.current,m=jt(u);n?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(a&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,l]),dn(()=>{if(e){let u;const a=e.ownerDocument.defaultView??window,h=m=>{const b=jt(r.current).includes(CSS.escape(m.animationName));if(m.target===e&&b&&(l("ANIMATION_END"),!s.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=a.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},f=m=>{m.target===e&&(o.current=jt(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{a.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(u=>{r.current=u?getComputedStyle(u):null,t(u)},[])}}function jt(n){return n?.animationName||"none"}function jo(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 zo=p.createContext(void 0);function Fo(n){const e=p.useContext(zo);return n||e||"ltr"}function Qe(n){const e=p.useRef(n);return p.useEffect(()=>{e.current=n}),p.useMemo(()=>(...t)=>e.current?.(...t),[])}function Vo(n,[e,t]){return Math.min(t,Math.max(e,n))}function Uo(n,e){return p.useReducer((t,r)=>e[t][r]??t,n)}var pn="ScrollArea",[dr]=No(pn),[$o,Se]=dr(pn),hr=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=n,[c,l]=p.useState(null),[u,a]=p.useState(null),[h,f]=p.useState(null),[m,g]=p.useState(null),[b,v]=p.useState(null),[w,_]=p.useState(0),[S,y]=p.useState(0),[P,x]=p.useState(!1),[C,D]=p.useState(!1),E=nt(e,L=>l(L)),O=Fo(s);return R.jsx($o,{scope:t,type:r,dir:O,scrollHideDelay:o,scrollArea:c,viewport:u,onViewportChange:a,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:P,onScrollbarXEnabledChange:x,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:C,onScrollbarYEnabledChange:D,onCornerWidthChange:_,onCornerHeightChange:y,children:R.jsx(Ot.div,{dir:O,...i,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":S+"px",...n.style}})})});hr.displayName=pn;var mr="ScrollAreaViewport",pr=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...o}=n,i=Se(mr,t),c=p.useRef(null),l=nt(e,c,i.onViewportChange);return R.jsxs(R.Fragment,{children:[R.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}),R.jsx(Ot.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...n.style},children:R.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});pr.displayName=mr;var Te="ScrollAreaScrollbar",gr=p.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Se(Te,n.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,c=n.orientation==="horizontal";return p.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),s.type==="hover"?R.jsx(Ho,{...r,ref:e,forceMount:t}):s.type==="scroll"?R.jsx(Bo,{...r,ref:e,forceMount:t}):s.type==="auto"?R.jsx(vr,{...r,ref:e,forceMount:t}):s.type==="always"?R.jsx(gn,{...r,ref:e}):null});gr.displayName=Te;var Ho=p.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Se(Te,n.__scopeScrollArea),[o,i]=p.useState(!1);return p.useEffect(()=>{const c=s.scrollArea;let l=0;if(c){const u=()=>{window.clearTimeout(l),i(!0)},a=()=>{l=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",a),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",a)}}},[s.scrollArea,s.scrollHideDelay]),R.jsx(Lt,{present:t||o,children:R.jsx(vr,{"data-state":o?"visible":"hidden",...r,ref:e})})}),Bo=p.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=Se(Te,n.__scopeScrollArea),o=n.orientation==="horizontal",i=Jt(()=>l("SCROLL_END"),100),[c,l]=Uo("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 p.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,s.scrollHideDelay,l]),p.useEffect(()=>{const u=s.viewport,a=o?"scrollLeft":"scrollTop";if(u){let h=u[a];const f=()=>{const m=u[a];h!==m&&(l("SCROLL"),i()),h=m};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,o,l,i]),R.jsx(Lt,{present:t||c!=="hidden",children:R.jsx(gn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:et(n.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:et(n.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),vr=p.forwardRef((n,e)=>{const t=Se(Te,n.__scopeScrollArea),{forceMount:r,...s}=n,[o,i]=p.useState(!1),c=n.orientation==="horizontal",l=Jt(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,a=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?u:a)}},10);return xt(t.viewport,l),xt(t.content,l),R.jsx(Lt,{present:r||o,children:R.jsx(gn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),gn=p.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=Se(Te,n.__scopeScrollArea),o=p.useRef(null),i=p.useRef(0),[c,l]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=yr(c.viewport,c.content),a={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function h(f,m){return Jo(f,i.current,c,m)}return t==="horizontal"?R.jsx(Yo,{...a,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollLeft,m=Xn(f,c,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=h(f,s.dir))}}):t==="vertical"?R.jsx(Xo,{...a,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollTop,m=Xn(f,c);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=h(f))}}):null}),Yo=p.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=Se(Te,n.__scopeScrollArea),[i,c]=p.useState(),l=p.useRef(null),u=nt(e,l,o.onScrollbarXChange);return p.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),R.jsx(_r,{"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":qt(t)+"px",...n.style},onThumbPointerDown:a=>n.onThumbPointerDown(a.x),onDragScroll:a=>n.onDragScroll(a.x),onWheelScroll:(a,h)=>{if(o.viewport){const f=o.viewport.scrollLeft+a.deltaX;n.onWheelScroll(f),Rr(f,h)&&a.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Xt(i.paddingLeft),paddingEnd:Xt(i.paddingRight)}})}})}),Xo=p.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=Se(Te,n.__scopeScrollArea),[i,c]=p.useState(),l=p.useRef(null),u=nt(e,l,o.onScrollbarYChange);return p.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),R.jsx(_r,{"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":qt(t)+"px",...n.style},onThumbPointerDown:a=>n.onThumbPointerDown(a.y),onDragScroll:a=>n.onDragScroll(a.y),onWheelScroll:(a,h)=>{if(o.viewport){const f=o.viewport.scrollTop+a.deltaY;n.onWheelScroll(f),Rr(f,h)&&a.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Xt(i.paddingTop),paddingEnd:Xt(i.paddingBottom)}})}})}),[Go,br]=dr(Te),_r=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:a,onResize:h,...f}=n,m=Se(Te,t),[g,b]=p.useState(null),v=nt(e,E=>b(E)),w=p.useRef(null),_=p.useRef(""),S=m.viewport,y=r.content-r.viewport,P=Qe(a),x=Qe(l),C=Jt(h,10);function D(E){if(w.current){const O=E.clientX-w.current.left,L=E.clientY-w.current.top;u({x:O,y:L})}}return p.useEffect(()=>{const E=O=>{const L=O.target;g?.contains(L)&&P(O,y)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[S,g,y,P]),p.useEffect(x,[r,x]),xt(g,C),xt(m.content,C),R.jsx(Go,{scope:t,scrollbar:g,hasThumb:s,onThumbChange:Qe(o),onThumbPointerUp:Qe(i),onThumbPositionChange:x,onThumbPointerDown:Qe(c),children:R.jsx(Ot.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:et(n.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),w.current=g.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),D(E))}),onPointerMove:et(n.onPointerMove,D),onPointerUp:et(n.onPointerUp,E=>{const O=E.target;O.hasPointerCapture(E.pointerId)&&O.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=_.current,m.viewport&&(m.viewport.style.scrollBehavior=""),w.current=null})})})}),Yt="ScrollAreaThumb",wr=p.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=br(Yt,n.__scopeScrollArea);return R.jsx(Lt,{present:t||s.hasThumb,children:R.jsx(Ko,{ref:e,...r})})}),Ko=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,o=Se(Yt,t),i=br(Yt,t),{onThumbPositionChange:c}=i,l=nt(e,h=>i.onThumbChange(h)),u=p.useRef(void 0),a=Jt(()=>{u.current&&(u.current(),u.current=void 0)},100);return p.useEffect(()=>{const h=o.viewport;if(h){const f=()=>{if(a(),!u.current){const m=Zo(h,c);u.current=m,c()}};return c(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[o.viewport,a,c]),R.jsx(Ot.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:et(n.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),g=h.clientX-m.left,b=h.clientY-m.top;i.onThumbPointerDown({x:g,y:b})}),onPointerUp:et(n.onPointerUp,i.onThumbPointerUp)})});wr.displayName=Yt;var vn="ScrollAreaCorner",Sr=p.forwardRef((n,e)=>{const t=Se(vn,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?R.jsx(qo,{...n,ref:e}):null});Sr.displayName=vn;var qo=p.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=Se(vn,t),[o,i]=p.useState(0),[c,l]=p.useState(0),u=!!(o&&c);return xt(s.scrollbarX,()=>{const a=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(a),l(a)}),xt(s.scrollbarY,()=>{const a=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(a),i(a)}),u?R.jsx(Ot.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 Xt(n){return n?parseInt(n,10):0}function yr(n,e){const t=n/e;return isNaN(t)?0:t}function qt(n){const e=yr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function Jo(n,e,t,r="ltr"){const s=qt(t),o=s/2,i=e||o,c=s-i,l=t.scrollbar.paddingStart+i,u=t.scrollbar.size-t.scrollbar.paddingEnd-c,a=t.content-t.viewport,h=r==="ltr"?[0,a]:[a*-1,0];return Er([l,u],h)(n)}function Xn(n,e,t="ltr"){const r=qt(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,c=o-r,l=t==="ltr"?[0,i]:[i*-1,0],u=Vo(n,l);return Er([0,i],[0,c])(u)}function Er(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 Rr(n,e){return n>0&&n<e}var Zo=(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 Jt(n,e){const t=Qe(n),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function xt(n,e){const t=Qe(e);dn(()=>{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 Qo=hr,ei=pr,ti=Sr;function Gn(n){const e=ze.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=R.jsx(wr,{"data-slot":"scroll-area-thumb"}),e[4]=i):i=e[4];let c;return e[5]!==t||e[6]!==o||e[7]!==r?(c=R.jsx(gr,{"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}const ni=T.forwardRef((n,e)=>{const t=Ir(n),{style:r}=n;let{editorData:s,hideCursor:o,disableDrag:i,scale:c=1,scaleWidth:l=160,startLeft:u=20,minScaleCount:a=20,maxScaleCount:h=1/0,onChange:f,onScroll:m}=t;const g=T.useRef(null),[b,v]=T.useState(s),[w,_]=T.useState(un),[S,y]=T.useState(Sn),P=T.useRef(Sn),x=T.useCallback(E=>{const O=Math.min(h,Math.max(a,E));_(O)},[h,a]);T.useLayoutEffect(()=>{x(kr(s,{scale:c})),v(s)},[s,a,h,c,x]);const C=E=>{f?.(E)},D=E=>{let{left:O,time:L}=E;return typeof L<"u"?(y(L),P.current=L,!0):typeof O<"u"?(y(P.current=tt(O,{startLeft:u,scale:c,scaleWidth:l})),!0):!1};return T.useImperativeHandle(e,()=>({get target(){return g.current},set time(E){D({time:E})},get time(){return P.current},setScrollLeft:E=>{g.current&&(g.current.scrollLeft=E)},setScrollTop:E=>{g.current&&(g.current.scrollTop=E)}})),R.jsxs(Qo,{style:r,className:`${cn} ${i?cn+"-disable":""}`,"data-slot":"scroll-area",children:[R.jsx(ei,{"data-slot":"scroll-area-viewport",ref:g,onScroll:E=>{m?.(E.currentTarget)},children:R.jsx(xo,{elementRef:g,children:({width:E,height:O})=>R.jsxs(R.Fragment,{children:[R.jsx(lo,{...t,setCursor:D,scaleCount:w,scrollElementRef:g}),R.jsx(ao,{...t,scrollElementRef:g,timelineWidth:E,timelineHeight:O,disableDrag:i,editorData:b,cursorTime:S,scaleCount:w,setScaleCount:x,setEditorData:C}),!o&&R.jsx(Co,{...t,timelineWidth:E,height:O,scaleCount:w,setScaleCount:x,setCursor:D,cursorTime:S,editorData:b,scrollElementRef:g})]})})}),R.jsx(Gn,{orientation:"horizontal"}),R.jsx(Gn,{orientation:"vertical"}),R.jsx(ti,{})]})});exports.Timeline=ni;