UNPKG

@bonobolabs/react-pose

Version:

A declarative animation library for React

1 lines 63.7 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):e(t.React)}(this,function(t){"use strict";var e="default"in t?t.default:t,r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function n(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function i(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]])}return r}var a=function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},s=function(t){return t%1?Number(t.toFixed(5)):t},c=/(-)?(\d[\d\.]*)/g,f=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,p=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,l={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},d=a({},l,{transform:u(0,1)}),h=a({},l,{default:1}),v=function(t){return{test:function(e){return"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},m=v("deg"),g=v("%"),y=v("px"),b=v("vh"),P=v("vw"),w=a({},g,{parse:function(t){return g.parse(t)/100},transform:function(t){return g.transform(100*t)}}),x=u(0,255),O=function(t){return void 0!==t.red},C=function(t){return void 0!==t.hue},S=function(t){return function(e){if("string"!=typeof e)return e;for(var r,n={},o=(r=e,r.substring(r.indexOf("(")+1,r.lastIndexOf(")"))).split(/,\s*/),i=0;i<4;i++)n[t[i]]=void 0!==o[i]?parseFloat(o[i]):1;return n}},A=a({},l,{transform:function(t){return Math.round(x(t))}});function k(t,e){return t.startsWith(e)&&p.test(t)}var E,M={test:function(t){return"string"==typeof t?k(t,"rgb"):O(t)},parse:S(["red","green","blue","alpha"]),transform:function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha,i=void 0===o?1:o;return function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha;return"rgba("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({red:A.transform(e),green:A.transform(r),blue:A.transform(n),alpha:s(d.transform(i))})}},V={test:function(t){return"string"==typeof t?k(t,"hsl"):C(t)},parse:S(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha,i=void 0===o?1:o;return function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha;return"hsla("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({hue:Math.round(e),saturation:g.transform(s(r)),lightness:g.transform(s(n)),alpha:s(d.transform(i))})}},T=a({},M,{test:function(t){return"string"==typeof t&&k(t,"#")},parse:function(t){var e="",r="",n="";return t.length>4?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),e+=e,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),R={test:function(t){return"string"==typeof t&&p.test(t)||O(t)||C(t)},parse:function(t){return M.test(t)?M.parse(t):V.test(t)?V.parse(t):T.test(t)?T.parse(t):t},transform:function(t){return O(t)?M.transform(t):C(t)?V.transform(t):t}},D=function(t){return"number"==typeof t?0:t},F={test:function(t){if("string"!=typeof t||!isNaN(t))return!1;var e=0,r=t.match(c),n=t.match(f);return r&&(e+=r.length),n&&(e+=n.length),e>0},parse:function(t){var e=t,r=[],n=e.match(f);n&&(e=e.replace(f,"${c}"),r.push.apply(r,n.map(R.parse)));var o=e.match(c);return o&&r.push.apply(r,o.map(l.parse)),r},createTransformer:function(t){var e=t,r=0,n=t.match(f),o=n?n.length:0;if(n)for(var i=0;i<o;i++)e=e.replace(n[i],"${c}"),r++;var a=e.match(c),u=a?a.length:0;if(a)for(i=0;i<u;i++)e=e.replace(a[i],"${n}"),r++;return function(t){for(var n=e,i=0;i<r;i++)n=n.replace(i<o?"${c}":"${n}",i<o?R.transform(t[i]):s(t[i]));return n}},getAnimatableNone:function(t){var e=F.parse(t);return F.createTransformer(t)(e.map(D))}},j=function(){},L=function(){},I=0,B="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),r=Math.max(0,16.7-(e-I));I=e+r,setTimeout(function(){return t(I)},r)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(E||(E={}));var X=1/60*1e3,Y=!0,z=!1,U=!1,_={delta:0,timestamp:0},H=[E.Read,E.Update,E.Render,E.PostRender],W=function(t){return z=t},N=H.reduce(function(t,e){var r,n,o,i,a,u,s,c,f,p=(r=W,n=[],o=[],i=0,a=!1,u=0,s=new WeakSet,c=new WeakSet,f={cancel:function(t){var e=o.indexOf(t);s.add(t),-1!==e&&o.splice(e,1)},process:function(t){var e,p;if(a=!0,n=(e=[o,n])[0],(o=e[1]).length=0,i=n.length)for(u=0;u<i;u++)(p=n[u])(t),!0!==c.has(p)||s.has(p)||(f.schedule(p),r(!0));a=!1},schedule:function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var u=r&&a,f=u?n:o;s.delete(t),e&&c.add(t),-1===f.indexOf(t)&&(f.push(t),u&&(i=n.length))}});return t.sync[e]=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=!1),z||J(),p.schedule(t,e,r),t},t.cancelSync[e]=function(t){return p.cancel(t)},t.steps[e]=p,t},{steps:{},sync:{},cancelSync:{}}),q=N.steps,$=N.sync,Z=N.cancelSync,G=function(t){return q[t].process(_)},K=function(t){z=!1,_.delta=Y?X:Math.max(Math.min(t-_.timestamp,40),1),Y||(X=_.delta),_.timestamp=t,U=!0,H.forEach(G),U=!1,z&&(Y=!1,B(K))},J=function(){z=!0,Y=!0,U||B(K)},Q=function(){return _},tt=function(t){return function(e){return 1-t(1-e)}},et=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},rt=tt,nt=function(t){return function(e){return e*e*((t+1)*e-t)}},ot=function(t){return t},it=function(t){return function(e){return Math.pow(e,t)}}(2),at=tt(it),ut=et(it),st=function(t){return 1-Math.sin(Math.acos(t))},ct=tt(st),ft=et(ct),pt=nt(1.525),lt=tt(pt),dt=et(pt),ht=function(t){var e=nt(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),vt=8,mt=.001,gt=1e-7,yt=10,bt=11,Pt=1/(bt-1),wt="undefined"!=typeof Float32Array,xt=function(t,e){return 1-3*e+3*t},Ot=function(t,e){return 3*e-6*t},Ct=function(t){return 3*t},St=function(t,e,r){return 3*xt(e,r)*t*t+2*Ot(e,r)*t+Ct(e)},At=function(t,e,r){return((xt(e,r)*t+Ot(e,r))*t+Ct(e))*t};function kt(t,e,r,n){var o=wt?new Float32Array(bt):new Array(bt),i=function(e){for(var n,i,a,u=0,s=1,c=bt-1;s!==c&&o[s]<=e;++s)u+=Pt;return n=(e-o[--s])/(o[s+1]-o[s]),(a=St(i=u+n*Pt,t,r))>=mt?function(e,n){for(var o=0,i=0;o<vt;++o){if(0===(i=St(n,t,r)))return n;n-=(At(n,t,r)-e)/i}return n}(e,i):0===a?i:function(e,n,o){var i,a,u=0;do{(i=At(a=n+(o-n)/2,t,r)-e)>0?o=a:n=a}while(Math.abs(i)>gt&&++u<yt);return a}(e,u,u+Pt)};!function(){for(var e=0;e<bt;++e)o[e]=At(e*Pt,t,r)}();return function(o){return t===e&&r===n?o:0===o?0:1===o?1:At(i(o),e,n)}}var Et={x:0,y:0,z:0},Mt=function(t){return"number"==typeof t},Vt=function(t){return 180*t/Math.PI},Tt=function(t,e){return void 0===e&&(e=Et),Vt(Math.atan2(e.y-t.y,e.x-t.x))},Rt=function(t,e){var r=!0;return void 0===e&&(e=t,r=!1),function(n){return r?n-t+e:(t=n,r=!0,e)}},Dt=function(t){return function(e,r,n){return void 0!==n?t(e,r,n):function(n){return t(e,r,n)}}},Ft=Dt(function(t,e,r){return Math.min(Math.max(r,t),e)}),jt=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},Lt=function(t){return jt(t)&&t.hasOwnProperty("z")},It=function(t,e){return Math.abs(t-e)},Bt=function(t,e){if(void 0===e&&(e=Et),Mt(t)&&Mt(e))return It(t,e);if(jt(t)&&jt(e)){var r=It(t.x,e.x),n=It(t.y,e.y),o=Lt(t)&&Lt(e)?It(t.z,e.z):0;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2)+Math.pow(o,2))}return 0},Xt=function(t,e,r){var n=e-t;return 0===n?1:(r-t)/n},Yt=function(t,e,r){return-r*t+r*e+t},zt=function(){return(zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ut=function(t,e,r){var n=t*t,o=e*e;return Math.sqrt(Math.max(0,r*(o-n)+n))},_t=[T,M,V],Ht=function(t){return _t.find(function(e){return e.test(t)})},Wt=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},Nt=function(t,e){var r=Ht(t),n=Ht(e);j(!!r,Wt(t)),j(!!n,Wt(e)),j(r.transform===n.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var o=r.parse(t),i=n.parse(e),a=zt({},o),u=r===V?Yt:Ut;return function(t){for(var e in a)"alpha"!==e&&(a[e]=u(o[e],i[e],t));return a.alpha=Yt(o.alpha,i.alpha,t),r.transform(a)}},qt=function(t,e){return function(r){return e(t(r))}},$t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(qt)};function Zt(t,e){return Mt(t)?function(r){return Yt(t,e,r)}:R.test(t)?Nt(t,e):Qt(t,e)}var Gt=function(t,e){var r=t.slice(),n=r.length,o=t.map(function(t,r){return Zt(t,e[r])});return function(t){for(var e=0;e<n;e++)r[e]=o[e](t);return r}},Kt=function(t,e){var r=zt({},t,e),n={};for(var o in r)void 0!==t[o]&&void 0!==e[o]&&(n[o]=Zt(t[o],e[o]));return function(t){for(var e in n)r[e]=n[e](t);return r}};function Jt(t){for(var e=F.parse(t),r=e.length,n=0,o=0,i=0,a=0;a<r;a++)n||"number"==typeof e[a]?n++:void 0!==e[a].hue?i++:o++;return{parsed:e,numNumbers:n,numRGB:o,numHSL:i}}var Qt=function(t,e){var r=F.createTransformer(e),n=Jt(t),o=Jt(e);return j(n.numHSL===o.numHSL&&n.numRGB===o.numRGB&&n.numNumbers>=o.numNumbers,"Complex values '"+t+"' and '"+e+"' too different to mix. Ensure all colors are of the same type."),$t(Gt(n.parsed,o.parsed),r)},te=function(t,e){return function(r){return Yt(t,e,r)}};function ee(t,e,r){for(var n,o=[],i=r||("number"==typeof(n=t[0])?te:"string"==typeof n?R.test(n)?Nt:Qt:Array.isArray(n)?Gt:"object"==typeof n?Kt:void 0),a=t.length-1,u=0;u<a;u++){var s=i(t[u],t[u+1]);if(e){var c=Array.isArray(e)?e[u]:e;s=$t(c,s)}o.push(s)}return o}var re=function(t,e,r,n){return void 0===n&&(n=0),o=t+r*(e-t)/Math.max(n,r),void 0===i&&(i=2),i=Math.pow(10,i),Math.round(o*i)/i;var o,i},ne=function(t){return t},oe=function(t){return void 0===t&&(t=ne),Dt(function(e,r,n){var o=r-n,i=-(0-e+1)*(0-t(Math.abs(o)));return o<=0?r+i:r-i})},ie=oe(),ae=oe(Math.sqrt),ue=function(t,e){return Mt(t)?t/(1e3/e):0},se=function(t,e){return e?t*(1e3/e):0},ce=Dt(function(t,e,r){var n=e-t;return((r-t)%n+n)%n+t}),fe=(Ft(0,1),function(){return(fe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)});function pe(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]])}return r}var le,de=function(t){var e=t.onRead,r=t.onRender,n=t.uncachedValues,o=void 0===n?new Set:n,i=t.useCache,a=void 0===i||i;return function(t){void 0===t&&(t={});var n=pe(t,[]),i={},u=[],s=!1;function c(t,e){t.startsWith("--")&&(n.hasCSSVariable=!0);var r=i[t];i[t]=e,i[t]!==r&&(-1===u.indexOf(t)&&u.push(t),s||(s=!0,$.render(f.render)))}var f={get:function(t,r){return void 0===r&&(r=!1),!r&&a&&!o.has(t)&&void 0!==i[t]?i[t]:e(t,n)},set:function(t,e){if("string"==typeof t)c(t,e);else for(var r in t)c(r,t[r]);return this},render:function(t){return void 0===t&&(t=!1),(s||!0===t)&&(r(i,n,u),s=!1,u.length=0),this}};return f}},he=/([a-z])([A-Z])/g,ve=function(t){return t.replace(he,"$1-$2").toLowerCase()},me=new Map,ge=new Map,ye=["Webkit","Moz","O","ms",""],be=ye.length,Pe="undefined"!=typeof document,we=function(t,e){return ge.set(t,ve(e))},xe=function(t,e){void 0===e&&(e=!1);var r=e?ge:me;return r.has(t)||(Pe?function(t){le=le||document.createElement("div");for(var e=0;e<be;e++){var r=ye[e],n=""===r,o=n?t:r+t.charAt(0).toUpperCase()+t.slice(1);(o in le.style||n)&&(me.set(t,o),we(t,(n?"":"-")+ve(o)))}}(t):function(t){we(t,t)}(t)),r.get(t)||t},Oe=["","X","Y","Z"],Ce=["scale","rotate","skew","transformPerspective"].reduce(function(t,e){return Oe.reduce(function(t,r){return t.push(e+r),t},t)},["x","y","z"]),Se=Ce.reduce(function(t,e){return t[e]=!0,t},{});function Ae(t){return!0===Se[t]}function ke(t,e){return Ce.indexOf(t)-Ce.indexOf(e)}var Ee=new Set(["originX","originY","originZ"]);function Me(t){return Ee.has(t)}var Ve=fe({},l,{transform:Math.round}),Te={color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,borderWidth:y,borderTopWidth:y,borderRightWidth:y,borderBottomWidth:y,borderLeftWidth:y,borderRadius:y,radius:y,borderTopLeftRadius:y,borderTopRightRadius:y,borderBottomRightRadius:y,borderBottomLeftRadius:y,width:y,maxWidth:y,height:y,maxHeight:y,size:y,top:y,right:y,bottom:y,left:y,padding:y,paddingTop:y,paddingRight:y,paddingBottom:y,paddingLeft:y,margin:y,marginTop:y,marginRight:y,marginBottom:y,marginLeft:y,rotate:m,rotateX:m,rotateY:m,rotateZ:m,scale:h,scaleX:h,scaleY:h,scaleZ:h,skew:m,skewX:m,skewY:m,distance:y,x:y,y:y,z:y,perspective:y,opacity:d,originX:w,originY:w,originZ:y,zIndex:Ve},Re=function(t){return Te[t]},De=function(t,e){return e&&"number"==typeof t?e.transform(t):t},Fe="scrollLeft",je="scrollTop",Le=new Set([Fe,je]),Ie=new Set([Fe,je,"transform"]),Be={x:"translateX",y:"translateY",z:"translateZ"};function Xe(t){return"function"==typeof t}function Ye(t,e,r,n,o,i,a){void 0===e&&(e=!0),void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===i&&(i=[]),void 0===a&&(a=!1);var u=!0,s=!1,c=!1;for(var f in t){var p=t[f],l=Re(f),d=De(p,l);Ae(f)?(s=!0,n[f]=d,i.push(f),u&&(l.default&&p!==l.default||!l.default&&0!==p)&&(u=!1)):Me(f)?(o[f]=d,c=!0):Ie.has(f)&&Xe(d)||(r[xe(f,a)]=d)}return(s||"function"==typeof t.transform)&&(r.transform=function(t,e,r,n,o){var i="",a=!1;r.sort(ke);for(var u=r.length,s=0;s<u;s++){var c=r[s];i+=(Be[c]||c)+"("+e[c]+") ",a="z"===c||a}return!a&&o?i+="translateZ(0)":i=i.trim(),Xe(t.transform)?i=t.transform(e,i):n&&(i="none"),i}(t,n,i,u,e)),c&&(r.transformOrigin=(o.originX||0)+" "+(o.originY||0)+" "+(o.originZ||0)),r}var ze=de({onRead:function(t,e){var r=e.element,n=e.preparseOutput,o=Re(t);if(Ae(t))return o&&o.default||0;if(Le.has(t))return r[t];var i=window.getComputedStyle(r,null).getPropertyValue(xe(t,!0))||0;return n&&o&&o.test(i)&&o.parse?o.parse(i):i},onRender:function(t,e,r){var n=e.element,o=e.buildStyles,i=e.hasCSSVariable;if(Object.assign(n.style,o(t)),i)for(var a=r.length,u=0;u<a;u++){var s=r[u];s.startsWith("--")&&n.style.setProperty(s,t[s])}-1!==r.indexOf(Fe)&&(n[Fe]=t[Fe]),-1!==r.indexOf(je)&&(n[je]=t[je])},uncachedValues:Le});function Ue(t,e){void 0===e&&(e={});var r=e.enableHardwareAcceleration,n=pe(e,["enableHardwareAcceleration"]);return ze(fe({element:t,buildStyles:function(t){void 0===t&&(t=!0);var e={},r={},n={},o=[];return function(i){return o.length=0,Ye(i,t,e,r,n,o,!0),e}}(r),preparseOutput:!0},n))}var _e=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),He=function(t,e){return t*e+"px"},We=fe({},l,{transform:Math.round}),Ne={fill:R,stroke:R,scale:h,scaleX:h,scaleY:h,opacity:d,fillOpacity:d,strokeOpacity:d,numOctaves:We},qe=de({onRead:function(t,e){var r=e.element;if(Ae(t)){var n=function(t){return Ne[t]}(t);return n?n.default:0}return r.getAttribute(t)},onRender:function(t,e){var r=e.dimensions;!function(t,e){for(var r in e)e.hasOwnProperty(r)&&t.setAttribute(r,e[r])}(e.element,function(t,e,r,n){var o=!1,i=!1,a={},u=r?{pathLength:"0",pathSpacing:""+n}:void 0,s=void 0!==t.scale?t.scale||1e-7:t.scaleX||1,c=void 0!==t.scaleY?t.scaleY||1e-7:s||1,f=e.width*(t.originX||50)+e.x,p=e.height*(t.originY||50)+e.y,l=1*s*-f,d=1*c*-p,h=f/s,v=p/c,m={translate:"translate("+t.x+", "+t.y+") ",scale:"translate("+l+", "+d+") scale("+s+", "+c+") translate("+h+", "+v+") ",rotate:"rotate("+t.rotate+", "+f+", "+p+") ",skewX:"skewX("+t.skewX+") ",skewY:"skewY("+t.skewY+") "};for(var g in t)if(t.hasOwnProperty(g)){var y=t[g];Ae(g)?o=!0:!r||"pathLength"!==g&&"pathSpacing"!==g||"number"!=typeof y?r&&"pathOffset"===g?a["stroke-dashoffset"]=He(-y,n):a[_e.has(g)?g:ve(g)]=y:(i=!0,u[g]=He(y,n))}if(i&&(a["stroke-dasharray"]=u.pathLength+" "+u.pathSpacing),o)for(var g in a.transform="",m)if(m.hasOwnProperty(g)){var b="scale"===g?"1":"0";a.transform+=m[g].replace(/undefined/g,b)}return a}(t,r,e.isPath,e.pathLength))}}),$e=de({useCache:!1,onRead:function(t){return"scrollTop"===t?window.pageYOffset:window.pageXOffset},onRender:function(t){var e=t.scrollTop,r=void 0===e?0:e,n=t.scrollLeft,o=void 0===n?0:n;return window.scrollTo(o,r)}}),Ze=new WeakMap,Ge=function(t,e){var r;return t instanceof HTMLElement?r=Ue(t,e):t instanceof SVGElement?r=function(t){var e={element:t,dimensions:function(t){try{return function(t){return"function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}(t)}catch(t){return{x:0,y:0,width:0,height:0}}}(t),isPath:!1};return"path"===t.tagName&&(e.isPath=!0,e.pathLength=t.getTotalLength()),qe(e)}(t):t===window&&(r=$e(t)),Ze.set(t,r),r},Ke=function(t,e){return Ze.has(t)?Ze.get(t):Ge(t,e)};var Je=function(){function t(t){void 0===t&&(t={}),this.props=t}return t.prototype.applyMiddleware=function(t){return this.create(o({},this.props,{middleware:this.props.middleware?[t].concat(this.props.middleware):[t]}))},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=1===t.length?t[0]:$t.apply(void 0,t);return this.applyMiddleware(function(t){return function(e){return t(r(e))}})},t.prototype.while=function(t){return this.applyMiddleware(function(e,r){return function(n){return t(n)?e(n):r()}})},t.prototype.filter=function(t){return this.applyMiddleware(function(e){return function(r){return t(r)&&e(r)}})},t}(),Qe=function(){return function(t,e){var r=t.middleware,n=t.onComplete,o=this;this.isActive=!0,this.update=function(t){o.observer.update&&o.updateObserver(t)},this.complete=function(){o.observer.complete&&o.isActive&&o.observer.complete(),o.onComplete&&o.onComplete(),o.isActive=!1},this.error=function(t){o.observer.error&&o.isActive&&o.observer.error(t),o.isActive=!1},this.observer=e,this.updateObserver=function(t){return e.update(t)},this.onComplete=n,e.update&&r&&r.length&&r.forEach(function(t){return o.updateObserver=t(o.updateObserver,o.complete)})}}(),tr=function(t,e,r){var n=e.middleware;return new Qe({middleware:n,onComplete:r},"function"==typeof t?{update:t}:t)},er=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.create=function(t){return new e(t)},e.prototype.start=function(t){void 0===t&&(t={});var e=!1,r={stop:function(){}},n=this.props,a=n.init,u=i(n,["init"]),s=a(tr(t,u,function(){e=!0,r.stop()}));return r=s?o({},r,s):r,t.registerParent&&t.registerParent(r),e&&r.stop(),r},e}(Je),rr=function(t){return new er({init:t})},nr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.subscribers=[],e}return n(e,t),e.prototype.complete=function(){this.subscribers.forEach(function(t){return t.complete()})},e.prototype.error=function(t){this.subscribers.forEach(function(e){return e.error(t)})},e.prototype.update=function(t){for(var e=0;e<this.subscribers.length;e++)this.subscribers[e].update(t)},e.prototype.subscribe=function(t){var e=this,r=tr(t,this.props);return this.subscribers.push(r),{unsubscribe:function(){var t=e.subscribers.indexOf(r);-1!==t&&e.subscribers.splice(t,1)}}},e.prototype.stop=function(){this.parent&&this.parent.stop()},e.prototype.registerParent=function(t){this.stop(),this.parent=t},e}(Je),or=function(t,e){var r=1/(t-1),n=1/(2*(t-1)),o=Math.min(e,1)/n;return Math.floor((o+1)/2)*r},ir=function(t){return Array.isArray(t)},ar=function(t){var e=typeof t;return"string"===e||"number"===e},ur=function(t){function e(e){var r=t.call(this,e)||this;return r.scheduleVelocityCheck=function(){return $.postRender(r.velocityCheck)},r.velocityCheck=function(t){t.timestamp!==r.lastUpdated&&(r.prev=r.current)},r.prev=r.current=e.value||0,ar(r.current)?(r.updateCurrent=function(t){return r.current=t},r.getVelocityOfCurrent=function(){return r.getSingleVelocity(r.current,r.prev)}):ir(r.current)?(r.updateCurrent=function(t){return r.current=t.slice()},r.getVelocityOfCurrent=function(){return r.getListVelocity()}):(r.updateCurrent=function(t){for(var e in r.current={},t)t.hasOwnProperty(e)&&(r.current[e]=t[e])},r.getVelocityOfCurrent=function(){return r.getMapVelocity()}),e.initialSubscription&&r.subscribe(e.initialSubscription),r}return n(e,t),e.prototype.create=function(t){return new e(t)},e.prototype.get=function(){return this.current},e.prototype.getVelocity=function(){return this.getVelocityOfCurrent()},e.prototype.update=function(e){t.prototype.update.call(this,e),this.prev=this.current,this.updateCurrent(e);var r=Q(),n=r.delta,o=r.timestamp;this.timeDelta=n,this.lastUpdated=o,$.postRender(this.scheduleVelocityCheck)},e.prototype.subscribe=function(e){var r=t.prototype.subscribe.call(this,e);return this.subscribers[this.subscribers.length-1].update(this.current),r},e.prototype.getSingleVelocity=function(t,e){return"number"==typeof t&&"number"==typeof e?se(t-e,this.timeDelta):se(parseFloat(t)-parseFloat(e),this.timeDelta)||0},e.prototype.getListVelocity=function(){var t=this;return this.current.map(function(e,r){return t.getSingleVelocity(e,t.prev[r])})},e.prototype.getMapVelocity=function(){var t={};for(var e in this.current)this.current.hasOwnProperty(e)&&(t[e]=this.getSingleVelocity(this.current[e],this.prev[e]));return t},e}(nr),sr=function(t,e){return new ur({value:t,initialSubscription:e})},cr=function(t){var e=t.getCount,r=t.getFirst,n=t.getOutput,o=t.mapApi,i=t.setProp,a=t.startActions;return function(t){return rr(function(u){var s=u.update,c=u.complete,f=u.error,p=e(t),l=n(),d=function(){return s(l)},h=0,v=a(t,function(t,e){var r=!1;return t.start({complete:function(){r||(r=!0,++h===p&&$.update(c))},error:f,update:function(t){i(l,e,t),$.update(d,!1,!0)}})});return Object.keys(r(v)).reduce(function(t,e){return t[e]=o(v,e),t},{})})}},fr=cr({getOutput:function(){return{}},getCount:function(t){return Object.keys(t).length},getFirst:function(t){return t[Object.keys(t)[0]]},mapApi:function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return Object.keys(t).reduce(function(n,o){var i;return t[o][e]&&(r[0]&&void 0!==r[0][o]?n[o]=t[o][e](r[0][o]):n[o]=(i=t[o])[e].apply(i,r)),n},{})}},setProp:function(t,e,r){return t[e]=r},startActions:function(t,e){return Object.keys(t).reduce(function(r,n){return r[n]=e(t[n],n),r},{})}}),pr=cr({getOutput:function(){return[]},getCount:function(t){return t.length},getFirst:function(t){return t[0]},mapApi:function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.map(function(t,n){if(t[e])return Array.isArray(r[0])?t[e](r[0][n]):t[e].apply(t,r)})}},setProp:function(t,e,r){return t[e]=r},startActions:function(t,e){return t.map(function(t,r){return e(t,r)})}}),lr=[y,g,m,b,P],dr=function(t){return lr.find(function(e){return e.test(t)})},hr=function(t,e){return t(e)},vr=function(t,e,r){var n=r[0],i=e[n].map(function(n,i){var a=r.reduce(function(t){return function(e,r){return e[r]=e[r][t],e}}(i),o({},e));return xr(n)(t,a)});return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return pr(t)}.apply(void 0,i)},mr=function(t,e,r){var n=r[0],i=Object.keys(e[n]).reduce(function(i,a){var u=r.reduce(function(t){return function(e,r){return e[r]=e[r][t],e}}(a),o({},e));return i[a]=xr(e[n][a])(t,u),i},{});return fr(i)},gr=function(t,e){var r=e.from,n=e.to,a=i(e,["from","to"]),u=dr(r)||dr(n),s=u.transform,c=u.parse;return t(o({},a,{from:"string"==typeof r?c(r):r,to:"string"==typeof n?c(n):n})).pipe(s)},yr=function(t){return function(e,r){var n=r.from,a=r.to,u=i(r,["from","to"]);return e(o({},u,{from:0,to:1})).pipe(t(n,a))}},br=yr(Nt),Pr=yr(Qt),wr=function(t,e){var r=function(t){var e=Object.keys(t),r=function(e,r){return void 0!==e&&!t[r](e)};return{getVectorKeys:function(t){return e.reduce(function(e,n){return r(t[n],n)&&e.push(n),e},[])},testVectorProps:function(t){return t&&e.some(function(e){return r(t[e],e)})}}}(e),n=r.testVectorProps,o=r.getVectorKeys;return function(e){if(!n(e))return t(e);var r=o(e),i=e[r[0]];return xr(i)(t,e,r)}},xr=function(t){return"number"==typeof t?hr:Array.isArray(t)?vr:function(t){return Boolean(dr(t))}(t)?gr:R.test(t)?br:F.test(t)?Pr:"object"==typeof t?mr:hr},Or=wr(function(t){return void 0===t&&(t={}),rr(function(e){var r=e.complete,n=e.update,o=t.velocity,i=void 0===o?0:o,a=t.from,u=void 0===a?0:a,s=t.power,c=void 0===s?.8:s,f=t.timeConstant,p=void 0===f?350:f,l=t.restDelta,d=void 0===l?.5:l,h=t.modifyTarget,v=0,m=c*i,g=Math.round(u+m),y=void 0===h?g:h(g),b=$.update(function(t){var e=t.delta;v+=e;var o=-m*Math.exp(-v/p),i=o>d||o<-d;n(i?y+o:y),i||(Z.update(b),r())},!0);return{stop:function(){return Z.update(b)}}})},{from:l.test,modifyTarget:function(t){return"function"==typeof t},velocity:l.test}),Cr=wr(function(t){return void 0===t&&(t={}),rr(function(e){var r=e.update,n=e.complete,o=t.velocity,i=void 0===o?0:o,a=t.from,u=void 0===a?0:a,s=t.to,c=void 0===s?0:s,f=t.stiffness,p=void 0===f?100:f,l=t.damping,d=void 0===l?10:l,h=t.mass,v=void 0===h?1:h,m=t.restSpeed,g=void 0===m?.01:m,y=t.restDelta,b=void 0===y?.01:y,P=i?-i/1e3:0,w=0,x=c-u,O=u,C=O,S=$.update(function(t){var e=t.delta;w+=e;var o=d/(2*Math.sqrt(p*v)),a=Math.sqrt(p/v)/1e3;if(C=O,o<1){var u=Math.exp(-o*a*w),s=a*Math.sqrt(1-o*o);O=c-u*((P+o*a*x)/s*Math.sin(s*w)+x*Math.cos(s*w))}else u=Math.exp(-a*w),O=c-u*(x+(P+a*x)*w);i=se(O-C,e);var f=Math.abs(i)<=g,l=Math.abs(c-O)<=b;f&&l?(r(O=c),Z.update(S),n()):r(O)},!0);return{stop:function(){return Z.update(S)}}})},{from:l.test,to:l.test,stiffness:l.test,damping:l.test,mass:l.test,velocity:l.test}),Sr=wr(function(t){var e=t.from,r=void 0===e?0:e,n=t.to,o=void 0===n?1:n,i=t.ease,a=void 0===i?ot:i,u=t.reverseEase;return void 0!==u&&u&&(a=rt(a)),rr(function(t){var e=t.update;return{seek:function(t){return e(t)}}}).pipe(a,function(t){return Yt(r,o,t)})},{ease:function(t){return"function"==typeof t},from:l.test,to:l.test}),Ar=Ft(0,1),kr=function(t){return void 0===t&&(t={}),rr(function(e){var r,n=e.update,o=e.complete,i=t.duration,a=void 0===i?300:i,u=t.ease,s=void 0===u?at:u,c=t.flip,f=void 0===c?0:c,p=t.loop,l=void 0===p?0:p,d=t.yoyo,h=void 0===d?0:d,v=t.repeatDelay,m=void 0===v?0:v,g=t.from,y=void 0===g?0:g,b=t.to,P=void 0===b?1:b,w=t.elapsed,x=void 0===w?0:w,O=t.flipCount,C=void 0===O?0:O,S=t.yoyoCount,A=void 0===S?0:S,k=t.loopCount,E=void 0===k?0:k,M=Sr({from:y,to:P,ease:s}).start(n),V=0,T=!1,R=function(t){var e;void 0===t&&(t=!1),M=Sr({from:y=(e=[P,y])[0],to:P=e[1],ease:s,reverseEase:t}).start(n)},D=function(){V=Ar(Xt(0,a,x)),M.seek(V)},F=function(){T=!0,r=$.update(function(t){var e,n=t.delta;x+=n,D(),!(e=T&&x>a+m)||(!e||l||f||h)&&(x=a-(x-m),l&&E<l?(E++,1):f&&C<f?(C++,R(),1):h&&A<h&&(R(++A%2!=0),1))||(Z.update(r),o&&$.update(o,!1,!0))},!0)},j=function(){T=!1,r&&Z.update(r)};return F(),{isActive:function(){return T},getElapsed:function(){return Ft(0,a,x)},getProgress:function(){return V},stop:function(){j()},pause:function(){return j(),this},resume:function(){return T||F(),this},seek:function(t){return x=Yt(0,a,t),$.update(D,!1,!0),this},reverse:function(){return R(),this}}})},Er=Ft(0,1),Mr=wr(function(t){return void 0===t&&(t={}),rr(function(e){var r=e.complete,n=e.update,o=t.acceleration,i=void 0===o?0:o,a=t.friction,u=void 0===a?0:a,s=t.velocity,c=void 0===s?0:s,f=t.springStrength,p=t.to,l=t.restSpeed,d=void 0===l?.001:l,h=t.from,v=void 0===h?0:h,m=$.update(function(t){var e=t.delta,o=Math.max(e,16);i&&(c+=ue(i,o)),u&&(c*=Math.pow(1-u,o/100)),void 0!==f&&void 0!==p&&(c+=(p-v)*ue(f,o)),v+=ue(c,o),n(v),!1!==d&&(!c||Math.abs(c)<=d)&&(Z.update(m),r())},!0);return{set:function(t){return v=t,this},setAcceleration:function(t){return i=t,this},setFriction:function(t){return u=t,this},setSpringStrength:function(t){return f=t,this},setSpringTarget:function(t){return p=t,this},setVelocity:function(t){return c=t,this},stop:function(){return Z.update(m)}}})},{acceleration:l.test,friction:l.test,velocity:l.test,from:l.test,to:l.test,springStrength:l.test}),Vr=function(t,e,r){return rr(function(n){var o=n.update,i=e.split(" ").map(function(e){return t.addEventListener(e,o,r),e});return{stop:function(){return i.forEach(function(e){return t.removeEventListener(e,o,r)})}}})},Tr=function(t,e){return void 0===e&&(e={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),e.clientX=e.x=t.clientX,e.clientY=e.y=t.clientY,e.pageX=t.pageX,e.pageY=t.pageY,e},Rr=[{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}],Dr=!1;if("undefined"!=typeof document){Vr(document,"touchstart touchmove",{passive:!0,capture:!0}).start(function(t){var e=t.touches;Dr=!0;var r=e.length;Rr.length=0;for(var n=0;n<r;n++){var o=e[n];Rr.push(Tr(o))}})}var Fr={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0},jr=!1;if("undefined"!=typeof document){Vr(document,"mousedown mousemove",!0).start(function(t){jr=!0,Tr(t,Fr)})}var Lr,Ir=function(t){return t[0]},Br=function(t){return void 0===t&&(t={}),Dr?(e=t,r=void 0===e?{}:e,n=r.preventDefault,o=void 0===n||n,i=r.scale,a=void 0===i?1:i,u=r.rotate,s=void 0===u?0:u,rr(function(t){var e=t.update,r={touches:Rr,scale:a,rotate:s},n=0,i=0,u=Rr.length>1;if(u){var c=Rr[0],f=Rr[1];n=Bt(c,f),i=Tt(c,f)}var p=function(){if(u){var t=Rr[0],o=Rr[1],c=Bt(t,o),f=Tt(t,o);r.scale=a*(c/n),r.rotate=s+(f-i)}e(r)},l=Vr(document,"touchmove",{passive:!o}).start(function(t){(o||t.touches.length>1)&&t.preventDefault(),$.update(p)});return Dr&&$.update(p),{stop:function(){Z.update(p),l.stop()}}})).pipe(function(t){return t.touches},Ir):function(t){var e=(void 0===t?{}:t).preventDefault,r=void 0===e||e;return rr(function(t){var e=t.update,n=function(){return e(Fr)},o=Vr(document,"mousemove").start(function(t){r&&t.preventDefault(),$.update(n)});return jr&&$.update(n),{stop:function(){Z.update(n),o.stop()}}})}(t);var e,r,n,o,i,a,u,s},Xr=Object.freeze({applyOffset:Rt,clamp:Ft,conditional:function(t,e){return function(r){return t(r)?e(r):r}},interpolate:function(t,e,r){var n=void 0===r?{}:r,o=n.clamp,i=void 0===o||o,a=n.ease,u=n.mixer,s=t.length;j(s===e.length,"Both input and output ranges must be the same length"),j(!a||!Array.isArray(a)||a.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=ee(e,a,u),f=2===s?function(t,e){var r=t[0],n=t[1],o=e[0];return function(t){return o(Xt(r,n,t))}}(t,c):function(t,e){var r=t.length,n=r-1;return function(o){var i=0,a=!1;if(o<=t[0]?a=!0:o>=t[n]&&(i=n-1,a=!0),!a){for(var u=1;u<r&&!(t[u]>o||u===n);u++);i=u-1}var s=Xt(t[i],t[i+1],o);return e[i](s)}}(t,c);return i?$t(Ft(t[0],t[s-1]),f):f},blendArray:Gt,blendColor:Nt,pipe:$t,smooth:function(t){void 0===t&&(t=50);var e=0,r=0;return function(n){var o=Q().timestamp,i=o!==r?o-r:0,a=i?re(e,n,i,t):e;return r=o,e=a,a}},snap:function(t){if("number"==typeof t)return function(e){return Math.round(e/t)*t};var e=0,r=t.length;return function(n){var o=Math.abs(t[0]-n);for(e=1;e<r;e++){var i=t[e],a=Math.abs(i-n);if(0===a)return i;if(a>o)return t[e-1];if(e===r-1)return i;o=a}}},generateStaticSpring:oe,nonlinearSpring:ae,linearSpring:ie,wrap:ce,appendUnit:function(t){return function(e){return""+e+t}},steps:function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),function(n){var o=Xt(e,r,n);return Yt(e,r,or(t,o))}},transformMap:function(t){return function(e){var r=o({},e);for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];r[n]=i(e[n])}return r}}}),Yr=function(t){t.transition,t.flip,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.afterChildren,t.beforeChildren,t.preTransition,t.applyAtStart,t.applyAtEnd;return i(t,["transition","flip","delay","delayChildren","staggerChildren","staggerDirection","afterChildren","beforeChildren","preTransition","applyAtStart","applyAtEnd"])},zr=function(t,e){return"function"==typeof t?t(e):t},Ur=function(t,e,r,n){return t&&void 0!==t[e]?zr(t[e],n):r},_r=function(t,e,r,n,o,i){var a;if("function"==typeof t){var u=t(n);a=_r(u,e,r,n,o,i)}else if(t[e]||t.default){var s=t[e]||t.default;a="function"==typeof s?s(n):s}else a=t;return!1===a?i(r,n):o(r,a,n)},Hr=function(t,e,r,n,o){return Object.keys(t).forEach(function(i){var a=zr(t[i],r);e.has(i)?n(e.get(i),a):o(i,a,r)})},Wr=function(t){var e=t.state,r=t.poses,n=t.startAction,i=t.stopAction,a=t.getInstantTransition,u=t.addActionDelay,s=t.getTransitionProps,c=t.resolveTarget,f=t.transformPose,p=t.posePriority,l=t.convertTransitionDefinition,d=t.setValue,h=t.setValueNative,v=t.forceRender;return function(t,m,g){void 0===m&&(m={}),void 0===g&&(g=!0);var y=e.children,b=e.values,P=e.props,w=e.activeActions,x=e.activePoses,O=m.delay,C=void 0===O?0:O,S=y.size,A=o({},P,m),k=r[t],E=function(){return S&&g?function(t,e,r,n){var o=[],i=Ur(r,"delayChildren",0,n),a=Ur(r,"staggerChildren",0,n),u=Ur(r,"staggerDirection",1,n),s=(t.size-1)*a,c=1===u?function(t){return t*a}:function(t){return s-t*a};return Array.from(t).forEach(function(t,r){o.push(t.set(e,{delay:i+c(r)}))}),o}(y,t,k,A):[]},M=function(){if(!k)return[];var r=k.applyAtStart;r&&(Hr(r,b,A,d,h),v&&v(A)),f&&(k=f(k,t,e));var m=k.preTransition,g=k.transition,y=k.applyAtEnd;m&&m(A);var P=Object.keys(Yr(k)).map(function(e){var r=x.has(e)?x.get(e):(x.set(e,[]),x.get(e)),f=r.indexOf(t);-1!==f&&r.splice(f,1);var d=p?p.indexOf(t):0,h=d<=0?0:function(t,e,r){for(var n=0,o=r-1;o>=0;o--){var i=t.indexOf(e[o]);if(-1!==i){n=i+1;break}}return n}(r,p,d);return r.splice(h,0,t),0===h?new Promise(function(t){var r=b.get(e),f=o({},A,{key:e,value:r}),p=c(r,zr(k[e],f));w.has(e)&&i(w.get(e));var d=o({to:p},f,s(r,p,f)),h=_r(g,e,r,d,l,a),v=C||zr(k.delay,f);v&&(h=u(v,h)),w.set(e,n(r,h,t))}):Promise.resolve()});return y?[Promise.all(P).then(function(){Hr(y,b,A,d,h)})]:P};if(k&&S){if(zr(k.beforeChildren,A))return Promise.all(M()).then(function(){return Promise.all(E())});if(zr(k.afterChildren,A))return Promise.all(E()).then(function(){return Promise.all(M())})}return Promise.all(M().concat(E()))}},Nr=function(t){return function(t){return t.includes("scale")}(t)?1:0},qr=function(t){var e=Array.isArray(t)?t:[t];return e.push("init"),e},$r=function(t,e,r,n,o,i){void 0===o&&(o=Nr);var a=qr(r).filter(Boolean).find(function(r){var n=t[r];return n&&(void 0!==n[e]||n.applyAtStart&&void 0!==n.applyAtStart[e]||n.applyAtEnd&&void 0!==n.applyAtEnd[e])});return i.set(e,[a||"init"]),a?function(t,e,r){var n=t.applyAtEnd&&void 0!==t.applyAtEnd[e]?t.applyAtEnd[e]:void 0!==t[e]?t[e]:t.applyAtStart&&void 0!==t.applyAtStart[e]?t.applyAtStart[e]:0;return zr(n,r)}(t[a],e,n):o(e,n)},Zr=function(t,e){return function(r){var n=e.poses[r];Object.keys(Yr(n)).forEach(function(t,e){var r=e.userSetValues,n=e.createValue,o=e.convertValue,i=e.readValueFromSource,a=e.initialPose,u=e.poses,s=e.activePoses,c=e.props;return function(e){if(!t.has(e)){var f;if(r&&void 0!==r[e])f=o(r[e],e,c);else{var p=$r(u,e,a,c,i,s);f=n(p,e,c)}t.set(e,f)}}}(t,e))}},Gr=function(t){var e=t.poses,r=t.passive,n=new Map;return Object.keys(e).forEach(Zr(n,t)),function(t){var e=t.setValueNative,r=t.initialPose,n=t.props,o=t.poses,i=new Set,a=function(t,r){if(t[r])for(var o in t[r])i.has(o)||(i.add(o),e(o,zr(t[r][o],n),n))};qr(r).forEach(function(t){var e=o[t];e&&(a(e,"applyAtEnd"),a(e,"applyAtStart"))})}(t),r&&Object.keys(r).forEach(function(t,e){var r=e.passive,n=e.ancestorValues,o=e.createValue,i=e.readValue,a=e.props;return function(e){var u=r[e],s=u[0],c=u[1],f=u[2],p=f&&n.length?function(t,e,r){if(!0===e)return r[0]&&r[0].values.get(t);var n=r.find(function(t){return t.label===e});return n&&n.values.get(t)}(s,f,n):!!t.has(s)&&t.get(s);if(p){var l=o(i(p),e,a,{passiveParentKey:s,passiveParent:p,passiveProps:c});t.set(e,l)}}}(n,t)),n},Kr=function(t,e){return Object.keys(t).forEach(function(r){var n=t[r];t[r]=void 0!==n.transition?n:function(t,e,r){return o({},t,{transition:r.has(e)?r.get(e):r.get("default")})}(n,r,e)}),t},Jr=function(t){var e=t.getDefaultProps,r=t.defaultTransitions,n=t.bindOnChange,a=t.startAction,u=t.stopAction,s=t.readValue,c=t.readValueFromSource,f=t.resolveTarget,p=t.setValue,l=t.setValueNative,d=t.createValue,h=t.convertValue,v=t.getInstantTransition,m=t.getTransitionProps,g=t.addActionDelay,y=t.selectValueToRead,b=t.convertTransitionDefinition,P=t.transformPose,w=t.posePriority,x=t.forceRender,O=t.extendAPI;return function(t){var C=t.parentValues,S=t.ancestorValues,A=void 0===S?[]:S;C&&A.unshift({values:C});var k=new Map,E=new Map,M=new Set,V=Kr(function(t){t.label,t.props,t.values,t.parentValues,t.ancestorValues,t.onChange,t.passive,t.initialPose;return i(t,["label","props","values","parentValues","ancestorValues","onChange","passive","initialPose"])}(t),r),T=t.props,R=void 0===T?{}:T;e&&(R=o({},e(t),R));var D=t.passive,F=t.values,j=t.initialPose,L=void 0===j?"init":j,I=Gr({poses:V,passive:D,ancestorValues:A,readValue:s,setValueNative:l,createValue:d,convertValue:h,readValueFromSource:c,userSetValues:F,initialPose:L,activePoses:E,props:R}),B={activeActions:k,activePoses:E,children:M,props:R,values:I},X=t.onChange;X&&Object.keys(X).forEach(n(I,X));var Y=Wr({state:B,poses:V,getInstantTransition:v,getTransitionProps:m,convertTransitionDefinition:b,setValue:p,setValueNative:l,startAction:a,stopAction:u,resolveTarget:f,addActionDelay:g,transformPose:P,posePriority:w,forceRender:x});return O({set:Y,unset:function(t,e){var r=[];E.forEach(function(e){var n=e.indexOf(t);if(-1!==n){var o=e[0];e.splice(n,1);var i=e[0];i!==o&&-1===r.indexOf(i)&&r.push(i)}});var n,o=r.sort((n=w,function(t,e){var r=n.indexOf(t),o=n.indexOf(e);return-1===r&&-1!==o?-1:-1!==r&&-1===o?1:r-o})).map(function(t){return Y(t,e,!1)});return M.forEach(function(e){return o.push(e.unset(t))}),Promise.all(o)},get:function(t){return t?y(I.get(t)):function(t,e){var r={};return t.forEach(function(t,n){return r[n]=e(t)}),r}(I,y)},has:function(t){return!!V[t]},setProps:function(t){return B.props=o({},B.props,t)},_addChild:function(e,r){var n=r(o({initialPose:L},e,{ancestorValues:[{label:t.label,values:I}].concat(A)}));return M.add(n),n},removeChild:function(t){return M.delete(t)},clearChildren:function(){M.forEach(function(t){return t.destroy()}),M.clear()},destroy:function(){k.forEach(u),M.forEach(function(t){return t.destroy()})}},B,t)}},Qr=function(){return(Qr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function tn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]])}return r}!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Lr||(Lr={}));var en=function(t,e){return"function"==typeof t?t(e):t},rn=Xr.interpolate,nn=function(t){return function(e){var r;return function(t){void 0===t&&(t={});var e=t.x,r=t.y,n=i(t,["x","y"]);if(void 0!==e||void 0!==r){var o=Rt(e||0),a=Rt(r||0),u={x:0,y:0};return Br(n).pipe(function(t){return u.x=o(t.x),u.y=a(t.y),u})}return Br(n)}((r={},r[t]="string"==typeof e?parseFloat(e):e,r)).pipe(function(e){return e[t]})}},on=nn("x"),an=nn("y"),un=function(t,e,r,n){return function(o){var i=o.from,a=o.type,u=o.dimensions,s=o.dragBounds,c=t(u.measurementAsPixels(n,i,a)),f=[];if(s){var p=en(s,o);void 0!==p[e]&&f.push(function(t){return Math.max(t,u.measurementAsPixels(n,p[e],a))}),void 0!==p[r]&&f.push(function(t){return Math.min(t,u.measurementAsPixels(n,p[r],a))})}return a===g&&f.push(rn([0,u.get(n)],[0,100],{clamp:!1}),function(t){return t+"%"}),f.length?c.pipe.apply(c,f):c}},sn=function(t){return rr(function(e){var r=e.update,n=e.complete;r(t),n()})},cn=function(t){var e=t.from,r=t.velocity,n=t.to;return Cr({from:e,to:n,velocity:r,stiffness:500,damping:25,restDelta:.5,restSpeed:10})},fn=function(t){var e=t.from,r=t.velocity,n=t.to;return Cr({from:e,to:n,velocity:r,stiffness:700,damping:0===n?100:35})},pn={x:cn,y:cn,z:cn,rotate:cn,rotateX:cn,rotateY:cn,rotateZ:cn,scaleX:fn,scaleY:fn,scale:fn,opacity:function(t){var e=t.from,r=t.to;return kr({from:e,to:r,ease:ot})},default:kr},ln=Qr({},pn,{x:un(on,"left","right",Lr.width),y:un(an,"top","bottom",Lr.height)}),dn=function(t){var e=t.from;return sn(e)},hn=new Map([["default",pn],["drag",ln],["dragEnd",Qr({},pn,{x:dn,y:dn})]]),vn={tween:kr,spring:Cr,decay:Or,keyframes:function(t){var e=t.easings,r=t.ease,n=void 0===r?ot:r,a=t.times,u=t.values,s=i(t,["easings","ease","times","values"]);e=Array.isArray(e)?e:function(t,e){return t.map(function(){return e||at}).splice(0,t.length-1)}(u,e),a=a||function(t){var e=t.length;return t.map(function(t,r){return 0!==r?r/(e-1):0})}(u);var c=e.map(function(t,e){return Sr({from:u[e],to:u[e+1],ease:t})});return kr(o({},s,{ease:n})).applyMiddleware(function(t){return function(t,e,r){var n=t.length,o=n-1,i=o-1,a=e.map(function(t){return t.start(r)});return function(e){e<=t[0]&&a[0].seek(0),e>=t[o]&&a[i].seek(1);for(var r=1;r<n&&!(t[r]>e||r===o);r++);var u=Xt(t[r-1],t[r],e);a[r-1].seek(Er(u))}}(a,c,t)})},physics:Mr},mn={linear:ot,easeIn:it,easeOut:at,easeInOut:ut,circIn:st,circOut:ct,circInOut:ft,backIn:pt,backOut:lt,backInOut:dt,anticipate:ht},gn=[l,m,g,y,P,b,{test:function(t){return"auto"===t},parse:function(t){return t}}],yn=function(t){return gn.find(function(t){return function(e){return e.test(t)}}(t))},bn=function(t,e){return void 0===t&&(t=0),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return rr(function(e){var r,n=e.update,o=e.complete,i=0,a=function(){r=t[i].start({complete:function(){++i>=t.length?o():a()},update:n})};return a(),{stop:function(){return r&&r.stop()}}})}((r=t,rr(function(t){var e=t.complete,n=setTimeout(e,r);return{stop:function(){return clearTimeout(n)}}})),e);var r},Pn=function(t){var e=t.startEvents,r=t.endEvents,n=t.startPose,o=t.endPose,i=t.startCallback,a=t.endCallback,u=t.useDocumentToEnd,s=t.preventScroll;return function(t,c,f,p){var l=p.posePrefix?p.posePrefix+n:n,d=n+"Start",h=n+"End",v=n+"Move";if(s){var m=Vr(t,"touchmove",{passive:!1}).start(function(t){t.preventDefault()});c.set(v,m)}var g=Vr(t,e).start(function(e){f.unset(o),f.set(l),i&&p[i]&&p[i](e);var n=Vr(u?document.documentElement:t,r+(u?" mouseenter":"")).start(function(t){u&&"mouseenter"===t.type&&1===t.buttons||(c.get(h).stop(),f.unset(l),f.set(o),a&&p[a]&&p[a](t))});c.set(h,n)});c.set(d,g)}},wn={draggable:Pn({startEvents:"mousedown touchstart",endEvents:"mouseup touchend",startPose:"drag",endPose:"dragEnd",startCallback:"onDragStart",endCallback:"onDragEnd",useDocumentToEnd:!0,preventScroll:!0}),hoverable:Pn({startEvents:"mouseenter",endEvents:"mouseleave",startPose:"hover",endPose:"hoverEnd"}),focusable:Pn({startEvents:"focus",endEvents:"blur",startPose:"focus",endPose:"blur"}),pressable:Pn({startEvents:"mousedown touchstart",endEvents:"mouseup touchend",startPose:"press",endPose:"pressEnd",startCallback:"onPressStart",endCallback:"onPressEnd",useDocumentToEnd:!0})},xn=Object.keys(wn),On=function(t){var e=t.top,r=t.right,n=t.bottom;return{x:(t.left+r)/2,y:(e+n)/2}},Cn=["width","height","top","left","bottom","right"],Sn=new Set(Cn),An=function(t){return Sn.has(t)},kn=function(t,e,r){var n=t.values,o=t.props;if(n.has(e)){var i=n.get(e).raw;i.update(r),i.update(r)}else n.set(e,{raw:sr(r,function(t){return o.elementStyler.set(e,t)})})},En=function(t,e){var r=t.props,n=r.dimensions,o=r.element,i=r.elementStyler;if(!n.has())return{};var a=n.get(),u=function(t){var e=t.style.transform;t.style.transform="";var r=t.getBoundingClientRect();return t.style.transform=e,r}(o),s=a.left===u.left?0:a.right===u.right?"100%":"50%",c=a.top===u.top?0:a.bottom===u.bottom?"100%":"50%";i.set({originX:s,originY:c}),a.width!==u.width&&(kn(t,"scaleX",a.width/u.width),e.scaleX=1),a.height!==u.height&&(kn(t,"scaleY",a.height/u.height),e.scaleY=1);var f=On(a),p=On(u);return"50%"===s&&(kn(t,"x",f.x-p.x),e.x=0),"50%"===c&&(kn(t,"y",f.y-p.y),e.y=0),i.render(),e},Mn=function(t,e){return r=e,Object.keys(r).some(An)?function(t,e){var r=t.props,n=r.dimensions,o=r.elementStyler;n.measure();e.width,e.height,e.top,e.left,e.bottom,e.right,e.position;var i=tn(e,["width","height","top","left","bottom","right","position"]),a=Cn.concat("position").reduce(function(r,n){return void 0!==e[n]&&(r[n]=en(e[n],t.props)),r},{});return o.set(a).render(),En(t,i)}(t,e):En(t,e);var r},Vn=function(t,e){return parseFloat(t.split(", ")[e])},Tn=function(t,e){return function(r,n,o){var i=o.transform;if(!i||"none"===i)return 0;var a=i.match(/^matrix3d\((.+)\)$/);return a?Vn(a[1],e):Vn(i.match(/^matrix\((.+)\)$/)[1],t)}},Rn={width:function(t,e){return e.width},height:function(t,e){return e.height},top:function(t,e,r){var n=r.top;return parseFloat(n)},left:function(t,e,r){var n=r.left;return parseFloat(n)},bottom:function(t,e,r){var n=e.height,o=r.top;return parseFloat(o)+n},right:function(t,e,r){var n=e.width,o=r.left;return parseFloat(o)+n},x:Tn(4,13),y:Tn(5,14)},Dn=function(t){return void 0!==Rn[t]},Fn=function(t){return function(e){return e.elementStyler.get(t)}},jn=function(t,e){var r,n,o,i=e.onDragStart,a=e.onDragEnd,u=e.onPressStart,s=e.onPressEnd,c=e.draggable,f=e.hoverable,p=e.focusable,l=e.pressable,d=e.dragBounds,h=e.posePrefix,v=tn(e,["onDragStart","onDragEnd","onPressStart","onPressEnd","draggable","hoverable","focusable","pressable","dragBounds","posePrefix"]),m=Qr({flip:{}},v,{props:Qr({},v.props,{onDragStart:i,onDragEnd:a,onPressStart:u,onPressEnd:s,dragBounds:d,draggable:c,hoverable:f,focusable:p,pressable:l,posePrefix:h,element:t,elementStyler:(r=t,n={preparseOutput:!1},o="string"==typeof r?document.querySelector(r):r,Ke(o,n)),dimensions:function(t){var e=!1,r={width:0,height:0,top:0,left:0,bottom:0,right:0};return{get:function(t){return t?r[t]:r},measure:function(){return r=t.getBoundingClientRect(),e=!0,r},measurementAsPixels:function(t,e,n){return n===g?("string"==typeof e?parseFloat(e):e)/100*r[t]:e},has:function(){return e}}}(t)})});if(c){var y=function(t){var e={preTransition:function(t){return t.dimensions.measure()}},r={};return!0!==t&&"x"!==t||(e.x=r.x=Fn("x")),!0!==t&&"y"!==t||(e.y=r.y=Fn("y")),{drag:e,dragEnd:r}}(c),b=y.drag,P=y.dragEnd;m.drag=Qr({},b,m.drag),m.dragEnd=Qr({},P,m.dragEnd)}return m},Ln=function(t){var e=t.transformPose,r=t.addListenerToValue,n=t.extendAPI,o=t.readValueFromSource,i=t.posePriority,a=t.setValueNative;return Jr({bindOnChange:function(t,e){return function(r){t.has(r)&&t.get(r).raw.subscribe(e[r])}},readValue:function(t){return t.raw.get()},setValue:function(t,e){return t.raw.update(e)},createValue:function(t,e,n,o){var i=n.elementStyler,a=void 0===o?{}:o,u=a.passiveParent,s=a.passiveProps,c=u?function(t,e,r){var n=sr(r(t));return e.raw.subscribe(function(t){return n.update(r(t))}),{raw:n}}(t,u,s):function(t){var e=yn(t);return{raw:sr(t),type:e}}(t);return c.raw.subscribe(r(e,i)),c},convertValue:function(t,e,n){var o=n.elementStyler;return t.subscribe(r(e,o)),{raw:t,type:yn(t.get())}},getTransitionProps:function(t,e){var r=t.raw,n=t.type;return{from:r.get(),velocity:r.getVelocity(),to:e,type:n}},resolveTarget:function(t,e){return e},selectValueToRead:function(t){return t.raw},startAction:function(t,e,r){var n=t.raw,o={update:function(t){return n.update(t)},complete:r};return e.start(o)},stopAction:function(t){return t.stop()},getInstantTransition:function(t,e){var r=e.to;return sn(r)},convertTransitionDefinition:function(t,e,r){if(function(t){return void 0!==t.start}(e))return e;var n=e.delay,o=e.min,i=e.max,a=e.round,u=function(t,e,r){var n,o=r.from,i=r.to,a=r.velocity,u=e.type,s=void 0===u?"tween":u,c=e.ease,f=tn(e,["type","ease"]);vn[s],"tween"===s&&"function"!=typeof c&&("string"==typeof c?n=mn[c]:Array.isArray(c)&&"number"==typeof c[0]&&(c.length,n=kt(c[0],c[1],c[2],c[3]))),n=n||c;var p="keyframes"!==s?{from:o,to:i,velocity:a,ease:n}:{ease:n};return vn[s](Qr({},p,f))}(0,tn(e,["delay","min","max","round"]),r),s=[];return n&&(u=bn(n,u)),void 0!==o&&s.push(function(t){return Math.max(t,o)}),void 0!==i&&s.push(function(t){return Math.min(t,i)}),a&&s.push(Math.round),s.length?u.pipe.apply(u,s):u},setValueNative:a,addActionDelay:bn,defaultTransitions:hn,transformPose:e,readValueFromSource:o,posePriority:i,extendAPI:n})}({posePriority:["drag","press","focus","hover"],transformPose:function(t,e,r){var n,o=t.flip,i=tn(t,["flip"]);return function(t,e,r){return r.props.element instanceof HTMLElement&&(!0===t||"flip"===e)}(o,e,r)?Mn(r,i):(n=i,Object.keys(n).some(Dn)?function(t,e){var r=t.values,n=t.props,o=n.element,i=n.elementStyler,a=Object.keys(e).filter(Dn),u=[],s=getComputedStyle(o),c=!1;if(a.forEach(function(o){var i=r.get(o),a=yn(i.raw.get()),s=en(e[o],n);a!==yn(s)&&(u.push(o),c||(c=!0,e.applyAtEnd=e.applyAtEnd?Qr({},e.applyAtEnd):{}),e.applyAtEnd[o]=e.applyAtEnd[o]||e[o],kn(t,o,s))}),!u.length)return e;var f=o.getBoundingClientRect(),p={top:s.top,left:s.left,bottom:s.bottom,right:s.right,transform:s.transform};i.render();var l=o.getBoundingClientRect();return u.forEach(function(r){kn(t,r,Rn[r](o,f,p)),e[r]=Rn[r](o,l,s)}),i.render(),e}(r,i):i)},forceRende