/**
 * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.
 * Original file: /npm/motion-utils@12.36.0/dist/es/index.mjs
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
function x(e,n){e.indexOf(n)===-1&&e.push(n)}function N(e,n){const t=e.indexOf(n);t>-1&&e.splice(t,1)}function J([...e],n,t){const r=n<0?e.length+n:n;if(r>=0&&r<e.length){const i=t<0?e.length+t:t,[o]=e.splice(n,1);e.splice(i,0,o)}return e}const z=(e,n,t)=>t>n?n:t<e?e:t;var w=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};function A(){throw new Error("setTimeout has not been defined")}function k(){throw new Error("clearTimeout has not been defined")}var u=A,a=k;typeof w.setTimeout=="function"&&(u=setTimeout),typeof w.clearTimeout=="function"&&(a=clearTimeout);function L(e){if(u===setTimeout)return setTimeout(e,0);if((u===A||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch{try{return u.call(null,e,0)}catch{return u.call(this,e,0)}}}function K(e){if(a===clearTimeout)return clearTimeout(e);if((a===k||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(e);try{return a(e)}catch{try{return a.call(null,e)}catch{return a.call(this,e)}}}var s=[],d=!1,l,m=-1;function R(){!d||!l||(d=!1,l.length?s=l.concat(s):m=-1,s.length&&$())}function $(){if(!d){var e=L(R);d=!0;for(var n=s.length;n;){for(l=s,s=[];++m<n;)l&&l[m].run();m=-1,n=s.length}l=null,d=!1,K(e)}}function X(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];s.push(new D(e,n)),s.length===1&&!d&&L($)}function D(e,n){this.fun=e,this.array=n}D.prototype.run=function(){this.fun.apply(null,this.array)};var Y="browser",ee="browser",ne=!0,te={},re=[],oe="",ie={},se={},ce={};function f(){}var ue=f,ae=f,le=f,fe=f,de=f,he=f,ve=f;function me(e){throw new Error("process.binding is not supported")}function ge(){return"/"}function be(e){throw new Error("process.chdir is not supported")}function pe(){return 0}var h=w.performance||{},we=h.now||h.mozNow||h.msNow||h.oNow||h.webkitNow||function(){return new Date().getTime()};function ye(e){var n=we.call(h)*.001,t=Math.floor(n),r=Math.floor(n%1*1e9);return e&&(t=t-e[0],r=r-e[1],r<0&&(t--,r+=1e9)),[t,r]}var Te=new Date;function Se(){var e=new Date,n=e-Te;return n/1e3}var y={nextTick:X,title:Y,browser:ne,env:te,argv:re,version:oe,versions:ie,on:ue,addListener:ae,once:le,off:fe,removeListener:de,removeAllListeners:he,emit:ve,binding:me,cwd:ge,chdir:be,umask:pe,hrtime:ye,platform:ee,release:se,config:ce,uptime:Se};typeof Symbol=="function"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"process",enumerable:!1,writable:!0,configurable:!1});function T(e,n){return n?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${n}`:e}let F=()=>{},g=()=>{};typeof y<"u"&&y.env?.NODE_ENV!=="production"&&(F=(e,n,t)=>{!e&&typeof console<"u"&&console.warn(T(n,t))},g=(e,n,t)=>{if(!e)throw new Error(T(n,t))});const Me={},Ee=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Oe(e){return typeof e=="object"&&e!==null}const Ie=e=>/^0[^.\s]+$/u.test(e);function xe(e){let n;return()=>(n===void 0&&(n=e()),n)}const S=e=>e,Ne=(e,n)=>t=>n(e(t)),ze=(...e)=>e.reduce(Ne),Ae=(e,n,t)=>{const r=n-e;return r===0?1:(t-e)/r};class ke{constructor(){this.subscriptions=[]}add(n){return x(this.subscriptions,n),()=>N(this.subscriptions,n)}notify(n,t,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](n,t,r);else for(let o=0;o<i;o++){const c=this.subscriptions[o];c&&c(n,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Le=e=>e*1e3,$e=e=>e/1e3;function De(e,n){return n?e*(1e3/n):0}const M=new Set;function Fe(e){return M.has(e)}function Ce(e,n,t){e||M.has(n)||(console.warn(T(n,t)),M.add(n))}const C=(e,n,t)=>{const r=n-e;return((t-e)%r+r)%r+e},j=(e,n,t)=>(((1-3*t+3*n)*e+(3*t-6*n))*e+3*n)*e,je=1e-7,qe=12;function Pe(e,n,t,r,i){let o,c,H=0;do c=n+(t-n)/2,o=j(c,r,i)-e,o>0?t=c:n=c;while(Math.abs(o)>je&&++H<qe);return c}function v(e,n,t,r){if(e===n&&t===r)return S;const i=o=>Pe(o,0,1,e,t);return o=>o===0||o===1?o:j(i(o),n,r)}const E=e=>n=>n<=.5?e(2*n)/2:(2-e(2*(1-n)))/2,O=e=>n=>1-e(1-n),I=v(.33,1.53,.69,.99),b=O(I),q=E(b),P=e=>e>=1?1:(e*=2)<1?.5*b(e):.5*(2-Math.pow(2,-10*(e-1))),p=e=>1-Math.sin(Math.acos(e)),V=O(p),Q=E(p),U=v(.42,0,1,1),_=v(0,0,.58,1),G=v(.42,0,.58,1);function Ve(e,n="end"){return t=>{t=n==="end"?Math.min(t,.999):Math.max(t,.001);const r=t*e,i=n==="end"?Math.floor(r):Math.ceil(r);return z(0,1,i/e)}}const W=e=>Array.isArray(e)&&typeof e[0]!="number";function Qe(e,n){return W(e)?e[C(0,e.length,n)]:e}const Z=e=>Array.isArray(e)&&typeof e[0]=="number",B={linear:S,easeIn:U,easeInOut:G,easeOut:_,circIn:p,circInOut:Q,circOut:V,backIn:b,backInOut:q,backOut:I,anticipate:P},Ue=e=>typeof e=="string",_e=e=>{if(Z(e)){g(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,t,r,i]=e;return v(n,t,r,i)}else if(Ue(e))return g(B[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),B[e];return e};export{Me as MotionGlobalConfig,ke as SubscriptionManager,x as addUniqueItem,P as anticipate,b as backIn,q as backInOut,I as backOut,p as circIn,Q as circInOut,V as circOut,z as clamp,v as cubicBezier,U as easeIn,G as easeInOut,_ as easeOut,_e as easingDefinitionToFunction,Qe as getEasingForSegment,Fe as hasWarned,g as invariant,Z as isBezierDefinition,W as isEasingArray,Ee as isNumericalString,Oe as isObject,Ie as isZeroValueString,xe as memo,$e as millisecondsToSeconds,E as mirrorEasing,J as moveItem,S as noop,ze as pipe,Ae as progress,N as removeItem,O as reverseEasing,Le as secondsToMilliseconds,Ve as steps,De as velocityPerSecond,Ce as warnOnce,F as warning,C as wrap};
//# sourceMappingURL=/sm/cfc9e1224e64e2d8acae29cda99ee60b5c66da9fd1a3cf6273175d93928fbb68.map