UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) 1.23 kB
import{__esDecorate as b,__runInitializers as l}from"tslib";import{easeQuadInOut as B}from"d3-ease";import{observable as P,reaction as g}from"mobx";const u=new Map;let h=(()=>{let n,r=[],i=[];return class f{static{const e=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[P],b(null,null,n,{kind:"field",name:"selectBgAnimationPart",static:!1,private:!1,access:{has:t=>"selectBgAnimationPart"in t,get:t=>t.selectBgAnimationPart,set:(t,m)=>{t.selectBgAnimationPart=m}},metadata:e},r,i),e&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}booth;selectBgAnimationPart=l(this,r,void 0);constructor(e){l(this,i),this.booth=e,A(()=>e.selected,t=>this.selectBgAnimationPart=B(t),1e3,8,!0)}static get(e){let t=u.get(e);return t||(t=new f(e),u.set(e,t)),t}}})();export default h;function A(n,r,i,c,e){const t=e?p:m;c%2===1&&c++,g(n,()=>{if(n()){const o=performance.now(),a=o+c*i,s=()=>{if(n()){if(performance.now()>=a){r(1);return}r(t(o,i)),window.requestAnimationFrame(s)}};s()}else r(0)},{fireImmediately:!0});function m(o,a){return(performance.now()-o)%a/1e3}function p(o,a){const w=((performance.now()-o)%(a*2)-a)/1e3;return 1-Math.abs(Math.abs(w)-a/1e3)/(a/1e3)}}