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

2 lines
55 KiB
JavaScript
Raw Permalink Normal View History

function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n<t?t:n;const n={},s=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function i(t){return"object"==typeof t&&null!==t}const r=t=>/^0[^.\s]+$/u.test(t);function a(t){let e;return()=>(void 0===e&&(e=t()),e)}const o=t=>t,l=(t,e)=>n=>e(t(n)),u=(...t)=>t.reduce(l),h=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class c{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const p=t=>1e3*t,d=t=>t/1e3;function m(t,e){return e?t*(1e3/e):0}const f=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function y(t,e,n,s){if(t===e&&n===s)return o;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=f(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:f(i(t),e,s)}const g=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,v=t=>e=>1-t(1-e),b=y(.33,1.53,.69,.99),w=v(b),T=g(w),M=t=>(t*=2)<1?.5*w(t):.5*(2-Math.pow(2,-10*(t-1))),V=t=>1-Math.sin(Math.acos(t)),A=v(V),S=g(V),x=y(.42,0,1,1),k=y(0,0,.58,1),C=y(.42,0,.58,1),F=t=>Array.isArray(t)&&"number"!=typeof t[0];function P(t,e){return F(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const O=t=>Array.isArray(t)&&"number"==typeof t[0],E={linear:o,easeIn:x,easeInOut:C,easeOut:k,circIn:V,circInOut:S,circOut:A,backIn:w,backInOut:T,backOut:b,anticipate:M},D=t=>{if(O(t)){t.length;const[e,n,s,i]=t;return y(e,n,s,i)}return"string"==typeof t?E[t]:t},I=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],R={value:null,addProjectionMetrics:null};function B(t,e){let s=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=I.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){a.has(e)&&(h.schedule(e),t()),l++,e(o)}const h={schedule:(t,e=!1,r=!1)=>{const o=r&&i?n:s;return e&&a.add(t),o.has(t)||o.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{o=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(u),e&&R.value&&R.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,h.process(t)))}};return h}(a,e?n:void 0),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:p,preRender:d,render:m,postRender:f}=o,y=()=>{const a=n.useManualTiming?r.timestamp:performance.now();s=!1,n.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(a-r.timestamp,40),1)),r.timestamp=a,r.isProcessing=!0,l.process(r),u.process(r),h.process(r),c.process(r),p.process(r),d.process(r),m.process(r),f.process(r),r.isProcessing=!1,s&&e&&(i=!1,t(y))};return{schedule:I.reduce((e,n)=>{const a=o[n];return e[n]=(e,n=!1,o=!1)=>(s||(s=!0,i=!0,r.isProcessing||t(y)),a.schedule(e,n,o)),e},{}),cancel:t=>{for(let e=0;e<I.length;e++)o[I[e]].cancel(t)},state:r,steps:o}}const{schedule:N,cancel:K,state:j,steps:W}=B("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:o,!0);let Y;function $(){Y=void 0}const L={now:()=>(void 0===Y&&L.set(j.isProcessing||n.useManualTiming?j.timestamp:performance.now()),Y),set:t=>{Y=t,queueMicrotask($)}},U=t=>e=>"string"==typeof e&&e.startsWith(t),X=U("--"),q=U("var(--"),z=t=>!!q(t)&&Z.test(t.split("/*")[0].trim()),Z=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,H={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},_={...H,transform:t=>e(0,1,t)},G={...H,default:1},J=t=>Math.round(1e5*t)/1e5,Q=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,et=(t,e)=>n=>Boolean("string"==typeof n&&tt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),nt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(Q);return{[t]:p