PageSourceSearch

https://convertex.ai/assets/use-spring-BwIyQN9G.js

js convertex.ai collected 2026-09-24 14:29:28 UTC 2,292 bytes, 1 lines download raw bytes

1import{r as t}from"./index-CTUgqakz.js";import{D as n,f as r,g as e,J as o,u as i,E as s,F as a,a as u,M as c}from"./proxy--AF1RYhV.js";import{u as f}from"./use-motion-value-Bin7rNAF.js";function y(t,n,i={}){const s=t.get();let a,u=null,c=s;const f="string"==typeof s?s.replace(/[\d.-]/g,""):void 0,y=()=>{u&&(u.stop(),u=null),t.animation=void 0},m=()=>{var n;(()=>{const n=p(t.get()),r=p(c);if(n===r)return void y();const e=u?u.getGeneratorVelocity():t.getVelocity();y(),u=new o({keyframes:[n,r],velocity:e,type:"spring",restDelta:.001,restSpeed:.01,...i,onUpdate:a})})(),t.animation=u??void 0,null==(n=t.events.animationStart)||n.notify(),null==u||u.then(()=>{var n;t.animation=void 0,null==(n=t.events.animationComplete)||n.notify()})};if(t.attach((t,n)=>{c=t,a=t=>n(l(t,f)),r.postRender(m)},y),e(n)){let r=!0===i.skipInitialAnimation;const e=n.on("change",n=>{r?(r=!1,t.jump(l(n,f),!1)):t.set(l(n,f))}),o=t.on("destroy",e);return()=>{e(),o()}}return y}function l(t,n){return n?t+n:t}function p(t){return"number"==typeof t?t:parseFloat(t)}function m(t,n){const e=f(n()),o=()=>e.set(n());return o(),i(()=>{const n=()=>r.preRender(o,!1,!0),e=t.map(t=>t.on("change",n));return()=>{e.forEach(t=>t()),s(o)}}),e}function d(t,r,e,o){if("function"==typeof t)return function(t){a.current=[],t();const n=m(a.current,t);return a.current=void 0,n}(t);if(void 0!==e&&!Array.isArray(e)&&"function"!=typeof r)return function(t,n,r,e){const o=u(()=>Object.keys(r)),i=u(()=>({}));for(const s of o)i[s]=d(t,n,r[s],e);return i}(t,r,e,o);const i="function"==typeof r?r:function(...t){const r=!Array.isArray(t[0]),e=r?0:-1,o=t[0+e],i=t[1+e],s=t[2+e],a=t[3+e],u=n(i,s,a);return r?u(o):u}(r,e,o),s=Array.isArray(t)?g(t,i):g([t],([t])=>i(t)),c=Array.isArray(t)?void 0:t.accelerate;return c&&!c.isTransformed&&"function"!=typeof r&&Array.isArray(e)&&!1!==(null==o?void 0:o.clamp)&&(s.accelerate={...c,times:r,keyframes:e,isTransformed:!0}),s}function g(t,n){const r=u(()=>[]);return m(t,()=>{r.length=0;const e=t.length;for(let n=0;n<e;n++)r[n]=t[n].get();return n(r)})}function v(n,r={}){return function(n,r={}){const{isStatic:o}=t.useContext(c),i=()=>e(n)?n.get():n;if(o)return d(i);const s=f(i());return t.useInsertionEffect(()=>y(s,n,r),[s,JSON.stringify(r)]),s}(n,{type:"spring",...r})}export{v as a,d as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.