Skip to content

Instantly share code, notes, and snippets.

@jpdery
Created February 7, 2014 16:07
Show Gist options
  • Save jpdery/8865806 to your computer and use it in GitHub Desktop.
Save jpdery/8865806 to your computer and use it in GitHub Desktop.
/*
---
provides: moofx
version: 3.2.0
description: A CSS3-enabled javascript animation library
homepage: http://moofx.it
author: Valerio Proietti <@kamicane> (http://mad4milk.net)
license: MIT (http://mootools.net/license.txt)
includes: cubic-bezier by Arian Stolwijk (https://github.com/arian/cubic-bezier)
...
*/
(function(t){var n={},r=function(e){var i=n[e];if(!i){i=n[e]={};var o=i.exports={};t[e].call(o,r,i,o,window)}return i.exports};window.moofx=r("0")})({0:function(t,n){"use strict";var r=t("1"),e=t("2"),i="undefined"!=typeof document?t("4"):t("18");i.requestFrame=function(t){return e.request(t),this},i.cancelFrame=function(t){return e.cancel(t),this},i.color=r,n.exports=i},1:function(t,n){"use strict";var r={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00",olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080",transparent:"#0000"},e=function(t,n,r,e){return(null==e||""===e)&&(e=1),t=parseFloat(t),n=parseFloat(n),r=parseFloat(r),e=parseFloat(e),255>=t&&t>=0&&255>=n&&n>=0&&255>=r&&r>=0&&1>=e&&e>=0?[Math.round(t),Math.round(n),Math.round(r),e]:null},i=function(t){if(3===t.length&&(t+="f"),4===t.length){var n=t.charAt(0),r=t.charAt(1),e=t.charAt(2),i=t.charAt(3);t=n+n+r+r+e+e+i+i}6===t.length&&(t+="ff");for(var o=[],u=0,c=t.length;c>u;u+=2)o.push(parseInt(t.substr(u,2),16)/(6===u?255:1));return o},o=function(t,n,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?t+6*(n-t)*r:.5>r?n:2/3>r?t+6*(n-t)*(2/3-r):t},u=function(t,n,r,e){var i,u,c;if((null==e||""===e)&&(e=1),t=parseFloat(t)/360,n=parseFloat(n)/100,r=parseFloat(r)/100,e=parseFloat(e)/1,t>1||0>t||n>1||0>n||r>1||0>r||e>1||0>e)return null;if(0===n)i=u=c=r;else{var a=.5>r?r*(1+n):r+n-r*n,s=2*r-a;i=o(s,a,t+1/3),c=o(s,a,t),u=o(s,a,t-1/3)}return[255*i,255*c,255*u,e]},c=[];for(var a in r)c.push(a);var s="(?:#([a-f0-9]{3,8}))",l="\\s*([.\\d%]+)\\s*",f="(?:,\\s*([.\\d]+)\\s*)?",p="\\("+[l,l,l]+f+"\\)",h="(?:rgb)a?",v="(?:hsl)a?",g="("+c.join("|")+")",x=RegExp(s,"i"),m=RegExp(h+p,"i"),d=RegExp(v+p,"i"),b=function(t,n){if(null==t)return null;t=(t+"").replace(/\s+/,"");var o=r[t];if(o)return b(o,n);if(o=t.match(x))t=i(o[1]);else if(o=t.match(m))t=o.slice(1);else{if(!(o=t.match(d)))return null;t=u.apply(null,o.slice(1))}return t&&(t=e.apply(null,t))?n?t:(1===t[3]&&t.splice(3,1),"rgb"+(4===t.length?"a":"")+"("+t+")"):null};b.x=RegExp([g,s,h+p,v+p].join("|"),"gi"),n.exports=b},2:function(t,n,r,e){"use strict";var i=t("3"),o=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t){return setTimeout(function(){t()},1e3/60)},u=[],c=function(t){for(var n=u.splice(0,u.length),r=0,e=n.length;e>r;r++)n[r](t||(t=+new Date))},a=function(t){var n=i(u,t);n>-1&&u.splice(n,1)},s=function(t){var n=u.push(t);return 1===n&&o(c),function(){a(t)}};r.request=s,r.cancel=a},3:function(t,n){function r(t,n,r){if(r=r||0,null==t)return-1;for(var e=t.length,i=0>r?e+r:r;e>i;){if(t[i]===n)return i;i++}return-1}n.exports=r},4:function(t,n,r,e){"use strict";var i=t("1"),o=t("2"),u=(o.cancel,o.request),c=t("5"),a=t("d"),s=t("j"),l=t("n"),f=t("o"),p=t("r"),h=t("11"),v=t("3"),g=t("12"),x=t("18"),m=function(t){return s(t).replace(/\s+/g," ")},d=function(t,n){return String.prototype.match.call(t,n)},b={},y=function(t){return b[t]||(b[t]=f(t))},S=function(t){return Math.round(1e3*t)/1e3},C=e.getComputedStyle?function(t){var n=getComputedStyle(t,null);return function(t){return n?n.getPropertyValue(y(t)):""}}:function(t){var n=t.currentStyle;return function(t){return n?n[a(t)]:""}},E=document.createElement("div"),w="border:none;margin:none;padding:none;visibility:hidden;position:absolute;height:0;",F=function(t,n){var r=t.parentNode,e=1;return r&&(E.style.cssText=w+("width:100"+n+";"),r.appendChild(E),e=E.offsetWidth/100,r.removeChild(E)),e},j=function(t){var n=t.length;return 1===n?t.push(t[0],t[0],t[0]):2===n?t.push(t[0],t[1]):3===n&&t.push(t[1]),t},k="([-.\\d]+)(%|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vm)",O=k+"?",T="none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit",q=RegExp(k,"g"),A=RegExp(O),R=RegExp(O,"g"),z=RegExp(T),D=function(t){return null==t?"":t+""},M=function(t,n){return null==t||""===t?n?"1":"":isFinite(t=+t)?0>t?"0":t+"":"1"};try{E.style.color="rgba(0,0,0,0.5)"}catch(P){}var L=/^rgba/.test(E.style.color),N=function(t,n){var r,e="rgba(0,0,0,1)";if(!t||!(r=i(t,!0)))return n?e:"";if(n)return"rgba("+r+")";var o=r[3];return 0===o?"transparent":L&&1!==o?"rgba("+r+")":"rgb("+r.slice(0,3)+")"},I=function(t,n){if(null==t||""===t)return n?"0px":"";var r=d(t,A);return r?r[1]+(r[2]||"px"):t},W=function(t,n){if(null==t||""===t)return n?"none":"";var r=t.match(z);return r?t:n?"none":""},B=function(t,n){var r="0px none rgba(0,0,0,1)";if(null==t||""===t)return n?r:"";if(0===t||"none"===t)return n?r:t+"";var e;t=t.replace(i.x,function(t){return e=t,""});var o=t.match(z),u=t.match(R);return m([I(u?u[0]:"",n),W(o?o[0]:"",n),N(e,n)].join(" "))},_=function(t,n){return null==t||""===t?n?"0px 0px 0px 0px":"":m(j(p(m(t).split(" "),function(t){return I(t,n)})).join(" "))},X=function(t,n,r){var e="rgba(0,0,0,0)",o=3===r?e+" 0px 0px 0px":e+" 0px 0px 0px 0px";if(null==t||""===t)return n?o:"";if("none"===t)return n?o:t;var u=[],t=m(t).replace(i.x,function(t){return u.push(t),""});return p(t.split(","),function(t,e){var i=N(u[e],n),o=/inset/.test(t),c=t.match(R)||["0px"];for(c=p(c,function(t){return I(t,n)});r>c.length;)c.push("0px");var a=o?["inset",i]:[i];return a.concat(c).join(" ")}).join(", ")},Y=function(t,n){return null==t||""===t?"":t.replace(i.x,function(t){return N(t,n)}).replace(q,function(t){return I(t,n)})},U={},Z={},H={},V={},$=function(t){return U[t]||(U[t]=function(){var n=V[t]||t,r=H[t]||Y;return function(){return r(C(this)(n),!0)}}())},G=function(t){return Z[t]||(Z[t]=function(){var n=V[t]||t,r=H[t]||Y;return function(t){this.style[n]=r(t,!1)}}())},J=["Top","Right","Bottom","Left"],K=["TopLeft","TopRight","BottomRight","BottomLeft"];h(J,function(t){var n="border"+t;h(["margin"+t,"padding"+t,n+"Width",t.toLowerCase()],function(t){H[t]=I}),H[n+"Color"]=N,H[n+"Style"]=W,H[n]=B,U[n]=function(){return[$(n+"Width").call(this),$(n+"Style").call(this),$(n+"Color").call(this)].join(" ")}}),h(K,function(t){H["border"+t+"Radius"]=I}),H.color=H.backgroundColor=N,H.width=H.height=H.minWidth=H.minHeight=H.maxWidth=H.maxHeight=H.fontSize=H.backgroundSize=I,h(["margin","padding"],function(t){H[t]=_,U[t]=function(){return p(J,function(n){return $(t+n).call(this)},this).join(" ")}}),H.borderWidth=_,H.borderStyle=function(t,n){return null==t||""===t?n?j(["none"]).join(" "):"":(t=m(t).split(" "),m(j(p(t,function(t){W(t,n)})).join(" ")))},H.borderColor=function(t,n){return t&&(t=d(t,i.x))?m(j(p(t,function(t){return N(t,n)})).join(" ")):n?j(["rgba(0,0,0,1)"]).join(" "):""},h(["Width","Style","Color"],function(t){U["border"+t]=function(){return p(J,function(n){return $("border"+n+t).call(this)},this).join(" ")}}),H.borderRadius=_,U.borderRadius=function(){return p(K,function(t){return $("border"+t+"Radius").call(this)},this).join(" ")},H.border=B,U.border=function(){for(var t,n=0;J.length>n;n++){var r=$("border"+J[n]).call(this);if(t&&r!==t)return null;t=r}return t},H.zIndex=D,H.opacity=M;var Q=null!=E.style.MsFilter&&"MsFilter"||null!=E.style.filter&&"filter";if(Q&&null==E.style.opacity){var tn=/alpha\(opacity=([\d.]+)\)/i;Z.opacity=function(t){t="1"===(t=M(t))?"":"alpha(opacity="+Math.round(100*t)+")";var n=C(this)(Q);return this.style[Q]=tn.test(n)?n.replace(tn,t):n+" "+t},U.opacity=function(){var t=C(this)(Q).match(tn);return(t?t[1]/100:1)+""}}var nn=H.boxShadow=function(t,n){return X(t,n,4)},rn=H.textShadow=function(t,n){return X(t,n,3)};h(["Webkit","Moz","ms","O",null],function(t){h(["transition","transform","transformOrigin","transformStyle","perspective","perspectiveOrigin","backfaceVisibility"],function(n){var r=t?t+l(n):n;"ms"===t&&(b[r]="-ms-"+y(n)),null!=E.style[r]&&(V[n]=r)})});var en=V.transition,on=V.transform;"OTransition"===en&&(en=null);var un,cn;!en&&on&&function(){var n=t("1a"),r="\\s*([-\\d\\w.]+)\\s*",e=RegExp("matrix\\("+[r,r,r,r,r,r]+"\\)"),i=function(t){var r=n.apply(null,t.match(e).slice(1))||[[0,0],0,0,[0,0]];return["translate("+p(r[0],function(t){return S(t)+"px"})+")","rotate("+S(180*r[1]/Math.PI)+"deg)","skewX("+S(180*r[2]/Math.PI)+"deg)","scale("+p(r[3],S)+")"].join(" ")},o=function(t){return t||"0px"},u=function(t){return t||"1"},a=function(t){return t||"0deg"},s={translate:function(t){t||(t="0px,0px");var n=t.split(",");return n[1]||(n[1]="0px"),p(n,m)+""},translateX:o,translateY:o,scale:function(t){t||(t="1,1");var n=t.split(",");return n[1]||(n[1]=n[0]),p(n,m)+""},scaleX:u,scaleY:u,rotate:a,skewX:a,skewY:a};cn=c({constructor:function(t){var n=this.names=[],r=this.values=[];t.replace(/(\w+)\(([-.\d\s\w,]+)\)/g,function(t,e,i){n.push(e),r.push(i)})},identity:function(){var t=[];return h(this.names,function(n){var r=s[n];r&&t.push(n+"("+r()+")")}),t.join(" ")},sameType:function(t){return""+this.names==""+t.names},decompose:function(){var t=""+this;E.style.cssText=w+y(on)+":"+t+";",document.body.appendChild(E);var n=C(E)(on);return n&&"none"!==n||(n="matrix(1, 0, 0, 1, 0, 0)"),document.body.removeChild(E),i(n)}}),cn.prototype.toString=function(t){var n=this.values,r=[];return h(this.names,function(e,i){var o=s[e];if(o){var u=o(n[i]);t&&u===o()||r.push(e+"("+u+")")}}),r.length?r.join(" "):"none"},cn.union=function(t,n){if(t!==n){var r,e;if("none"===t?(e=new cn(n),n=""+e,t=e.identity(),r=new cn(t)):"none"===n?(r=new cn(t),t=""+r,n=r.identity(),e=new cn(n)):(r=new cn(t),t=""+r,e=new cn(n),n=""+e),t!==n&&(r.sameType(e)||(t=r.decompose(),n=e.decompose()),t!==n))return[t,n]}},un=H.transform=function(t){return t&&"none"!==t?new cn(e.test(t)?i(t):t).toString(!0):"none"},U.transform=function(){var t=this.style;return t[on]||(t[on]=un(C(this)(on)))}}();var an,sn=function(t,n,r){var e=H[n]||Y,i=$(n).call(t),r=e(r,!0);if(i!==r){if(e===I||e===B||e===_){var o=r.match(q),u=0;o&&(i=i.replace(q,function(n,r,e){var i=o[u++],c=i.match(A),a=c[2];if(e!==a){var s="px"===e?r:F(t,e)*r;return S(s/F(t,a))+a}return n})),u>0&&G(n).call(t,i)}else if(e===un)return cn.union(i,r);return i!==r?[i,r]:null}},ln=c({inherits:x,constructor:function ln(t,n){var r=$(n),e=G(n);this.get=function(){return r.call(t)},this.set=function(n){return e.call(t,n)},ln.parent.constructor.call(this,this.set),this.node=t,this.property=n}});an=c({inherits:ln,constructor:function an(){return an.parent.constructor.apply(this,arguments)},start:function(t){if(this.stop(),0===this.duration)return this.cancel(t),this;var n=sn(this.node,this.property,t);if(!n)return this.cancel(t),this;if(an.parent.start.apply(this,n),!this.cancelStep)return this;var r=H[this.property]||Y;return r!==nn&&r!==rn&&r!==Y||this.templateFrom===this.templateTo||(this.cancelStep(),delete this.cancelStep,this.cancel(t)),this},parseEquation:function(t){return"string"==typeof t?an.parent.parseEquation.call(this,t):void 0}});var fn=function(t,n,r,e){var i=v(n,t);-1!==i&&(n.splice(i,1),r.splice(i,1),e.splice(i,1))},pn=c({inherits:ln,constructor:function pn(t,n){pn.parent.constructor.call(this,t,n),this.hproperty=y(V[n]||n);var r=this;this.bSetTransitionCSS=function(t){r.setTransitionCSS(t)},this.bSetStyleCSS=function(t){r.setStyleCSS(t)},this.bComplete=function(){r.complete()}},start:function(t){if(this.stop(),0===this.duration)return this.cancel(t),this;var n=sn(this.node,this.property,t);return n?(this.to=n[1],this.cancelSetTransitionCSS=u(this.bSetTransitionCSS),this):(this.cancel(t),this)},setTransitionCSS:function(){delete this.cancelSetTransitionCSS,this.resetCSS(!0),this.cancelSetStyleCSS=u(this.bSetStyleCSS)},setStyleCSS:function(t){delete this.cancelSetStyleCSS;var n=this.duration;this.cancelComplete=setTimeout(this.bComplete,n),this.endTime=t+n,this.set(this.to)},complete:function(){delete this.cancelComplete,this.resetCSS(),this.callback(this.endTime)},stop:function(t){return this.cancelExit?(this.cancelExit(),delete this.cancelExit):this.cancelSetTransitionCSS?(this.cancelSetTransitionCSS(),delete this.cancelSetTransitionCSS):this.cancelSetStyleCSS?(this.cancelSetStyleCSS(),delete this.cancelSetStyleCSS,t&&this.resetCSS()):this.cancelComplete&&(clearTimeout(this.cancelComplete),delete this.cancelComplete,t&&(this.resetCSS(),this.set(this.get()))),this},resetCSS:function(t){var n=C(this.node),r=(n(en+"Property").replace(/\s+/g,"")||"all").split(","),e=(n(en+"Duration").replace(/\s+/g,"")||"0s").split(","),i=(n(en+"TimingFunction").replace(/\s+/g,"")||"ease").match(/cubic-bezier\([\d-.,]+\)|([a-z-]+)/g);fn("all",r,e,i),fn(this.hproperty,r,e,i),t&&(r.push(this.hproperty),e.push(this.duration+"ms"),i.push("cubic-bezier("+this.equation+")"));var o=this.node.style;o[en+"Property"]=r,o[en+"Duration"]=e,o[en+"TimingFunction"]=i},parseEquation:function(t){return"string"==typeof t?pn.parent.parseEquation.call(this,t,!0):void 0}}),hn=an,vn=function(t,n){return"function"==typeof t?x(t):g(t,n)};g.implement({animate:function(t,n,r){var e=t,i=n;"string"==typeof t&&(e={},e[t]=n,i=r),null==i&&(i={});var o=typeof i;i="function"===o?{callback:i}:"string"===o||"number"===o?{duration:i}:i;var u=i.callback||function(){},c=0,s=0;i.callback=function(t){++c===s&&u(t)};for(var l in e){var f=e[l],l=a(l);this.forEach(function(t){s++;var n=g(t),r=n._animations||(n._animations={}),e=r[l]||(r[l]=new hn(t,l));e.setOptions(i).start(f)})}return this},style:function(t,n){var r=t;"string"==typeof t&&(r={},r[t]=n);for(var e in r){var i=r[e],o=G(e=a(e));this.forEach(function(t){var n,r=g(t),u=r._animations;u&&(n=u[e])&&n.stop(!0),o.call(t,i)})}return this},compute:function(t){t=a(t);var n=this[0];if("transform"===t&&un)return C(n)(on);var r=$(t).call(n);return null!=r?r.replace(q,function(t,r,e){return"px"===e?t:F(n,e)*r+"px"}):""}}),vn.parse=function(t,n,r){return(H[a(t)]||Y)(n,r)},n.exports=vn},5:function(t,n){"use strict";var r=t("6"),e=t("7"),i=t("8"),o=t("a"),u=t("b"),c=t("c"),a=Object.defineProperty,s=Object.getOwnPropertyDescriptor;try{a({},"~",{}),s({},"~")}catch(l){a=null,s=null}var f=function(t,n,r){a(this,n,s(r,n)||{writable:!0,enumerable:!0,configurable:!0,value:t})},p=function(t,n){this[n]=t},h=function(t){return e(t,a?f:p,this.prototype),this},v=/^constructor|inherits|mixin$/,g=function(t){"function"===c(t)&&(t={constructor:t});var n=t.inherits,e=r(t,"constructor")?t.constructor:n?function(){return n.apply(this,arguments)}:function(){};if(n){i(e,n);var a=n.prototype,s=e.prototype=u(a);e.parent=a,s.constructor=e}e.implement||(e.implement=h);var l=t.mixin;if(l){"array"!==c(l)&&(l=[l]);for(var f=0;l.length>f;f++)e.implement(u(l[f].prototype))}return e.implement(o(t,function(t,n){return!n.match(v)}))};n.exports=g},6:function(t,n){"use strict";var r=Object.hasOwnProperty,e=function(t,n){return r.call(t,n)};n.exports=e},7:function(t,n){"use strict";var r=t("6"),e=function(t,n,r){for(var e in t)if(n.call(r,t[e],e,t)===!1)break;return t};if(!{valueOf:0}.propertyIsEnumerable("valueOf")){var i="constructor,toString,valueOf,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString".split(","),o=Object.prototype;e=function(t,n,e){for(var u in t)if(n.call(e,t[u],u,t)===!1)return t;for(var c=0;u=i[c];c++){var a=t[u];if((a!==o[u]||r(t,u))&&n.call(e,a,u,t)===!1)break}return t}}n.exports=e},8:function(t,n){"use strict";var r=t("9"),e=function(t,n){this[n]=t},i=function(t){for(var n=1,i=arguments.length;i>n;n++)r(arguments[n],e,t);return t};n.exports=i},9:function(t,n){"use strict";var r=t("7"),e=t("6"),i=function(t,n,i){return r(t,function(r,o){return e(t,o)?n.call(i,r,o,t):void 0}),t};n.exports=i},a:function(t,n){"use strict";var r=t("7"),e=function(t,n,e){var i={};return r(t,function(r,o){n.call(e,r,o,t)&&(i[o]=r)}),i};n.exports=e},b:function(t,n){"use strict";var r=function(t){var n=function(){};return n.prototype=t,new n};n.exports=r},c:function(t,n){"use strict";var r=Object.prototype.toString,e=/number|object|array|string|function|date|regexp|boolean/,i=function(t){if(null==t)return"null";var n=r.call(t).slice(8,-1).toLowerCase();return"number"===n&&isNaN(t)?"null":e.test(n)?n:"object"};n.exports=i},d:function(t,n){function r(t){return t=e(t),t=i(t),t=o(t).replace(/[\-_]/g," ").replace(/\s[a-z]/g,u).replace(/\s+/g,"").replace(/^[A-Z]/g,c)}var e=t("e"),i=t("f"),o=t("g"),u=t("h"),c=t("i");n.exports=r},e:function(t,n){function r(t){return null==t?"":""+t}n.exports=r},f:function(t,n){function r(t){return t=e(t),t.search(/[\xC0-\xFF]/g)>-1&&(t=t.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),t}var e=t("e");n.exports=r},g:function(t,n){function r(t){return t=e(t),t.replace(/[^0-9a-zA-Z\xC0-\xFF \-_]/g,"")}var e=t("e");n.exports=r},h:function(t,n){function r(t){return t=e(t),t.toUpperCase()}var e=t("e");n.exports=r},i:function(t,n){function r(t){return t=e(t),t.toLowerCase()}var e=t("e");n.exports=r},j:function(t,n){function r(t,n){return t=e(t),n=n||i,o(u(t,n),n)}var e=t("e"),i=t("k"),o=t("l"),u=t("m");n.exports=r},k:function(t,n){n.exports=[" ","\n","\r"," ","\f"," "," "," ","᠎"," "," "," "," "," "," "," "," "," "," "," ","\u2028","\u2029"," "," "," "]},l:function(t,n){function r(t,n){t=e(t),n=n||i;for(var r,o,u=0,c=t.length,a=n.length,s=!0;s&&c>u;)for(s=!1,r=-1,o=t.charAt(u);a>++r;)if(o===n[r]){s=!0,u++;break}return u>=c?"":t.substr(u,c)}var e=t("e"),i=t("k");n.exports=r},m:function(t,n){function r(t,n){t=e(t),n=n||i;for(var r,o,u=t.length-1,c=n.length,a=!0;a&&u>=0;)for(a=!1,r=-1,o=t.charAt(u);c>++r;)if(o===n[r]){a=!0,u--;break}return u>=0?t.substring(0,u+1):""}var e=t("e"),i=t("k");n.exports=r},n:function(t,n){function r(t){return t=e(t),i(t).replace(/^\w|\s\w/g,o)}var e=t("e"),i=t("i"),o=t("h");n.exports=r},o:function(t,n){function r(t){return t=e(t),t=o(t),i(t,"-")}var e=t("e"),i=t("p"),o=t("q");n.exports=r},p:function(t,n){function r(t,n){return t=e(t),null==n&&(n="-"),t=i(t),t=o(t),t=u(t).replace(/ +/g,n).toLowerCase()}var e=t("e"),i=t("f"),o=t("g"),u=t("j");n.exports=r},q:function(t,n){function r(t,n){function r(t,r,e){return r+n+e}return null==n&&(n=" "),t=e(t),t=t.replace(i,r),t=t.toLowerCase()}var e=t("e"),i=/([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g;n.exports=r},r:function(t,n){function r(t,n,r){n=e(n,r);var i=[];if(null==t)return i;for(var o=-1,u=t.length;u>++o;)i[o]=n(t[o],o,t);return i}var e=t("s");n.exports=r},s:function(t,n){function r(t,n){switch(typeof t){case"function":return n!==void 0?function(r,e,i){return t.call(n,r,e,i)}:t;case"object":return null!=t?function(n){return i(n,t)}:t;case"string":case"number":return e(t);default:return t}}var e=t("t"),i=t("u");n.exports=r},t:function(t,n){function r(t){return function(n){return n[t]}}n.exports=r},u:function(t,n){function r(t,n){for(var r=-1,e=t.length;e>++r;)if(o(t[r],n))return!0;return!1}function e(t,n){for(var e=-1,i=n.length;i>++e;)if(!r(t,n[e]))return!1;return!0}function i(t,n){var r=!0;return u(n,function(n,e){return o(t[e],n)?void 0:r=!1}),r}function o(t,n){return t&&"object"==typeof t?c(t)&&c(n)?e(t,n):i(t,n):t===n}var u=t("v"),c=t("y");n.exports=o},v:function(t,n){function r(t,n,r){i(t,function(i,o){return e(t,o)?n.call(r,t[o],o,t):void 0})}var e=t("w"),i=t("x");n.exports=r},w:function(t,n){function r(t,n){return Object.prototype.hasOwnProperty.call(t,n)}n.exports=r},x:function(t,n){function r(){u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=!0;for(var t in{toString:null})o=!1}function e(t,n,e){var c,a=0;null==o&&r();for(c in t)if(i(n,t,c,e)===!1)break;if(o)for(;(c=u[a++])&&(t[c]===Object.prototype[c]||i(n,t,c,e)!==!1););}function i(t,n,r,e){return t.call(e,n[r],r,n)}var o,u;n.exports=e},y:function(t,n){var r=t("z"),e=Array.isArray||function(t){return r(t,"Array")};n.exports=e},z:function(t,n){function r(t,n){return e(t)===n}var e=t("10");n.exports=r},10:function(t,n){function r(t){return null===t?"Null":t===e?"Undefined":i.exec(o.call(t))[1]}var e,i=/^\[object (.*)\]$/,o=Object.prototype.toString;n.exports=r},11:function(t,n){function r(t,n,r){if(null!=t)for(var e=-1,i=t.length;i>++e&&n.call(r,t[e],e,t)!==!1;);}n.exports=r},12:function(t,n,r,e){"use strict";var i=t("5"),o=t("13"),u=t("14"),c=t("15"),a=t("16"),s=t("17"),l=0,f=function(t){return t===e?"global":t.uniqueNumber||(t.uniqueNumber="n:"+(l++).toString(36))},p={},h=i({constructor:function h(t,n){if(null==t)return this&&this.constructor===h?new v:null;var r=t;if(t.constructor!==v){r=new v;var i;if("string"==typeof t)return r.search?(r[r.length++]=n||document,r.search(t)):null;if(t.nodeType||t===e)r[r.length++]=t;else if(t.length)for(var o={},u=0,c=t.length;c>u;u++){var a=h(t[u],n);if(a&&a.length)for(var s=0,l=a.length;l>s;s++){var g=a[s];i=f(g),o[i]||(r[r.length++]=g,o[i]=!0)}}}return r.length?1===r.length?(i=f(r[0]),p[i]||(p[i]=r)):r:null}}),v=i({inherits:h,constructor:function v(){this.length=0},unlink:function(){return this.map(function(t){return delete p[f(t)],t})},forEach:function(t,n){return o(this,t,n)},map:function(t,n){return u(this,t,n)},filter:function(t,n){return c(this,t,n)},every:function(t,n){return a(this,t,n)},some:function(t,n){return s(this,t,n)}});n.exports=h},13:function(t,n){"use strict";var r=function(t,n,r){for(var e=0,i=t.length>>>0;i>e&&n.call(r,t[e],e,t)!==!1;e++);return t};n.exports=r},14:function(t,n){"use strict";var r=function(t,n,r){for(var e=t.length>>>0,i=Array(e),o=0,u=e;u>o;o++)i[o]=n.call(r,t[o],o,t);return i};n.exports=r},15:function(t,n){"use strict";var r=function(t,n,r){for(var e=[],i=0,o=t.length>>>0;o>i;i++){var u=t[i];n.call(r,u,i,t)&&e.push(u)}return e};n.exports=r},16:function(t,n){"use strict";var r=function(t,n,r){for(var e=0,i=t.length>>>0;i>e;e++)if(!n.call(r,t[e],e,t))return!1;return!0};n.exports=r},17:function(t,n){"use strict";var r=function(t,n,r){for(var e=0,i=t.length>>>0;i>e;e++)if(n.call(r,t[e],e,t))return!0;return!1};n.exports=r},18:function(t,n){"use strict";var r=t("5"),e=t("2").request,i=t("19"),o=t("r"),u="([\\d.]+)(s|ms)?",c="cubic-bezier\\(([-.\\d]+),([-.\\d]+),([-.\\d]+),([-.\\d]+)\\)",a=RegExp(u),s=RegExp(c);RegExp(c,"g");var l={"default":"cubic-bezier(0.25, 0.1, 0.25, 1.0)",linear:"cubic-bezier(0, 0, 1, 1)","ease-in":"cubic-bezier(0.42, 0, 1.0, 1.0)","ease-out":"cubic-bezier(0, 0, 0.58, 1.0)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1.0)"};l.ease=l["default"];var f=function(t,n,r){return(n-t)*r+t},p=function(t){var n=[],r=(t+"").replace(/[-.\d]+/g,function(t){return n.push(+t),"@"});return[n,r]},h=r({constructor:function h(t,n){this.setOptions(n),this.render=t||function(){};var r=this;this.bStep=function(t){return r.step(t)},this.bExit=function(t){r.exit(t)}},setOptions:function(t){if(null==t&&(t={}),!(this.duration=this.parseDuration(t.duration||"500ms")))throw Error("invalid duration");if(!(this.equation=this.parseEquation(t.equation||"default")))throw Error("invalid equation");return this.callback=t.callback||function(){},this},parseDuration:function(t){if(t=(t+"").match(a)){var n=+t[1],r=t[2]||"ms";if("s"===r)return 1e3*n;if("ms"===r)return n}},parseEquation:function(t,n){var r=typeof t;if("function"===r)return t;if("string"===r){t=l[t]||t;var e=t.replace(/\s+/g,"").match(s);if(e){if(t=o(e.slice(1),function(t){return+t}),n)return t;if("0,0,1,1"==""+t)return function(t){return t};r="object"}}return"object"===r?i(t[0],t[1],t[2],t[3],1e3/60/this.duration/4):void 0},cancel:function(t){this.to=t,this.cancelExit=e(this.bExit)},exit:function(t){this.render(this.to),delete this.cancelExit,this.callback(t)},start:function(t,n){if(this.stop(),0===this.duration)return this.cancel(n),this;this.isArray=!1,this.isNumber=!1;var r=typeof t,i=typeof n;"object"===r&&"object"===i?this.isArray=!0:"number"===r&&"number"===i&&(this.isNumber=!0);var o=p(t),u=p(n);return this.from=o[0],this.to=u[0],this.templateFrom=o[1],this.templateTo=u[1],this.from.length!==this.to.length||""+this.from==""+this.to?(this.cancel(n),this):(delete this.time,this.length=this.from.length,this.cancelStep=e(this.bStep),this)},stop:function(){return this.cancelExit?(this.cancelExit(),delete this.cancelExit):this.cancelStep&&(this.cancelStep(),delete this.cancelStep),this},step:function(t){this.time||(this.time=t);var n=(t-this.time)/this.duration;n>1&&(n=1);for(var r=this.equation(n),i=this.from,o=this.to,u=this.templateTo,c=0,a=this.length;a>c;c++){var s=i[c],l=o[c];u=u.replace("@",l!==s?f(s,l,r):l)}this.render(this.isArray?u.split(","):this.isNumber?+u:u,n),1!==n?this.cancelStep=e(this.bStep):(delete this.cancelStep,this.callback(t))}}),v=function(t){var n=new h(t);return{start:function(t,r,e){var i=typeof e;return n.setOptions("function"===i?{callback:e}:"string"===i||"number"===i?{duration:e}:e).start(t,r),this},stop:function(){return n.stop(),this}}};v.prototype=h.prototype,n.exports=v},19:function(t,n){n.exports=function(t,n,r,e,i){var o=function(n){var e=1-n;return 3*e*e*n*t+3*e*n*n*r+n*n*n},u=function(t){var r=1-t;return 3*r*r*t*n+3*r*t*t*e+t*t*t},c=function(n){var e=1-n;return 3*(2*(n-1)*n+e*e)*t+3*(-n*n*n+2*e*n)*r};return function(t){var n,r,e,a,s,l,f=t;for(e=f,l=0;8>l;l++){if(a=o(e)-f,i>Math.abs(a))return u(e);if(s=c(e),1e-6>Math.abs(s))break;e-=a/s}if(n=0,r=1,e=f,n>e)return u(n);if(e>r)return u(r);for(;r>n;){if(a=o(e),i>Math.abs(a-f))return u(e);f>a?n=e:r=e,e=.5*(r-n)+n}return u(e)}}},"1a":function(t,n){"use strict";var r=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},e=function(t){var n=r(t);return n?[t[0]/n,t[1]/n]:[0,0]},i=function(t,n){return t[0]*n[0]+t[1]*n[1]},o=Math.atan2,u=function(t,n,r,e){return[r*t[0]+e*n[0],r*t[1]+e*n[1]]};n.exports=function(t,n,c,a,s,l){if(0===t*a-n*c)return!1;var f=[s,l],p=[[t,n],[c,a]],h=[r(p[0])];p[0]=e(p[0]);var v=i(p[0],p[1]);p[1]=u(p[1],p[0],1,-v),h[1]=r(p[1]),v/=h[1];var g=o(p[0][1],p[0][0]);return[f,g,v,h]}}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment