unis_crm/frontend/node_modules/framer-motion/dist/mini.js

2 lines
8.3 KiB
JavaScript
Raw Normal View History

2026-03-19 06:27:20 +00:00
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}let i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(i=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const s=t=>t,a=t=>1e3*t,o=t=>t/1e3,r=t=>null!==t;class l{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}function u(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const h=t=>t.startsWith("--");const d={};function m(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>d[e]??n()}const c=m(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),p=m(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),f=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,g={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:f([0,.65,.55,1]),circOut:f([.55,0,1,.45]),backIn:f([.31,.01,.66,-.59]),backOut:f([.33,1.53,.69,.99])};function y(t,e){return t?"function"==typeof t?p()?((t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`})(t,e):"ease-out":(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?f(t):Array.isArray(t)?t.map(t=>y(t,e)||g.easeOut):g[t]:void 0}class T extends l{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=Boolean(a),this.allowFlatten=o,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const d=function({type:t,...e}){return function(t){return"function"==typeof t&&"applyToOptions"in t}(t)&&p()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const d=y(r,s);Array.isArray(d)&&(h.easing=d);const m={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===o?"alternate":"normal"};return u&&(m.pseudoElement=u),t.animate(h,m)}(e,n,s,d,a),!1===d.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const a=t.filter(r),o=s<0||e&&"loop"!==n&&e%2==1?0:a.length-1;return o&&void 0!==i?i:a[o]}(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(t),function(t,e,n){h(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}u?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return o(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+o(t)}get time(){return o(Number(this.animation.currentTime)||0)}set time(t