Files
ai-course/node_modules/framer-motion/dist/size-rollup-motion.js

2 lines
108 KiB
JavaScript
Raw Normal View History

import{jsx as t,jsxs as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useId as s,useEffect as o,useCallback as r,Component as a,useMemo as l,useLayoutEffect as h,useRef as u,useInsertionEffect as c,forwardRef as d,Fragment as p,createElement as m}from"react";function f(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function y(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function g(t,e,n,i){if("function"==typeof e){const[s,o]=y(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=y(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function v(t,e,n){const i=t.getProps();return g(i,e,void 0!==n?n:i.custom,t)}function x(t,e){-1===t.indexOf(e)&&t.push(e)}function T(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const w=(t,e,n)=>n>e?e:n<t?t:n;const P={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function b(t){return"object"==typeof t&&null!==t}const A=t=>/^0[^.\s]+$/u.test(t);function V(t){let e;return()=>(void 0===e&&(e=t()),e)}const E=t=>t,M=(t,e)=>n=>e(t(n)),D=(...t)=>t.reduce(M),C=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class k{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>T(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const R=t=>1e3*t,L=t=>t/1e3;function j(t,e){return e?t*(1e3/e):0}const B=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function F(t,e,n,i){if(t===e&&n===i)return E;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=B(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:B(s(t),e,i)}const O=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,I=t=>e=>1-t(1-e),U=F(.33,1.53,.69,.99),N=I(U),W=O(N),$=t=>(t*=2)<1?.5*N(t):.5*(2-Math.pow(2,-10*(t-1))),Y=t=>1-Math.sin(Math.acos(t)),X=I(Y),K=O(Y),z=F(.42,0,1,1),H=F(0,0,.58,1),q=F(.42,0,.58,1),G=t=>Array.isArray(t)&&"number"==typeof t[0],Z={linear:E,easeIn:z,easeInOut:q,easeOut:H,circIn:Y,circInOut:K,circOut:X,backIn:N,backInOut:W,backOut:U,anticipate:$},_=t=>{if(G(t)){t.length;const[e,n,i,s]=t;return F(e,n,i,s)}return"string"==typeof t?Z[t]:t},J=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Q={value:null,addProjectionMetrics:null};function tt(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=J.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(h),e&&Q.value&&Q.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=P.useManualTiming?s.timestamp:performance.now();n=!1,P.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:J.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<J.length;e++)r[J[e]].cancel(t)},state:s,steps:r}}const{schedule:et,cancel:nt,state:it,steps:st}=tt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:E,!0);let ot;function rt(){ot=void 0}const at={now:()=>(void 0===ot&&at.set(it.isProcessing||P.useManualTiming?it.timestamp:performance.now()),ot),set:t=>{ot=t,queueMicrotask(rt)}},lt=t=>e=>"string"==typeof e&&e.startsWith(t),ht=lt("--"),ut=lt("var(--"),ct=t=>!!ut(t)&&d