text: // am.js@v0.0.1, MIT licensed. https://github.com/adriancmiranda/am.js
  !function(t,e,n){"use strict";function r(t,e,n,r,o,a,i){var u,m,c,s,l,p=[];for(u=0;t>u;u++)c=i?~~(u/e):u%e,m=i?u%e:~~(u/e),s=Math.round(n+o)*c,l=Math.round(r+a)*m,p.push({column:c,row:m,x:0-s,y:0-l,frame:u,label:""});return p}function o(t){var e=(i(t,"backgroundPosition")||i(t,"backgroundPositionX")+" "+i(t,"backgroundPositionY")).replace(/left|top/gi,0).split(" ");return{x:g(e[0]),y:g(e[1])}}function a(t){var e=i(t,"backgroundImage")||"";return e.replace(/url\(|\)|"|'/g,"")}function i(e,n){return t.getComputedStyle?t.getComputedStyle(e,null)[n]:e.currentStyle[n]}function u(t,e){if(t===!1)return"Boolean";if(""===t)return"String";if(0===t)return"Number";if(t&&t.constructor){var n=(t.constructor.toString()||Object.prototype.toString.apply(t)).replace(/^.*function([^\s]*|[^\(]*)\([^\x00]+$/,"$1").replace(/^(\[object\s)|]$/g,"").replace(/\s+/,"")||"Object";return e===!0||/^(Boolean|RegExp|Number|String|Array|Date)$/.test(n)?n:"Object"}return t}function m(e,n){var r=typeof e;return e===!1?"boolean":""===e?"string":(e&&"object"===r&&(r=u(e,n),r=String(r).toLowerCase()),"number"===r&&!t.isNaN(e)&&t.isFinite(e)?n===!0&&t.parseFloat(e)===t.parseInt(e,10)?0>e?"int":"uint":"number":e?r:e)}function c(e,n){return e=t.parseFloat(e),e=t.isNaN(e)||!t.isFinite(e)?0:e,n===!0&&(e=t.parseInt(1e4*e,10)/1e4),e}function s(t){return"string"===m(t)?/^(true|(^[1-9][0-9]*$)$|yes|y|sim|s|on)$/gi.test(t):!!t}function l(t,e,n){return t=c(t),e=c(e),n=c(n),t>n?n:e>t?e:t}function p(t,e,n){return t=c(t),e=c(e),n=c(n),t%=n,c(e>t?t+n:t)}function f(t){return t=g(t),0>t?0:t}function g(e){return 0|t.parseInt(e,10)}!function(){var e,n,r,o,a,i;for(n=0,r=["ms","moz","webkit","o"],e=0;e<r.length&&!t.requestAnimationFrame;++e)o=r[e]+"RequestAnimationFrame",a=r[e]+"CancelAnimationFrame",i=r[e]+"CancelRequestAnimationFrame",t.requestAnimationFrame=t[o],t.cancelAnimationFrame=t[a]||t[i];t.requestAnimationFrame||(t.requestAnimationFrame=function(e,r){var o,a,i;return o=(new Date).getTime(),a=Math.max(0,16-(o-n)),i=t.setTimeout(function(){e(o+a,r)},a),n=o+a,i}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(e){t.clearTimeout(e)})}(),n.Sprite=function(e,n){function i(t,e){var n,r={};e="object"===m(e)?e:{};for(n in t){var o=u(n);r[n]=e.hasOwnProperty(n)||o?e[n]||o:t[n]}return r}function u(t,n){return m(n)?void e.setAttribute("data-"+t,n):e.getAttribute("data-"+t)}function F(e,n,r){var o,a;if("function"===m(e))return"number"===m(n)&&(r=n,n=null),a=++h.animationID,r=1e3/l(r||10,1,60),h.animations[a]={timeout:0,rAF:0},o=Array.prototype.slice.call(arguments,0),o.splice(0,3),function i(){h.animations[a].timeout=t.setTimeout(function(){h.animations[a].rAF=t.requestAnimationFrame(i,n),e.apply(null,o)},r)}(),a}function y(e){m(h.animations[e])&&(t.clearTimeout(h.animations[e].timeout),t.cancelAnimationFrame(h.animations[e].rAF),delete h.animations[e])}function d(t){b.lastFrame=b.currentFrame,b.currentFrame=p(t,1,b.totalFrames),b.row=b.timeline[b.currentFrame-1].row,b.column=b.timeline[b.currentFrame-1].column,b.offsetX=b.timeline[b.currentFrame-1].x+b.image.x,b.offsetY=b.timeline[b.currentFrame-1].y+b.image.y,b.element.style.backgroundPosition=b.offsetX+"px "+b.offsetY+"px"}function A(){"function"==typeof j.onUpdate&&j.onUpdate.apply(b,j.onUpdateParams),b.currentFrame<b.targetFrame?d(b.currentFrame+w):b.currentFrame>b.targetFrame?d(b.currentFrame+w):b.currentFrame===b.targetFrame&&(b.looping?b.yoyo?b.loopBetween(b.currentFrame,b.targetNextFrame,b.yoyo,j):b.loopBetween(b.targetNextFrame,b.currentFrame,b.yoyo,j):(b.pause(),"function"==typeof j.onComplete&&j.onComplete.apply(b,j.onCompleteParams)))}var b=this,h=b.constructor.static,v=o(e),S=a(e),w=1,x=null,j={};b.id=h.instances++,b.name="AM[Sprite_"+b.id+"]",b.element=e,b.image={url:S,x:v.x,y:v.y,object:new Image},b.options=i(h.defaults,n),b.fps=c(b.options.fps),b.totalFrames=Math.max(1,b.options.totalFrames-1),b.currentFrame=l(b.options.currentFrame,1,b.totalFrames),b.vertical=s(b.options.vertical),b.tileW=c(b.options.tileW)||e.clientWidth,b.tileH=c(b.options.tileH)||e.clientHeight,b.columns=f(b.options.columns),b.rows=f(b.options.rows),b.column=c(b.currentFrame%b.rows),b.row=~~(b.currentFrame/b.columns),b.timeline=r(b.totalFrames,b.vertical?b.rows:b.columns,b.tileW,b.tileH,0,0,b.vertical),b.lastFrame=b.currentFrame,b.targetNextFrame=0,b.targetFrame=0,b.offsetX=0,b.offsetY=0,b.reverse=!1,b.running=!1,b.looping=!1,b.yoyo=!1,b.load=function(t){t="object"===m(t)?t:{},b.image.object.src=b.image.url,b.image.object.onload=function(){b.image.width=b.image.object.width,b.image.height=b.image.object.height,"function"==typeof t.onLoad&&t.onLoad.apply(b,t.onLoadParams)}},b.play=function(t,e){b.pause(),"uint"===m(t,!0)?(j="object"===m(e)?e:{},b.targetFrame=l(t,1,b.totalFrames),b.reverse=b.currentFrame>b.targetFrame,w=b.reverse?-1:1,"function"==typeof j.onInit&&j.onInit.apply(b,j.onInitParams)):b.targetFrame=0,x=F(A,b.element,b.fps),b.running=!0,"function"==typeof j.onStart&&j.onStart.apply(b,j.onStartParams)},b.pause=function(){y(x),x=null,b.running=!1},b.togglePause=function(){b[x?"pause":"play"]()},b.stop=function(){d(0),b.pause(),b.running=!1},b.playToBeginAndStop=function(t){b.play(0,t)},b.playToEndAndStop=function(t){b.play(b.totalFrames,t)},b.gotoRandomFrame=function(){b.gotoAndStop(~~(Math.random()*b.totalFrames))},b.gotoAndPlay=function(t){d(t),b.play(),b.running=!0},b.gotoAndStop=function(t){d(t),b.pause(),b.running=!1},b.nextFrame=function(){b.jumpFrames(1),b.running=!1},b.prevFrame=function(){b.jumpFrames(-1),b.running=!1},b.jumpFrames=function(t){b.gotoAndStop(b.currentFrame+g(t))},b.loopBetween=function(t,e,n,r){t=l(t,1,b.totalFrames),e=l(e,0,b.totalFrames),b.gotoAndStop(t),b.running=!0,b.looping=!0,b.yoyo=s(n),b.targetNextFrame=t,0===e&&(e=b.totalFrames),b.play(e,r)},b.cancelLooping=function(){b.running=!1,b.looping=!1,b.yoyo=!1}},n.Sprite.static={instances:0,animationID:0,animations:{},defaults:{fps:24,totalFrames:1,currentFrame:1,vertical:!1,tileW:0,tileH:0,columns:0,rows:0}}}(this,this.document,this.AM=this.AM||{});