@cyca/react-timeline-editor 0.2.2-alpha.3 → 0.2.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -217,7 +217,7 @@ export declare interface EffectSourceParam {
217
217
  }
218
218
 
219
219
  /** Scroll parameters from virtualized container */
220
- export declare type OnScrollParams = {
220
+ declare type OnScrollParams = {
221
221
  clientHeight: number;
222
222
  clientWidth: number;
223
223
  scrollHeight: number;
@@ -262,11 +262,6 @@ export declare interface TimelineAction {
262
262
  * @interface TimelineProp
263
263
  */
264
264
  export declare interface TimelineEditor extends EditData {
265
- /**
266
- * @description Scroll distance from top of editing area (please use ref.setScrollTop instead)
267
- * @deprecated
268
- */
269
- scrollTop?: number;
270
265
  /**
271
266
  * @description Editing area scroll callback (used to control synchronization with editing row scrolling)
272
267
  */
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),Yn=require("react-dom");function Gn(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 qe=Gn(b);var Ot={exports:{}},Et={};var Qt;function Kn(){if(Qt)return Et;Qt=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,i){var o=null;if(i!==void 0&&(o=""+i),s.key!==void 0&&(o=""+s.key),"key"in s){i={};for(var c in s)c!=="key"&&(i[c]=s[c])}else i=s;return s=i.ref,{$$typeof:n,type:r,key:o,ref:s!==void 0?s:null,props:i}}return Et.Fragment=e,Et.jsx=t,Et.jsxs=t,Et}var St={};var en;function qn(){return en||(en=1,process.env.NODE_ENV!=="production"&&(function(){function n(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===Y?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case y:return"Fragment";case h:return"Profiler";case E:return"StrictMode";case w:return"Suspense";case S:return"SuspenseList";case B:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case p:return"Portal";case D:return u.displayName||"Context";case x:return(u._context.displayName||"Context")+".Consumer";case _:var A=u.render;return u=u.displayName,u||(u=A.displayName||A.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case k:return A=u.displayName||null,A!==null?A:n(u.type)||"Memo";case C:A=u._payload,u=u._init;try{return n(u(A))}catch{}}return null}function e(u){return""+u}function t(u){try{e(u);var A=!1}catch{A=!0}if(A){A=console;var I=A.error,$=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return I.call(A,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$),e(u)}}function r(u){if(u===y)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===C)return"<...>";try{var A=n(u);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function s(){var u=F.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function o(u){if(V.call(u,"key")){var A=Object.getOwnPropertyDescriptor(u,"key").get;if(A&&A.isReactWarning)return!1}return u.key!==void 0}function c(u,A){function I(){T||(T=!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))}I.isReactWarning=!0,Object.defineProperty(u,"key",{get:I,configurable:!0})}function a(){var u=n(this.type);return P[u]||(P[u]=!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.")),u=this.props.ref,u!==void 0?u:null}function f(u,A,I,$,_e,ve){var L=I.ref;return u={$$typeof:v,type:u,key:A,props:I,_owner:$},(L!==void 0?L:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:a}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:_e}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ve}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function l(u,A,I,$,_e,ve){var L=A.children;if(L!==void 0)if($)if(J(L)){for($=0;$<L.length;$++)m(L[$]);Object.freeze&&Object.freeze(L)}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 m(L);if(V.call(A,"key")){L=n(u);var re=Object.keys(A).filter(function(N){return N!=="key"});$=0<re.length?"{key: someKey, "+re.join(": ..., ")+": ...}":"{key: someKey}",ge[L+$]||(re=0<re.length?"{"+re.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 x=require("react"),Bn=require("react-dom");function Hn(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const Pe=Hn(x);var Te={exports:{}},be={};var Qe;function Yn(){if(Qe)return be;Qe=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function e(r,s,i){var o=null;if(i!==void 0&&(o=""+i),s.key!==void 0&&(o=""+s.key),"key"in s){i={};for(var c in s)c!=="key"&&(i[c]=s[c])}else i=s;return s=i.ref,{$$typeof:n,type:r,key:o,ref:s!==void 0?s:null,props:i}}return be.Fragment=t,be.jsx=e,be.jsxs=e,be}var ye={};var tn;function Xn(){return tn||(tn=1,process.env.NODE_ENV!=="production"&&(function(){function n(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===C?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case h:return"Fragment";case p:return"Profiler";case g:return"StrictMode";case A:return"Suspense";case w:return"SuspenseList";case K:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case m:return"Portal";case y:return u.displayName||"Context";case b:return(u._context.displayName||"Context")+".Consumer";case S:var R=u.render;return u=u.displayName,u||(u=R.displayName||R.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case T:return R=u.displayName||null,R!==null?R:n(u.type)||"Memo";case k:R=u._payload,u=u._init;try{return n(u(R))}catch{}}return null}function t(u){return""+u}function e(u){try{t(u);var R=!1}catch{R=!0}if(R){R=console;var N=R.error,F=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return N.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",F),t(u)}}function r(u){if(u===h)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===k)return"<...>";try{var R=n(u);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function s(){var u=Q.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function o(u){if(B.call(u,"key")){var R=Object.getOwnPropertyDescriptor(u,"key").get;if(R&&R.isReactWarning)return!1}return u.key!==void 0}function c(u,R){function N(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",R))}N.isReactWarning=!0,Object.defineProperty(u,"key",{get:N,configurable:!0})}function l(){var u=n(this.type);return H[u]||(H[u]=!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.")),u=this.props.ref,u!==void 0?u:null}function f(u,R,N,F,Y,V){var W=N.ref;return u={$$typeof:E,type:u,key:R,props:N,_owner:F},(W!==void 0?W:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:l}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function a(u,R,N,F,Y,V){var W=R.children;if(W!==void 0)if(F)if(et(W)){for(F=0;F<W.length;F++)_(W[F]);Object.freeze&&Object.freeze(W)}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 _(W);if(B.call(R,"key")){W=n(u);var D=Object.keys(R).filter(function(z){return z!=="key"});F=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",dt[W+F]||(D=0<D.length?"{"+D.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} />`,$,L,re,L),ge[L+$]=!0)}if(L=null,I!==void 0&&(t(I),L=""+I),o(A)&&(t(A.key),L=""+A.key),"key"in A){I={};for(var U in A)U!=="key"&&(I[U]=A[U])}else I=A;return L&&c(I,typeof u=="function"?u.displayName||u.name||"Unknown":u),f(u,L,I,s(),_e,ve)}function m(u){d(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===C&&(u._payload.status==="fulfilled"?d(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function d(u){return typeof u=="object"&&u!==null&&u.$$typeof===v}var g=b,v=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),D=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),Y=Symbol.for("react.client.reference"),F=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,J=Array.isArray,R=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(u){return u()}};var T,P={},H=g.react_stack_bottom_frame.bind(g,i)(),fe=R(r(i)),ge={};St.Fragment=y,St.jsx=function(u,A,I){var $=1e4>F.recentlyCreatedOwnerStacks++;return l(u,A,I,!1,$?Error("react-stack-top-frame"):H,$?R(r(u)):fe)},St.jsxs=function(u,A,I){var $=1e4>F.recentlyCreatedOwnerStacks++;return l(u,A,I,!0,$?Error("react-stack-top-frame"):H,$?R(r(u)):fe)}})()),St}var tn;function Jn(){return tn||(tn=1,process.env.NODE_ENV==="production"?Ot.exports=Kn():Ot.exports=qn()),Ot.exports}var j=Jn();const Yt="timeline-editor",Zn=0,Nt=1,An=10,jt=160,zt=20,Gt=1,Kt=8,nn=32,qt=20,On=5,$t={trace:0,debug:1,info:2,warn:3,error:4,silent:5},Qn=["trace","debug","info","warn","error"];var er=class Dn{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(){Qn.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>$t[e]>=$t[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 $t?(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 Dn(this.s,this.e,e,this.r||this);this.ls.set(e,Cn(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 Cn(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 tr=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const nr={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},rn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},rr={bind(n,e,t){const r=t?`${rn[e]} ${String(t)}:`:`${rn[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${nr[e]}; font-weight: bold;`,"color: inherit")}},Ke=Cn(new er(new tr,rr));function sr(n){let{editorData:e=[],effects:t={},scrollTop:r=0,scale:s=Nt,scaleSplitCount:i=An,scaleWidth:o=jt,startLeft:c=zt,minScaleCount:a=qt,maxScaleCount:f=1/0,rowHeight:l=nn}=n;s<=0&&(Ke.error("Error: scale must be greater than 0!"),s=Nt),r<0&&(Ke.warn("Warning: scrollTop cannot be less than 0!"),r=0),i<=0&&(Ke.warn("Warning: scaleSplitCount cannot be less than 1!"),i=1),o<=0&&(Ke.warn("Warning: scaleWidth must be greater than 0!"),o=jt),c<0&&(Ke.warn("Warning: startLeft cannot be less than 0!"),c=0),a<1&&(Ke.warn("Warning: minScaleCount must be greater than 1!"),a=qt),a=parseInt(a+""),f<a&&(Ke.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),f=a),f=f===1/0?1/0:parseInt(f+""),l<=0&&(Ke.warn("Warning: rowHeight must be greater than 0!"),l=nn);const m={...n};return delete m.style,{...m,editorData:e,effects:t,scrollTop:r,scale:s,scaleSplitCount:i,scaleWidth:o,startLeft:c,minScaleCount:a,maxScaleCount:f,rowHeight:l}}function Ve(n,e){const{startLeft:t,scale:r,scaleWidth:s}=e;return t+n/r*s}function et(n,e){const{startLeft:t,scale:r,scaleWidth:s}=e;return(n-t)/s*r}function Rt(n,e){const{left:t,width:r}=n,s=et(t,e),i=et(t+r,e);return{start:s,end:i}}function Ln(n,e){const{start:t,end:r}=n,s=Ve(t,e),i=Ve(r,e)-s;return{left:s,width:i}}function ir(n,e){let t=0;return n.forEach(s=>{s.actions.forEach(i=>{t=Math.max(t,i.end)})}),Math.ceil(t/e.scale)+On}function or(n,e){const{startLeft:t,scaleWidth:r}=e,s=Math.ceil((n-t)/r);return Math.max(s+On,e.scaleCount)}function cr(n,e){const t=[];return n.forEach(r=>{t.push(Ve(r.start,e)),t.push(Ve(r.end,e))}),t}var Dt={exports:{}},Ut={};var sn;function ar(){if(sn)return Ut;sn=1;var n=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Ut.c=function(e){return n.H.useMemoCache(e)},Ut}var Ht={};var on;function lr(){return on||(on=1,process.env.NODE_ENV!=="production"&&(function(){var n=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Ht.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} />`,F,W,D,W),dt[W+F]=!0)}if(W=null,N!==void 0&&(e(N),W=""+N),o(R)&&(e(R.key),W=""+R.key),"key"in R){N={};for(var O in R)O!=="key"&&(N[O]=R[O])}else N=R;return W&&c(N,typeof u=="function"?u.displayName||u.name||"Unknown":u),f(u,W,N,s(),Y,V)}function _(u){d(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===k&&(u._payload.status==="fulfilled"?d(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function d(u){return typeof u=="object"&&u!==null&&u.$$typeof===E}var v=x,E=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),y=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),C=Symbol.for("react.client.reference"),Q=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,et=Array.isArray,j=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(u){return u()}};var M,H={},lt=v.react_stack_bottom_frame.bind(v,i)(),ut=j(r(i)),dt={};ye.Fragment=h,ye.jsx=function(u,R,N){var F=1e4>Q.recentlyCreatedOwnerStacks++;return a(u,R,N,!1,F?Error("react-stack-top-frame"):lt,F?j(r(u)):ut)},ye.jsxs=function(u,R,N){var F=1e4>Q.recentlyCreatedOwnerStacks++;return a(u,R,N,!0,F?Error("react-stack-top-frame"):lt,F?j(r(u)):ut)}})()),ye}var en;function Gn(){return en||(en=1,process.env.NODE_ENV==="production"?Te.exports=Yn():Te.exports=Xn()),Te.exports}var G=Gn();const Ye="timeline-editor",Kn=0,Ie=1,An=10,ke=160,We=20,Xe=1,Ge=8,nn=32,Ke=20,Dn=5,Ve={trace:0,debug:1,info:2,warn:3,error:4,silent:5},qn=["trace","debug","info","warn","error"];var Jn=class Cn{s;ls=new Map;lvl;def;n;r;c=console;e;trace;debug;info;warn;error;constructor(t,e,r,s){this.s=t,this.e=e,this.n=r,this.r=s,this.bindMethods()}noop=()=>{};bindMethods(){qn.forEach(t=>{const e=this.e.bind(this.c,t,this.n);Object.defineProperty(this,t,{get:()=>Ve[t]>=Ve[this.currentLevel()]?e:this.noop,configurable:!0})})}storageKey(){return this.n?`loglevel:${String(this.n)}`:"loglevel"}currentLevel(){if(this.lvl)return this.lvl;const t=this.s.get(this.storageKey());return t&&t in Ve?(this.lvl=t,this.lvl):this.def?this.def:this.r?this.r.currentLevel():"trace"}setLevel(t){return this.lvl=t,this.s.set(this.storageKey(),t),this}setDefaultLevel(t){return this.s.get(this.storageKey())||(this.def=t),this}resetLevel(){return this.lvl=void 0,this.s.del(this.storageKey()),this}getLogger(t){if(!t)throw new Error("Logger name required");if(!this.ls.has(t)){const e=new Cn(this.s,this.e,t,this.r||this);this.ls.set(t,On(e))}return this.ls.get(t)}getLoggers(){const t={};return this.ls.forEach((e,r)=>{t[String(r)]=e}),t}use(t){this.c=t,this.bindMethods()}};function On(n){return new Proxy(n,{get(t,e,r){if(e in t)return Reflect.get(t,e,r);const s=t.c[e];return typeof s=="function"?s.bind(t.c):s}})}var Zn=class{get(n){return localStorage.getItem(n)}set(n,t){localStorage.setItem(n,t)}del(n){localStorage.removeItem(n)}};const Qn={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},rn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},tr={bind(n,t,e){const r=e?`${rn[t]} ${String(e)}:`:`${rn[t]}`;return(n[t]||n.log).bind(n,`%c${r}%c`,`color: ${Qn[t]}; font-weight: bold;`,"color: inherit")}},Kt=On(new Jn(new Zn,tr));function er(n){let{editorData:t=[],effects:e={},scale:r=Ie,scaleSplitCount:s=An,scaleWidth:i=ke,startLeft:o=We,minScaleCount:c=Ke,maxScaleCount:l=1/0,rowHeight:f=nn}=n;r<=0&&(Kt.error("Error: scale must be greater than 0!"),r=Ie),s<=0&&(Kt.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),i<=0&&(Kt.warn("Warning: scaleWidth must be greater than 0!"),i=ke),o<0&&(Kt.warn("Warning: startLeft cannot be less than 0!"),o=0),c<1&&(Kt.warn("Warning: minScaleCount must be greater than 1!"),c=Ke),c=parseInt(c+""),l<c&&(Kt.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),l=c),l=l===1/0?1/0:parseInt(l+""),f<=0&&(Kt.warn("Warning: rowHeight must be greater than 0!"),f=nn);const a={...n};return delete a.style,{...a,editorData:t,effects:e,scale:r,scaleSplitCount:s,scaleWidth:i,startLeft:o,minScaleCount:c,maxScaleCount:l,rowHeight:f}}function kt(n,t){const{startLeft:e,scale:r,scaleWidth:s}=t;return e+n/r*s}function qt(n,t){const{startLeft:e,scale:r,scaleWidth:s}=t;return(n-e)/s*r}function Ee(n,t){const{left:e,width:r}=n,s=qt(e,t),i=qt(e+r,t);return{start:s,end:i}}function Je(n,t){const{start:e,end:r}=n,s=kt(e,t),i=kt(r,t)-s;return{left:s,width:i}}function nr(n,t){let e=0;return n.forEach(s=>{s.actions.forEach(i=>{e=Math.max(e,i.end)})}),Math.ceil(e/t.scale)+Dn}function rr(n,t){const{startLeft:e,scaleWidth:r}=t,s=Math.ceil((n-e)/r);return Math.max(s+Dn,t.scaleCount)}function sr(n,t){const e=[];return n.forEach(r=>{e.push(kt(r.start,t)),e.push(kt(r.end,t))}),e}var xe={exports:{}},$e={};var sn;function ir(){if(sn)return $e;sn=1;var n=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return $e.c=function(t){return n.H.useMemoCache(t)},$e}var Ue={};var on;function or(){return on||(on=1,process.env.NODE_ENV!=="production"&&(function(){var n=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Ue.c=function(t){var e=n.H;return e===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)}})()),Ht}var cn;function ur(){return cn||(cn=1,process.env.NODE_ENV==="production"?Dt.exports=ar():Dt.exports=lr()),Dt.exports}var Je=ur();function fr(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 me(...n){return fr(`${Yt}-`,...n)}const Ct=1,an=3,ln=10;function dr(n){const e=Je.c(7),t=b.useRef(Number.MIN_SAFE_INTEGER),r=b.useRef(Number.MAX_SAFE_INTEGER),s=b.useRef(Ct),i=b.useRef(void 0);let o;e[0]!==n?(o=()=>{if(n?.current){const{left:p,width:y}=n.current.getBoundingClientRect();t.current=p,r.current=p+y}},e[0]=n,e[1]=o):o=e[1];const c=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(p,y)=>{if(p.clientX>=r.current||p.clientX<=t.current){i.current!==void 0&&cancelAnimationFrame(i.current);const E=Math.abs(p.clientX>=r.current?p.clientX-r.current:p.clientX-t.current);s.current=Math.min(Number((E/ln).toFixed(0))*Ct,an);const x=(p.clientX>=r.current?1:-1)*s.current,D=()=>{y&&y(x),i.current=requestAnimationFrame(D)};return i.current=requestAnimationFrame(D),!1}else i.current!==void 0&&cancelAnimationFrame(i.current);return!0},e[2]=a):a=e[2];const f=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(p,y,E)=>{if(p.clientX>=r.current||p.clientX<t.current){i.current!==void 0&&cancelAnimationFrame(i.current);const h=Math.abs(p.clientX>=r.current?p.clientX-r.current:p.clientX-t.current);s.current=Math.min(Number((h/ln).toFixed(0))*Ct,an);const D=(p.clientX>=r.current?1:-1)*s.current,_=()=>{E&&E(D),i.current=requestAnimationFrame(_)};return i.current=requestAnimationFrame(_),!1}else i.current!==void 0&&cancelAnimationFrame(i.current);return!0},e[3]=l):l=e[3];const m=l;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{t.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=Ct,i.current!==void 0&&cancelAnimationFrame(i.current)},e[4]=d):d=e[4];const g=d;let v;return e[5]!==c?(v={initAutoScroll:c,dealDragAutoScroll:f,dealResizeAutoScroll:m,stopAutoScroll:g},e[5]=c,e[6]=v):v=e[6],v}function hr(n,e,t){return Math.max(e,Math.min(n,t))}const pe={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 un(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function fn(n,e,t,r=.15){return r===0?hr(n,e,t):n<e?-un(e-n,t-e,r)+e:n>t?+un(n-t,t-e,r)+t:n}function mr(n,[e,t],[r,s]){const[[i,o],[c,a]]=n;return[fn(e,i,o,r),fn(t,c,a,s)]}function pr(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=pr(n,"string");return typeof e=="symbol"?e:String(e)}function Se(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 dn(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 ne(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dn(Object(t),!0).forEach(function(r){Se(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const Mn={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 hn(n){return n?n[0].toUpperCase()+n.slice(1):""}const _r=["enter","leave"];function vr(n=!1,e){return n&&!_r.includes(e)}function br(n,e="",t=!1){const r=Mn[n],s=r&&r[e]||e;return"on"+hn(n)+hn(s)+(vr(t,s)?"Capture":"")}const yr=["gotpointercapture","lostpointercapture"];function wr(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=yr.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function Er(n,e=""){const t=Mn[n],r=t&&t[e]||e;return n+r}function Ft(n){return"touches"in n}function Pn(n){return Ft(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function Sr(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 Rr(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function In(n){return Ft(n)?Rr(n)[0]:n}function xr(n){return Sr(n).map(e=>e.identifier)}function Bt(n){const e=In(n);return Ft(n)?e.identifier:e.pointerId}function mn(n){const e=In(n);return[e.clientX,e.clientY]}function Tr(n){const e={};if("buttons"in n&&(e.buttons=n.buttons),"shiftKey"in n){const{shiftKey:t,altKey:r,metaKey:s,ctrlKey:i}=n;Object.assign(e,{shiftKey:t,altKey:r,metaKey:s,ctrlKey:i})}return e}function Wt(n,...e){return typeof n=="function"?n(...e):n}function Ar(){}function Or(...n){return n.length===0?Ar:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function pn(n,e){return Object.assign({},e,n||{})}const Dr=32;class Cr{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?Wt(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 i=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,Tr(e)),s.down=s.pressed=s.buttons%2===1||s.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const w=t._delta.map(Math.abs);pe.addTo(t._distance,w)}this.axisIntent&&this.axisIntent(e);const[o,c]=t._movement,[a,f]=r.threshold,{_step:l,values:m}=t;if(r.hasCustomTransform?(l[0]===!1&&(l[0]=Math.abs(o)>=a&&m[0]),l[1]===!1&&(l[1]=Math.abs(c)>=f&&m[1])):(l[0]===!1&&(l[0]=Math.abs(o)>=a&&Math.sign(o)*a),l[1]===!1&&(l[1]=Math.abs(c)>=f&&Math.sign(c)*f)),t.intentional=l[0]!==!1||l[1]!==!1,!t.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[w,S]=m;d[0]=l[0]!==!1?w-l[0]:0,d[1]=l[1]!==!1?S-l[1]:0}else d[0]=l[0]!==!1?o-l[0]:0,d[1]=l[1]!==!1?c-l[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const g=t.offset,v=t._active&&!t._blocked||t.active;v&&(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=Wt(r.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[p,y]=t.offset,[[E,h],[x,D]]=t._bounds;t.overflow=[p<E?-1:p>h?1:0,y<x?-1:y>D?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 _=t._active?r.rubberband||[0,0]:[0,0];if(t.offset=mr(t._bounds,t.offset,_),t.delta=pe.sub(t.offset,g),this.computeMovement(),v&&(!t.last||i>Dr)){t.delta=pe.sub(t.offset,g);const w=t.delta.map(Math.abs);pe.addTo(t.distance,w),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[w[0]/i,w[1]/i],t.timeDelta=i)}}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(ne(ne(ne({},t),e),{},{[this.aliasKey]:e.values}));s!==void 0&&(e.memo=s)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Lr([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 Mr extends Cr{constructor(...e){super(...e),Se(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=pe.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=pe.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[Pn(e)]:r.axisThreshold;t.axis=Lr(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 gn=n=>n,_n=.15,Zt={enabled(n=!0){return n},eventOptions(n,e,t){return ne(ne({},t.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[_n,_n];case!1:return[0,0];default:return pe.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return pe.toVector(n)},transform(n,e,t){const r=n||t.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const s=r||gn;return i=>{const o=s(i);return(!isFinite(o[0])||!isFinite(o[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${o[0]},${[1]}]`),o}}return r||gn},threshold(n){return pe.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(Zt,{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 Pr=0,xt=ne(ne({},Zt),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=Pr){return n},bounds(n={}){if(typeof n=="function")return i=>xt.bounds(n(i));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]]}}),vn={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 Ir extends Mr{constructor(...e){super(...e),Se(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),s={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=xt.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=Bt(e),r._pointerActive=!0,this.computeValues(mn(e)),this.computeInitial(),t.preventScrollAxis&&Pn(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=Bt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const i=mn(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=pe.sub(i,t._values),this.computeValues(i)),pe.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=Bt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,o]=t._distance;if(t.tap=i<=r.tapsThreshold&&o<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[c,a]=t._delta,[f,l]=t._movement,[m,d]=r.swipe.velocity,[g,v]=r.swipe.distance,p=r.swipe.duration;if(t.elapsedTime<p){const y=Math.abs(c/t.timeDelta),E=Math.abs(a/t.timeDelta);y>m&&Math.abs(f)>g&&(t.swipe[0]=Math.sign(c)),E>d&&Math.abs(l)>v&&(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,kr(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=vn[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,pe.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in vn&&(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 kr(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Tt=typeof window<"u"&&window.document&&window.document.createElement;function kn(){return Tt&&"ontouchstart"in window}function Nr(){return kn()||Tt&&window.navigator.maxTouchPoints>1}function jr(){return Tt&&"onpointerdown"in window}function Wr(){return Tt&&"exitPointerLock"in window.document}function zr(){try{return"constructor"in GestureEvent}catch{return!1}}const Me={isBrowser:Tt,gesture:zr(),touch:kn(),touchscreen:Nr(),pointer:jr(),pointerLock:Wr()},Fr=250,Vr=180,$r=.5,Ur=50,Hr=250,Br=10,bn={mouse:0,touch:0,pen:8},Nn=ne(ne({},xt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&Me.pointerLock,Me.touch&&t?"touch":this.pointerLock?"mouse":Me.pointer&&!s?"pointer":Me.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?Fr:void 0,!(!Me.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 i=pe.toVector(n,t?r:s?1:0);return this.filterTaps=t,this.tapsThreshold=r,i},swipe({velocity:n=$r,distance:e=Ur,duration:t=Hr}={}){return{velocity:this.transform(pe.toVector(n)),distance:this.transform(pe.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return Vr;case!1:return 0;default:return n}},axisThreshold(n){return n?ne(ne({},bn),n):bn},keyboardDisplacement(n=Br){return n}});process.env.NODE_ENV==="development"&&Object.assign(Nn,{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}});ne(ne({},Zt),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!Me.touch&&Me.gesture)return"gesture";if(Me.touch&&r)return"touch";if(Me.touchscreen){if(Me.pointer)return"pointer";if(Me.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=o=>{const c=pn(Wt(t,o),{min:-1/0,max:1/0});return[c.min,c.max]},i=o=>{const c=pn(Wt(r,o),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof t!="function"&&typeof r!="function"?[s(),i()]:o=>[s(o),i(o)]},threshold(n,e,t){return this.lockDirection=t.axis==="lock",pe.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});ne(ne({},xt),{},{mouseOnly:(n=!0)=>n});ne(ne({},xt),{},{mouseOnly:(n=!0)=>n});const jn=new Map,Jt=new Map;function Xr(n){jn.set(n.key,n.engine),Jt.set(n.key,n.resolver)}const Yr={key:"drag",engine:Ir,resolver:Nn};function Gr(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}function Kr(n,e){if(n==null)return{};var t=Gr(n,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}const qr={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=Me.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},Jr=["target","eventOptions","window","enabled","transform"];function Mt(n={},e){const t={};for(const[r,s]of Object.entries(e))switch(typeof s){case"function":if(process.env.NODE_ENV==="development"){const i=s.call(t,n[r],r,n);Number.isNaN(i)||(t[r]=i)}else t[r]=s.call(t,n[r],r,n);break;case"object":t[r]=Mt(n[r],s);break;case"boolean":s&&(t[r]=n[r]);break}return t}function Zr(n,e,t={}){const r=n,{target:s,eventOptions:i,window:o,enabled:c,transform:a}=r,f=Kr(r,Jr);if(t.shared=Mt({target:s,eventOptions:i,window:o,enabled:c,transform:a},qr),e){const l=Jt.get(e);t[e]=Mt(ne({shared:t.shared},f),l)}else for(const l in f){const m=Jt.get(l);if(m)t[l]=Mt(ne({shared:t.shared},f[l]),m);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 Wn{constructor(e,t){Se(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,i){const o=this._listeners,c=Er(t,r),a=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},f=ne(ne({},a),i);e.addEventListener(c,s,f);const l=()=>{e.removeEventListener(c,s,f),o.delete(l)};return o.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Qr{constructor(){Se(this,"_timeouts",new Map)}add(e,t,r=140,...s){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...s))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class es{constructor(e){Se(this,"gestures",new Set),Se(this,"_targetEventStore",new Wn(this)),Se(this,"gestureEventStores",{}),Se(this,"gestureTimeoutStores",{}),Se(this,"handlers",{}),Se(this,"config",{}),Se(this,"pointerIds",new Set),Se(this,"touchIds",new Set),Se(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),ts(this,e)}setEventIds(e){if(Ft(e))return this.touchIds=new Set(xr(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=Zr(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 o of this.gestures){const c=this.config[o],a=yn(r,c.eventOptions,!!s);if(c.enabled){const f=jn.get(o);new f(this,e,o).bind(a)}}const i=yn(r,t.eventOptions,!!s);for(const o in this.nativeHandlers)i(o,"",c=>this.nativeHandlers[o](ne(ne({},this.state.shared),{},{event:c,args:e})),void 0,!0)}for(const i in r)r[i]=Or(...r[i]);if(!s)return r;for(const i in r){const{device:o,capture:c,passive:a}=wr(i);this._targetEventStore.add(s,o,"",r[i],{capture:c,passive:a})}}}}function bt(n,e){n.gestures.add(e),n.gestureEventStores[e]=new Wn(n,e),n.gestureTimeoutStores[e]=new Qr}function ts(n,e){e.drag&&bt(n,"drag"),e.wheel&&bt(n,"wheel"),e.scroll&&bt(n,"scroll"),e.move&&bt(n,"move"),e.pinch&&bt(n,"pinch"),e.hover&&bt(n,"hover")}const yn=(n,e,t)=>(r,s,i,o={},c=!1)=>{var a,f;const l=(a=o.capture)!==null&&a!==void 0?a:e.capture,m=(f=o.passive)!==null&&f!==void 0?f:e.passive;let d=c?r:br(r,s,l);t&&m&&(d+="Passive"),n[d]=n[d]||[],n[d].push(i)};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 rs(n){var e=ns(n,"string");return typeof e=="symbol"?e:String(e)}function ss(n,e,t){return e=rs(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wn(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 Lt(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wn(Object(t),!0).forEach(function(r){ss(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class is{constructor(e,t,r,s,i){this._target=e,this._gestureKey=s,this._ctrl=new es(t),this._ctrl.applyHandlers(t,i),this._ctrl.applyConfig(Lt(Lt({},r),{},{target:e}),s),this._ctrl.effect()}destroy(){this._ctrl.clean()}setConfig(e){this._ctrl.clean(),this._ctrl.applyConfig(Lt(Lt({},e),{},{target:this._target}),this._gestureKey),this._ctrl.effect()}}const Xt=function(e,t,r){return Xr(Yr),new is(e,{drag:t},r||{},"drag")};function zn(...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 Fn=({children:n,...e})=>{const t=b.Children.only(n),r=os(t),s=t.props||{},i=s.style||{},o={...e,...s,style:{...e.style??{},...i},ref:zn(r,e.ref)};return b.cloneElement(t,o)};function os(n){let e=Object.getOwnPropertyDescriptor(n,"ref")?.get;return e&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref}const cs=({children:n,interactRef:e,draggable:t,resizable:r,draggableOptions:s,resizableOptions:i})=>{const o=b.useRef(null),c=b.useRef(void 0),a=b.useRef(void 0),f=b.useRef(void 0),l=b.useRef(void 0),m=b.useRef(void 0),d=b.useRef(null),g=b.useRef(null);b.useEffect(()=>{c.current=s,a.current=i},[s,i]);const v=b.useEffectEvent(()=>{o.current&&(t&&c.current&&(f.current=new Xt(o.current,p=>{const{active:y,delta:E,xy:h,event:x,first:D,last:_}=p,w=x?.target;if(w&&(w===d.current||w===g.current||d.current&&d.current.contains(w)||g.current&&g.current.contains(w)))return;const S={target:o.current,dx:E[0],dy:E[1],clientX:h[0],clientY:h[1]};D?c.current?.onstart?.(S):_?c.current?.onend?.(S):y&&c.current?.onmove?.(S)},{axis:c.current?.lockAxis==="x"?"x":void 0,pointer:{capture:!0}})),r&&a.current?.edges&&(a.current.edges.left&&(d.current||(d.current=o.current.querySelector(a.current.edges.left)),l.current=new Xt(d.current,p=>{const{active:y,delta:E,xy:h,first:x,last:D}=p,_={target:o.current,dx:E[0],dy:0,clientX:h[0],clientY:h[1],edges:{left:!0},deltaRect:{left:E[0]}};D?a.current?.onend?.(_):x?a.current?.onstart?.(_):y&&a.current?.onmove?.(_)},{pointer:{capture:!0}})),a.current.edges.right&&(g.current||(g.current=o.current.querySelector(a.current.edges.right)),m.current=new Xt(g.current,p=>{const{active:y,delta:E,xy:h,first:x,last:D}=p,_={target:o.current,dx:E[0],dy:0,clientX:h[0],clientY:h[1],edges:{right:!0},deltaRect:{right:E[0]}};D?a.current?.onend?.(_):x?a.current?.onstart?.(_):y&&a.current?.onmove?.(_)},{pointer:{capture:!0}}))))});return b.useEffect(()=>{if(!o.current)return;f.current?.destroy(),l.current?.destroy(),m.current?.destroy();const p={target:o.current,unset:()=>{f.current?.destroy(),l.current?.destroy(),m.current?.destroy()}};e&&(e.current=p),v()},[t,r,e]),Fn({children:n,ref:o,draggable:!1,style:{...t&&{touchAction:"none"}}})},Vn=b.forwardRef((n,e)=>{const t=Je.c(72),{children:r,edges:s,left:i,width:o,start:c,grid:a,bounds:f,enableResizing:l,enableDragging:m,adsorptionDistance:d,adsorptionPositions:g,onResizeStart:v,onResize:p,onResizeEnd:y,onDragStart:E,onDragEnd:h,onDrag:x,parentRef:D,deltaScrollLeft:_}=n,w=c===void 0?zt:c,S=a===void 0?Gt:a;let k;t[0]!==f?(k=f===void 0?{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}:f,t[0]=f,t[1]=k):k=t[1];const C=k,B=l===void 0?!0:l,Y=m===void 0?!0:m,F=d===void 0?Kt:d;let V;t[2]!==g?(V=g===void 0?[]:g,t[2]=g,t[3]=V):V=t[3];const J=V,R=b.useRef(void 0),T=b.useRef(0),P=b.useRef(!1),{initAutoScroll:H,dealDragAutoScroll:fe,dealResizeAutoScroll:ge,stopAutoScroll:u}=dr(D);let A,I;t[4]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{const M=R.current;return()=>{M?.unset()}},I=[],t[4]=A,t[5]=I):(A=t[4],I=t[5]),b.useEffect(A,I);let $;t[6]===Symbol.for("react.memo_cache_sentinel")?($=(M,q)=>{const X=q===void 0?!0:q;if(!R.current||!R.current.target)return;X&&(T.current=0);const z=R.current.target;z.style.left=`${M}px`,Object.assign(z.dataset,{left:M})},t[6]=$):$=t[6];const _e=$;let ve;t[7]===Symbol.for("react.memo_cache_sentinel")?(ve=(M,q)=>{const X=q===void 0?!0:q;if(!R.current||!R.current.target)return;X&&(T.current=0);const z=R.current.target;z.style.width=`${M}px`,Object.assign(z.dataset,{width:M})},t[7]=ve):ve=t[7];const L=ve;let re;t[8]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{if(!R.current?.target)return 0;const M=R.current.target;return parseFloat(M?.dataset?.left||"0")},t[8]=re):re=t[8];const U=re;let N;t[9]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{if(!R.current?.target)return 0;const M=R.current.target;return parseFloat(M?.dataset?.width||"0")},t[9]=N):N=t[9];const W=N;let je,$e;t[10]!==o?(je=()=>{if(!R.current?.target)return;const M=R.current.target;L(typeof o>"u"?M.offsetWidth:o,!1)},$e=[o],t[10]=o,t[11]=je,t[12]=$e):(je=t[11],$e=t[12]),b.useEffect(je,$e);let Pe,Re;t[13]!==i?(Pe=()=>{_e(i||0,!1)},Re=[i],t[13]=i,t[14]=Pe,t[15]=Re):(Pe=t[14],Re=t[15]),b.useEffect(Pe,Re);let xe;t[16]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>({updateLeft:M=>_e(M||0,!1),updateWidth:M=>L(M,!1),getLeft:U,getWidth:W}),t[16]=xe):xe=t[16],b.useImperativeHandle(e,xe);let Ae;t[17]!==H||t[18]!==E?(Ae=()=>{T.current=0,P.current=!1,H(),E&&E()},t[17]=H,t[18]=E,t[19]=Ae):Ae=t[19];const We=Ae;let Oe;t[20]!==F||t[21]!==J||t[22]!==C||t[23]!==S||t[24]!==x||t[25]!==w?(Oe=M=>{const{preLeft:q,preWidth:X,scrollDelta:z}=M,ee=P.current?F:S;if(Math.abs(T.current)>=ee){const le=parseInt(T.current/ee+"");let O=q+le*ee,te=O;const oe=Number.MAX_SAFE_INTEGER;if(J.forEach(K=>{const ce=Math.abs(K-O);ce<F&&ce<oe&&(te=K);const de=Math.abs(K-(O+X));de<F&&de<oe&&(te=K-X)}),te!==O?(P.current=!0,O=te):((O-w)%S!==0&&(O=w+S*Math.round((O-w)/S)),P.current=!1),T.current=T.current%ee,O<C.left?O=C.left:O+X>C.right&&(O=C.right-X),x&&x({lastLeft:q,left:O,lastWidth:X,width:X},z)===!1)return;_e(O,!1)}},t[20]=F,t[21]=J,t[22]=C,t[23]=S,t[24]=x,t[25]=w,t[26]=Oe):Oe=t[26];const De=Oe;let Ce;t[27]!==fe||t[28]!==_||t[29]!==De||t[30]!==D?(Ce=M=>{const q=M.target;if(_&&D?.current&&!fe(M,te=>{_(te);const{left:oe,width:K}=q.dataset,ce=parseFloat(oe||"0"),de=parseFloat(K||"0");T.current=T.current+te,De({preLeft:ce,preWidth:de,scrollDelta:te})}))return;const{left:X,width:z}=q.dataset,ee=parseFloat(X||"0"),le=parseFloat(z||"0");T.current=T.current+M.dx,De({preLeft:ee,preWidth:le})},t[27]=fe,t[28]=_,t[29]=De,t[30]=D,t[31]=Ce):Ce=t[31];const Ze=Ce;let Z;t[32]!==h||t[33]!==u?(Z=M=>{T.current=0,P.current=!1,u();const q=M.target,{left:X,width:z}=q.dataset;h&&h({left:parseFloat(X||"0"),width:parseFloat(z||"0")})},t[32]=h,t[33]=u,t[34]=Z):Z=t[34];const Q=Z;let G;t[35]!==H||t[36]!==v?(G=M=>{T.current=0,P.current=!1,H();const q=M.edges?.right?"right":"left";v&&v(q)},t[35]=H,t[36]=v,t[37]=G):G=t[37];const ie=G;let be;t[38]!==F||t[39]!==J||t[40]!==C||t[41]!==S||t[42]!==p||t[43]!==w?(be=M=>{const{dir:q,preWidth:X,preLeft:z}=M,ee=P.current?F:S;if(q==="left"){if(Math.abs(T.current)>=ee){const le=parseInt(T.current/ee+"");let O=z+le*ee,te=O;const oe=Number.MAX_SAFE_INTEGER;J.forEach(de=>{const Ne=Math.abs(de-O);Ne<F&&Ne<oe&&(te=de)}),te!==O?(P.current=!0,O=te):((O-w)%S!==0&&(O=w+S*Math.round((O-w)/S)),P.current=!1),T.current=T.current%ee;const K=z+X;O<C.left&&(O=C.left);const ce=K-O;if(p&&p("left",{lastLeft:z,lastWidth:X,left:O,width:ce})===!1)return;_e(O,!1),L(ce,!1)}}else if(q==="right"&&Math.abs(T.current)>=ee){const le=parseInt(T.current/S+"");let O=X+le*S,te=z+O;const oe=Number.MAX_SAFE_INTEGER;if(J.forEach(K=>{const ce=Math.abs(K-(z+O));ce<F&&ce<oe&&(te=K)}),te!==z+O)P.current=!0,O=te-z;else{let K=z+O;(K-w)%S!==0&&(K=w+S*Math.round((K-w)/S),O=K-z),P.current=!1}if(T.current=T.current%ee,z+O>C.right&&(O=C.right-z),p&&p("right",{lastLeft:z,lastWidth:X,left:z,width:O})===!1)return;L(O,!1)}},t[38]=F,t[39]=J,t[40]=C,t[41]=S,t[42]=p,t[43]=w,t[44]=be):be=t[44];const Te=be;let Ie;t[45]!==ge||t[46]!==_||t[47]!==D||t[48]!==Te?(Ie=M=>{const q=M.target,X=M.edges?.left?"left":"right";if(_&&D?.current&&!ge(M,X,oe=>{_(oe);const{left:K,width:ce}=q.dataset,de=parseFloat(K||"0"),Ne=parseFloat(ce||"0");T.current=T.current+oe,Te({preLeft:de,preWidth:Ne,dir:X})}))return;const{left:z,width:ee}=q.dataset,le=parseFloat(z||"0"),O=parseFloat(ee||"0");T.current=T.current+(X==="left"?M.deltaRect?.left||0:M.deltaRect?.right||0),Te({preLeft:le,preWidth:O,dir:X})},t[45]=ge,t[46]=_,t[47]=D,t[48]=Te,t[49]=Ie):Ie=t[49];const Ue=Ie;let He;t[50]!==y||t[51]!==u?(He=M=>{T.current=0,P.current=!1,u();const q=M.target,{left:X,width:z}=q.dataset,ee=M.edges?.right?"right":"left";y&&y(ee,{left:parseFloat(X||"0"),width:parseFloat(z||"0")})},t[50]=y,t[51]=u,t[52]=He):He=t[52];const Qe=He;let ke;t[53]!==Ze||t[54]!==We||t[55]!==Q?(ke={lockAxis:"x",onmove:Ze,onstart:We,onend:Q,cursorChecker:as},t[53]=Ze,t[54]=We,t[55]=Q,t[56]=ke):ke=t[56];let ze;t[57]!==s||t[58]!==Ue||t[59]!==ie||t[60]!==Qe?(ze={axis:"x",invert:"none",edges:s,onmove:Ue,onstart:ie,onend:Qe},t[57]=s,t[58]=Ue,t[59]=ie,t[60]=Qe,t[61]=ze):ze=t[61];const Xe=r;let Fe;t[62]!==i||t[63]!==Xe||t[64]!==o?(Fe=Fn({children:Xe,style:{left:i,width:o}}),t[62]=i,t[63]=Xe,t[64]=o,t[65]=Fe):Fe=t[65];let Be;return t[66]!==Y||t[67]!==B||t[68]!==ke||t[69]!==ze||t[70]!==Fe?(Be=j.jsx(cs,{interactRef:R,draggable:Y,resizable:B,draggableOptions:ke,resizableOptions:ze,children:Fe}),t[66]=Y,t[67]=B,t[68]=ke,t[69]=ze,t[70]=Fe,t[71]=Be):Be=t[71],Be});function as(){return""}const $n=qe.forwardRef(({children:n},e)=>{const[t,r]=qe.useState({clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0}),s=qe.useCallback(i=>{r(o=>({...o,...i}))},[]);return qe.useImperativeHandle(e,()=>({get state(){return t},setScrollState:r,handleScroll:s})),n({...t,onScroll:s})});$n.displayName="ScrollSync";const ls=n=>{const e=Je.c(42),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:i,timelineWidth:o,scaleWidth:c,scale:a,scrollLeft:f,scrollSync:l,areaRef:m,maxScaleCount:d,deltaScrollLeft:g,onCursorDragStart:v,onCursorDrag:p,onCursorDragEnd:y}=n,E=b.useRef(null),h=b.useRef(void 0);let x,D;e[0]!==r||e[1]!==a||e[2]!==c||e[3]!==f||e[4]!==i?(x=()=>{if(typeof h.current>"u"&&E.current){const fe=i??20,ge=c??160,u=a??1;E.current.updateLeft(Ve(r,{startLeft:fe,scaleWidth:ge,scale:u})-f)}},D=[r,i,c,a,f],e[0]=r,e[1]=a,e[2]=c,e[3]=f,e[4]=i,e[5]=x,e[6]=D):(x=e[5],D=e[6]),b.useEffect(x,D);const _=i??20,w=c??160,S=a??1,C=Math.min(o,(d??1/0)*w+_-f);let B;e[7]!==C?(B={left:0,right:C},e[7]=C,e[8]=B):B=e[8];const Y=!t;let F;e[9]!==r||e[10]!==_||e[11]!==v||e[12]!==S||e[13]!==f||e[14]!==w?(F=()=>{v&&v(r),h.current=Ve(r,{startLeft:_,scaleWidth:w,scale:S})-f,E.current?.updateLeft(h.current)},e[9]=r,e[10]=_,e[11]=v,e[12]=S,e[13]=f,e[14]=w,e[15]=F):F=e[15];let V;e[16]!==_||e[17]!==y||e[18]!==S||e[19]!==f||e[20]!==s||e[21]!==w?(V=()=>{if(typeof h.current<"u"){const fe=et(h.current+f,{startLeft:_,scale:S,scaleWidth:w});s({time:fe}),y&&y(fe)}h.current=void 0},e[16]=_,e[17]=y,e[18]=S,e[19]=f,e[20]=s,e[21]=w,e[22]=V):V=e[22];let J;e[23]!==_||e[24]!==p||e[25]!==S||e[26]!==l.current||e[27]!==s||e[28]!==w?(J=(fe,ge)=>{const{left:u}=fe,A=ge===void 0?0:ge;if(!l.current?.state)return!1;const I=l.current.state.scrollLeft;if(!A||I===0?u<_-I?h.current=_-I:h.current=u:typeof h.current<"u"&&h.current<_-I-A&&(h.current=_-I-A),typeof h.current<"u"){E.current?.updateLeft(h.current);const $=et(h.current+I,{startLeft:_,scale:S,scaleWidth:w});s({time:$}),p&&p($)}return!1},e[23]=_,e[24]=p,e[25]=S,e[26]=l.current,e[27]=s,e[28]=w,e[29]=J):J=e[29];let R,T;e[30]===Symbol.for("react.memo_cache_sentinel")?(T=me("cursor"),R=me("cursor-top"),e[30]=R,e[31]=T):(R=e[30],T=e[31]);let P;e[32]===Symbol.for("react.memo_cache_sentinel")?(P=j.jsxs("div",{className:T,children:[j.jsx("svg",{className:R,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:j.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:"#5297FF"})}),j.jsx("div",{className:me("cursor-area")})]}),e[32]=P):P=e[32];let H;return e[33]!==m||e[34]!==g||e[35]!==_||e[36]!==B||e[37]!==Y||e[38]!==F||e[39]!==V||e[40]!==J?(H=j.jsx(Vn,{start:_,ref:E,parentRef:m,bounds:B,deltaScrollLeft:g,enableDragging:Y,enableResizing:!1,onDragStart:F,onDragEnd:V,onDrag:J,children:P}),e[33]=m,e[34]=g,e[35]=_,e[36]=B,e[37]=Y,e[38]=F,e[39]=V,e[40]=J,e[41]=H):H=e[41],H};function yt(n,e,t){let r=t.initialDeps??[],s;function i(){var o,c,a,f;let l;t.key&&((o=t.debug)!=null&&o.call(t))&&(l=Date.now());const m=n();if(!(m.length!==r.length||m.some((v,p)=>r[p]!==v)))return s;r=m;let g;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(g=Date.now()),s=e(...m),t.key&&((a=t.debug)!=null&&a.call(t))){const v=Math.round((Date.now()-l)*100)/100,p=Math.round((Date.now()-g)*100)/100,y=p/16,E=(h,x)=>{for(h=String(h);h.length<x;)h=" "+h;return h};console.info(`%c⏱ ${E(p,5)} /${E(v,5)} ms`,`
10
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),e.useMemoCache(t)}})()),Ue}var cn;function cr(){return cn||(cn=1,process.env.NODE_ENV==="production"?xe.exports=ir():xe.exports=or()),xe.exports}var Nt=cr();function ar(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return t.map(function(r){return r.split(" ").map(function(s){return s?""+n+s:""}).join(" ")}).join(" ")}function Et(...n){return ar(`${Ye}-`,...n)}const lr=n=>{const t=Nt.c(11),{isMoving:e,movePositions:r,assistPositions:s}=n;let i,o;if(t[0]!==e||t[1]!==r||t[2]!==s){const l=r===void 0?[]:r;let f;t[5]!==s?(f=s===void 0?[]:s,t[5]=s,t[6]=f):f=t[6];const a=f;t[7]===Symbol.for("react.memo_cache_sentinel")?(i=Et("drag-line-container"),t[7]=i):i=t[7],o=e&&l.filter(_=>a.includes(_)).map(ur),t[0]=e,t[1]=r,t[2]=s,t[3]=i,t[4]=o}else i=t[3],o=t[4];let c;return t[8]!==i||t[9]!==o?(c=G.jsx("div",{className:i,children:o}),t[8]=i,t[9]=o,t[10]=c):c=t[10],c};function ur(n,t){return G.jsx("div",{className:Et("drag-line"),style:{left:n}},t)}const Ae=1,an=10,ln=10;function fr(n){const t=Nt.c(7),e=x.useRef(Number.MIN_SAFE_INTEGER),r=x.useRef(Number.MAX_SAFE_INTEGER),s=x.useRef(Ae),i=x.useRef(void 0);let o;t[0]!==n?(o=()=>{if(n?.current){const{left:m,width:h}=n.current.getBoundingClientRect();e.current=m,r.current=m+h}},t[0]=n,t[1]=o):o=t[1];const c=o;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(m,h)=>{if(m.clientX>=r.current||m.clientX<=e.current){i.current!==void 0&&cancelAnimationFrame(i.current);const g=Math.abs(m.clientX>=r.current?m.clientX-r.current:m.clientX-e.current);s.current=Math.min(Number((g/ln).toFixed(0))*Ae,an);const b=(m.clientX>=r.current?1:-1)*s.current,y=()=>{h&&h(b),i.current=requestAnimationFrame(y)};return i.current=requestAnimationFrame(y),!1}else i.current!==void 0&&cancelAnimationFrame(i.current);return!0},t[2]=l):l=t[2];const f=l;let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=(m,h,g)=>{if(m.clientX>=r.current||m.clientX<e.current){i.current!==void 0&&cancelAnimationFrame(i.current);const p=Math.abs(m.clientX>=r.current?m.clientX-r.current:m.clientX-e.current);s.current=Math.min(Number((p/ln).toFixed(0))*Ae,an);const y=(m.clientX>=r.current?1:-1)*s.current,S=()=>{g&&g(y),i.current=requestAnimationFrame(S)};return i.current=requestAnimationFrame(S),!1}else i.current!==void 0&&cancelAnimationFrame(i.current);return!0},t[3]=a):a=t[3];const _=a;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{e.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=Ae,i.current!==void 0&&cancelAnimationFrame(i.current)},t[4]=d):d=t[4];const v=d;let E;return t[5]!==c?(E={initAutoScroll:c,dealDragAutoScroll:f,dealResizeAutoScroll:_,stopAutoScroll:v},t[5]=c,t[6]=E):E=t[6],E}function dr(n,t,e){return Math.max(t,Math.min(n,e))}const ft={toVector(n,t){return n===void 0&&(n=t),Array.isArray(n)?n:[n,n]},add(n,t){return[n[0]+t[0],n[1]+t[1]]},sub(n,t){return[n[0]-t[0],n[1]-t[1]]},addTo(n,t){n[0]+=t[0],n[1]+=t[1]},subTo(n,t){n[0]-=t[0],n[1]-=t[1]}};function un(n,t,e){return t===0||Math.abs(t)===1/0?Math.pow(n,e*5):n*t*e/(t+e*n)}function fn(n,t,e,r=.15){return r===0?dr(n,t,e):n<t?-un(t-n,e-t,r)+t:n>e?+un(n-e,e-t,r)+e:n}function hr(n,[t,e],[r,s]){const[[i,o],[c,l]]=n;return[fn(t,i,o,r),fn(e,c,l,s)]}function mr(n,t){if(typeof n!="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var r=e.call(n,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function gr(n){var t=mr(n,"string");return typeof t=="symbol"?t:String(t)}function gt(n,t,e){return t=gr(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function dn(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,r)}return e}function Z(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?dn(Object(e),!0).forEach(function(r){gt(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):dn(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}const Ln={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 hn(n){return n?n[0].toUpperCase()+n.slice(1):""}const pr=["enter","leave"];function _r(n=!1,t){return n&&!pr.includes(t)}function vr(n,t="",e=!1){const r=Ln[n],s=r&&r[t]||t;return"on"+hn(n)+hn(s)+(_r(e,s)?"Capture":"")}const br=["gotpointercapture","lostpointercapture"];function yr(n){let t=n.substring(2).toLowerCase();const e=!!~t.indexOf("passive");e&&(t=t.replace("passive",""));const r=br.includes(t)?"capturecapture":"capture",s=!!~t.indexOf(r);return s&&(t=t.replace("capture","")),{device:t,capture:s,passive:e}}function Er(n,t=""){const e=Ln[n],r=e&&e[t]||t;return n+r}function ze(n){return"touches"in n}function Mn(n){return ze(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function wr(n){return Array.from(n.touches).filter(t=>{var e,r;return t.target===n.currentTarget||((e=n.currentTarget)===null||e===void 0||(r=e.contains)===null||r===void 0?void 0:r.call(e,t.target))})}function Sr(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Pn(n){return ze(n)?Sr(n)[0]:n}function Rr(n){return wr(n).map(t=>t.identifier)}function Be(n){const t=Pn(n);return ze(n)?t.identifier:t.pointerId}function mn(n){const t=Pn(n);return[t.clientX,t.clientY]}function Tr(n){const t={};if("buttons"in n&&(t.buttons=n.buttons),"shiftKey"in n){const{shiftKey:e,altKey:r,metaKey:s,ctrlKey:i}=n;Object.assign(t,{shiftKey:e,altKey:r,metaKey:s,ctrlKey:i})}return t}function Ne(n,...t){return typeof n=="function"?n(...t):n}function xr(){}function Ar(...n){return n.length===0?xr:n.length===1?n[0]:function(){let t;for(const e of n)t=e.apply(this,arguments)||t;return t}}function gn(n,t){return Object.assign({},t,n||{})}const Dr=32;class Cr{constructor(t,e,r){this.ctrl=t,this.args=e,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(t){this.ctrl.state[this.key]=t}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:t,shared:e,ingKey:r,args:s}=this;e[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=s,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const e=this.state,r=this.config;e._active||(this.reset(),this.computeInitial(),e._active=!0,e.target=t.target,e.currentTarget=t.currentTarget,e.lastOffset=r.from?Ne(r.from,e):e.offset,e.offset=e.lastOffset,e.startTime=e.timeStamp=t.timeStamp)}computeValues(t){const e=this.state;e._values=t,e.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:e,config:r,shared:s}=this;e.args=this.args;let i=0;if(t&&(e.event=t,r.preventDefault&&t.cancelable&&e.event.preventDefault(),e.type=t.type,s.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,s.locked=!!document.pointerLockElement,Object.assign(s,Tr(t)),s.down=s.pressed=s.buttons%2===1||s.touches>0,i=t.timeStamp-e.timeStamp,e.timeStamp=t.timeStamp,e.elapsedTime=e.timeStamp-e.startTime),e._active){const A=e._delta.map(Math.abs);ft.addTo(e._distance,A)}this.axisIntent&&this.axisIntent(t);const[o,c]=e._movement,[l,f]=r.threshold,{_step:a,values:_}=e;if(r.hasCustomTransform?(a[0]===!1&&(a[0]=Math.abs(o)>=l&&_[0]),a[1]===!1&&(a[1]=Math.abs(c)>=f&&_[1])):(a[0]===!1&&(a[0]=Math.abs(o)>=l&&Math.sign(o)*l),a[1]===!1&&(a[1]=Math.abs(c)>=f&&Math.sign(c)*f)),e.intentional=a[0]!==!1||a[1]!==!1,!e.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[A,w]=_;d[0]=a[0]!==!1?A-a[0]:0,d[1]=a[1]!==!1?w-a[1]:0}else d[0]=a[0]!==!1?o-a[0]:0,d[1]=a[1]!==!1?c-a[1]:0;this.restrictToAxis&&!e._blocked&&this.restrictToAxis(d);const v=e.offset,E=e._active&&!e._blocked||e.active;E&&(e.first=e._active&&!e.active,e.last=!e._active&&e.active,e.active=s[this.ingKey]=e._active,t&&(e.first&&("bounds"in r&&(e._bounds=Ne(r.bounds,e)),this.setup&&this.setup()),e.movement=d,this.computeOffset()));const[m,h]=e.offset,[[g,p],[b,y]]=e._bounds;e.overflow=[m<g?-1:m>p?1:0,h<b?-1:h>y?1:0],e._movementBound[0]=e.overflow[0]?e._movementBound[0]===!1?e._movement[0]:e._movementBound[0]:!1,e._movementBound[1]=e.overflow[1]?e._movementBound[1]===!1?e._movement[1]:e._movementBound[1]:!1;const S=e._active?r.rubberband||[0,0]:[0,0];if(e.offset=hr(e._bounds,e.offset,S),e.delta=ft.sub(e.offset,v),this.computeMovement(),E&&(!e.last||i>Dr)){e.delta=ft.sub(e.offset,v);const A=e.delta.map(Math.abs);ft.addTo(e.distance,A),e.direction=e.delta.map(Math.sign),e._direction=e._delta.map(Math.sign),!e.first&&i>0&&(e.velocity=[A[0]/i,A[1]/i],e.timeDelta=i)}}emit(){const t=this.state,e=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const s=this.handler(Z(Z(Z({},e),t),{},{[this.aliasKey]:t.values}));s!==void 0&&(t.memo=s)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Or([n,t],e){const r=Math.abs(n),s=Math.abs(t);if(r>s&&r>e)return"x";if(s>r&&s>e)return"y"}class Lr extends Cr{constructor(...t){super(...t),gt(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=ft.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ft.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const e=this.state,r=this.config;if(!e.axis&&t){const s=typeof r.axisThreshold=="object"?r.axisThreshold[Mn(t)]:r.axisThreshold;e.axis=Or(e._movement,s)}e._blocked=(r.lockDirection||!!r.axis)&&!e.axis||!!r.axis&&r.axis!==e.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const pn=n=>n,_n=.15,Ze={enabled(n=!0){return n},eventOptions(n,t,e){return Z(Z({},e.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[_n,_n];case!1:return[0,0];default:return ft.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return ft.toVector(n)},transform(n,t,e){const r=n||e.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const s=r||pn;return i=>{const o=s(i);return(!isFinite(o[0])||!isFinite(o[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${o[0]},${[1]}]`),o}}return r||pn},threshold(n){return ft.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(Ze,{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 Mr=0,we=Z(Z({},Ze),{},{axis(n,t,{axis:e}){if(this.lockDirection=e==="lock",!this.lockDirection)return e},axisThreshold(n=Mr){return n},bounds(n={}){if(typeof n=="function")return i=>we.bounds(n(i));if("current"in n)return()=>n.current;if(typeof HTMLElement=="function"&&n instanceof HTMLElement)return n;const{left:t=-1/0,right:e=1/0,top:r=-1/0,bottom:s=1/0}=n;return[[t,e],[r,s]]}}),vn={ArrowRight:(n,t=1)=>[n*t,0],ArrowLeft:(n,t=1)=>[-1*n*t,0],ArrowUp:(n,t=1)=>[0,-1*n*t],ArrowDown:(n,t=1)=>[0,n*t]};class Pr extends Lr{constructor(...t){super(...t),gt(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const e=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),s={left:e.left-r.left+t.offset[0],right:e.right-r.right+t.offset[0],top:e.top-r.top+t.offset[1],bottom:e.bottom-r.bottom+t.offset[1]};t._bounds=we.bounds(s)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._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(t){const e=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(e.pointerButtons)?!e.pointerButtons.includes(t.buttons):e.pointerButtons!==-1&&e.pointerButtons!==t.buttons))return;const s=this.ctrl.setEventIds(t);e.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(s&&s.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=Be(t),r._pointerActive=!0,this.computeValues(mn(t)),this.computeInitial(),e.preventScrollAxis&&Mn(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):e.delay>0?(this.setupDelayTrigger(t),e.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const e=this.state;e._active=!0,e._preventScroll=!0,e._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const e=this.state,r=this.config;if(!e._pointerActive)return;const s=Be(t);if(e._pointerId!==void 0&&s!==e._pointerId)return;const i=mn(t);if(document.pointerLockElement===t.target?e._delta=[t.movementX,t.movementY]:(e._delta=ft.sub(i,e._values),this.computeValues(i)),ft.addTo(e._movement,e._delta),this.compute(t),e._delayed&&e.intentional){this.timeoutStore.remove("dragDelay"),e.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!e._preventScroll)if(e.axis)if(e.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){e._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.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 e=this.state,r=this.config;if(!e._active||!e._pointerActive)return;const s=Be(t);if(e._pointerId!==void 0&&s!==e._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[i,o]=e._distance;if(e.tap=i<=r.tapsThreshold&&o<=r.tapsThreshold,e.tap&&r.filterTaps)e._force=!0;else{const[c,l]=e._delta,[f,a]=e._movement,[_,d]=r.swipe.velocity,[v,E]=r.swipe.distance,m=r.swipe.duration;if(e.elapsedTime<m){const h=Math.abs(c/e.timeDelta),g=Math.abs(l/e.timeDelta);h>_&&Math.abs(f)>v&&(e.swipe[0]=Math.sign(c)),g>d&&Math.abs(a)>E&&(e.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const e=this.config,r=e.device;if(process.env.NODE_ENV==="development")try{if(r==="pointer"&&e.preventScrollDelay===void 0){const s="uv"in t?t.sourceEvent.currentTarget:t.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{}e.pointerLock&&t.currentTarget.requestPointerLock(),e.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(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,Ir(t);const e=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",e),this.eventStore.add(this.sharedConfig.window,"touch","cancel",e),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const e=vn[t.key];if(e){const r=this.state,s=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=e(this.config.keyboardDisplacement,s),r._keyboardActive=!0,ft.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in vn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const e=this.config.device;t(e,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(e,"change",this.pointerMove.bind(this)),t(e,"end",this.pointerUp.bind(this)),t(e,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Ir(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Se=typeof window<"u"&&window.document&&window.document.createElement;function In(){return Se&&"ontouchstart"in window}function kr(){return In()||Se&&window.navigator.maxTouchPoints>1}function Nr(){return Se&&"onpointerdown"in window}function Wr(){return Se&&"exitPointerLock"in window.document}function zr(){try{return"constructor"in GestureEvent}catch{return!1}}const vt={isBrowser:Se,gesture:zr(),touch:In(),touchscreen:kr(),pointer:Nr(),pointerLock:Wr()},jr=250,Fr=180,Vr=.5,$r=50,Ur=250,Br=10,bn={mouse:0,touch:0,pen:8},kn=Z(Z({},we),{},{device(n,t,{pointer:{touch:e=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&vt.pointerLock,vt.touch&&e?"touch":this.pointerLock?"mouse":vt.pointer&&!s?"pointer":vt.touch?"touch":"mouse"},preventScrollAxis(n,t,{preventScroll:e}){if(this.preventScrollDelay=typeof e=="number"?e:e||e===void 0&&n?jr:void 0,!(!vt.touchscreen||e===!1))return n||(e!==void 0?"y":void 0)},pointerCapture(n,t,{pointer:{capture:e=!0,buttons:r=1,keys:s=!0}={}}){return this.pointerButtons=r,this.keys=s,!this.pointerLock&&this.device==="pointer"&&e},threshold(n,t,{filterTaps:e=!1,tapsThreshold:r=3,axis:s=void 0}){const i=ft.toVector(n,e?r:s?1:0);return this.filterTaps=e,this.tapsThreshold=r,i},swipe({velocity:n=Vr,distance:t=$r,duration:e=Ur}={}){return{velocity:this.transform(ft.toVector(n)),distance:this.transform(ft.toVector(t)),duration:e}},delay(n=0){switch(n){case!0:return Fr;case!1:return 0;default:return n}},axisThreshold(n){return n?Z(Z({},bn),n):bn},keyboardDisplacement(n=Br){return n}});process.env.NODE_ENV==="development"&&Object.assign(kn,{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}});Z(Z({},Ze),{},{device(n,t,{shared:e,pointer:{touch:r=!1}={}}){if(e.target&&!vt.touch&&vt.gesture)return"gesture";if(vt.touch&&r)return"touch";if(vt.touchscreen){if(vt.pointer)return"pointer";if(vt.touch)return"touch"}},bounds(n,t,{scaleBounds:e={},angleBounds:r={}}){const s=o=>{const c=gn(Ne(e,o),{min:-1/0,max:1/0});return[c.min,c.max]},i=o=>{const c=gn(Ne(r,o),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof e!="function"&&typeof r!="function"?[s(),i()]:o=>[s(o),i(o)]},threshold(n,t,e){return this.lockDirection=e.axis==="lock",ft.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});Z(Z({},we),{},{mouseOnly:(n=!0)=>n});Z(Z({},we),{},{mouseOnly:(n=!0)=>n});const Nn=new Map,qe=new Map;function Hr(n){Nn.set(n.key,n.engine),qe.set(n.key,n.resolver)}const Yr={key:"drag",engine:Pr,resolver:kn};function Xr(n,t){if(n==null)return{};var e={},r=Object.keys(n),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(e[s]=n[s]);return e}function Gr(n,t){if(n==null)return{};var e=Xr(n,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(e[r]=n[r])}return e}const Kr={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=vt.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:t=!1}={}){return{passive:n,capture:t}},transform(n){return n}},qr=["target","eventOptions","window","enabled","transform"];function Ce(n={},t){const e={};for(const[r,s]of Object.entries(t))switch(typeof s){case"function":if(process.env.NODE_ENV==="development"){const i=s.call(e,n[r],r,n);Number.isNaN(i)||(e[r]=i)}else e[r]=s.call(e,n[r],r,n);break;case"object":e[r]=Ce(n[r],s);break;case"boolean":s&&(e[r]=n[r]);break}return e}function Jr(n,t,e={}){const r=n,{target:s,eventOptions:i,window:o,enabled:c,transform:l}=r,f=Gr(r,qr);if(e.shared=Ce({target:s,eventOptions:i,window:o,enabled:c,transform:l},Kr),t){const a=qe.get(t);e[t]=Ce(Z({shared:e.shared},f),a)}else for(const a in f){const _=qe.get(a);if(_)e[a]=Ce(Z({shared:e.shared},f[a]),_);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 e}class Wn{constructor(t,e){gt(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=e}add(t,e,r,s,i){const o=this._listeners,c=Er(e,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},f=Z(Z({},l),i);t.addEventListener(c,s,f);const a=()=>{t.removeEventListener(c,s,f),o.delete(a)};return o.add(a),a}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class Zr{constructor(){gt(this,"_timeouts",new Map)}add(t,e,r=140,...s){this.remove(t),this._timeouts.set(t,window.setTimeout(e,r,...s))}remove(t){const e=this._timeouts.get(t);e&&window.clearTimeout(e)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class Qr{constructor(t){gt(this,"gestures",new Set),gt(this,"_targetEventStore",new Wn(this)),gt(this,"gestureEventStores",{}),gt(this,"gestureTimeoutStores",{}),gt(this,"handlers",{}),gt(this,"config",{}),gt(this,"pointerIds",new Set),gt(this,"touchIds",new Set),gt(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),ts(this,t)}setEventIds(t){if(ze(t))return this.touchIds=new Set(Rr(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,e){this.handlers=t,this.nativeHandlers=e}applyConfig(t,e){this.config=Jr(t,e,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const e=this.config.shared,r={};let s;if(!(e.target&&(s=e.target(),!s))){if(e.enabled){for(const o of this.gestures){const c=this.config[o],l=yn(r,c.eventOptions,!!s);if(c.enabled){const f=Nn.get(o);new f(this,t,o).bind(l)}}const i=yn(r,e.eventOptions,!!s);for(const o in this.nativeHandlers)i(o,"",c=>this.nativeHandlers[o](Z(Z({},this.state.shared),{},{event:c,args:t})),void 0,!0)}for(const i in r)r[i]=Ar(...r[i]);if(!s)return r;for(const i in r){const{device:o,capture:c,passive:l}=yr(i);this._targetEventStore.add(s,o,"",r[i],{capture:c,passive:l})}}}}function pe(n,t){n.gestures.add(t),n.gestureEventStores[t]=new Wn(n,t),n.gestureTimeoutStores[t]=new Zr}function ts(n,t){t.drag&&pe(n,"drag"),t.wheel&&pe(n,"wheel"),t.scroll&&pe(n,"scroll"),t.move&&pe(n,"move"),t.pinch&&pe(n,"pinch"),t.hover&&pe(n,"hover")}const yn=(n,t,e)=>(r,s,i,o={},c=!1)=>{var l,f;const a=(l=o.capture)!==null&&l!==void 0?l:t.capture,_=(f=o.passive)!==null&&f!==void 0?f:t.passive;let d=c?r:vr(r,s,a);e&&_&&(d+="Passive"),n[d]=n[d]||[],n[d].push(i)};function es(n,t){if(typeof n!="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var r=e.call(n,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function ns(n){var t=es(n,"string");return typeof t=="symbol"?t:String(t)}function rs(n,t,e){return t=ns(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function En(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,r)}return e}function De(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?En(Object(e),!0).forEach(function(r){rs(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):En(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}class ss{constructor(t,e,r,s,i){this._target=t,this._gestureKey=s,this._ctrl=new Qr(e),this._ctrl.applyHandlers(e,i),this._ctrl.applyConfig(De(De({},r),{},{target:t}),s),this._ctrl.effect()}destroy(){this._ctrl.clean()}setConfig(t){this._ctrl.clean(),this._ctrl.applyConfig(De(De({},t),{},{target:this._target}),this._gestureKey),this._ctrl.effect()}}const He=function(t,e,r){return Hr(Yr),new ss(t,{drag:e},r||{},"drag")};function zn(...n){const t=n.filter(Boolean);return t.length<=1?t[0]||null:function(r){for(const s of t)typeof s=="function"?s(r):s&&(s.current=r)}}const jn=({children:n,...t})=>{const e=x.Children.only(n),r=is(e),s=e.props||{},i=s.style||{},o={...t,...s,style:{...t.style??{},...i},ref:zn(r,t.ref)};return x.cloneElement(e,o)};function is(n){let t=Object.getOwnPropertyDescriptor(n,"ref")?.get;return t&&"isReactWarning"in t&&t.isReactWarning?n.props.ref:n.props.ref||n.ref}const os=({children:n,interactRef:t,draggable:e,resizable:r,draggableOptions:s,resizableOptions:i})=>{const o=x.useRef(null),c=x.useRef(void 0),l=x.useRef(void 0),f=x.useRef(void 0),a=x.useRef(void 0),_=x.useRef(void 0),d=x.useRef(null),v=x.useRef(null);x.useEffect(()=>{c.current=s,l.current=i},[s,i]);const E=x.useEffectEvent(()=>{o.current&&(e&&c.current&&(f.current=new He(o.current,m=>{const{active:h,delta:g,xy:p,event:b,first:y,last:S}=m,A=b?.target;if(A&&(A===d.current||A===v.current||d.current&&d.current.contains(A)||v.current&&v.current.contains(A)))return;const w={target:o.current,dx:g[0],dy:g[1],clientX:p[0],clientY:p[1]};y?c.current?.onstart?.(w):S?c.current?.onend?.(w):h&&c.current?.onmove?.(w)},{axis:c.current?.lockAxis==="x"?"x":void 0,threshold:0,pointer:{capture:!0}})),r&&l.current?.edges&&(l.current.edges.left&&(d.current||(d.current=o.current.querySelector(l.current.edges.left)),a.current=new He(d.current,m=>{const{active:h,delta:g,xy:p,first:b,last:y}=m,S={target:o.current,dx:g[0],dy:0,clientX:p[0],clientY:p[1],edges:{left:!0},deltaRect:{left:g[0]}};y?l.current?.onend?.(S):b?l.current?.onstart?.(S):h&&l.current?.onmove?.(S)},{pointer:{capture:!0},threshold:0})),l.current.edges.right&&(v.current||(v.current=o.current.querySelector(l.current.edges.right)),_.current=new He(v.current,m=>{const{active:h,delta:g,xy:p,first:b,last:y}=m,S={target:o.current,dx:g[0],dy:0,clientX:p[0],clientY:p[1],edges:{right:!0},deltaRect:{right:g[0]}};y?l.current?.onend?.(S):b?l.current?.onstart?.(S):h&&l.current?.onmove?.(S)},{pointer:{capture:!0},threshold:0}))))});return x.useEffect(()=>{if(!o.current)return;f.current?.destroy(),a.current?.destroy(),_.current?.destroy();const m={target:o.current,unset:()=>{f.current?.destroy(),a.current?.destroy(),_.current?.destroy()}};t&&(t.current=m),E()},[e,r,t]),jn({children:n,ref:o,draggable:!1,style:{...e&&{touchAction:"none"}}})},Fn=x.forwardRef((n,t)=>{const e=Nt.c(70),{children:r,edges:s,left:i,width:o,start:c,grid:l,getBounds:f,enableResizing:a,enableDragging:_,adsorptionDistance:d,adsorptionPositions:v,onResizeStart:E,onResize:m,onResizeEnd:h,onDragStart:g,onDragEnd:p,onDrag:b,parentRef:y,autoScroll:S}=n,A=c===void 0?We:c,w=l===void 0?Xe:l,T=f===void 0?cs:f,k=a===void 0?!0:a,K=_===void 0?!0:_,C=d===void 0?Ge:d;let Q;e[0]!==v?(Q=v===void 0?[]:v,e[0]=v,e[1]=Q):Q=e[1];const B=Q,et=S===void 0?!0:S,j=x.useRef(void 0),M=x.useRef(0),H=x.useRef(!1),{initAutoScroll:lt,stopAutoScroll:ut,dealDragAutoScroll:dt,dealResizeAutoScroll:u}=fr(y);let R,N;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{const L=j.current;return()=>{L?.unset()}},N=[],e[2]=R,e[3]=N):(R=e[2],N=e[3]),x.useEffect(R,N);let F;e[4]===Symbol.for("react.memo_cache_sentinel")?(F=(L,X)=>{const $=X===void 0?!0:X;if(!j.current||!j.current.target)return;$&&(M.current=0);const I=j.current.target;I.style.left=`${L}px`,Object.assign(I.dataset,{left:L})},e[4]=F):F=e[4];const Y=F;let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=(L,X)=>{const $=X===void 0?!0:X;if(!j.current||!j.current.target)return;$&&(M.current=0);const I=j.current.target;I.style.width=`${L}px`,Object.assign(I.dataset,{width:L})},e[5]=V):V=e[5];const W=V;let D;e[6]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{if(!j.current?.target)return 0;const L=j.current.target;return parseFloat(L?.dataset?.left||"0")},e[6]=D):D=e[6];const O=D;let z;e[7]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{if(!j.current?.target)return 0;const L=j.current.target;return parseFloat(L?.dataset?.width||"0")},e[7]=z):z=e[7];const je=z;let Jt,Wt;e[8]!==o?(Jt=()=>{if(!j.current?.target)return;const L=j.current.target;W(typeof o>"u"?L.offsetWidth:o,!1)},Wt=[o],e[8]=o,e[9]=Jt,e[10]=Wt):(Jt=e[9],Wt=e[10]),x.useEffect(Jt,Wt);let Tt,wt;e[11]!==i?(Tt=()=>{Y(i||0,!1)},wt=[i],e[11]=i,e[12]=Tt,e[13]=wt):(Tt=e[12],wt=e[13]),x.useEffect(Tt,wt);let zt;e[14]===Symbol.for("react.memo_cache_sentinel")?(zt=()=>({updateLeft:L=>Y(L||0,!1),updateWidth:L=>W(L,!1),getLeft:O,getWidth:je}),e[14]=zt):zt=e[14],x.useImperativeHandle(t,zt);let xt;e[15]!==lt||e[16]!==g?(xt=()=>{M.current=0,H.current=!1,lt(),g&&g()},e[15]=lt,e[16]=g,e[17]=xt):xt=e[17];const At=xt;let Dt;e[18]!==C||e[19]!==B||e[20]!==T||e[21]!==w||e[22]!==b||e[23]!==A?(Dt=L=>{const{preLeft:X,preWidth:$,scrollDelta:I}=L;I&&(M.current=M.current+I);const tt=H.current?C:w;if(Math.abs(M.current)>=tt){const nt=parseInt(M.current/tt+"");let U=X+nt*tt,P=U;const rt=Number.MAX_SAFE_INTEGER;if(B.forEach(J=>{const q=Math.abs(J-U);q<C&&q<rt&&(P=J);const ot=Math.abs(J-(U+$));ot<C&&ot<rt&&(P=J-$)}),P!==U?(H.current=!0,U=P):((U-A)%w!==0&&(U=A+w*Math.round((U-A)/w)),H.current=!1),M.current=M.current%tt,U<T().left?U=T().left:U+$>T().right&&(U=T().right-$),b&&b({lastLeft:X,left:U,lastWidth:$,width:$},I)===!1)return;Y(U,!1)}},e[18]=C,e[19]=B,e[20]=T,e[21]=w,e[22]=b,e[23]=A,e[24]=Dt):Dt=e[24];const Zt=Dt;let Qt;e[25]!==et||e[26]!==dt||e[27]!==Zt||e[28]!==y?(Qt=L=>{const X=L.target,{left:$,width:I}=X.dataset,tt=parseFloat($||"0"),nt=parseFloat(I||"0");M.current=M.current+L.dx,!(et&&y?.current&&!dt(L,rt=>{if(!y?.current||!j.current?.target)return;y.current.scrollLeft=y.current.scrollLeft+rt;const J=j.current.target,q=parseFloat(J.dataset.left||"0"),ot=parseFloat(J.dataset.width||"0");Zt({preLeft:q,preWidth:ot,scrollDelta:rt})}))&&Zt({preLeft:tt,preWidth:nt})},e[25]=et,e[26]=dt,e[27]=Zt,e[28]=y,e[29]=Qt):Qt=e[29];const jt=Qt;let pt;e[30]!==p||e[31]!==ut?(pt=L=>{M.current=0,H.current=!1,ut();const X=L.target,{left:$,width:I}=X.dataset;p&&p({left:parseFloat($||"0"),width:parseFloat(I||"0")})},e[30]=p,e[31]=ut,e[32]=pt):pt=e[32];const Ft=pt;let Ct;e[33]!==lt||e[34]!==E?(Ct=L=>{M.current=0,H.current=!1,lt();const X=L.edges?.right?"right":"left";E&&E(X)},e[33]=lt,e[34]=E,e[35]=Ct):Ct=e[35];const Yt=Ct;let Ot;e[36]!==C||e[37]!==B||e[38]!==T||e[39]!==w||e[40]!==m||e[41]!==A?(Ot=L=>{const{dir:X,preWidth:$,preLeft:I,scrollDelta:tt}=L;tt&&(M.current=M.current+tt);const nt=H.current?C:w;if(X==="left"){if(Math.abs(M.current)>=nt){const U=parseInt(M.current/nt+"");let P=I+U*nt,rt=P;const J=Number.MAX_SAFE_INTEGER;B.forEach(_t=>{const It=Math.abs(_t-P);It<C&&It<J&&(rt=_t)}),rt!==P?(H.current=!0,P=rt):((P-A)%w!==0&&(P=A+w*Math.round((P-A)/w)),H.current=!1),M.current=M.current%nt;const q=I+$;P<T().left&&(P=T().left);const ot=q-P;if(m&&m("left",{lastLeft:I,lastWidth:$,left:P,width:ot})===!1)return;Y(P,!1),W(ot,!1)}}else if(X==="right"&&Math.abs(M.current)>=nt){const U=parseInt(M.current/w+"");let P=$+U*w,rt=I+P;const J=Number.MAX_SAFE_INTEGER;if(B.forEach(q=>{const ot=Math.abs(q-(I+P));ot<C&&ot<J&&(rt=q)}),rt!==I+P)H.current=!0,P=rt-I;else{let q=I+P;(q-A)%w!==0&&(q=A+w*Math.round((q-A)/w),P=q-I),H.current=!1}if(M.current=M.current%nt,I+P>T().right&&(P=T().right-I),m&&m("right",{lastLeft:I,lastWidth:$,left:I,width:P})===!1)return;W(P,!1)}},e[36]=C,e[37]=B,e[38]=T,e[39]=w,e[40]=m,e[41]=A,e[42]=Ot):Ot=e[42];const bt=Ot;let Lt;e[43]!==et||e[44]!==u||e[45]!==y||e[46]!==bt?(Lt=L=>{const X=L.target,$=L.edges?.left?"left":"right",{left:I,width:tt}=X.dataset,nt=parseFloat(I||"0"),U=parseFloat(tt||"0");M.current=M.current+($==="left"?L.deltaRect?.left||0:L.deltaRect?.right||0),!(et&&y?.current&&!u(L,$,J=>{if(!y?.current||!j.current?.target)return;y.current.scrollLeft=y.current.scrollLeft+J;const q=j.current.target,ot=parseFloat(q.dataset.left||"0"),_t=parseFloat(q.dataset.width||"0");bt({preLeft:ot,preWidth:_t,dir:$,scrollDelta:J})}))&&bt({preLeft:nt,preWidth:U,dir:$})},e[43]=et,e[44]=u,e[45]=y,e[46]=bt,e[47]=Lt):Lt=e[47];const Xt=Lt;let Mt;e[48]!==h||e[49]!==ut?(Mt=L=>{M.current=0,H.current=!1,ut();const X=L.target,{left:$,width:I}=X.dataset,tt=L.edges?.right?"right":"left";h&&h(tt,{left:parseFloat($||"0"),width:parseFloat(I||"0")})},e[48]=h,e[49]=ut,e[50]=Mt):Mt=e[50];const Gt=Mt;let yt;e[51]!==jt||e[52]!==At||e[53]!==Ft?(yt={lockAxis:"x",onmove:jt,onstart:At,onend:Ft,cursorChecker:as},e[51]=jt,e[52]=At,e[53]=Ft,e[54]=yt):yt=e[54];let St;e[55]!==s||e[56]!==Xt||e[57]!==Yt||e[58]!==Gt?(St={axis:"x",invert:"none",edges:s,onmove:Xt,onstart:Yt,onend:Gt},e[55]=s,e[56]=Xt,e[57]=Yt,e[58]=Gt,e[59]=St):St=e[59];const Vt=r;let Rt;e[60]!==i||e[61]!==Vt||e[62]!==o?(Rt=jn({children:Vt,style:{left:i,width:o}}),e[60]=i,e[61]=Vt,e[62]=o,e[63]=Rt):Rt=e[63];let Pt;return e[64]!==K||e[65]!==k||e[66]!==yt||e[67]!==St||e[68]!==Rt?(Pt=G.jsx(os,{interactRef:j,draggable:K,resizable:k,draggableOptions:yt,resizableOptions:St,children:Rt}),e[64]=K,e[65]=k,e[66]=yt,e[67]=St,e[68]=Rt,e[69]=Pt):Pt=e[69],Pt});function cs(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function as(){return""}function ls(){let n=0,t,e="",r=arguments.length;for(;n<r;n++)(t=arguments[n])&&typeof t=="string"&&(e+=(e&&" ")+t);return e}const us=n=>{const t=Nt.c(191),{editorData:e,row:r,action:s,effects:i,rowHeight:o,scale:c,scaleWidth:l,scaleSplitCount:f,startLeft:a,gridSnap:_,disableDrag:d,scaleCount:v,maxScaleCount:E,setScaleCount:m,onActionMoveStart:h,onActionMoving:g,onActionMoveEnd:p,onActionResizeStart:b,onActionResizeEnd:y,onActionResizing:S,dragLineData:A,setEditorData:w,onClickAction:T,onClickActionOnly:k,onDoubleClickAction:K,onContextMenuAction:C,getActionRender:Q,handleTime:B,scrollContainerRef:et}=n,j=x.useRef(null),M=x.useRef(!1),{id:H,maxEnd:lt,minStart:ut,end:dt,start:u,selected:R,flexible:N,movable:F,effectId:Y}=s,V=N===void 0?!0:N,W=F===void 0?!0:F,D=c??Ie,O=l??ke,z=a??We,je=f??An,Jt=E??Number.MAX_SAFE_INTEGER,Wt=ut||0;let Tt;t[0]!==D||t[1]!==O||t[2]!==z||t[3]!==Wt?(Tt=kt(Wt,{startLeft:z,scale:D,scaleWidth:O}),t[0]=D,t[1]=O,t[2]=z,t[3]=Wt,t[4]=Tt):Tt=t[4];const wt=Tt,zt=lt||Number.MAX_VALUE;let xt;t[5]!==D||t[6]!==O||t[7]!==z||t[8]!==zt?(xt=kt(zt,{startLeft:z,scale:D,scaleWidth:O}),t[5]=D,t[6]=O,t[7]=z,t[8]=zt,t[9]=xt):xt=t[9];const At=Math.min(Jt*O+z,xt);let Dt;t[10]!==dt||t[11]!==D||t[12]!==O||t[13]!==z||t[14]!==u?(Dt=Je({start:u,end:dt},{startLeft:z,scale:D,scaleWidth:O}),t[10]=dt,t[11]=D,t[12]=O,t[13]=z,t[14]=u,t[15]=Dt):Dt=t[15];const Zt=Dt,[Qt,jt]=x.useState(null),pt=Qt??Zt,Ft=O/je;let Ct;t[16]!==Y||t[17]!==i||t[18]!==V||t[19]!==W||t[20]!==R?(Ct=Et(ls("action",W&&"action-movable",R&&"action-selected",V&&"action-flexible",i[Y]&&`action-effect-${Y}`)),t[16]=Y,t[17]=i,t[18]=V,t[19]=W,t[20]=R,t[21]=Ct):Ct=t[21];const Yt=Ct;let Ot;t[22]!==O||t[23]!==z||t[24]!==v||t[25]!==m?(Ot=(ht,mt)=>{const st=rr(ht+mt,{startLeft:z,scaleCount:v,scaleWidth:O});st!==v&&m(st)},t[22]=O,t[23]=z,t[24]=v,t[25]=m,t[26]=Ot):Ot=t[26];const bt=Ot;let Lt;t[27]!==s||t[28]!==h||t[29]!==r?(Lt=()=>{h&&h({action:s,row:r})},t[27]=s,t[28]=h,t[29]=r,t[30]=Lt):Lt=t[30];const Xt=Lt;let Mt;t[31]!==s||t[32]!==bt||t[33]!==g||t[34]!==r||t[35]!==D||t[36]!==O||t[37]!==z?(Mt=ht=>{const{left:mt,width:st}=ht;if(M.current=!0,g){const{start:at,end:it}=Ee({left:mt,width:st},{scaleWidth:O,scale:D,startLeft:z});if(g({action:s,row:r,start:at,end:it})===!1)return!1}jt({left:mt,width:st}),bt(mt,st)},t[31]=s,t[32]=bt,t[33]=g,t[34]=r,t[35]=D,t[36]=O,t[37]=z,t[38]=Mt):Mt=t[38];const Gt=Mt;let yt;t[39]!==e||t[40]!==H||t[41]!==p||t[42]!==r||t[43]!==D||t[44]!==O||t[45]!==z||t[46]!==w?(yt=ht=>{const{left:mt,width:st}=ht,{start:at,end:it}=Ee({left:mt,width:st},{scaleWidth:O,scale:D,startLeft:z}),ct=e.find(Ht=>Ht.id===r.id);if(!ct)return;const Bt=ct.actions.find(Ht=>Ht.id===H);Bt&&(Bt.start=at,Bt.end=it,w(e),p&&p({action:Bt,row:r,start:at,end:it}),jt(null))},t[39]=e,t[40]=H,t[41]=p,t[42]=r,t[43]=D,t[44]=O,t[45]=z,t[46]=w,t[47]=yt):yt=t[47];const St=yt;let Vt;t[48]!==s||t[49]!==b||t[50]!==r?(Vt=ht=>{b&&b({action:s,row:r,dir:ht})},t[48]=s,t[49]=b,t[50]=r,t[51]=Vt):Vt=t[51];const Rt=Vt;let Pt;t[52]!==s||t[53]!==bt||t[54]!==S||t[55]!==r||t[56]!==D||t[57]!==O||t[58]!==z?(Pt=(ht,mt)=>{const{left:st,width:at}=mt;if(M.current=!0,S){const{start:it,end:ct}=Ee({left:st,width:at},{scaleWidth:O,scale:D,startLeft:z});if(S({action:s,row:r,start:it,end:ct,dir:ht})===!1)return!1}jt({left:st,width:at}),bt(st,at)},t[52]=s,t[53]=bt,t[54]=S,t[55]=r,t[56]=D,t[57]=O,t[58]=z,t[59]=Pt):Pt=t[59];const L=Pt;let X;t[60]!==e||t[61]!==H||t[62]!==y||t[63]!==r||t[64]!==D||t[65]!==O||t[66]!==z||t[67]!==w?(X=(ht,mt)=>{const{left:st,width:at}=mt,{start:it,end:ct}=Ee({left:st,width:at},{scaleWidth:O,scale:D,startLeft:z}),Bt=e.find(Fe=>Fe.id===r.id);if(!Bt)return;const Ht=Bt.actions.find(Fe=>Fe.id===H);Ht&&(Ht.start=it,Ht.end=ct,w(e),y&&y({action:Ht,row:r,start:it,end:ct,dir:ht}),jt(null))},t[60]=e,t[61]=H,t[62]=y,t[63]=r,t[64]=D,t[65]=O,t[66]=z,t[67]=w,t[68]=X):X=t[68];const $=X;let I,tt,nt,U,P,rt,J,q,ot,_t,It,te,ee,ne,re,se,$t,Ut,ie,oe,ce,ae,le,ue,fe,de;if(t[69]!==s||t[70]!==Yt||t[71]!==d||t[72]!==A.assistPositions||t[73]!==V||t[74]!==Q||t[75]!==Ft||t[76]!==_||t[77]!==Gt||t[78]!==St||t[79]!==Xt||t[80]!==$||t[81]!==Rt||t[82]!==L||t[83]!==B||t[84]!==wt||t[85]!==W||t[86]!==T||t[87]!==k||t[88]!==C||t[89]!==K||t[90]!==At||t[91]!==r||t[92]!==o||t[93]!==D||t[94]!==O||t[95]!==z||t[96]!==et||t[97]!==pt.left||t[98]!==pt.width){const ht={...s,...Ee({left:pt.left,width:pt.width},{startLeft:z,scaleWidth:O,scale:D})},mt={...r,actions:[...r.actions]};r.actions.includes(s)&&(mt.actions[r.actions.indexOf(s)]=ht),I=Fn,ot=j,_t=et,It=z,te=pt.left,ee=pt.width,ne=_&&Ft||Xe,re=_?Math.max((Ft||Xe)/2,Ge):Ge,se=A.assistPositions,t[125]!==wt||t[126]!==At?($t=()=>({left:wt,right:At}),t[125]=wt,t[126]=At,t[127]=$t):$t=t[127];let st;t[128]!==d||t[129]!==V?(st=!d&&V&&`.${Et("action-left-stretch")}`,t[128]=d,t[129]=V,t[130]=st):st=t[130];let at;t[131]!==d||t[132]!==V?(at=!d&&V&&`.${Et("action-right-stretch")}`,t[131]=d,t[132]=V,t[133]=at):at=t[133],t[134]!==st||t[135]!==at?(Ut={left:st,right:at},t[134]=st,t[135]=at,t[136]=Ut):Ut=t[136],ie=!d&&W,oe=!d&&V,ce=Xt,ae=Gt,le=St,ue=Rt,fe=L,de=$,t[137]===Symbol.for("react.memo_cache_sentinel")?(tt=()=>{M.current=!1},t[137]=tt):tt=t[137],t[138]!==s||t[139]!==B||t[140]!==T||t[141]!==k||t[142]!==r?(nt=it=>{let ct;T&&(ct=B(it),T(it,{row:r,action:s,time:ct})),!M.current&&k&&(ct===void 0&&(ct=B(it)),k(it,{row:r,action:s,time:ct}))},t[138]=s,t[139]=B,t[140]=T,t[141]=k,t[142]=r,t[143]=nt):nt=t[143],t[144]!==s||t[145]!==B||t[146]!==K||t[147]!==r?(U=it=>{if(K){const ct=B(it);K(it,{row:r,action:s,time:ct})}},t[144]=s,t[145]=B,t[146]=K,t[147]=r,t[148]=U):U=t[148],t[149]!==s||t[150]!==B||t[151]!==C||t[152]!==r?(P=it=>{if(C){const ct=B(it);C(it,{row:r,action:s,time:ct})}},t[149]=s,t[150]=B,t[151]=C,t[152]=r,t[153]=P):P=t[153],rt=Yt,t[154]!==o?(J={height:o},t[154]=o,t[155]=J):J=t[155],q=Q&&Q(ht,mt),t[69]=s,t[70]=Yt,t[71]=d,t[72]=A.assistPositions,t[73]=V,t[74]=Q,t[75]=Ft,t[76]=_,t[77]=Gt,t[78]=St,t[79]=Xt,t[80]=$,t[81]=Rt,t[82]=L,t[83]=B,t[84]=wt,t[85]=W,t[86]=T,t[87]=k,t[88]=C,t[89]=K,t[90]=At,t[91]=r,t[92]=o,t[93]=D,t[94]=O,t[95]=z,t[96]=et,t[97]=pt.left,t[98]=pt.width,t[99]=I,t[100]=tt,t[101]=nt,t[102]=U,t[103]=P,t[104]=rt,t[105]=J,t[106]=q,t[107]=ot,t[108]=_t,t[109]=It,t[110]=te,t[111]=ee,t[112]=ne,t[113]=re,t[114]=se,t[115]=$t,t[116]=Ut,t[117]=ie,t[118]=oe,t[119]=ce,t[120]=ae,t[121]=le,t[122]=ue,t[123]=fe,t[124]=de}else I=t[99],tt=t[100],nt=t[101],U=t[102],P=t[103],rt=t[104],J=t[105],q=t[106],ot=t[107],_t=t[108],It=t[109],te=t[110],ee=t[111],ne=t[112],re=t[113],se=t[114],$t=t[115],Ut=t[116],ie=t[117],oe=t[118],ce=t[119],ae=t[120],le=t[121],ue=t[122],fe=t[123],de=t[124];let he;t[156]!==V?(he=V&&G.jsx("div",{className:Et("action-left-stretch"),style:{touchAction:"none"}}),t[156]=V,t[157]=he):he=t[157];let me;t[158]!==V?(me=V&&G.jsx("div",{className:Et("action-right-stretch"),style:{touchAction:"none"}}),t[158]=V,t[159]=me):me=t[159];let ge;t[160]!==tt||t[161]!==nt||t[162]!==U||t[163]!==P||t[164]!==rt||t[165]!==J||t[166]!==q||t[167]!==he||t[168]!==me?(ge=G.jsxs("div",{onMouseDown:tt,onClick:nt,onDoubleClick:U,onContextMenu:P,className:rt,style:J,children:[q,he,me]}),t[160]=tt,t[161]=nt,t[162]=U,t[163]=P,t[164]=rt,t[165]=J,t[166]=q,t[167]=he,t[168]=me,t[169]=ge):ge=t[169];let Re;return t[170]!==I||t[171]!==ot||t[172]!==_t||t[173]!==It||t[174]!==te||t[175]!==ee||t[176]!==ne||t[177]!==re||t[178]!==se||t[179]!==$t||t[180]!==Ut||t[181]!==ie||t[182]!==oe||t[183]!==ce||t[184]!==ae||t[185]!==le||t[186]!==ue||t[187]!==fe||t[188]!==de||t[189]!==ge?(Re=G.jsx(I,{ref:ot,parentRef:_t,start:It,left:te,width:ee,grid:ne,adsorptionDistance:re,adsorptionPositions:se,getBounds:$t,edges:Ut,enableDragging:ie,enableResizing:oe,onDragStart:ce,onDrag:ae,onDragEnd:le,onResizeStart:ue,onResize:fe,onResizeEnd:de,children:ge}),t[170]=I,t[171]=ot,t[172]=_t,t[173]=It,t[174]=te,t[175]=ee,t[176]=ne,t[177]=re,t[178]=se,t[179]=$t,t[180]=Ut,t[181]=ie,t[182]=oe,t[183]=ce,t[184]=ae,t[185]=le,t[186]=ue,t[187]=fe,t[188]=de,t[189]=ge,t[190]=Re):Re=t[190],Re};function _e(n,t,e){let r=e.initialDeps??[],s;function i(){var o,c,l,f;let a;e.key&&((o=e.debug)!=null&&o.call(e))&&(a=Date.now());const _=n();if(!(_.length!==r.length||_.some((E,m)=>r[m]!==E)))return s;r=_;let v;if(e.key&&((c=e.debug)!=null&&c.call(e))&&(v=Date.now()),s=t(..._),e.key&&((l=e.debug)!=null&&l.call(e))){const E=Math.round((Date.now()-a)*100)/100,m=Math.round((Date.now()-v)*100)/100,h=m/16,g=(p,b)=>{for(p=String(p);p.length<b;)p=" "+p;return p};console.info(`%c⏱ ${g(m,5)} /${g(E,5)} ms`,`
11
11
  font-size: .6rem;
12
12
  font-weight: bold;
13
- color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,t?.key)}return(f=t?.onChange)==null||f.call(t,s),s}return i.updateDeps=o=>{r=o},i}function En(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const us=(n,e)=>Math.abs(n-e)<1.01,fs=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},Sn=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},ds=n=>n,hs=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},ms=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=o=>{const{width:c,height:a}=o;e({width:Math.round(c),height:Math.round(a)})};if(s(Sn(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(o=>{const c=()=>{const a=o[0];if(a?.borderBoxSize){const f=a.borderBoxSize[0];if(f){s({width:f.inlineSize,height:f.blockSize});return}}s(Sn(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},Rn={passive:!0},xn=typeof window>"u"?!0:"onscrollend"in window,ps=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const i=n.options.useScrollendEvent&&xn?()=>{}:fs(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),o=l=>()=>{const{horizontal:m,isRtl:d}=n.options;s=m?t.scrollLeft*(d&&-1||1):t.scrollTop,i(),e(s,l)},c=o(!0),a=o(!1);a(),t.addEventListener("scroll",c,Rn);const f=n.options.useScrollendEvent&&xn;return f&&t.addEventListener("scrollend",a,Rn),()=>{t.removeEventListener("scroll",c),f&&t.removeEventListener("scrollend",a)}},gs=(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"]},_s=(n,{adjustments:e=0,behavior:t},r)=>{var s,i;const o=n+e;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:o,behavior:t})};class vs{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(i=>{const o=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.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:ds,rangeExtractor:hs,onChange:()=>{},measureElement:gs,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=yt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,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,i=new Map;for(let o=r-1;o>=0;o--){const c=t[o];if(s.has(c.lane))continue;const a=i.get(c.lane);if(a==null||c.end>a.end?i.set(c.lane,c):c.end<a.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((o,c)=>o.end===c.end?o.index-c.index:o.end-c.end)[0]:void 0},this.getMeasurementOptions=yt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,s,i,o)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:o}),{key:!1}),this.getMeasurements=yt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:o},c)=>{if(!o)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 f=this.measurementsCache.slice(0,a);for(let l=a;l<t;l++){const m=i(l),d=this.options.lanes===1?f[l-1]:this.getFurthestMeasurement(f,l),g=d?d.end+this.options.gap:r+s,v=c.get(m),p=typeof v=="number"?v:this.options.estimateSize(l),y=g+p,E=d?d.lane:l%this.options.lanes;f[l]={index:l,start:g,size:p,end:y,key:m,lane:E}}return this.measurementsCache=f,f},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=yt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>this.range=t.length>0&&r>0?bs({measurements:t,outerSize:r,scrollOffset:s,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=yt(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,o)=>i===null||o===null?[]:t({startIndex:i,endIndex:o,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),i=this.measurementsCache[s];if(!i)return;const o=i.key,c=this.elementsCache.get(o);c!==t&&(c&&this.observer.unobserve(c),this.observer.observe(t),this.elementsCache.set(o,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 i=this.itemSizeCache.get(s.key)??s.size,o=r-i;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,o,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",o),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=yt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,o=t.length;i<o;i++){const c=t[i],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 En(r[Un(0,r.length-1,s=>En(r[s]).start,t)])},this.getOffsetForAlignment=(t,r,s=0)=>{const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=t>=o+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const c=this.getTotalSize()+this.options.scrollMargin-i;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 i=this.getSize(),o=this.getScrollOffset();if(r==="auto")if(s.end>=o+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=o+this.options.scrollPaddingStart)r="start";else return[o,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 i=0;const o=10,c=f=>{if(!this.targetWindow)return;const l=this.getOffsetForIndex(t,f);if(!l){console.warn("Failed to get offset for index:",t);return}const[m,d]=l;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const g=this.getScrollOffset(),v=this.getOffsetForIndex(t,d);if(!v){console.warn("Failed to get offset for index:",t);return}us(v[0],g)||a(d)})},a=f=>{this.targetWindow&&(i++,i<o?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,o),this.targetWindow.requestAnimationFrame(()=>c(f))):console.warn(`Failed to scroll to index ${t} after ${o} 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 i=Array(this.options.lanes).fill(null);let o=r.length-1;for(;o>=0&&i.some(c=>c===null);){const c=r[o];i[c.lane]===null&&(i[c.lane]=c.end),o--}s=Math.max(...i.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 Un=(n,e,t,r)=>{for(;n<=e;){const s=(n+e)/2|0,i=t(s);if(i<r)n=s+1;else if(i>r)e=s-1;else return s}return n>0?n-1:0};function bs({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,i=a=>n[a].start;if(n.length<=r)return{startIndex:0,endIndex:s};let o=Un(0,s,i,t),c=o;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 f=Array(r).fill(t+e);for(;o>=0&&f.some(l=>l>=t);){const l=n[o];f[l.lane]=l.start,o--}o=Math.max(0,o-o%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:o,endIndex:c}}const Tn=typeof document<"u"?qe.useLayoutEffect:qe.useEffect;function ys(n){const e=qe.useReducer(()=>({}),{})[1],t={...n,onChange:(s,i)=>{var o;i?Yn.flushSync(e):e(),(o=n.onChange)==null||o.call(n,s,i)}},[r]=qe.useState(()=>new vs(t));return r.setOptions(t),Tn(()=>r._didMount(),[]),Tn(()=>r._willUpdate()),r}function Hn(n){return ys({observeElementRect:ms,observeElementOffset:ps,scrollToFn:_s,...n})}const ws=n=>{const e=Je.c(12),{isMoving:t,movePositions:r,assistPositions:s,scrollLeft:i}=n;let o,c;if(e[0]!==t||e[1]!==i||e[2]!==r||e[3]!==s){const f=r===void 0?[]:r;let l;e[6]!==s?(l=s===void 0?[]:s,e[6]=s,e[7]=l):l=e[7];const m=l;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=me("drag-line-container"),e[8]=o):o=e[8],c=t&&f.filter(d=>m.includes(d)).map((d,g)=>j.jsx("div",{className:me("drag-line"),style:{left:d-i}},g)),e[0]=t,e[1]=i,e[2]=r,e[3]=s,e[4]=o,e[5]=c}else o=e[4],c=e[5];let a;return e[9]!==o||e[10]!==c?(a=j.jsx("div",{className:o,children:c}),e[9]=o,e[10]=c,e[11]=a):a=e[11],a},Es=n=>{const e=Je.c(198),{editorData:t,row:r,action:s,effects:i,rowHeight:o,scale:c,scaleWidth:a,scaleSplitCount:f,startLeft:l,gridSnap:m,disableDrag:d,scaleCount:g,maxScaleCount:v,setScaleCount:p,onActionMoveStart:y,onActionMoving:E,onActionMoveEnd:h,onActionResizeStart:x,onActionResizeEnd:D,onActionResizing:_,dragLineData:w,setEditorData:S,onClickAction:k,onClickActionOnly:C,onDoubleClickAction:B,onContextMenuAction:Y,getActionRender:F,handleTime:V,areaRef:J,deltaScrollLeft:R}=n,T=b.useRef(null),P=b.useRef(!1),{id:H,maxEnd:fe,minStart:ge,end:u,start:A,selected:I,flexible:$,movable:_e,effectId:ve}=s,L=$===void 0?!0:$,re=_e===void 0?!0:_e,U=c??Nt,N=a??jt,W=l??zt,je=f??An,$e=v??Number.MAX_SAFE_INTEGER,Pe=ge||0;let Re;e[0]!==U||e[1]!==N||e[2]!==W||e[3]!==Pe?(Re=Ve(Pe,{startLeft:W,scale:U,scaleWidth:N}),e[0]=U,e[1]=N,e[2]=W,e[3]=Pe,e[4]=Re):Re=e[4];const xe=Re,Ae=fe||Number.MAX_VALUE;let We;e[5]!==U||e[6]!==N||e[7]!==W||e[8]!==Ae?(We=Ve(Ae,{startLeft:W,scale:U,scaleWidth:N}),e[5]=U,e[6]=N,e[7]=W,e[8]=Ae,e[9]=We):We=e[9];const Oe=Math.min($e*N+W,We);let De;e[10]!==u||e[11]!==U||e[12]!==N||e[13]!==W||e[14]!==A?(De=Ln({start:A,end:u},{startLeft:W,scale:U,scaleWidth:N}),e[10]=u,e[11]=U,e[12]=N,e[13]=W,e[14]=A,e[15]=De):De=e[15];const Ce=De,[Ze,Z]=b.useState(null),Q=Ze??Ce,G=N/je;let ie;e[16]!==ve||e[17]!==i||e[18]!==L||e[19]!==re||e[20]!==I?(ie=["action"],re&&ie.push("action-movable"),I&&ie.push("action-selected"),L&&ie.push("action-flexible"),i[ve]&&ie.push(`action-effect-${ve}`),e[16]=ve,e[17]=i,e[18]=L,e[19]=re,e[20]=I,e[21]=ie):ie=e[21];let be;e[22]!==N||e[23]!==W||e[24]!==g||e[25]!==p?(be=(ye,we)=>{const se=or(ye+we,{startLeft:W,scaleCount:g,scaleWidth:N});se!==g&&p(se)},e[22]=N,e[23]=W,e[24]=g,e[25]=p,e[26]=be):be=e[26];const Te=be;let Ie;e[27]!==s||e[28]!==y||e[29]!==r?(Ie=()=>{y&&y({action:s,row:r})},e[27]=s,e[28]=y,e[29]=r,e[30]=Ie):Ie=e[30];const Ue=Ie;let He;e[31]!==s||e[32]!==Te||e[33]!==E||e[34]!==r||e[35]!==U||e[36]!==N||e[37]!==W?(He=ye=>{const{left:we,width:se}=ye;if(P.current=!0,E){const{start:he,end:Ee}=Rt({left:we,width:se},{scaleWidth:N,scale:U,startLeft:W});if(E({action:s,row:r,start:he,end:Ee})===!1)return!1}Z({left:we,width:se}),Te(we,se)},e[31]=s,e[32]=Te,e[33]=E,e[34]=r,e[35]=U,e[36]=N,e[37]=W,e[38]=He):He=e[38];const Qe=He;let ke;e[39]!==t||e[40]!==H||e[41]!==h||e[42]!==r||e[43]!==U||e[44]!==N||e[45]!==W||e[46]!==S?(ke=ye=>{const{left:we,width:se}=ye,{start:he,end:Ee}=Rt({left:we,width:se},{scaleWidth:N,scale:U,startLeft:W}),Le=t.find(ue=>ue.id===r.id);if(!Le)return;const ae=Le.actions.find(ue=>ue.id===H);ae&&(ae.start=he,ae.end=Ee,S(t),h&&h({action:ae,row:r,start:he,end:Ee}),Z(null))},e[39]=t,e[40]=H,e[41]=h,e[42]=r,e[43]=U,e[44]=N,e[45]=W,e[46]=S,e[47]=ke):ke=e[47];const ze=ke;let Xe;e[48]!==s||e[49]!==x||e[50]!==r?(Xe=ye=>{x&&x({action:s,row:r,dir:ye})},e[48]=s,e[49]=x,e[50]=r,e[51]=Xe):Xe=e[51];const Fe=Xe;let Be;e[52]!==s||e[53]!==Te||e[54]!==_||e[55]!==r||e[56]!==U||e[57]!==N||e[58]!==W?(Be=(ye,we)=>{const{left:se,width:he}=we;if(P.current=!0,_){const{start:Ee,end:Le}=Rt({left:se,width:he},{scaleWidth:N,scale:U,startLeft:W});if(_({action:s,row:r,start:Ee,end:Le,dir:ye})===!1)return!1}Z({left:se,width:he}),Te(se,he)},e[52]=s,e[53]=Te,e[54]=_,e[55]=r,e[56]=U,e[57]=N,e[58]=W,e[59]=Be):Be=e[59];const M=Be;let q;e[60]!==t||e[61]!==H||e[62]!==D||e[63]!==r||e[64]!==U||e[65]!==N||e[66]!==W||e[67]!==S?(q=(ye,we)=>{const{left:se,width:he}=we,{start:Ee,end:Le}=Rt({left:se,width:he},{scaleWidth:N,scale:U,startLeft:W}),ae=t.find(Vt=>Vt.id===r.id);if(!ae)return;const ue=ae.actions.find(Vt=>Vt.id===H);ue&&(ue.start=Ee,ue.end=Le,S(t),D&&D({action:ue,row:r,start:Ee,end:Le,dir:ye}),Z(null))},e[60]=t,e[61]=H,e[62]=D,e[63]=r,e[64]=U,e[65]=N,e[66]=W,e[67]=S,e[68]=q):q=e[68];const X=q;let z,ee,le,O,te,oe,K,ce,de,Ne,tt,nt,rt,st,it,ot,Ye,Ge,ct,at,lt,ut,ft,dt,ht,mt,pt;if(e[69]!==s||e[70]!==J||e[71]!==ie||e[72]!==R||e[73]!==d||e[74]!==w.assistPositions||e[75]!==L||e[76]!==F||e[77]!==G||e[78]!==m||e[79]!==Qe||e[80]!==ze||e[81]!==Ue||e[82]!==X||e[83]!==Fe||e[84]!==M||e[85]!==V||e[86]!==xe||e[87]!==re||e[88]!==k||e[89]!==C||e[90]!==Y||e[91]!==B||e[92]!==Oe||e[93]!==r||e[94]!==o||e[95]!==U||e[96]!==N||e[97]!==W||e[98]!==Q.left||e[99]!==Q.width){const ye={...s,...Rt({left:Q.left,width:Q.width},{startLeft:W,scaleWidth:N,scale:U})},we={...r,actions:[...r.actions]};r.actions.includes(s)&&(we.actions[r.actions.indexOf(s)]=ye),z=Vn,de=T,Ne=J,tt=W,nt=Q.left,rt=Q.width,st=m&&G||Gt,it=m?Math.max((G||Gt)/2,Kt):Kt,ot=w.assistPositions,e[127]!==xe||e[128]!==Oe?(Ye={left:xe,right:Oe},e[127]=xe,e[128]=Oe,e[129]=Ye):Ye=e[129];let se;e[130]!==d||e[131]!==L?(se=!d&&L&&`.${me("action-left-stretch")}`,e[130]=d,e[131]=L,e[132]=se):se=e[132];let he;e[133]!==d||e[134]!==L?(he=!d&&L&&`.${me("action-right-stretch")}`,e[133]=d,e[134]=L,e[135]=he):he=e[135],e[136]!==se||e[137]!==he?(Ge={left:se,right:he},e[136]=se,e[137]=he,e[138]=Ge):Ge=e[138],ct=!d&&re,at=!d&&L,lt=Ue,ut=Qe,ft=ze,dt=Fe,ht=M,mt=X,pt=R,e[139]===Symbol.for("react.memo_cache_sentinel")?(ee=()=>{P.current=!1},e[139]=ee):ee=e[139],e[140]!==s||e[141]!==V||e[142]!==k||e[143]!==C||e[144]!==r?(le=ae=>{let ue;k&&(ue=V(ae),k(ae,{row:r,action:s,time:ue})),!P.current&&C&&(ue===void 0&&(ue=V(ae)),C(ae,{row:r,action:s,time:ue}))},e[140]=s,e[141]=V,e[142]=k,e[143]=C,e[144]=r,e[145]=le):le=e[145],e[146]!==s||e[147]!==V||e[148]!==B||e[149]!==r?(O=ae=>{if(B){const ue=V(ae);B(ae,{row:r,action:s,time:ue})}},e[146]=s,e[147]=V,e[148]=B,e[149]=r,e[150]=O):O=e[150],e[151]!==s||e[152]!==V||e[153]!==Y||e[154]!==r?(te=ae=>{if(Y){const ue=V(ae);Y(ae,{row:r,action:s,time:ue})}},e[151]=s,e[152]=V,e[153]=Y,e[154]=r,e[155]=te):te=e[155];let Ee;e[156]!==ie?(Ee=ie||[],e[156]=ie,e[157]=Ee):Ee=e[157];const Le=Ee.join(" ");e[158]!==Le?(oe=me(Le),e[158]=Le,e[159]=oe):oe=e[159],e[160]!==o?(K={height:o},e[160]=o,e[161]=K):K=e[161],ce=F&&F(ye,we),e[69]=s,e[70]=J,e[71]=ie,e[72]=R,e[73]=d,e[74]=w.assistPositions,e[75]=L,e[76]=F,e[77]=G,e[78]=m,e[79]=Qe,e[80]=ze,e[81]=Ue,e[82]=X,e[83]=Fe,e[84]=M,e[85]=V,e[86]=xe,e[87]=re,e[88]=k,e[89]=C,e[90]=Y,e[91]=B,e[92]=Oe,e[93]=r,e[94]=o,e[95]=U,e[96]=N,e[97]=W,e[98]=Q.left,e[99]=Q.width,e[100]=z,e[101]=ee,e[102]=le,e[103]=O,e[104]=te,e[105]=oe,e[106]=K,e[107]=ce,e[108]=de,e[109]=Ne,e[110]=tt,e[111]=nt,e[112]=rt,e[113]=st,e[114]=it,e[115]=ot,e[116]=Ye,e[117]=Ge,e[118]=ct,e[119]=at,e[120]=lt,e[121]=ut,e[122]=ft,e[123]=dt,e[124]=ht,e[125]=mt,e[126]=pt}else z=e[100],ee=e[101],le=e[102],O=e[103],te=e[104],oe=e[105],K=e[106],ce=e[107],de=e[108],Ne=e[109],tt=e[110],nt=e[111],rt=e[112],st=e[113],it=e[114],ot=e[115],Ye=e[116],Ge=e[117],ct=e[118],at=e[119],lt=e[120],ut=e[121],ft=e[122],dt=e[123],ht=e[124],mt=e[125],pt=e[126];let gt;e[162]!==L?(gt=L&&j.jsx("div",{className:me("action-left-stretch"),style:{touchAction:"none"}}),e[162]=L,e[163]=gt):gt=e[163];let _t;e[164]!==L?(_t=L&&j.jsx("div",{className:me("action-right-stretch"),style:{touchAction:"none"}}),e[164]=L,e[165]=_t):_t=e[165];let vt;e[166]!==ee||e[167]!==le||e[168]!==O||e[169]!==te||e[170]!==oe||e[171]!==K||e[172]!==ce||e[173]!==gt||e[174]!==_t?(vt=j.jsxs("div",{onMouseDown:ee,onClick:le,onDoubleClick:O,onContextMenu:te,className:oe,style:K,children:[ce,gt,_t]}),e[166]=ee,e[167]=le,e[168]=O,e[169]=te,e[170]=oe,e[171]=K,e[172]=ce,e[173]=gt,e[174]=_t,e[175]=vt):vt=e[175];let At;return e[176]!==z||e[177]!==de||e[178]!==Ne||e[179]!==tt||e[180]!==nt||e[181]!==rt||e[182]!==st||e[183]!==it||e[184]!==ot||e[185]!==Ye||e[186]!==Ge||e[187]!==ct||e[188]!==at||e[189]!==lt||e[190]!==ut||e[191]!==ft||e[192]!==dt||e[193]!==ht||e[194]!==mt||e[195]!==pt||e[196]!==vt?(At=j.jsx(z,{ref:de,parentRef:Ne,start:tt,left:nt,width:rt,grid:st,adsorptionDistance:it,adsorptionPositions:ot,bounds:Ye,edges:Ge,enableDragging:ct,enableResizing:at,onDragStart:lt,onDrag:ut,onDragEnd:ft,onResizeStart:dt,onResize:ht,onResizeEnd:mt,deltaScrollLeft:pt,children:vt}),e[176]=z,e[177]=de,e[178]=Ne,e[179]=tt,e[180]=nt,e[181]=rt,e[182]=st,e[183]=it,e[184]=ot,e[185]=Ye,e[186]=Ge,e[187]=ct,e[188]=at,e[189]=lt,e[190]=ut,e[191]=ft,e[192]=dt,e[193]=ht,e[194]=mt,e[195]=pt,e[196]=vt,e[197]=At):At=e[197],At},Ss=n=>{const e=Je.c(43),{rowData:t,style:r,onClickRow:s,onDoubleClickRow:i,onContextMenuRow:o,areaRef:c,scrollLeft:a,startLeft:f,scale:l,scaleWidth:m}=n;let d;e[0]!==r?(d=r===void 0?{}:r,e[0]=r,e[1]=d):d=e[1];const g=d;let v,p;if(e[2]!==c||e[3]!==t?.selected||e[4]!==l||e[5]!==m||e[6]!==a||e[7]!==f){const k=["edit-row"];t?.selected&&k.push("edit-row-selected");const C=l??Nt,B=m??jt,Y=f??zt;let F;e[10]!==c||e[11]!==C||e[12]!==B||e[13]!==Y||e[14]!==a?(F=V=>{if(!c.current)return 0;const J=c.current.getBoundingClientRect(),T=V.clientX-J.x+a;return et(T,{startLeft:Y,scale:C,scaleWidth:B})},e[10]=c,e[11]=C,e[12]=B,e[13]=Y,e[14]=a,e[15]=F):F=e[15],v=F,p=me(...k),e[2]=c,e[3]=t?.selected,e[4]=l,e[5]=m,e[6]=a,e[7]=f,e[8]=v,e[9]=p}else v=e[8],p=e[9];let y;e[16]!==t?.classNames?(y=t?.classNames||[],e[16]=t?.classNames,e[17]=y):y=e[17];let E;e[18]!==y?(E=y.join(" "),e[18]=y,e[19]=E):E=e[19];const h=`${p} ${E}`;let x;e[20]!==v||e[21]!==s||e[22]!==t?(x=k=>{if(t&&s){const C=v(k);s(k,{row:t,time:C})}},e[20]=v,e[21]=s,e[22]=t,e[23]=x):x=e[23];let D;e[24]!==v||e[25]!==i||e[26]!==t?(D=k=>{if(t&&i){const C=v(k);i(k,{row:t,time:C})}},e[24]=v,e[25]=i,e[26]=t,e[27]=D):D=e[27];let _;e[28]!==v||e[29]!==o||e[30]!==t?(_=k=>{if(t&&o){const C=v(k);o(k,{row:t,time:C})}},e[28]=v,e[29]=o,e[30]=t,e[31]=_):_=e[31];let w;e[32]!==v||e[33]!==n||e[34]!==t?(w=t&&(t.actions||[]).map(k=>j.jsx(Es,{...n,handleTime:v,row:t,action:k},k.id)),e[32]=v,e[33]=n,e[34]=t,e[35]=w):w=e[35];let S;return e[36]!==g||e[37]!==h||e[38]!==x||e[39]!==D||e[40]!==_||e[41]!==w?(S=j.jsx("div",{className:h,style:g,onClick:x,onDoubleClick:D,onContextMenu:_,children:w}),e[36]=g,e[37]=h,e[38]=x,e[39]=D,e[40]=_,e[41]=w,e[42]=S):S=e[42],S};function Rs(){const n=Je.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]=b.useState(e),s=Ts,i=xs;let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o=g=>{const{movePositions:v,assistPositions:p}=g;r({isMoving:!0,movePositions:v||[],assistPositions:p||[]})},n[1]=o):o=n[1];const c=o;let a;n[2]===Symbol.for("react.memo_cache_sentinel")?(a=g=>{const{movePositions:v,assistPositions:p}=g;r(y=>({...y,movePositions:v||y.movePositions,assistPositions:p||y.assistPositions}))},n[2]=a):a=n[2];const f=a;let l;n[3]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=l):l=n[3];const m=l;let d;return n[4]!==t?(d={initDragLine:c,updateDragLine:f,disposeDragLine:m,dragLineData:t,defaultGetAssistPosition:s,defaultGetMovePosition:i},n[4]=t,n[5]=d):d=n[5],d}function xs(n){const{start:e,end:t,dir:r,scale:s,scaleWidth:i,startLeft:o}=n,{left:c,width:a}=Ln({start:e,end:t},{startLeft:o,scaleWidth:i,scale:s});return r?r==="right"?[c+a]:[c]:[c,c+a]}function Ts(n){const{editorData:e,assistActionIds:t,action:r,row:s,scale:i,scaleWidth:o,startLeft:c,cursorLeft:a,hideCursor:f}=n,l=[];t?e.forEach(d=>{d.actions.forEach(g=>{t.includes(g.id)&&l.push(g)})}):e.forEach(d=>{d.id!==s.id?l.push(...d.actions):d.actions.forEach(g=>{g.id!==r.id&&l.push(g)})});const m=cr(l,{startLeft:c,scale:i,scaleWidth:o});return f||m.push(a),m}function As(n){return typeof n=="object"&&n!==null}function Os(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 Ds(n){return As(n)&&"ownerSVGElement"in n}const Pt=new WeakMap;let It;const Bn=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:Ds(r)&&"getBBox"in r?r.getBBox()[e]:r[t],Cs=Bn("inline","width","offsetWidth"),Ls=Bn("block","height","offsetHeight");function Ms({target:n,borderBoxSize:e}){Pt.get(n)?.forEach(t=>{t(n,{get width(){return Cs(n,e)},get height(){return Ls(n,e)}})})}function Ps(n){n.forEach(Ms)}function Is(){typeof ResizeObserver>"u"||(It=new ResizeObserver(Ps))}function ks(n,e){It||Is();const t=Os(n);return t.forEach(r=>{let s=Pt.get(r);s||(s=new Set,Pt.set(r,s)),s.add(e),It?.observe(r)}),()=>{t.forEach(r=>{const s=Pt.get(r);s?.delete(e),s?.size||It?.unobserve(r)})}}const kt=new Set;let wt;function Ns(){wt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};kt.forEach(e=>e(n))},window.addEventListener("resize",wt)}function js(n){return kt.add(n),wt||Ns(),()=>{kt.delete(n),!kt.size&&typeof wt=="function"&&(window.removeEventListener("resize",wt),wt=void 0)}}function Ws(n,e){return typeof n=="function"?js(n):ks(n,e)}function Xn(n){const e=Je.c(16);let t,r,s;e[0]!==n?({render:s,ref:r,...t}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i={width:0,height:0},e[4]=i):i=e[4];const[o,c]=b.useState(i),a=b.useRef(null);let f,l;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{a.current&&Ws(a.current,(v,p)=>{c({width:p.width,height:p.height})})},l=[],e[5]=f,e[6]=l):(f=e[5],l=e[6]),b.useLayoutEffect(f,l);let m;e[7]!==r?(m=zn(a,r),e[7]=r,e[8]=m):m=e[8];let d;e[9]!==s||e[10]!==o?(d=s(o),e[9]=s,e[10]=o,e[11]=d):d=e[11];let g;return e[12]!==t||e[13]!==m||e[14]!==d?(g=j.jsx("div",{ref:m,...t,children:d}),e[12]=t,e[13]=m,e[14]=d,e[15]=g):g=e[15],g}const zs=({width:n,height:e,editAreaRef:t,editorData:r,rowHeight:s,scaleWidth:i,scaleCount:o,setScaleCount:c,startLeft:a,scrollLeft:f,scrollTop:l,scale:m,dragLine:d,getAssistDragLineActionIds:g,onActionMoveEnd:v,onActionMoveStart:p,onActionMoving:y,onActionResizeEnd:E,onActionResizeStart:h,onActionResizing:x,onScroll:D,cursorTime:_,hideCursor:w,setEditorData:S,deltaScrollLeft:k,timelineWidth:C,getActionRender:B,getScaleRender:Y,onClickRow:F,onDoubleClickRow:V,onContextMenuRow:J,onClickAction:R,onClickActionOnly:T,onDoubleClickAction:P,onContextMenuAction:H,onCursorDragStart:fe,onCursorDragEnd:ge,onCursorDrag:u,onClickTimeArea:A,gridSnap:I,effects:$})=>{const{dragLineData:_e,initDragLine:ve,updateDragLine:L,disposeDragLine:re,defaultGetAssistPosition:U,defaultGetMovePosition:N}=Rs(),W=b.useRef(null),je=b.useRef(-1),$e=Z=>{if(d){const Q=g&&g({action:Z.action,row:Z.row,editorData:r}),G=i??160,ie=m??1,be=a??20,Te=w??!1,Ie=Ve(_,{scaleWidth:G,scale:ie,startLeft:be}),Ue=U({editorData:r,assistActionIds:Q,action:Z.action,row:Z.row,scale:ie,scaleWidth:G,startLeft:be,hideCursor:Te,cursorLeft:Ie});ve({assistPositions:Ue})}},Pe=Z=>{if(d){const be=N({...Z,startLeft:a??20,scaleWidth:i??160,scale:m??1});L({movePositions:be})}};let Re=0;const xe=s??32,Ae=r.map(Z=>{const Q=Z.rowHeight||xe;return Re+=Q,Q});Re<e&&(Ae.push(e-Re),je.current!==e&&je.current>=0&&setTimeout(()=>{Ce.measure()})),je.current=e;const We=i??160,Oe=a??20,De=Math.max(o*We+Oe,n),Ce=Hn({count:Ae.length,getScrollElement:()=>W.current,estimateSize:Z=>Ae[Z]??xe,overscan:10});b.useLayoutEffect(()=>{W.current&&(l!==void 0&&(W.current.scrollTop=l),f!==void 0&&(W.current.scrollLeft=f))},[l,f]),b.useEffect(()=>{Ce.measure()},[r,Ce]);const Ze=Z=>{const Q=Z.currentTarget;D({clientHeight:Q.clientHeight,clientWidth:Q.clientWidth,scrollHeight:Q.scrollHeight,scrollLeft:Q.scrollLeft,scrollTop:Q.scrollTop,scrollWidth:Q.scrollWidth})};return j.jsxs(j.Fragment,{children:[j.jsx("div",{ref:W,style:{width:n,height:e,overflow:"auto"},onScroll:Ze,children:j.jsx("div",{style:{height:`${Ce.getTotalSize()}px`,width:De,position:"relative"},children:Ce.getVirtualItems().map(Z=>{const Q=r[Z.index];return j.jsx(Ss,{scaleCount:o,setScaleCount:c,cursorTime:_,editorData:r,rowHeight:s,scaleWidth:i,startLeft:a,scale:m,hideCursor:w,timelineWidth:C,getActionRender:B,getScaleRender:Y,onClickRow:F,onDoubleClickRow:V,onContextMenuRow:J,onClickAction:R,onClickActionOnly:T,onDoubleClickAction:P,onContextMenuAction:H,onCursorDragStart:fe,onCursorDragEnd:ge,onCursorDrag:u,onClickTimeArea:A,gridSnap:I,effects:$,setEditorData:S,deltaScrollLeft:k,style:{position:"absolute",top:0,left:0,width:De,height:`${Z.size}px`,transform:`translateY(${Z.start}px)`,backgroundPositionX:`0, ${a??20}px`,backgroundSize:`${a??20}px, ${i??160}px`},areaRef:t,rowData:Q,dragLineData:_e,onActionMoveStart:G=>($e(G),p&&p(G)),onActionResizeStart:G=>($e(G),h&&h(G)),onActionMoving:G=>(Pe(G),y&&y(G)),onActionResizing:G=>(Pe(G),x&&x(G)),onActionResizeEnd:G=>(re(),E&&E(G)),onActionMoveEnd:G=>(re(),v&&v(G)),scrollLeft:f},Z.key)})})}),d&&j.jsx(ws,{scrollLeft:f,..._e})]})},Fs=b.forwardRef((n,e)=>{const t=b.useRef(null);return b.useImperativeHandle(e,()=>({get domRef(){return t}})),j.jsx(Xn,{ref:t,className:me("edit-area"),render:({width:r,height:s})=>j.jsx(zs,{...n,width:r,height:s,editAreaRef:t})})}),Vs=({setCursor:n,maxScaleCount:e,hideCursor:t,scale:r,scaleWidth:s,scaleCount:i,scaleSplitCount:o,startLeft:c,scrollLeft:a,onClickTimeArea:f,getScaleRender:l})=>{const m=b.useRef(null),d=(o??0)>0,g=y=>{const E=o??1,h=s??160,x=c??20;switch(y){case 0:return x;default:return d?h/E:h}},v=d?i*(o??1)+1:i,p=Hn({horizontal:!0,count:v,getScrollElement:()=>m.current,estimateSize:g,overscan:10});return b.useLayoutEffect(()=>{m.current&&a!==void 0&&(m.current.scrollLeft=a)},[a]),b.useEffect(()=>{p.measure()},[s,c,p]),j.jsx(Xn,{className:me("time-area"),render:({width:y,height:E})=>j.jsxs(j.Fragment,{children:[j.jsx("div",{className:me("time-area-virtual"),ref:m,style:{width:y,height:E,overflowX:"hidden",overflowY:"hidden"},children:j.jsx("div",{style:{width:`${p.getTotalSize()}px`,height:"100%",position:"relative"},children:p.getVirtualItems().map(h=>{const x=h.index,D=o??1,_=r??1,w=d?x%D===0:!0,S=["time-unit"];w&&S.push("time-unit-big");const k=(d?x/D:x)*_;return j.jsx("div",{"data-index":h.index,style:{position:"absolute",top:0,left:0,height:"100%",width:`${h.size}px`,transform:`translateX(${h.start}px)`},className:me(...S),children:w&&j.jsx("div",{className:me("time-unit-scale"),children:l?l(k):k})},h.key)})})}),j.jsx("div",{style:{width:y,height:E},onClick:h=>{if(t)return;const x=c??20,D=s??160,_=r??1,w=e??1/0,S=h.currentTarget.getBoundingClientRect(),k=h.clientX-S.x,C=Math.max(k+a,x);if(C>w*D+x-a)return;const B=et(C,{startLeft:x,scale:_,scaleWidth:D});(f&&f(B,h))!==!1&&n({time:B})},className:me("time-area-interact")})]})})},$s=b.forwardRef((n,e)=>{const t=sr(n),{style:r}=n;let{editorData:s,scrollTop:i,autoScroll:o,hideCursor:c,disableDrag:a,scale:f=1,scaleWidth:l=160,startLeft:m=20,minScaleCount:d=20,maxScaleCount:g=1/0,onChange:v,onScroll:p}=t;const y=b.useRef(null),E=b.useRef(null),h=b.useRef(null),[x,D]=b.useState(s),[_,w]=b.useState(qt),[S,k]=b.useState(Zn),[C,B]=b.useState(Number.MAX_SAFE_INTEGER),Y=b.useCallback(R=>{const T=Math.min(g,Math.max(d,R));w(T)},[g,d]);b.useLayoutEffect(()=>{Y(ir(s,{scale:f})),D(s)},[s,d,g,f,Y]),b.useEffect(()=>{i!==void 0&&h.current?.setScrollState(R=>({...R,scrollTop:i}))},[i]);const F=R=>{v?.(R)},V=R=>{let{left:T,time:P}=R;if(typeof T>"u"&&typeof P>"u")return!0;typeof P>"u"&&(T=Ve(P??0,{startLeft:m,scale:f,scaleWidth:l}),P=et(T,{startLeft:m,scale:f,scaleWidth:l}));let H=!0;return k(P),H},J=R=>{!h.current?.state||h.current.state.scrollLeft+R>_*(l-1)+m-C||h.current&&h.current.setScrollState(P=>({...P,scrollLeft:Math.max(P.scrollLeft+R,0)}))};return b.useImperativeHandle(e,()=>({get target(){return y.current},set time(R){V({time:R})},get time(){return S},setScrollLeft:R=>{h.current&&h.current.setScrollState(T=>({...T,scrollLeft:Math.max(R,0)}))},setScrollTop:R=>{h.current&&h.current.setScrollState(T=>({...T,scrollTop:Math.max(R,0)}))}})),b.useEffect(()=>{if(E.current){const R=new ResizeObserver(()=>{E.current&&B(E.current.getBoundingClientRect().width)});return R.observe(E.current),()=>{R&&R.disconnect()}}},[]),j.jsx("div",{ref:y,style:r,className:`${Yt} ${a?Yt+"-disable":""}`,children:j.jsx($n,{ref:h,children:({scrollLeft:R,scrollTop:T,onScroll:P})=>j.jsxs(j.Fragment,{children:[j.jsx(Vs,{...t,timelineWidth:C,disableDrag:a,setCursor:V,cursorTime:S,editorData:x,scaleCount:_,setScaleCount:Y,onScroll:P,scrollLeft:R}),j.jsx(Fs,{...t,timelineWidth:C,ref:H=>{H?.domRef.current&&(E.current=H.domRef.current)},disableDrag:a,editorData:x,cursorTime:S,scaleCount:_,setScaleCount:Y,scrollTop:T,scrollLeft:R,setEditorData:F,deltaScrollLeft:o?J:void 0,onScroll:H=>{P(H),p?.(H)}}),!c&&j.jsx(ls,{...t,timelineWidth:C,scrollLeft:R,scaleCount:_,setScaleCount:Y,setCursor:V,cursorTime:S,editorData:x,areaRef:E,scrollSync:h,deltaScrollLeft:o?J:void 0})]})})})});exports.Timeline=$s;
13
+ color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,e?.key)}return(f=e?.onChange)==null||f.call(e,s),s}return i.updateDeps=o=>{r=o},i}function wn(n,t){if(n===void 0)throw new Error("Unexpected undefined");return n}const fs=(n,t)=>Math.abs(n-t)<1.01,ds=(n,t,e)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>t.apply(this,s),e)}},Sn=n=>{const{offsetWidth:t,offsetHeight:e}=n;return{width:t,height:e}},hs=n=>n,ms=n=>{const t=Math.max(n.startIndex-n.overscan,0),e=Math.min(n.endIndex+n.overscan,n.count-1),r=[];for(let s=t;s<=e;s++)r.push(s);return r},gs=(n,t)=>{const e=n.scrollElement;if(!e)return;const r=n.targetWindow;if(!r)return;const s=o=>{const{width:c,height:l}=o;t({width:Math.round(c),height:Math.round(l)})};if(s(Sn(e)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(o=>{const c=()=>{const l=o[0];if(l?.borderBoxSize){const f=l.borderBoxSize[0];if(f){s({width:f.inlineSize,height:f.blockSize});return}}s(Sn(e))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return i.observe(e,{box:"border-box"}),()=>{i.unobserve(e)}},Rn={passive:!0},Tn=typeof window>"u"?!0:"onscrollend"in window,ps=(n,t)=>{const e=n.scrollElement;if(!e)return;const r=n.targetWindow;if(!r)return;let s=0;const i=n.options.useScrollendEvent&&Tn?()=>{}:ds(r,()=>{t(s,!1)},n.options.isScrollingResetDelay),o=a=>()=>{const{horizontal:_,isRtl:d}=n.options;s=_?e.scrollLeft*(d&&-1||1):e.scrollTop,i(),t(s,a)},c=o(!0),l=o(!1);l(),e.addEventListener("scroll",c,Rn);const f=n.options.useScrollendEvent&&Tn;return f&&e.addEventListener("scrollend",l,Rn),()=>{e.removeEventListener("scroll",c),f&&e.removeEventListener("scrollend",l)}},_s=(n,t,e)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[e.options.horizontal?"inlineSize":"blockSize"])}return n[e.options.horizontal?"offsetWidth":"offsetHeight"]},vs=(n,{adjustments:t=0,behavior:e},r)=>{var s,i;const o=n+t;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:o,behavior:e})};class bs{constructor(t){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 e=null;const r=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const o=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),e=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([r,s])=>{typeof s>"u"&&delete e[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:hs,rangeExtractor:ms,onChange:()=>{},measureElement:_s,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,...e}},this.notify=e=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,e)},this.maybeNotify=_e(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{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(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;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=((e=this.scrollElement)==null?void 0:e.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,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,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=(e,r)=>{const s=new Map,i=new Map;for(let o=r-1;o>=0;o--){const c=e[o];if(s.has(c.lane))continue;const l=i.get(c.lane);if(l==null||c.end>l.end?i.set(c.lane,c):c.end<l.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((o,c)=>o.end===c.end?o.index-c.index:o.end-c.end)[0]:void 0},this.getMeasurementOptions=_e(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,r,s,i,o)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:o}),{key:!1}),this.getMeasurements=_e(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:o},c)=>{if(!o)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 f=this.measurementsCache.slice(0,l);for(let a=l;a<e;a++){const _=i(a),d=this.options.lanes===1?f[a-1]:this.getFurthestMeasurement(f,a),v=d?d.end+this.options.gap:r+s,E=c.get(_),m=typeof E=="number"?E:this.options.estimateSize(a),h=v+m,g=d?d.lane:a%this.options.lanes;f[a]={index:a,start:v,size:m,end:h,key:_,lane:g}}return this.measurementsCache=f,f},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=_e(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,r,s,i)=>this.range=e.length>0&&r>0?ys({measurements:e,outerSize:r,scrollOffset:s,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=_e(()=>{let e=null,r=null;const s=this.calculateRange();return s&&(e=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,r]},(e,r,s,i,o)=>i===null||o===null?[]:e({startIndex:i,endIndex:o,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const r=this.options.indexAttribute,s=e.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(e,r)=>{const s=this.indexFromElement(e),i=this.measurementsCache[s];if(!i)return;const o=i.key,c=this.elementsCache.get(o);c!==e&&(c&&this.observer.unobserve(c),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(s,this.options.measureElement(e,r,this))},this.resizeItem=(e,r)=>{const s=this.measurementsCache[e];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,o=r-i;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,o,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",o),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(e,void 0)},this.getVirtualItems=_e(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,r)=>{const s=[];for(let i=0,o=e.length;i<o;i++){const c=e[i],l=r[c];s.push(l)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const r=this.getMeasurements();if(r.length!==0)return wn(r[Vn(0,r.length-1,s=>wn(r[s]).start,e)])},this.getOffsetForAlignment=(e,r,s=0)=>{const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=e>=o+i?"end":"start"),r==="center"?e+=(s-i)/2:r==="end"&&(e-=i);const c=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(c,e),0)},this.getOffsetForIndex=(e,r="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const s=this.measurementsCache[e];if(!s)return;const i=this.getSize(),o=this.getScrollOffset();if(r==="auto")if(s.end>=o+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=o+this.options.scrollPaddingStart)r="start";else return[o,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=(e,{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(e,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(e,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let i=0;const o=10,c=f=>{if(!this.targetWindow)return;const a=this.getOffsetForIndex(e,f);if(!a){console.warn("Failed to get offset for index:",e);return}const[_,d]=a;this._scrollToOffset(_,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const v=this.getScrollOffset(),E=this.getOffsetForIndex(e,d);if(!E){console.warn("Failed to get offset for index:",e);return}fs(E[0],v)||l(d)})},l=f=>{this.targetWindow&&(i++,i<o?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,o),this.targetWindow.requestAnimationFrame(()=>c(f))):console.warn(`Failed to scroll to index ${e} after ${o} attempts.`))};c(r)},this.scrollBy=(e,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var e;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((e=r[r.length-1])==null?void 0:e.end)??0;else{const i=Array(this.options.lanes).fill(null);let o=r.length-1;for(;o>=0&&i.some(c=>c===null);){const c=r[o];i[c.lane]===null&&(i[c.lane]=c.end),o--}s=Math.max(...i.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:r,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Vn=(n,t,e,r)=>{for(;n<=t;){const s=(n+t)/2|0,i=e(s);if(i<r)n=s+1;else if(i>r)t=s-1;else return s}return n>0?n-1:0};function ys({measurements:n,outerSize:t,scrollOffset:e,lanes:r}){const s=n.length-1,i=l=>n[l].start;if(n.length<=r)return{startIndex:0,endIndex:s};let o=Vn(0,s,i,e),c=o;if(r===1)for(;c<s&&n[c].end<e+t;)c++;else if(r>1){const l=Array(r).fill(0);for(;c<s&&l.some(a=>a<e+t);){const a=n[c];l[a.lane]=a.end,c++}const f=Array(r).fill(e+t);for(;o>=0&&f.some(a=>a>=e);){const a=n[o];f[a.lane]=a.start,o--}o=Math.max(0,o-o%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:o,endIndex:c}}const xn=typeof document<"u"?Pe.useLayoutEffect:Pe.useEffect;function Es(n){const t=Pe.useReducer(()=>({}),{})[1],e={...n,onChange:(s,i)=>{var o;i?Bn.flushSync(t):t(),(o=n.onChange)==null||o.call(n,s,i)}},[r]=Pe.useState(()=>new bs(e));return r.setOptions(e),xn(()=>r._didMount(),[]),xn(()=>r._willUpdate()),r}function $n(n){return Es({observeElementRect:gs,observeElementOffset:ps,scrollToFn:vs,...n})}const ws=n=>{const{rowData:t,style:e={},onClickRow:r,onDoubleClickRow:s,onContextMenuRow:i,scrollContainerRef:o,startLeft:c,scale:l,scaleWidth:f}=n,a=["edit-row"];t?.selected&&a.push("edit-row-selected");const _=l??Ie,d=f??ke,v=c??We,E=g=>{if(!o.current)return 0;const p=o.current.getBoundingClientRect(),y=g.clientX-p.x;return qt(y,{startLeft:v,scale:_,scaleWidth:d})},m=t?.actions??[],h=$n({horizontal:!0,count:m.length,getScrollElement:()=>o.current,estimateSize:g=>{if(!m[g])return 0;let{width:p}=Je({start:m[g].start,end:m[g].end},{startLeft:v,scale:_,scaleWidth:d});return p},overscan:3});return x.useLayoutEffect(()=>{h.measure()},[f,c,h]),G.jsx("div",{className:`${Et(...a)} ${(t?.classNames||[]).join(" ")}`,style:e,onClick:g=>{if(t&&r){const p=E(g);r(g,{row:t,time:p})}},onDoubleClick:g=>{if(t&&s){const p=E(g);s(g,{row:t,time:p})}},onContextMenu:g=>{if(t&&i){const p=E(g);i(g,{row:t,time:p})}},children:t&&h.getVirtualItems().map(g=>{const p=m[g.index];if(!p)throw new Error("Action not found");return G.jsx(us,{...n,handleTime:E,row:t,action:p},p.id)})})};function Ss(){const n=Nt.c(6);let t;n[0]===Symbol.for("react.memo_cache_sentinel")?(t={isMoving:!1,movePositions:[],assistPositions:[]},n[0]=t):t=n[0];const[e,r]=x.useState(t),s=Ts,i=Rs;let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o=v=>{const{movePositions:E,assistPositions:m}=v;r({isMoving:!0,movePositions:E||[],assistPositions:m||[]})},n[1]=o):o=n[1];const c=o;let l;n[2]===Symbol.for("react.memo_cache_sentinel")?(l=v=>{const{movePositions:E,assistPositions:m}=v;r(h=>({...h,movePositions:E||h.movePositions,assistPositions:m||h.assistPositions}))},n[2]=l):l=n[2];const f=l;let a;n[3]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=a):a=n[3];const _=a;let d;return n[4]!==e?(d={initDragLine:c,updateDragLine:f,disposeDragLine:_,dragLineData:e,defaultGetAssistPosition:s,defaultGetMovePosition:i},n[4]=e,n[5]=d):d=n[5],d}function Rs(n){const{start:t,end:e,dir:r,scale:s,scaleWidth:i,startLeft:o}=n,{left:c,width:l}=Je({start:t,end:e},{startLeft:o,scaleWidth:i,scale:s});return r?r==="right"?[c+l]:[c]:[c,c+l]}function Ts(n){const{editorData:t,assistActionIds:e,action:r,row:s,scale:i,scaleWidth:o,startLeft:c,cursorLeft:l,hideCursor:f}=n,a=[];e?t.forEach(d=>{d.actions.forEach(v=>{e.includes(v.id)&&a.push(v)})}):t.forEach(d=>{d.id!==s.id?a.push(...d.actions):d.actions.forEach(v=>{v.id!==r.id&&a.push(v)})});const _=sr(a,{startLeft:c,scale:i,scaleWidth:o});return f||_.push(l),_}const xs=n=>{const t=Nt.c(30),{dragLineData:e,initDragLine:r,updateDragLine:s,disposeDragLine:i,defaultGetAssistPosition:o,defaultGetMovePosition:c}=Ss();let l;t[0]!==o||t[1]!==r||t[2]!==n?(l=w=>{if(n.dragLine){const T=n.getAssistDragLineActionIds&&n.getAssistDragLineActionIds({action:w.action,row:w.row,editorData:n.editorData}),k=n.scaleWidth??160,K=n.scale??1,C=n.startLeft??20,Q=n.hideCursor??!1,B=kt(n.cursorTime,{scaleWidth:k,scale:K,startLeft:C}),et=o({editorData:n.editorData,assistActionIds:T,action:w.action,row:w.row,scale:K,scaleWidth:k,startLeft:C,hideCursor:Q,cursorLeft:B});r({assistPositions:et})}},t[0]=o,t[1]=r,t[2]=n,t[3]=l):l=t[3];const f=l;let a;t[4]!==c||t[5]!==n.dragLine||t[6]!==n.scale||t[7]!==n.scaleWidth||t[8]!==n.startLeft||t[9]!==s?(a=w=>{if(n.dragLine){const T=n.scaleWidth??160,k=n.scale??1,K=n.startLeft??20,C=c({...w,startLeft:K,scaleWidth:T,scale:k});s({movePositions:C})}},t[4]=c,t[5]=n.dragLine,t[6]=n.scale,t[7]=n.scaleWidth,t[8]=n.startLeft,t[9]=s,t[10]=a):a=t[10];const _=a,d=n.rowHeight??32,v=n.scaleWidth??160,E=n.startLeft??20,m=Math.max(n.scaleCount*v+E,n.timelineWidth),h=`0, ${n.startLeft??20}px`,g=`${n.startLeft??20}px, ${n.scaleWidth??160}px`;let p;t[11]!==m||t[12]!==h||t[13]!==g?(p={width:m,position:"relative",backgroundPositionX:h,backgroundSize:g},t[11]=m,t[12]=h,t[13]=g,t[14]=p):p=t[14];let b;if(t[15]!==m||t[16]!==d||t[17]!==i||t[18]!==e||t[19]!==f||t[20]!==_||t[21]!==n){b=[];let w=0;for(let T=0;T<n.editorData.length;T++){const k=n.editorData[T];if(!k)continue;const K=k.rowHeight||d;b.push(x.createElement(ws,{...n,key:k.id,rowData:k,dragLineData:e,scrollContainerRef:n.scrollElementRef,style:{position:"absolute",top:0,left:0,width:m,height:`${K}px`,transform:`translateY(${w}px)`},onActionMoveStart:C=>(f(C),n.onActionMoveStart&&n.onActionMoveStart(C)),onActionResizeStart:C=>(f(C),n.onActionResizeStart&&n.onActionResizeStart(C)),onActionMoving:C=>(_(C),n.onActionMoving&&n.onActionMoving(C)),onActionResizing:C=>(_(C),n.onActionResizing&&n.onActionResizing(C)),onActionResizeEnd:C=>(i(),n.onActionResizeEnd&&n.onActionResizeEnd(C)),onActionMoveEnd:C=>(i(),n.onActionMoveEnd&&n.onActionMoveEnd(C))})),w=w+K}t[15]=m,t[16]=d,t[17]=i,t[18]=e,t[19]=f,t[20]=_,t[21]=n,t[22]=b}else b=t[22];const y=b;let S;t[23]!==e||t[24]!==n.dragLine?(S=n.dragLine&&G.jsx(lr,{...e}),t[23]=e,t[24]=n.dragLine,t[25]=S):S=t[25];let A;return t[26]!==p||t[27]!==y||t[28]!==S?(A=G.jsxs("div",{style:p,className:"timeline-editor-edit-area",children:[y,S]}),t[26]=p,t[27]=y,t[28]=S,t[29]=A):A=t[29],A};function As({scaleSplitCount:n,scaleWidth:t,startLeft:e,scaleCount:r,maxScaleCount:s,scale:i,scrollElementRef:o,onClickTimeArea:c,setCursor:l}){const f=n??1,a=t??160,_=e??20,d=(n??0)>0,v=d?r*(n??1)+1:r,E=(d?a/f:a)*(v-1)+_,h=$n({horizontal:!0,count:v,getScrollElement:()=>o.current,estimateSize:g=>{switch(g){case 0:return _;default:return d?a/f:a}},overscan:10});return x.useEffect(()=>h.measure(),[t,e,h]),G.jsx("div",{style:{width:`${E}px`},className:"time-editor-time-area",onClick:g=>{const p=e??20,b=t??160,y=i??1,S=s??1/0,A=g.currentTarget.getBoundingClientRect(),w=g.clientX-A.x,T=Math.max(w,p);if(T>S*b+p)return;const k=qt(T,{startLeft:p,scale:y,scaleWidth:b});c&&c(k,g),!g.defaultPrevented&&l({time:k})},children:h.getVirtualItems().map(g=>{const p=g.index,b=n??1,y=i??1,S=d?p%b===0:!0,A=["time-editor-time-unit",S?"time-editor-time-unit-big":"time-editor-time-unit-small"],w=(d?p/b:p)*y;return G.jsx("div",{"data-index":g.index,style:{width:`${g.size}px`,transform:`translateX(${g.start}px)`},className:A.join(" "),children:S&&G.jsx("div",{className:"time-editor-time-unit-scale",children:w})},g.key)})})}function Ds(n){return typeof n=="object"&&n!==null}function Cs(n,t,e){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 Os(n){return Ds(n)&&"ownerSVGElement"in n}const Oe=new WeakMap;let Le;const Un=(n,t,e)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:Os(r)&&"getBBox"in r?r.getBBox()[t]:r[e],Ls=Un("inline","width","offsetWidth"),Ms=Un("block","height","offsetHeight");function Ps({target:n,borderBoxSize:t}){Oe.get(n)?.forEach(e=>{e(n,{get width(){return Ls(n,t)},get height(){return Ms(n,t)}})})}function Is(n){n.forEach(Ps)}function ks(){typeof ResizeObserver>"u"||(Le=new ResizeObserver(Is))}function Ns(n,t){Le||ks();const e=Cs(n);return e.forEach(r=>{let s=Oe.get(r);s||(s=new Set,Oe.set(r,s)),s.add(t),Le?.observe(r)}),()=>{e.forEach(r=>{const s=Oe.get(r);s?.delete(t),s?.size||Le?.unobserve(r)})}}const Me=new Set;let ve;function Ws(){ve=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Me.forEach(t=>t(n))},window.addEventListener("resize",ve)}function zs(n){return Me.add(n),ve||Ws(),()=>{Me.delete(n),!Me.size&&typeof ve=="function"&&(window.removeEventListener("resize",ve),ve=void 0)}}function js(n,t){return typeof n=="function"?zs(n):Ns(n,t)}function Fs(n){const t=Nt.c(13);let e,r,s;t[0]!==n?({render:s,ref:r,...e}=n,t[0]=n,t[1]=e,t[2]=r,t[3]=s):(e=t[1],r=t[2],s=t[3]);const i=x.useRef(null),o=Vs(i);let c;t[4]!==r?(c=zn(i,r),t[4]=r,t[5]=c):c=t[5];let l;t[6]!==s||t[7]!==o?(l=s(o),t[6]=s,t[7]=o,t[8]=l):l=t[8];let f;return t[9]!==e||t[10]!==c||t[11]!==l?(f=G.jsx("div",{ref:c,...e,children:l}),t[9]=e,t[10]=c,t[11]=l,t[12]=f):f=t[12],f}function Vs(n){const t=Nt.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:0,height:0},t[0]=e):e=t[0];const[r,s]=x.useState(e);let i;t[1]!==n?(i=()=>{n.current&&js(n.current,(c,l)=>{s({width:l.width,height:l.height})})},t[1]=n,t[2]=i):i=t[2];let o;return t[3]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[3]=o):o=t[3],x.useLayoutEffect(i,o),r}const $s=n=>{const t=Nt.c(42),{disableDrag:e,cursorTime:r,setCursor:s,startLeft:i,scaleWidth:o,scale:c,scaleCount:l,scaleSplitCount:f,scrollElementRef:a,maxScaleCount:_,onCursorDragStart:d,onCursorDrag:v,onCursorDragEnd:E}=n,m=x.useRef(null),h=x.useRef(void 0);let g,p;t[0]!==r||t[1]!==c||t[2]!==o||t[3]!==i?(g=()=>{if(typeof h.current>"u"&&m.current){const u=i??20,R=o??160,N=c??1;m.current.updateLeft(kt(r,{startLeft:u,scaleWidth:R,scale:N}))}},p=[r,i,o,c],t[0]=r,t[1]=c,t[2]=o,t[3]=i,t[4]=g,t[5]=p):(g=t[4],p=t[5]),x.useEffect(g,p);const b=i??20,y=o??160,S=c??1,A=_??1/0,w=(f??0)>0,T=f??1,k=w?l*(f??1)+1:l,K=i??20,C=(w?y/T:y)*(k-1)+K;let Q;t[6]!==b||t[7]!==A||t[8]!==a||t[9]!==C||t[10]!==y?(Q=()=>({left:0,right:Math.min(C,A*y+b-(a.current?.scrollLeft??0))}),t[6]=b,t[7]=A,t[8]=a,t[9]=C,t[10]=y,t[11]=Q):Q=t[11];const B=!e;let et;t[12]!==r||t[13]!==b||t[14]!==d||t[15]!==S||t[16]!==y?(et=()=>{d&&d(r),h.current=kt(r,{startLeft:b,scaleWidth:y,scale:S}),m.current?.updateLeft(h.current)},t[12]=r,t[13]=b,t[14]=d,t[15]=S,t[16]=y,t[17]=et):et=t[17];let j;t[18]!==b||t[19]!==E||t[20]!==S||t[21]!==s||t[22]!==y?(j=()=>{if(typeof h.current<"u"){const u=qt(h.current,{startLeft:b,scale:S,scaleWidth:y});s({time:u}),E&&E(u)}h.current=void 0},t[18]=b,t[19]=E,t[20]=S,t[21]=s,t[22]=y,t[23]=j):j=t[23];let M;t[24]!==b||t[25]!==v||t[26]!==S||t[27]!==a||t[28]!==s||t[29]!==y?(M=(u,R)=>{const{left:N}=u,F=R===void 0?0:R,Y=a.current?.scrollLeft??0,V=a.current,W=V?.clientWidth??0;if(F!==0)if(typeof h.current<"u"){h.current=h.current+F;const D=Y,O=Y+W;h.current<D+10?h.current=D+10:h.current>O-10&&(h.current=O-10),h.current<b-Y&&(h.current=b-Y)}else{h.current=N+F;const D=Y,O=Y+W;h.current<D+10?h.current=D+10:h.current>O-10&&(h.current=O-10)}else if(N<b-Y?h.current=b-Y:h.current=N,V&&W>0){const D=Y,O=Y+W;h.current<D+10?h.current=D+10:h.current>O-10&&(h.current=O-10)}if(typeof h.current<"u"){m.current?.updateLeft(h.current);const D=qt(h.current+Y,{startLeft:b,scale:S,scaleWidth:y});s({time:D}),v&&v(D)}return!1},t[24]=b,t[25]=v,t[26]=S,t[27]=a,t[28]=s,t[29]=y,t[30]=M):M=t[30];let H,lt;t[31]===Symbol.for("react.memo_cache_sentinel")?(H=Et("cursor"),lt=Et("cursor-top"),t[31]=H,t[32]=lt):(H=t[31],lt=t[32]);let ut;t[33]===Symbol.for("react.memo_cache_sentinel")?(ut=G.jsxs("div",{className:H,children:[G.jsx("svg",{className:lt,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:G.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:"#5297FF"})}),G.jsx("div",{className:Et("cursor-area")})]}),t[33]=ut):ut=t[33];let dt;return t[34]!==b||t[35]!==a||t[36]!==Q||t[37]!==B||t[38]!==et||t[39]!==j||t[40]!==M?(dt=G.jsx(Fn,{start:b,ref:m,parentRef:a,getBounds:Q,autoScroll:!0,enableDragging:B,enableResizing:!1,onDragStart:et,onDragEnd:j,onDrag:M,children:ut}),t[34]=b,t[35]=a,t[36]=Q,t[37]=B,t[38]=et,t[39]=j,t[40]=M,t[41]=dt):dt=t[41],dt},Us=x.forwardRef((n,t)=>{const e=er(n),{style:r}=n;let{editorData:s,hideCursor:i,disableDrag:o,scale:c=1,scaleWidth:l=160,startLeft:f=20,minScaleCount:a=20,maxScaleCount:_=1/0,onChange:d,onScroll:v}=e;const E=x.useRef(null),[m,h]=x.useState(s),[g,p]=x.useState(Ke),[b,y]=x.useState(Kn),S=x.useCallback(T=>{const k=Math.min(_,Math.max(a,T));p(k)},[_,a]);x.useLayoutEffect(()=>{S(nr(s,{scale:c})),h(s)},[s,a,_,c,S]);const A=T=>{d?.(T)},w=T=>{let{left:k,time:K}=T;return typeof K<"u"?(y(K),!0):typeof k<"u"?(y(qt(k,{startLeft:f,scale:c,scaleWidth:l})),!0):!1};return x.useImperativeHandle(t,()=>({get target(){return E.current},set time(T){w({time:T})},get time(){return b},setScrollLeft:T=>{E.current&&(E.current.scrollLeft=T)},setScrollTop:T=>{E.current&&(E.current.scrollTop=T)}})),G.jsx(Fs,{ref:E,style:r,className:`${Ye} ${o?Ye+"-disable":""}`,onScroll:T=>{v?.(T.currentTarget)},render:({width:T,height:k})=>G.jsxs(G.Fragment,{children:[G.jsx(As,{...e,setCursor:w,scaleCount:g,scrollElementRef:E}),G.jsx(xs,{...e,scrollElementRef:E,timelineWidth:T,timelineHeight:k,disableDrag:o,editorData:m,cursorTime:b,scaleCount:g,setScaleCount:S,setEditorData:A}),!i&&G.jsx($s,{...e,timelineWidth:T,scaleCount:g,setScaleCount:S,setCursor:w,cursorTime:b,editorData:m,scrollElementRef:E})]})})});exports.Timeline=Us;
@@ -1 +1 @@
1
- .timeline-editor-cursor{cursor:ew-resize;position:absolute;top:32px;height:calc(100% - 32px);box-sizing:border-box;border-left:1px solid #5297FF;border-right:1px solid #5297FF;transform:translate(-25%) scaleX(.5)}.timeline-editor-cursor-top{position:absolute;top:0;left:50%;transform:translate(-50%) scaleX(2);margin:auto}.timeline-editor-cursor-area{width:16px;height:100%;cursor:ew-resize;position:absolute;top:0;left:50%;transform:translate(-50%)}.timeline-editor-drag-line-container{position:absolute;height:100%;top:0;left:0}.timeline-editor-drag-line{width:0;position:absolute;top:0;height:99%;border-left:1px dashed rgba(82,151,255,.6)}.timeline-editor:hover .timeline-editor-edit-area .ReactVirtualized__Grid::-webkit-scrollbar{height:4px}.timeline-editor-edit-area{flex:1 1 auto;margin-top:10px;overflow:hidden;position:relative}.timeline-editor-edit-area .ReactVirtualized__Grid{outline:none!important;overflow:overlay!important}.timeline-editor-edit-area .ReactVirtualized__Grid::-webkit-scrollbar{width:0;height:0}.timeline-editor-edit-area .ReactVirtualized__Grid::-webkit-scrollbar-track{background-color:transparent!important}.timeline-editor-edit-area .ReactVirtualized__Grid::-webkit-scrollbar-thumb{background:#313132;border-radius:16px}.timeline-editor-action{position:absolute;left:0;top:0;background-color:#2f3134}.timeline-editor-action .timeline-editor-action-left-stretch,.timeline-editor-action .timeline-editor-action-right-stretch{position:absolute;top:0;width:10px;border-radius:4px;height:100%;overflow:hidden}.timeline-editor-action .timeline-editor-action-left-stretch:after,.timeline-editor-action .timeline-editor-action-right-stretch:after{position:absolute;top:0;bottom:0;margin:auto;border-radius:4px;border-top:28px solid transparent;border-bottom:28px solid transparent}.timeline-editor-action .timeline-editor-action-left-stretch{left:0}.timeline-editor-action .timeline-editor-action-left-stretch:after{left:0;content:"";border-left:7px solid rgba(255,255,255,.1);border-right:7px solid transparent}.timeline-editor-action .timeline-editor-action-right-stretch{right:0}.timeline-editor-action .timeline-editor-action-right-stretch:after{right:0;content:"";border-right:7px solid rgba(255,255,255,.1);border-left:7px solid transparent}.timeline-editor-edit-row{background-repeat:no-repeat,repeat;background-image:linear-gradient(#191b1d,#191b1d),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 0);display:flex;flex-direction:row;box-sizing:border-box}.timeline-editor{height:600px;width:600px;min-height:32px;position:relative;font-size:12px;font-family:PingFang SC;background-color:#191b1d;display:flex;flex-direction:column;overflow:hidden}.timeline-editor-time-area{position:relative;height:32px;flex:0 0 auto}.timeline-editor-time-area-virtual{outline:none}.timeline-editor-time-area-virtual::-webkit-scrollbar{display:none}.timeline-editor-time-area-interact{position:absolute;cursor:pointer;left:0;top:0}.timeline-editor-time-unit{border-right:1px solid rgba(255,255,255,.2);position:relative;box-sizing:content-box;height:4px!important;bottom:0!important;top:auto!important}.timeline-editor-time-unit-big{height:8px!important}.timeline-editor-time-unit-scale{color:#fff9;position:absolute;right:0;top:0;transform:translate(50%,-100%)}
1
+ @layer base,components;@layer components{.timeline-editor{min-height:2rem;position:relative;font-size:.75rem;line-height:1rem;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#0a0a0a;display:flex;flex-direction:column;overflow:auto}.timeline-editor-edit-area{flex:1 1 0%;margin-top:.625rem;background-repeat:no-repeat,repeat;background-image:linear-gradient(transparent,transparent),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 0)}.timeline-editor-edit-row{display:flex;flex-direction:row}.timeline-editor-action{position:absolute;left:0;top:0;background-color:#404040}.timeline-editor-action-left-stretch,.timeline-editor-action-right-stretch{position:absolute;width:.625rem;border-radius:.25rem;height:100%;overflow:hidden;top:0}.timeline-editor-action-left-stretch:after,.timeline-editor-action-right-stretch:after{position:absolute;border-radius:.25rem;margin:auto;border-top-width:7rem;border-top-color:transparent;border-bottom-width:7rem;border-bottom-color:transparent;border-style:solid;top:0;bottom:0}.timeline-editor-action-left-stretch{left:0}.timeline-editor-action-left-stretch:after{content:"";border-left-color:#ffffff1a;border-right-color:transparent;border-left-width:7px;border-right-width:7px;border-style:solid;left:0}.timeline-editor-action-right-stretch{right:0}.timeline-editor-action-right-stretch:after{content:"";border-left-color:transparent;border-right-color:#ffffff1a;border-left-width:7px;border-right-width:7px;border-style:solid;right:0}.time-editor-time-area{z-index:1;background-color:#0a0a0a;position:sticky;top:0;height:2rem;text-align:center;font-weight:700;font-size:1.125rem;line-height:1.75rem;overflow:clip}.time-editor-time-unit{box-sizing:content-box;position:absolute;left:0;border-right-width:1px;border-right-style:solid;border-right-color:#404040;bottom:0;top:auto;pointer-events:none}.time-editor-time-unit-big{height:.5rem}.time-editor-time-unit-small{height:.25rem}.time-editor-time-unit-scale{position:absolute;top:0;right:0;transform:translate(50%) translateY(-100%);pointer-events:none;color:#737373;font-size:.75rem;line-height:1rem;font-weight:300}.timeline-editor-cursor{cursor:ew-resize;position:absolute;height:calc(100% - 32px);box-sizing:border-box;transform:translate(-25%) scaleX(.5);border-left-width:1px;border-left-style:solid;border-left-color:#3b82f6;border-right-width:1px;border-right-style:solid;border-right-color:#3b82f6;top:2rem}.timeline-editor-cursor-top{position:absolute;transform:translate(-50%) translateY(0) scaleX(2);margin:auto;left:50%;top:0}.timeline-editor-cursor-area{width:1rem;height:100%;cursor:ew-resize;position:absolute;transform:translate(-50%);left:50%;top:0}.timeline-editor-drag-line-container{position:absolute;height:100%;left:0;top:0}.timeline-editor-drag-line{width:0;position:absolute;height:99%;border-left-color:#64748b;border-left-width:1px;border-left-style:dashed;top:0}}