PageSourceSearch

https://displaay.net/assets/AskAlbertButton-EgwH_C7K.js

js displaay.net collected 2026-10-03 19:27:41 UTC 3,501 bytes, 1 lines download raw bytes

1import{r as A,j as F}from"./chunk-EPOLDU6W-CmtMsyi3.js";import{c as z}from"./index-2HZVyVkC.js";import{u as I}from"./useModalStore-B2RQYT8h.js";import{u as O}from"./useWebStore-DOS8DErR.js";import{B as R}from"./Button-DeALEcoT.js";import{i as C,K as p,c as e,s as r,g as c,m as d,n as T,p as E,P as f,r as b,a as S,b as M,e as w,d as P,f as j,h as k}from"./animation-B4ySuxaG.js";const n=p*10;class y{constructor(t={}){const a=!C(t.bounce)||!C(t.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/p,this.maxIterations=this.maxDuration/this.timeStep/p,this.bn=e(r(t.bounce,.5),-1,1),this.pd=e(r(t.duration,628),10*c.timeScale,n*c.timeScale),this.m=e(r(t.mass,1),1,n),this.s=e(r(t.stiffness,100),d,n),this.d=e(r(t.damping,10),d,n),this.v=e(r(t.velocity,0),-n,n),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=t.onComplete||T,a&&this.calculateSDFromBD(),this.compute(),this.ease=i=>{const h=i*this.settlingDuration,o=this.completed,s=this.pd;return h>
1=s&&!o&&(this.completed=!0,this.onComplete(this.parent)),h<s&&o&&(this.completed=!1),i===0||i===1?i:this.solve(i*this.solverDuration)}}solve(t){const{zeta:a,w0:i,wd:h,b:o}=this;let s=t;return a<1?s=w(-s*a*i)*(1*P(h*s)+o*j(h*s)):a===1?s=(1+o*s)*w(-s*i):s=((1+o)*w((-a*i+h)*s)+(1-o)*w((-a*i-h)*s))/2,1-s}calculateSDFromBD(){const t=c.timeScale===1?this.pd/p:this.pd;this.m=1,this.v=0,this.s=E(2*f/t,2),this.bn>=0?this.d=(1-this.bn)*4*f/t:this.d=4*f/(t*(1+this.bn)),this.s=b(e(this.s,d,n),3),this.d=b(e(this.d,d,300),3)}calculateBDFromSD(){const t=2*f/S(this.s);this.pd=t*(c.timeScale===1?p:1),this.d/(2*S(this.s))<=1?this.bn=1-this.d*t/(4*f):this.bn=4*f/(this.d*t)-1,this.bn=b(e(this.bn,-1,1),3),this.pd=b(e(this.pd,10*c.timeScale,n*c.timeScale),3)}compute(){const{maxRestSteps:t,maxIterations:a,restThreshold:i,timeStep:h,m:o,d:s,s:v,v:D}=this,u=this.w0=e(S(v/o),d,p),l=this.zeta=s/(2*S(v*o));l<1?(this.wd=u*S(1-l*l),this.b=(l*u+-D)/this.wd):l===1?(this.wd=0,this.b=-D+u):(this.wd=u*S(l*l-1),this.b=(l*u+-D)/this.wd);let m=0,x=0,B=0;for(;x<=t&&B<=a;)M(1-this.solve(m))<i?x++:x=0,this.solverDuration=m,m+=h,B++;this.settlingDuration=b(this.solverDuration*p,0)*c.timeScale}get bounce(){return this.bn}set bounce(t){this.bn=e(r(t,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(t){this.pd=e(r(t,1),10*c.timeScale,n*c.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(t){this.s=e(r(t,100),d,n),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(t){this.d=e(r(t,10),d,n),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(t){this.m=e(r(t,1),1,n),this.compute()}get velocity(){return this.v}set velocity(t){this.v=e(r(t,0),-n,n),this.compute()}}const V=g=>(console.warn("createSpring() is deprecated use spring() instead"),new y(g)),G=({buttonProps:g,label:t,onlyIcon:a=!1,hideIcon:i=!1,initMessage:h})=>{const o=A.useRef(null),s=I(m=>m.setAiChatDialogOpen),v=O(m=>m.setChatInitMessage),{className:D,...u}=g||{},l=()=>{o.current&&k(o.current,{scale:[{to:1.25,ease:"inOut(3)",duration:200},{to:1,ease:V({stiffness:300})}]})};return F.jsx(R,{className:z("text-white",D),onClick:()=>{h&&v(h),s(!0)},onMouseEnter:l,variant:"primary",icon:i?void 0:{name:"ai",size:a?void 0:18,ref:o},...u,children:a?null:t??"Ask Albert"})};export{G as A};

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.