{"version":3,"sources":["progressBar.min.js"],"names":["e","exports","module","define","amd","f","window","global","self","ProgressBar","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","mockTweenable","root","this","Function","Tweenable","formula","DEFAULT_SCHEDULE_FUNCTION","timeoutHandler_endTime","timeoutHandler_currentTime","timeoutHandler_isEnded","timeoutHandler_offset","DEFAULT_EASING","_now","Date","now","SHIFTY_DEBUG_NOW","noop","each","obj","fn","key","Object","hasOwnProperty","shallowCopy","targetObj","srcObj","prop","defaults","target","src","tweenProps","forPosition","currentState","originalState","targetState","duration","timestamp","easing","easingObjectProp","easingFn","normalizedPosition","tweenProp","start","end","easingFunc","position","applyFilter","tweenable","filterName","filters","prototype","filter","args","_filterArgs","name","apply","timeoutHandler","delay","step","schedule","opt_currentTimeOverride","Math","min","isPlaying","_attachment","stop","_scheduleId","_timeoutHandler","composeEasingObject","fromTweenParams","composedEasing","typeofEasing","opt_initialState","opt_config","_currentState","_configured","_scheduleFunction","setConfig","requestAnimationFrame","webkitRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","mozCancelRequestAnimationFrame","mozRequestAnimationFrame","setTimeout","tween","_isTweening","undefined","_timestamp","_start","get","resume","config","attachment","_pausedAtTime","_delay","_step","_finish","finish","_duration","from","_originalState","_targetState","to","_easing","set","state","pause","_isPaused","seek","millisecond","max","currentTime","gotoEnd","cancelAnimationFrame","webkitCancelAnimationFrame","oCancelAnimationFrame","msCancelAnimationFrame","clearTimeout","setScheduleFunction","scheduleFunction","dispose","linear","pos","easeInQuad","pow","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","cos","PI","easeOutSine","sin","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","sqrt","easeOutCirc","easeInOutCirc","easeOutBounce","easeInBack","easeOutBack","easeInOutBack","elastic","swingFromTo","swingFrom","swingTo","bounce","bouncePast","easeFromTo","easeFrom","easeTo","cubicBezierAtTime","p1x","p1y","p2x","p2y","ax","bx","cx","ay","by","cy","sampleCurveX","fabs","x","epsilon","t0","t1","t2","x2","d2","solveCurveX","setBezierFunction","x1","y1","y2","cubicBezierTransition","displayName","unsetBezierFunction","interpolate","opt_delay","current","easingObject","filterArgs","interpolatedValues","R_NUMBER_COMPONENT","R_FORMAT_CHUNKS","R_UNFORMATTED_VALUES","R_RGB","RegExp","source","R_RGB_PREFIX","R_HEX","VALUE_PLACEHOLDER","sanitizeObjectForHexProps","stateObject","currentProp","match","filterStringChunks","convertHexToRGB","hexString","rgbArr","hex","replace","split","hexToRGBArray_returnArray","hexToDec","substr","hexToRGBArray","parseInt","pattern","unfilteredString","pattenMatches","filteredString","currentChunk","pattenMatchesLength","shift","sanitizeRGBChunk","rgbChunk","numbers","numbersLength","sanitizedString","slice","getFormatManifests","manifestAccumulator","formattedString","chunks","rawValues","getValuesFrom","formatString","unshift","join","chunkNames","prefix","accumulator","rawValuesLength","push","getFormatChunksFrom","expandFormattedProperties","formatManifests","collapseFormattedProperties","valuesList","getValuesList_accumulator","chunkNamesLength","getValuesList","currentChunkName","extractedValues","extractPropertyChunks","formattedValueString","toFixed","getFormattedValues","token","tweenCreated","fromState","toState","_tokenData","beforeTween","tokenData","chunkLength","easingChunks","lastEasingChunk","afterTween","firstEasing","composedEasingString","2","Shape","utils","Circle","container","options","_pathTemplate","containerAspectRatio","arguments","constructor","_pathString","opts","widthOfWider","strokeWidth","trailWidth","render","radius","2radius","_trailString","./shape","./utils","3","Line","_initializeSvg","svg","setAttribute","center","4","SemiCircle","Path","./circle","./line","./path","./semicircle","5","EASING_ALIASES","easeIn","easeOut","easeInOut","path","element","extend","isString","document","querySelector","_opts","_tweenable","getTotalLength","style","strokeDasharray","value","offset","_getComputedDashOffset","parseFloat","progress","strokeDashoffset","_progressToOffset","isFunction","_calculateTo","shape","_stopTween","animate","cb","passedOpts","defaultOpts","shiftyEasing","values","_resolveFromAndTo","getBoundingClientRect","newOffset","reference","computedStyle","getComputedStyle","getPropertyValue","_calculateFrom","shifty","6","_initializeTextContainer","textContainer","text","top","bottom","alignToBottom","setStyle","7","DESTROYED_ERROR","color","trailColor","fill","left","padding","margin","transform","autoStyleContainer","className","svgStyle","display","width","isObject","svgView","_createSvgView","_container","appendChild","_warnContainerAspectRatio","setStyles","trail","newOpts","_progressPath","setText","destroy","parentNode","removeChild","newText","_createTextContainer","removeChildren","innerHTML","createElementNS","trailPath","_createTrail","_createPath","pathString","_createPathElement","createElement","textStyle","height","floatEquals","console","warn","8","PREFIXES","elStyle","capitalize","charAt","toUpperCase","toString","forEachObject","object","callback","destination","recursive","attrName","destVal","sourceVal","template","vars","rendered","val","regExp","styles","styleValue","styleName","String","b","abs","el","firstChild"],"mappings":"CAIC,SAAUA,GAAK,GAAI,iBAAmBC,SAAW,oBAAsBC,OAAQA,OAAOD,QAAUD,SAAU,GAAI,mBAAqBG,QAAUA,OAAOC,IAAKD,OAAO,GAAIH,OAAS,CAAE,IAAIK,EAAG,oBAAsBC,OAASD,EAAIC,OAAS,oBAAsBC,OAASF,EAAIE,OAAS,oBAAsBC,OAASH,EAAIG,MAAOH,EAAEI,YAAcT,KAAxU,CAAgV,WAChT,OAAO,SAAUA,EAAEU,EAAGC,EAAGC,GAAK,SAASC,EAAEC,EAAGC,GAAK,IAAKJ,EAAEG,GAAI,CAAE,IAAKJ,EAAEI,GAAI,CAAE,IAAIE,EAAsB,mBAAXC,SAAyBA,QAAS,IAAKF,GAAKC,EAAG,OAAOA,EAAEF,GAAG,GAAK,GAAII,EAAG,OAAOA,EAAEJ,GAAG,GAAK,IAAIT,EAAI,IAAIc,MAAM,uBAAyBL,EAAI,KAAM,MAAMT,EAAEe,KAAO,mBAAoBf,EAAI,IAAIgB,EAAIV,EAAEG,GAAK,CAAEb,QAAS,IAAMS,EAAEI,GAAG,GAAGQ,KAAKD,EAAEpB,QAAS,SAAUD,GAAK,IAAIW,EAAID,EAAEI,GA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J,GAsGP3H,OA9FJ,SAAgBgI,EAAUC,GACtB,IAAIC,EAAWF,EAEf,IAAK,IAAI/Y,KAAOgZ,EACZ,GAAIA,EAAK9Y,eAAeF,GAAM,CAC1B,IAAIkZ,EAAMF,EAAKhZ,GAEXmZ,EAAS,IAAI9N,OADE,MAAQrL,EAAM,MACK,KAEtCiZ,EAAWA,EAAS9M,QAAQgN,EAAQD,GAI5C,OAAOD,GAkFP9D,SAAUA,EACVqB,UArEJ,SAAmBhE,EAAS4G,GACxBb,EAAca,EAAQ,SAAUC,EAAYC,GAGpCD,MAAAA,IAMAnD,EAASmD,KAAqC,IAAtBA,EAAWpL,OACnCkH,EAAS3C,EAAS8G,EAAWD,EAAWnG,OAExCV,EAAQQ,MAAMsG,GAAaD,MAyDnClB,WAAYA,EACZzF,SAjDJ,SAAkB5S,GACd,MAAsB,iBAARA,GAAoBA,aAAeyZ,QAiDjD9F,WA9CJ,SAAoB3T,GAChB,MAAsB,mBAARA,GA8CdoW,SAAUA,EACVqC,cAAeA,EACfV,YArBJ,SAAqB1Z,EAAGqb,GACpB,OAAO/W,KAAKgX,IAAItb,EAAIqb,GA/GO,MAoI3BtC,eAjBJ,SAAwBwC,GACpB,KAAOA,EAAGC,YACND,EAAG3C,YAAY2C,EAAGC,eAkB3B,KACJ,GAAI,CAAC,GAt3E4B,CAs3ExB","file":"progressBar.min.js","sourcesContent":["// ProgressBar.js 1.0.0\r\n// https://kimmobrunfeldt.github.io/progressbar.js\r\n// License: MIT\r\n\r\n!function (e) { if (\"object\" == typeof exports && \"undefined\" != typeof module) module.exports = e(); else if (\"function\" == typeof define && define.amd) define([], e); else { var f; \"undefined\" != typeof window ? f = window : \"undefined\" != typeof global ? f = global : \"undefined\" != typeof self && (f = self), f.ProgressBar = e() } }(function () {\r\n var define, module, exports; return (function e(t, n, r) { function s(o, u) { if (!n[o]) { if (!t[o]) { var a = typeof require == \"function\" && require; if (!u && a) return a(o, !0); if (i) return i(o, !0); var f = new Error(\"Cannot find module '\" + o + \"'\"); throw f.code = \"MODULE_NOT_FOUND\", f } var l = n[o] = { exports: {} }; t[o][0].call(l.exports, function (e) { var n = t[o][1][e]; return s(n ? n : e) }, l, l.exports, e, t, n, r) } return n[o].exports } var i = typeof require == \"function\" && require; for (var o = 0; o < r.length; o++) s(r[o]); return s })({\r\n 1: [function (require, module, exports) {\r\n /* shifty - v1.5.2 - 2016-02-10 - http://jeremyckahn.github.io/shifty */\r\n ; (function () {\r\n var root = this || Function('return this')();\r\n\r\n /**\r\n * Shifty Core\r\n * By Jeremy Kahn - jeremyckahn@gmail.com\r\n */\r\n\r\n var Tweenable = (function () {\r\n\r\n 'use strict';\r\n\r\n // Aliases that get defined later in this function\r\n var formula;\r\n\r\n // CONSTANTS\r\n var DEFAULT_SCHEDULE_FUNCTION;\r\n var DEFAULT_EASING = 'linear';\r\n var DEFAULT_DURATION = 500;\r\n var UPDATE_TIME = 1000 / 60;\r\n\r\n var _now = Date.now\r\n ? Date.now\r\n : function () { return +new Date(); };\r\n\r\n var now = typeof SHIFTY_DEBUG_NOW !== 'undefined' ? SHIFTY_DEBUG_NOW : _now;\r\n\r\n if (typeof window !== 'undefined') {\r\n // requestAnimationFrame() shim by Paul Irish (modified for Shifty)\r\n // http://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n DEFAULT_SCHEDULE_FUNCTION = window.requestAnimationFrame\r\n || window.webkitRequestAnimationFrame\r\n || window.oRequestAnimationFrame\r\n || window.msRequestAnimationFrame\r\n || (window.mozCancelRequestAnimationFrame\r\n && window.mozRequestAnimationFrame)\r\n || setTimeout;\r\n } else {\r\n DEFAULT_SCHEDULE_FUNCTION = setTimeout;\r\n }\r\n\r\n function noop() {\r\n // NOOP!\r\n }\r\n\r\n /**\r\n * Handy shortcut for doing a for-in loop. This is not a \"normal\" each\r\n * function, it is optimized for Shifty. The iterator function only receives\r\n * the property name, not the value.\r\n * @param {Object} obj\r\n * @param {Function(string)} fn\r\n * @private\r\n */\r\n function each(obj, fn) {\r\n var key;\r\n for (key in obj) {\r\n if (Object.hasOwnProperty.call(obj, key)) {\r\n fn(key);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Perform a shallow copy of Object properties.\r\n * @param {Object} targetObject The object to copy into\r\n * @param {Object} srcObject The object to copy from\r\n * @return {Object} A reference to the augmented `targetObj` Object\r\n * @private\r\n */\r\n function shallowCopy(targetObj, srcObj) {\r\n each(srcObj, function (prop) {\r\n targetObj[prop] = srcObj[prop];\r\n });\r\n\r\n return targetObj;\r\n }\r\n\r\n /**\r\n * Copies each property from src onto target, but only if the property to\r\n * copy to target is undefined.\r\n * @param {Object} target Missing properties in this Object are filled in\r\n * @param {Object} src\r\n * @private\r\n */\r\n function defaults(target, src) {\r\n each(src, function (prop) {\r\n if (typeof target[prop] === 'undefined') {\r\n target[prop] = src[prop];\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Calculates the interpolated tween values of an Object for a given\r\n * timestamp.\r\n * @param {Number} forPosition The position to compute the state for.\r\n * @param {Object} currentState Current state properties.\r\n * @param {Object} originalState: The original state properties the Object is\r\n * tweening from.\r\n * @param {Object} targetState: The destination state properties the Object\r\n * is tweening to.\r\n * @param {number} duration: The length of the tween in milliseconds.\r\n * @param {number} timestamp: The UNIX epoch time at which the tween began.\r\n * @param {Object} easing: This Object's keys must correspond to the keys in\r\n * targetState.\r\n * @private\r\n */\r\n function tweenProps(forPosition, currentState, originalState, targetState,\r\n duration, timestamp, easing) {\r\n var normalizedPosition =\r\n forPosition < timestamp ? 0 : (forPosition - timestamp) / duration;\r\n\r\n\r\n var prop;\r\n var easingObjectProp;\r\n var easingFn;\r\n for (prop in currentState) {\r\n if (currentState.hasOwnProperty(prop)) {\r\n easingObjectProp = easing[prop];\r\n easingFn = typeof easingObjectProp === 'function'\r\n ? easingObjectProp\r\n : formula[easingObjectProp];\r\n\r\n currentState[prop] = tweenProp(\r\n originalState[prop],\r\n targetState[prop],\r\n easingFn,\r\n normalizedPosition\r\n );\r\n }\r\n }\r\n\r\n return currentState;\r\n }\r\n\r\n /**\r\n * Tweens a single property.\r\n * @param {number} start The value that the tween started from.\r\n * @param {number} end The value that the tween should end at.\r\n * @param {Function} easingFunc The easing curve to apply to the tween.\r\n * @param {number} position The normalized position (between 0.0 and 1.0) to\r\n * calculate the midpoint of 'start' and 'end' against.\r\n * @return {number} The tweened value.\r\n * @private\r\n */\r\n function tweenProp(start, end, easingFunc, position) {\r\n return start + (end - start) * easingFunc(position);\r\n }\r\n\r\n /**\r\n * Applies a filter to Tweenable instance.\r\n * @param {Tweenable} tweenable The `Tweenable` instance to call the filter\r\n * upon.\r\n * @param {String} filterName The name of the filter to apply.\r\n * @private\r\n */\r\n function applyFilter(tweenable, filterName) {\r\n var filters = Tweenable.prototype.filter;\r\n var args = tweenable._filterArgs;\r\n\r\n each(filters, function (name) {\r\n if (typeof filters[name][filterName] !== 'undefined') {\r\n filters[name][filterName].apply(tweenable, args);\r\n }\r\n });\r\n }\r\n\r\n var timeoutHandler_endTime;\r\n var timeoutHandler_currentTime;\r\n var timeoutHandler_isEnded;\r\n var timeoutHandler_offset;\r\n /**\r\n * Handles the update logic for one step of a tween.\r\n * @param {Tweenable} tweenable\r\n * @param {number} timestamp\r\n * @param {number} delay\r\n * @param {number} duration\r\n * @param {Object} currentState\r\n * @param {Object} originalState\r\n * @param {Object} targetState\r\n * @param {Object} easing\r\n * @param {Function(Object, *, number)} step\r\n * @param {Function(Function,number)}} schedule\r\n * @param {number=} opt_currentTimeOverride Needed for accurate timestamp in\r\n * Tweenable#seek.\r\n * @private\r\n */\r\n function timeoutHandler(tweenable, timestamp, delay, duration, currentState,\r\n originalState, targetState, easing, step, schedule,\r\n opt_currentTimeOverride) {\r\n\r\n timeoutHandler_endTime = timestamp + delay + duration;\r\n\r\n timeoutHandler_currentTime =\r\n Math.min(opt_currentTimeOverride || now(), timeoutHandler_endTime);\r\n\r\n timeoutHandler_isEnded =\r\n timeoutHandler_currentTime >= timeoutHandler_endTime;\r\n\r\n timeoutHandler_offset = duration - (\r\n timeoutHandler_endTime - timeoutHandler_currentTime);\r\n\r\n if (tweenable.isPlaying()) {\r\n if (timeoutHandler_isEnded) {\r\n step(targetState, tweenable._attachment, timeoutHandler_offset);\r\n tweenable.stop(true);\r\n } else {\r\n tweenable._scheduleId =\r\n schedule(tweenable._timeoutHandler, UPDATE_TIME);\r\n\r\n applyFilter(tweenable, 'beforeTween');\r\n\r\n // If the animation has not yet reached the start point (e.g., there was\r\n // delay that has not yet completed), just interpolate the starting\r\n // position of the tween.\r\n if (timeoutHandler_currentTime < (timestamp + delay)) {\r\n tweenProps(1, currentState, originalState, targetState, 1, 1, easing);\r\n } else {\r\n tweenProps(timeoutHandler_currentTime, currentState, originalState,\r\n targetState, duration, timestamp + delay, easing);\r\n }\r\n\r\n applyFilter(tweenable, 'afterTween');\r\n\r\n step(currentState, tweenable._attachment, timeoutHandler_offset);\r\n }\r\n }\r\n }\r\n\r\n\r\n /**\r\n * Creates a usable easing Object from a string, a function or another easing\r\n * Object. If `easing` is an Object, then this function clones it and fills\r\n * in the missing properties with `\"linear\"`.\r\n * @param {Object.} fromTweenParams\r\n * @param {Object|string|Function} easing\r\n * @return {Object.}\r\n * @private\r\n */\r\n function composeEasingObject(fromTweenParams, easing) {\r\n var composedEasing = {};\r\n var typeofEasing = typeof easing;\r\n\r\n if (typeofEasing === 'string' || typeofEasing === 'function') {\r\n each(fromTweenParams, function (prop) {\r\n composedEasing[prop] = easing;\r\n });\r\n } else {\r\n each(fromTweenParams, function (prop) {\r\n if (!composedEasing[prop]) {\r\n composedEasing[prop] = easing[prop] || DEFAULT_EASING;\r\n }\r\n });\r\n }\r\n\r\n return composedEasing;\r\n }\r\n\r\n /**\r\n * Tweenable constructor.\r\n * @class Tweenable\r\n * @param {Object=} opt_initialState The values that the initial tween should\r\n * start at if a `from` object is not provided to `{{#crossLink\r\n * \"Tweenable/tween:method\"}}{{/crossLink}}` or `{{#crossLink\r\n * \"Tweenable/setConfig:method\"}}{{/crossLink}}`.\r\n * @param {Object=} opt_config Configuration object to be passed to\r\n * `{{#crossLink \"Tweenable/setConfig:method\"}}{{/crossLink}}`.\r\n * @module Tweenable\r\n * @constructor\r\n */\r\n function Tweenable(opt_initialState, opt_config) {\r\n this._currentState = opt_initialState || {};\r\n this._configured = false;\r\n this._scheduleFunction = DEFAULT_SCHEDULE_FUNCTION;\r\n\r\n // To prevent unnecessary calls to setConfig do not set default\r\n // configuration here. Only set default configuration immediately before\r\n // tweening if none has been set.\r\n if (typeof opt_config !== 'undefined') {\r\n this.setConfig(opt_config);\r\n }\r\n }\r\n\r\n /**\r\n * Configure and start a tween.\r\n * @method tween\r\n * @param {Object=} opt_config Configuration object to be passed to\r\n * `{{#crossLink \"Tweenable/setConfig:method\"}}{{/crossLink}}`.\r\n * @chainable\r\n */\r\n Tweenable.prototype.tween = function (opt_config) {\r\n if (this._isTweening) {\r\n return this;\r\n }\r\n\r\n // Only set default config if no configuration has been set previously and\r\n // none is provided now.\r\n if (opt_config !== undefined || !this._configured) {\r\n this.setConfig(opt_config);\r\n }\r\n\r\n this._timestamp = now();\r\n this._start(this.get(), this._attachment);\r\n return this.resume();\r\n };\r\n\r\n /**\r\n * Configure a tween that will start at some point in the future.\r\n *\r\n * @method setConfig\r\n * @param {Object} config The following values are valid:\r\n * - __from__ (_Object=_): Starting position. If omitted, `{{#crossLink\r\n * \"Tweenable/get:method\"}}get(){{/crossLink}}` is used.\r\n * - __to__ (_Object=_): Ending position.\r\n * - __duration__ (_number=_): How many milliseconds to animate for.\r\n * - __delay__ (_delay=_): How many milliseconds to wait before starting the\r\n * tween.\r\n * - __start__ (_Function(Object, *)_): Function to execute when the tween\r\n * begins. Receives the state of the tween as the first parameter and\r\n * `attachment` as the second parameter.\r\n * - __step__ (_Function(Object, *, number)_): Function to execute on every\r\n * tick. Receives `{{#crossLink\r\n * \"Tweenable/get:method\"}}get(){{/crossLink}}` as the first parameter,\r\n * `attachment` as the second parameter, and the time elapsed since the\r\n * start of the tween as the third. This function is not called on the\r\n * final step of the animation, but `finish` is.\r\n * - __finish__ (_Function(Object, *)_): Function to execute upon tween\r\n * completion. Receives the state of the tween as the first parameter and\r\n * `attachment` as the second parameter.\r\n * - __easing__ (_Object.|string|Function=_): Easing curve\r\n * name(s) or function(s) to use for the tween.\r\n * - __attachment__ (_*_): Cached value that is passed to the\r\n * `step`/`start`/`finish` methods.\r\n * @chainable\r\n */\r\n Tweenable.prototype.setConfig = function (config) {\r\n config = config || {};\r\n this._configured = true;\r\n\r\n // Attach something to this Tweenable instance (e.g.: a DOM element, an\r\n // object, a string, etc.);\r\n this._attachment = config.attachment;\r\n\r\n // Init the internal state\r\n this._pausedAtTime = null;\r\n this._scheduleId = null;\r\n this._delay = config.delay || 0;\r\n this._start = config.start || noop;\r\n this._step = config.step || noop;\r\n this._finish = config.finish || noop;\r\n this._duration = config.duration || DEFAULT_DURATION;\r\n this._currentState = shallowCopy({}, config.from) || this.get();\r\n this._originalState = this.get();\r\n this._targetState = shallowCopy({}, config.to) || this.get();\r\n\r\n var self = this;\r\n this._timeoutHandler = function () {\r\n timeoutHandler(self,\r\n self._timestamp,\r\n self._delay,\r\n self._duration,\r\n self._currentState,\r\n self._originalState,\r\n self._targetState,\r\n self._easing,\r\n self._step,\r\n self._scheduleFunction\r\n );\r\n };\r\n\r\n // Aliases used below\r\n var currentState = this._currentState;\r\n var targetState = this._targetState;\r\n\r\n // Ensure that there is always something to tween to.\r\n defaults(targetState, currentState);\r\n\r\n this._easing = composeEasingObject(\r\n currentState, config.easing || DEFAULT_EASING);\r\n\r\n this._filterArgs =\r\n [currentState, this._originalState, targetState, this._easing];\r\n\r\n applyFilter(this, 'tweenCreated');\r\n return this;\r\n };\r\n\r\n /**\r\n * @method get\r\n * @return {Object} The current state.\r\n */\r\n Tweenable.prototype.get = function () {\r\n return shallowCopy({}, this._currentState);\r\n };\r\n\r\n /**\r\n * @method set\r\n * @param {Object} state The current state.\r\n */\r\n Tweenable.prototype.set = function (state) {\r\n this._currentState = state;\r\n };\r\n\r\n /**\r\n * Pause a tween. Paused tweens can be resumed from the point at which they\r\n * were paused. This is different from `{{#crossLink\r\n * \"Tweenable/stop:method\"}}{{/crossLink}}`, as that method\r\n * causes a tween to start over when it is resumed.\r\n * @method pause\r\n * @chainable\r\n */\r\n Tweenable.prototype.pause = function () {\r\n this._pausedAtTime = now();\r\n this._isPaused = true;\r\n return this;\r\n };\r\n\r\n /**\r\n * Resume a paused tween.\r\n * @method resume\r\n * @chainable\r\n */\r\n Tweenable.prototype.resume = function () {\r\n if (this._isPaused) {\r\n this._timestamp += now() - this._pausedAtTime;\r\n }\r\n\r\n this._isPaused = false;\r\n this._isTweening = true;\r\n\r\n this._timeoutHandler();\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * Move the state of the animation to a specific point in the tween's\r\n * timeline. If the animation is not running, this will cause the `step`\r\n * handlers to be called.\r\n * @method seek\r\n * @param {millisecond} millisecond The millisecond of the animation to seek\r\n * to. This must not be less than `0`.\r\n * @chainable\r\n */\r\n Tweenable.prototype.seek = function (millisecond) {\r\n millisecond = Math.max(millisecond, 0);\r\n var currentTime = now();\r\n\r\n if ((this._timestamp + millisecond) === 0) {\r\n return this;\r\n }\r\n\r\n this._timestamp = currentTime - millisecond;\r\n\r\n if (!this.isPlaying()) {\r\n this._isTweening = true;\r\n this._isPaused = false;\r\n\r\n // If the animation is not running, call timeoutHandler to make sure that\r\n // any step handlers are run.\r\n timeoutHandler(this,\r\n this._timestamp,\r\n this._delay,\r\n this._duration,\r\n this._currentState,\r\n this._originalState,\r\n this._targetState,\r\n this._easing,\r\n this._step,\r\n this._scheduleFunction,\r\n currentTime\r\n );\r\n\r\n this.pause();\r\n }\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * Stops and cancels a tween.\r\n * @param {boolean=} gotoEnd If `false` or omitted, the tween just stops at\r\n * its current state, and the `finish` handler is not invoked. If `true`,\r\n * the tweened object's values are instantly set to the target values, and\r\n * `finish` is invoked.\r\n * @method stop\r\n * @chainable\r\n */\r\n Tweenable.prototype.stop = function (gotoEnd) {\r\n this._isTweening = false;\r\n this._isPaused = false;\r\n this._timeoutHandler = noop;\r\n\r\n (root.cancelAnimationFrame ||\r\n root.webkitCancelAnimationFrame ||\r\n root.oCancelAnimationFrame ||\r\n root.msCancelAnimationFrame ||\r\n root.mozCancelRequestAnimationFrame ||\r\n root.clearTimeout)(this._scheduleId);\r\n\r\n if (gotoEnd) {\r\n applyFilter(this, 'beforeTween');\r\n tweenProps(\r\n 1,\r\n this._currentState,\r\n this._originalState,\r\n this._targetState,\r\n 1,\r\n 0,\r\n this._easing\r\n );\r\n applyFilter(this, 'afterTween');\r\n applyFilter(this, 'afterTweenEnd');\r\n this._finish.call(this, this._currentState, this._attachment);\r\n }\r\n\r\n return this;\r\n };\r\n\r\n /**\r\n * @method isPlaying\r\n * @return {boolean} Whether or not a tween is running.\r\n */\r\n Tweenable.prototype.isPlaying = function () {\r\n return this._isTweening && !this._isPaused;\r\n };\r\n\r\n /**\r\n * Set a custom schedule function.\r\n *\r\n * If a custom function is not set,\r\n * [`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame)\r\n * is used if available, otherwise\r\n * [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/Window.setTimeout)\r\n * is used.\r\n * @method setScheduleFunction\r\n * @param {Function(Function,number)} scheduleFunction The function to be\r\n * used to schedule the next frame to be rendered.\r\n */\r\n Tweenable.prototype.setScheduleFunction = function (scheduleFunction) {\r\n this._scheduleFunction = scheduleFunction;\r\n };\r\n\r\n /**\r\n * `delete` all \"own\" properties. Call this when the `Tweenable` instance\r\n * is no longer needed to free memory.\r\n * @method dispose\r\n */\r\n Tweenable.prototype.dispose = function () {\r\n var prop;\r\n for (prop in this) {\r\n if (this.hasOwnProperty(prop)) {\r\n delete this[prop];\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Filters are used for transforming the properties of a tween at various\r\n * points in a Tweenable's life cycle. See the README for more info on this.\r\n * @private\r\n */\r\n Tweenable.prototype.filter = {};\r\n\r\n /**\r\n * This object contains all of the tweens available to Shifty. It is\r\n * extensible - simply attach properties to the `Tweenable.prototype.formula`\r\n * Object following the same format as `linear`.\r\n *\r\n * `pos` should be a normalized `number` (between 0 and 1).\r\n * @property formula\r\n * @type {Object(function)}\r\n */\r\n Tweenable.prototype.formula = {\r\n linear: function (pos) {\r\n return pos;\r\n }\r\n };\r\n\r\n formula = Tweenable.prototype.formula;\r\n\r\n shallowCopy(Tweenable, {\r\n 'now': now\r\n , 'each': each\r\n , 'tweenProps': tweenProps\r\n , 'tweenProp': tweenProp\r\n , 'applyFilter': applyFilter\r\n , 'shallowCopy': shallowCopy\r\n , 'defaults': defaults\r\n , 'composeEasingObject': composeEasingObject\r\n });\r\n\r\n // `root` is provided in the intro/outro files.\r\n\r\n // A hook used for unit testing.\r\n if (typeof SHIFTY_DEBUG_NOW === 'function') {\r\n root.timeoutHandler = timeoutHandler;\r\n }\r\n\r\n // Bootstrap Tweenable appropriately for the environment.\r\n if (typeof exports === 'object') {\r\n // CommonJS\r\n module.exports = Tweenable;\r\n } else if (typeof define === 'function' && define.amd) {\r\n // AMD\r\n define(function () { return Tweenable; });\r\n } else if (typeof root.Tweenable === 'undefined') {\r\n // Browser: Make `Tweenable` globally accessible.\r\n root.Tweenable = Tweenable;\r\n }\r\n\r\n return Tweenable;\r\n\r\n }());\r\n\r\n /*!\r\n * All equations are adapted from Thomas Fuchs'\r\n * [Scripty2](https://github.com/madrobby/scripty2/blob/master/src/effects/transitions/penner.js).\r\n *\r\n * Based on Easing Equations (c) 2003 [Robert\r\n * Penner](http://www.robertpenner.com/), all rights reserved. This work is\r\n * [subject to terms](http://www.robertpenner.com/easing_terms_of_use.html).\r\n */\r\n\r\n /*!\r\n * TERMS OF USE - EASING EQUATIONS\r\n * Open source under the BSD License.\r\n * Easing Equations (c) 2003 Robert Penner, all rights reserved.\r\n */\r\n\r\n ; (function () {\r\n\r\n Tweenable.shallowCopy(Tweenable.prototype.formula, {\r\n easeInQuad: function (pos) {\r\n return Math.pow(pos, 2);\r\n },\r\n\r\n easeOutQuad: function (pos) {\r\n return -(Math.pow((pos - 1), 2) - 1);\r\n },\r\n\r\n easeInOutQuad: function (pos) {\r\n if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 2); }\r\n return -0.5 * ((pos -= 2) * pos - 2);\r\n },\r\n\r\n easeInCubic: function (pos) {\r\n return Math.pow(pos, 3);\r\n },\r\n\r\n easeOutCubic: function (pos) {\r\n return (Math.pow((pos - 1), 3) + 1);\r\n },\r\n\r\n easeInOutCubic: function (pos) {\r\n if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 3); }\r\n return 0.5 * (Math.pow((pos - 2), 3) + 2);\r\n },\r\n\r\n easeInQuart: function (pos) {\r\n return Math.pow(pos, 4);\r\n },\r\n\r\n easeOutQuart: function (pos) {\r\n return -(Math.pow((pos - 1), 4) - 1);\r\n },\r\n\r\n easeInOutQuart: function (pos) {\r\n if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 4); }\r\n return -0.5 * ((pos -= 2) * Math.pow(pos, 3) - 2);\r\n },\r\n\r\n easeInQuint: function (pos) {\r\n return Math.pow(pos, 5);\r\n },\r\n\r\n easeOutQuint: function (pos) {\r\n return (Math.pow((pos - 1), 5) + 1);\r\n },\r\n\r\n easeInOutQuint: function (pos) {\r\n if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 5); }\r\n return 0.5 * (Math.pow((pos - 2), 5) + 2);\r\n },\r\n\r\n easeInSine: function (pos) {\r\n return -Math.cos(pos * (Math.PI / 2)) + 1;\r\n },\r\n\r\n easeOutSine: function (pos) {\r\n return Math.sin(pos * (Math.PI / 2));\r\n },\r\n\r\n easeInOutSine: function (pos) {\r\n return (-0.5 * (Math.cos(Math.PI * pos) - 1));\r\n },\r\n\r\n easeInExpo: function (pos) {\r\n return (pos === 0) ? 0 : Math.pow(2, 10 * (pos - 1));\r\n },\r\n\r\n easeOutExpo: function (pos) {\r\n return (pos === 1) ? 1 : -Math.pow(2, -10 * pos) + 1;\r\n },\r\n\r\n easeInOutExpo: function (pos) {\r\n if (pos === 0) { return 0; }\r\n if (pos === 1) { return 1; }\r\n if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(2, 10 * (pos - 1)); }\r\n return 0.5 * (-Math.pow(2, -10 * --pos) + 2);\r\n },\r\n\r\n easeInCirc: function (pos) {\r\n return -(Math.sqrt(1 - (pos * pos)) - 1);\r\n },\r\n\r\n easeOutCirc: function (pos) {\r\n return Math.sqrt(1 - Math.pow((pos - 1), 2));\r\n },\r\n\r\n easeInOutCirc: function (pos) {\r\n if ((pos /= 0.5) < 1) { return -0.5 * (Math.sqrt(1 - pos * pos) - 1); }\r\n return 0.5 * (Math.sqrt(1 - (pos -= 2) * pos) + 1);\r\n },\r\n\r\n easeOutBounce: function (pos) {\r\n if ((pos) < (1 / 2.75)) {\r\n return (7.5625 * pos * pos);\r\n } else if (pos < (2 / 2.75)) {\r\n return (7.5625 * (pos -= (1.5 / 2.75)) * pos + 0.75);\r\n } else if (pos < (2.5 / 2.75)) {\r\n return (7.5625 * (pos -= (2.25 / 2.75)) * pos + 0.9375);\r\n } else {\r\n return (7.5625 * (pos -= (2.625 / 2.75)) * pos + 0.984375);\r\n }\r\n },\r\n\r\n easeInBack: function (pos) {\r\n var s = 1.70158;\r\n return (pos) * pos * ((s + 1) * pos - s);\r\n },\r\n\r\n easeOutBack: function (pos) {\r\n var s = 1.70158;\r\n return (pos = pos - 1) * pos * ((s + 1) * pos + s) + 1;\r\n },\r\n\r\n easeInOutBack: function (pos) {\r\n var s = 1.70158;\r\n if ((pos /= 0.5) < 1) {\r\n return 0.5 * (pos * pos * (((s *= (1.525)) + 1) * pos - s));\r\n }\r\n return 0.5 * ((pos -= 2) * pos * (((s *= (1.525)) + 1) * pos + s) + 2);\r\n },\r\n\r\n elastic: function (pos) {\r\n // jshint maxlen:90\r\n return -1 * Math.pow(4, -8 * pos) * Math.sin((pos * 6 - 1) * (2 * Math.PI) / 2) + 1;\r\n },\r\n\r\n swingFromTo: function (pos) {\r\n var s = 1.70158;\r\n return ((pos /= 0.5) < 1) ?\r\n 0.5 * (pos * pos * (((s *= (1.525)) + 1) * pos - s)) :\r\n 0.5 * ((pos -= 2) * pos * (((s *= (1.525)) + 1) * pos + s) + 2);\r\n },\r\n\r\n swingFrom: function (pos) {\r\n var s = 1.70158;\r\n return pos * pos * ((s + 1) * pos - s);\r\n },\r\n\r\n swingTo: function (pos) {\r\n var s = 1.70158;\r\n return (pos -= 1) * pos * ((s + 1) * pos + s) + 1;\r\n },\r\n\r\n bounce: function (pos) {\r\n if (pos < (1 / 2.75)) {\r\n return (7.5625 * pos * pos);\r\n } else if (pos < (2 / 2.75)) {\r\n return (7.5625 * (pos -= (1.5 / 2.75)) * pos + 0.75);\r\n } else if (pos < (2.5 / 2.75)) {\r\n return (7.5625 * (pos -= (2.25 / 2.75)) * pos + 0.9375);\r\n } else {\r\n return (7.5625 * (pos -= (2.625 / 2.75)) * pos + 0.984375);\r\n }\r\n },\r\n\r\n bouncePast: function (pos) {\r\n if (pos < (1 / 2.75)) {\r\n return (7.5625 * pos * pos);\r\n } else if (pos < (2 / 2.75)) {\r\n return 2 - (7.5625 * (pos -= (1.5 / 2.75)) * pos + 0.75);\r\n } else if (pos < (2.5 / 2.75)) {\r\n return 2 - (7.5625 * (pos -= (2.25 / 2.75)) * pos + 0.9375);\r\n } else {\r\n return 2 - (7.5625 * (pos -= (2.625 / 2.75)) * pos + 0.984375);\r\n }\r\n },\r\n\r\n easeFromTo: function (pos) {\r\n if ((pos /= 0.5) < 1) { return 0.5 * Math.pow(pos, 4); }\r\n return -0.5 * ((pos -= 2) * Math.pow(pos, 3) - 2);\r\n },\r\n\r\n easeFrom: function (pos) {\r\n return Math.pow(pos, 4);\r\n },\r\n\r\n easeTo: function (pos) {\r\n return Math.pow(pos, 0.25);\r\n }\r\n });\r\n\r\n }());\r\n\r\n // jshint maxlen:100\r\n /**\r\n * The Bezier magic in this file is adapted/copied almost wholesale from\r\n * [Scripty2](https://github.com/madrobby/scripty2/blob/master/src/effects/transitions/cubic-bezier.js),\r\n * which was adapted from Apple code (which probably came from\r\n * [here](http://opensource.apple.com/source/WebCore/WebCore-955.66/platform/graphics/UnitBezier.h)).\r\n * Special thanks to Apple and Thomas Fuchs for much of this code.\r\n */\r\n\r\n /**\r\n * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder(s) nor the names of any\r\n * contributors may be used to endorse or promote products derived from\r\n * this software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n */\r\n ; (function () {\r\n // port of webkit cubic bezier handling by http://www.netzgesta.de/dev/\r\n function cubicBezierAtTime(t, p1x, p1y, p2x, p2y, duration) {\r\n var ax = 0, bx = 0, cx = 0, ay = 0, by = 0, cy = 0;\r\n function sampleCurveX(t) {\r\n return ((ax * t + bx) * t + cx) * t;\r\n }\r\n function sampleCurveY(t) {\r\n return ((ay * t + by) * t + cy) * t;\r\n }\r\n function sampleCurveDerivativeX(t) {\r\n return (3.0 * ax * t + 2.0 * bx) * t + cx;\r\n }\r\n function solveEpsilon(duration) {\r\n return 1.0 / (200.0 * duration);\r\n }\r\n function solve(x, epsilon) {\r\n return sampleCurveY(solveCurveX(x, epsilon));\r\n }\r\n function fabs(n) {\r\n if (n >= 0) {\r\n return n;\r\n } else {\r\n return 0 - n;\r\n }\r\n }\r\n function solveCurveX(x, epsilon) {\r\n var t0, t1, t2, x2, d2, i;\r\n for (t2 = x, i = 0; i < 8; i++) {\r\n x2 = sampleCurveX(t2) - x;\r\n if (fabs(x2) < epsilon) {\r\n return t2;\r\n }\r\n d2 = sampleCurveDerivativeX(t2);\r\n if (fabs(d2) < 1e-6) {\r\n break;\r\n }\r\n t2 = t2 - x2 / d2;\r\n }\r\n t0 = 0.0;\r\n t1 = 1.0;\r\n t2 = x;\r\n if (t2 < t0) {\r\n return t0;\r\n }\r\n if (t2 > t1) {\r\n return t1;\r\n }\r\n while (t0 < t1) {\r\n x2 = sampleCurveX(t2);\r\n if (fabs(x2 - x) < epsilon) {\r\n return t2;\r\n }\r\n if (x > x2) {\r\n t0 = t2;\r\n } else {\r\n t1 = t2;\r\n }\r\n t2 = (t1 - t0) * 0.5 + t0;\r\n }\r\n return t2; // Failure.\r\n }\r\n cx = 3.0 * p1x;\r\n bx = 3.0 * (p2x - p1x) - cx;\r\n ax = 1.0 - cx - bx;\r\n cy = 3.0 * p1y;\r\n by = 3.0 * (p2y - p1y) - cy;\r\n ay = 1.0 - cy - by;\r\n return solve(t, solveEpsilon(duration));\r\n }\r\n /**\r\n * getCubicBezierTransition(x1, y1, x2, y2) -> Function\r\n *\r\n * Generates a transition easing function that is compatible\r\n * with WebKit's CSS transitions `-webkit-transition-timing-function`\r\n * CSS property.\r\n *\r\n * The W3C has more information about CSS3 transition timing functions:\r\n * http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag\r\n *\r\n * @param {number} x1\r\n * @param {number} y1\r\n * @param {number} x2\r\n * @param {number} y2\r\n * @return {function}\r\n * @private\r\n */\r\n function getCubicBezierTransition(x1, y1, x2, y2) {\r\n return function (pos) {\r\n return cubicBezierAtTime(pos, x1, y1, x2, y2, 1);\r\n };\r\n }\r\n // End ported code\r\n\r\n /**\r\n * Create a Bezier easing function and attach it to `{{#crossLink\r\n * \"Tweenable/formula:property\"}}Tweenable#formula{{/crossLink}}`. This\r\n * function gives you total control over the easing curve. Matthew Lein's\r\n * [Ceaser](http://matthewlein.com/ceaser/) is a useful tool for visualizing\r\n * the curves you can make with this function.\r\n * @method setBezierFunction\r\n * @param {string} name The name of the easing curve. Overwrites the old\r\n * easing function on `{{#crossLink\r\n * \"Tweenable/formula:property\"}}Tweenable#formula{{/crossLink}}` if it\r\n * exists.\r\n * @param {number} x1\r\n * @param {number} y1\r\n * @param {number} x2\r\n * @param {number} y2\r\n * @return {function} The easing function that was attached to\r\n * Tweenable.prototype.formula.\r\n */\r\n Tweenable.setBezierFunction = function (name, x1, y1, x2, y2) {\r\n var cubicBezierTransition = getCubicBezierTransition(x1, y1, x2, y2);\r\n cubicBezierTransition.displayName = name;\r\n cubicBezierTransition.x1 = x1;\r\n cubicBezierTransition.y1 = y1;\r\n cubicBezierTransition.x2 = x2;\r\n cubicBezierTransition.y2 = y2;\r\n\r\n return Tweenable.prototype.formula[name] = cubicBezierTransition;\r\n };\r\n\r\n\r\n /**\r\n * `delete` an easing function from `{{#crossLink\r\n * \"Tweenable/formula:property\"}}Tweenable#formula{{/crossLink}}`. Be\r\n * careful with this method, as it `delete`s whatever easing formula matches\r\n * `name` (which means you can delete standard Shifty easing functions).\r\n * @method unsetBezierFunction\r\n * @param {string} name The name of the easing function to delete.\r\n * @return {function}\r\n */\r\n Tweenable.unsetBezierFunction = function (name) {\r\n delete Tweenable.prototype.formula[name];\r\n };\r\n\r\n })();\r\n\r\n ; (function () {\r\n\r\n function getInterpolatedValues(\r\n from, current, targetState, position, easing, delay) {\r\n return Tweenable.tweenProps(\r\n position, current, from, targetState, 1, delay, easing);\r\n }\r\n\r\n // Fake a Tweenable and patch some internals. This approach allows us to\r\n // skip uneccessary processing and object recreation, cutting down on garbage\r\n // collection pauses.\r\n var mockTweenable = new Tweenable();\r\n mockTweenable._filterArgs = [];\r\n\r\n /**\r\n * Compute the midpoint of two Objects. This method effectively calculates a\r\n * specific frame of animation that `{{#crossLink\r\n * \"Tweenable/tween:method\"}}{{/crossLink}}` does many times over the course\r\n * of a full tween.\r\n *\r\n * var interpolatedValues = Tweenable.interpolate({\r\n * width: '100px',\r\n * opacity: 0,\r\n * color: '#fff'\r\n * }, {\r\n * width: '200px',\r\n * opacity: 1,\r\n * color: '#000'\r\n * }, 0.5);\r\n *\r\n * console.log(interpolatedValues);\r\n * // {opacity: 0.5, width: \"150px\", color: \"rgb(127,127,127)\"}\r\n *\r\n * @static\r\n * @method interpolate\r\n * @param {Object} from The starting values to tween from.\r\n * @param {Object} targetState The ending values to tween to.\r\n * @param {number} position The normalized position value (between `0.0` and\r\n * `1.0`) to interpolate the values between `from` and `to` for. `from`\r\n * represents `0` and `to` represents `1`.\r\n * @param {Object.|string|Function} easing The easing\r\n * curve(s) to calculate the midpoint against. You can reference any easing\r\n * function attached to `Tweenable.prototype.formula`, or provide the easing\r\n * function(s) directly. If omitted, this defaults to \"linear\".\r\n * @param {number=} opt_delay Optional delay to pad the beginning of the\r\n * interpolated tween with. This increases the range of `position` from (`0`\r\n * through `1`) to (`0` through `1 + opt_delay`). So, a delay of `0.5` would\r\n * increase all valid values of `position` to numbers between `0` and `1.5`.\r\n * @return {Object}\r\n */\r\n Tweenable.interpolate = function (\r\n from, targetState, position, easing, opt_delay) {\r\n\r\n var current = Tweenable.shallowCopy({}, from);\r\n var delay = opt_delay || 0;\r\n var easingObject = Tweenable.composeEasingObject(\r\n from, easing || 'linear');\r\n\r\n mockTweenable.set({});\r\n\r\n // Alias and reuse the _filterArgs array instead of recreating it.\r\n var filterArgs = mockTweenable._filterArgs;\r\n filterArgs.length = 0;\r\n filterArgs[0] = current;\r\n filterArgs[1] = from;\r\n filterArgs[2] = targetState;\r\n filterArgs[3] = easingObject;\r\n\r\n // Any defined value transformation must be applied\r\n Tweenable.applyFilter(mockTweenable, 'tweenCreated');\r\n Tweenable.applyFilter(mockTweenable, 'beforeTween');\r\n\r\n var interpolatedValues = getInterpolatedValues(\r\n from, current, targetState, position, easingObject, delay);\r\n\r\n // Transform values back into their original format\r\n Tweenable.applyFilter(mockTweenable, 'afterTween');\r\n\r\n return interpolatedValues;\r\n };\r\n\r\n }());\r\n\r\n /**\r\n * This module adds string interpolation support to Shifty.\r\n *\r\n * The Token extension allows Shifty to tween numbers inside of strings. Among\r\n * other things, this allows you to animate CSS properties. For example, you\r\n * can do this:\r\n *\r\n * var tweenable = new Tweenable();\r\n * tweenable.tween({\r\n * from: { transform: 'translateX(45px)' },\r\n * to: { transform: 'translateX(90xp)' }\r\n * });\r\n *\r\n * `translateX(45)` will be tweened to `translateX(90)`. To demonstrate:\r\n *\r\n * var tweenable = new Tweenable();\r\n * tweenable.tween({\r\n * from: { transform: 'translateX(45px)' },\r\n * to: { transform: 'translateX(90px)' },\r\n * step: function (state) {\r\n * console.log(state.transform);\r\n * }\r\n * });\r\n *\r\n * The above snippet will log something like this in the console:\r\n *\r\n * translateX(60.3px)\r\n * ...\r\n * translateX(76.05px)\r\n * ...\r\n * translateX(90px)\r\n *\r\n * Another use for this is animating colors:\r\n *\r\n * var tweenable = new Tweenable();\r\n * tweenable.tween({\r\n * from: { color: 'rgb(0,255,0)' },\r\n * to: { color: 'rgb(255,0,255)' },\r\n * step: function (state) {\r\n * console.log(state.color);\r\n * }\r\n * });\r\n *\r\n * The above snippet will log something like this:\r\n *\r\n * rgb(84,170,84)\r\n * ...\r\n * rgb(170,84,170)\r\n * ...\r\n * rgb(255,0,255)\r\n *\r\n * This extension also supports hexadecimal colors, in both long (`#ff00ff`)\r\n * and short (`#f0f`) forms. Be aware that hexadecimal input values will be\r\n * converted into the equivalent RGB output values. This is done to optimize\r\n * for performance.\r\n *\r\n * var tweenable = new Tweenable();\r\n * tweenable.tween({\r\n * from: { color: '#0f0' },\r\n * to: { color: '#f0f' },\r\n * step: function (state) {\r\n * console.log(state.color);\r\n * }\r\n * });\r\n *\r\n * This snippet will generate the same output as the one before it because\r\n * equivalent values were supplied (just in hexadecimal form rather than RGB):\r\n *\r\n * rgb(84,170,84)\r\n * ...\r\n * rgb(170,84,170)\r\n * ...\r\n * rgb(255,0,255)\r\n *\r\n * ## Easing support\r\n *\r\n * Easing works somewhat differently in the Token extension. This is because\r\n * some CSS properties have multiple values in them, and you might need to\r\n * tween each value along its own easing curve. A basic example:\r\n *\r\n * var tweenable = new Tweenable();\r\n * tweenable.tween({\r\n * from: { transform: 'translateX(0px) translateY(0px)' },\r\n * to: { transform: 'translateX(100px) translateY(100px)' },\r\n * easing: { transform: 'easeInQuad' },\r\n * step: function (state) {\r\n * console.log(state.transform);\r\n * }\r\n * });\r\n *\r\n * The above snippet will create values like this:\r\n *\r\n * translateX(11.56px) translateY(11.56px)\r\n * ...\r\n * translateX(46.24px) translateY(46.24px)\r\n * ...\r\n * translateX(100px) translateY(100px)\r\n *\r\n * In this case, the values for `translateX` and `translateY` are always the\r\n * same for each step of the tween, because they have the same start and end\r\n * points and both use the same easing curve. We can also tween `translateX`\r\n * and `translateY` along independent curves:\r\n *\r\n * var tweenable = new Tweenable();\r\n * tweenable.tween({\r\n * from: { transform: 'translateX(0px) translateY(0px)' },\r\n * to: { transform: 'translateX(100px) translateY(100px)' },\r\n * easing: { transform: 'easeInQuad bounce' },\r\n * step: function (state) {\r\n * console.log(state.transform);\r\n * }\r\n * });\r\n *\r\n * The above snippet will create values like this:\r\n *\r\n * translateX(10.89px) translateY(82.35px)\r\n * ...\r\n * translateX(44.89px) translateY(86.73px)\r\n * ...\r\n * translateX(100px) translateY(100px)\r\n *\r\n * `translateX` and `translateY` are not in sync anymore, because `easeInQuad`\r\n * was specified for `translateX` and `bounce` for `translateY`. Mixing and\r\n * matching easing curves can make for some interesting motion in your\r\n * animations.\r\n *\r\n * The order of the space-separated easing curves correspond the token values\r\n * they apply to. If there are more token values than easing curves listed,\r\n * the last easing curve listed is used.\r\n * @submodule Tweenable.token\r\n */\r\n\r\n // token function is defined above only so that dox-foundation sees it as\r\n // documentation and renders it. It is never used, and is optimized away at\r\n // build time.\r\n\r\n ; (function (Tweenable) {\r\n\r\n /**\r\n * @typedef {{\r\n * formatString: string\r\n * chunkNames: Array.\r\n * }}\r\n * @private\r\n */\r\n var formatManifest;\r\n\r\n // CONSTANTS\r\n\r\n var R_NUMBER_COMPONENT = /(\\d|\\-|\\.)/;\r\n var R_FORMAT_CHUNKS = /([^\\-0-9\\.]+)/g;\r\n var R_UNFORMATTED_VALUES = /[0-9.\\-]+/g;\r\n var R_RGB = new RegExp(\r\n 'rgb\\\\(' + R_UNFORMATTED_VALUES.source +\r\n (/,\\s*/.source) + R_UNFORMATTED_VALUES.source +\r\n (/,\\s*/.source) + R_UNFORMATTED_VALUES.source + '\\\\)', 'g');\r\n var R_RGB_PREFIX = /^.*\\(/;\r\n var R_HEX = /#([0-9]|[a-f]){3,6}/gi;\r\n var VALUE_PLACEHOLDER = 'VAL';\r\n\r\n // HELPERS\r\n\r\n /**\r\n * @param {Array.number} rawValues\r\n * @param {string} prefix\r\n *\r\n * @return {Array.}\r\n * @private\r\n */\r\n function getFormatChunksFrom(rawValues, prefix) {\r\n var accumulator = [];\r\n\r\n var rawValuesLength = rawValues.length;\r\n var i;\r\n\r\n for (i = 0; i < rawValuesLength; i++) {\r\n accumulator.push('_' + prefix + '_' + i);\r\n }\r\n\r\n return accumulator;\r\n }\r\n\r\n /**\r\n * @param {string} formattedString\r\n *\r\n * @return {string}\r\n * @private\r\n */\r\n function getFormatStringFrom(formattedString) {\r\n var chunks = formattedString.match(R_FORMAT_CHUNKS);\r\n\r\n if (!chunks) {\r\n // chunks will be null if there were no tokens to parse in\r\n // formattedString (for example, if formattedString is '2'). Coerce\r\n // chunks to be useful here.\r\n chunks = ['', ''];\r\n\r\n // If there is only one chunk, assume that the string is a number\r\n // followed by a token...\r\n // NOTE: This may be an unwise assumption.\r\n } else if (chunks.length === 1 ||\r\n // ...or if the string starts with a number component (\".\", \"-\", or a\r\n // digit)...\r\n formattedString[0].match(R_NUMBER_COMPONENT)) {\r\n // ...prepend an empty string here to make sure that the formatted number\r\n // is properly replaced by VALUE_PLACEHOLDER\r\n chunks.unshift('');\r\n }\r\n\r\n return chunks.join(VALUE_PLACEHOLDER);\r\n }\r\n\r\n /**\r\n * Convert all hex color values within a string to an rgb string.\r\n *\r\n * @param {Object} stateObject\r\n *\r\n * @return {Object} The modified obj\r\n * @private\r\n */\r\n function sanitizeObjectForHexProps(stateObject) {\r\n Tweenable.each(stateObject, function (prop) {\r\n var currentProp = stateObject[prop];\r\n\r\n if (typeof currentProp === 'string' && currentProp.match(R_HEX)) {\r\n stateObject[prop] = sanitizeHexChunksToRGB(currentProp);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * @param {string} str\r\n *\r\n * @return {string}\r\n * @private\r\n */\r\n function sanitizeHexChunksToRGB(str) {\r\n return filterStringChunks(R_HEX, str, convertHexToRGB);\r\n }\r\n\r\n /**\r\n * @param {string} hexString\r\n *\r\n * @return {string}\r\n * @private\r\n */\r\n function convertHexToRGB(hexString) {\r\n var rgbArr = hexToRGBArray(hexString);\r\n return 'rgb(' + rgbArr[0] + ',' + rgbArr[1] + ',' + rgbArr[2] + ')';\r\n }\r\n\r\n var hexToRGBArray_returnArray = [];\r\n /**\r\n * Convert a hexadecimal string to an array with three items, one each for\r\n * the red, blue, and green decimal values.\r\n *\r\n * @param {string} hex A hexadecimal string.\r\n *\r\n * @returns {Array.} The converted Array of RGB values if `hex` is a\r\n * valid string, or an Array of three 0's.\r\n * @private\r\n */\r\n function hexToRGBArray(hex) {\r\n\r\n hex = hex.replace(/#/, '');\r\n\r\n // If the string is a shorthand three digit hex notation, normalize it to\r\n // the standard six digit notation\r\n if (hex.length === 3) {\r\n hex = hex.split('');\r\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\r\n }\r\n\r\n hexToRGBArray_returnArray[0] = hexToDec(hex.substr(0, 2));\r\n hexToRGBArray_returnArray[1] = hexToDec(hex.substr(2, 2));\r\n hexToRGBArray_returnArray[2] = hexToDec(hex.substr(4, 2));\r\n\r\n return hexToRGBArray_returnArray;\r\n }\r\n\r\n /**\r\n * Convert a base-16 number to base-10.\r\n *\r\n * @param {Number|String} hex The value to convert\r\n *\r\n * @returns {Number} The base-10 equivalent of `hex`.\r\n * @private\r\n */\r\n function hexToDec(hex) {\r\n return parseInt(hex, 16);\r\n }\r\n\r\n /**\r\n * Runs a filter operation on all chunks of a string that match a RegExp\r\n *\r\n * @param {RegExp} pattern\r\n * @param {string} unfilteredString\r\n * @param {function(string)} filter\r\n *\r\n * @return {string}\r\n * @private\r\n */\r\n function filterStringChunks(pattern, unfilteredString, filter) {\r\n var pattenMatches = unfilteredString.match(pattern);\r\n var filteredString = unfilteredString.replace(pattern, VALUE_PLACEHOLDER);\r\n\r\n if (pattenMatches) {\r\n var pattenMatchesLength = pattenMatches.length;\r\n var currentChunk;\r\n\r\n for (var i = 0; i < pattenMatchesLength; i++) {\r\n currentChunk = pattenMatches.shift();\r\n filteredString = filteredString.replace(\r\n VALUE_PLACEHOLDER, filter(currentChunk));\r\n }\r\n }\r\n\r\n return filteredString;\r\n }\r\n\r\n /**\r\n * Check for floating point values within rgb strings and rounds them.\r\n *\r\n * @param {string} formattedString\r\n *\r\n * @return {string}\r\n * @private\r\n */\r\n function sanitizeRGBChunks(formattedString) {\r\n return filterStringChunks(R_RGB, formattedString, sanitizeRGBChunk);\r\n }\r\n\r\n /**\r\n * @param {string} rgbChunk\r\n *\r\n * @return {string}\r\n * @private\r\n */\r\n function sanitizeRGBChunk(rgbChunk) {\r\n var numbers = rgbChunk.match(R_UNFORMATTED_VALUES);\r\n var numbersLength = numbers.length;\r\n var sanitizedString = rgbChunk.match(R_RGB_PREFIX)[0];\r\n\r\n for (var i = 0; i < numbersLength; i++) {\r\n sanitizedString += parseInt(numbers[i], 10) + ',';\r\n }\r\n\r\n sanitizedString = sanitizedString.slice(0, -1) + ')';\r\n\r\n return sanitizedString;\r\n }\r\n\r\n /**\r\n * @param {Object} stateObject\r\n *\r\n * @return {Object} An Object of formatManifests that correspond to\r\n * the string properties of stateObject\r\n * @private\r\n */\r\n function getFormatManifests(stateObject) {\r\n var manifestAccumulator = {};\r\n\r\n Tweenable.each(stateObject, function (prop) {\r\n var currentProp = stateObject[prop];\r\n\r\n if (typeof currentProp === 'string') {\r\n var rawValues = getValuesFrom(currentProp);\r\n\r\n manifestAccumulator[prop] = {\r\n 'formatString': getFormatStringFrom(currentProp)\r\n , 'chunkNames': getFormatChunksFrom(rawValues, prop)\r\n };\r\n }\r\n });\r\n\r\n return manifestAccumulator;\r\n }\r\n\r\n /**\r\n * @param {Object} stateObject\r\n * @param {Object} formatManifests\r\n * @private\r\n */\r\n function expandFormattedProperties(stateObject, formatManifests) {\r\n Tweenable.each(formatManifests, function (prop) {\r\n var currentProp = stateObject[prop];\r\n var rawValues = getValuesFrom(currentProp);\r\n var rawValuesLength = rawValues.length;\r\n\r\n for (var i = 0; i < rawValuesLength; i++) {\r\n stateObject[formatManifests[prop].chunkNames[i]] = +rawValues[i];\r\n }\r\n\r\n delete stateObject[prop];\r\n });\r\n }\r\n\r\n /**\r\n * @param {Object} stateObject\r\n * @param {Object} formatManifests\r\n * @private\r\n */\r\n function collapseFormattedProperties(stateObject, formatManifests) {\r\n Tweenable.each(formatManifests, function (prop) {\r\n var currentProp = stateObject[prop];\r\n var formatChunks = extractPropertyChunks(\r\n stateObject, formatManifests[prop].chunkNames);\r\n var valuesList = getValuesList(\r\n formatChunks, formatManifests[prop].chunkNames);\r\n currentProp = getFormattedValues(\r\n formatManifests[prop].formatString, valuesList);\r\n stateObject[prop] = sanitizeRGBChunks(currentProp);\r\n });\r\n }\r\n\r\n /**\r\n * @param {Object} stateObject\r\n * @param {Array.} chunkNames\r\n *\r\n * @return {Object} The extracted value chunks.\r\n * @private\r\n */\r\n function extractPropertyChunks(stateObject, chunkNames) {\r\n var extractedValues = {};\r\n var currentChunkName, chunkNamesLength = chunkNames.length;\r\n\r\n for (var i = 0; i < chunkNamesLength; i++) {\r\n currentChunkName = chunkNames[i];\r\n extractedValues[currentChunkName] = stateObject[currentChunkName];\r\n delete stateObject[currentChunkName];\r\n }\r\n\r\n return extractedValues;\r\n }\r\n\r\n var getValuesList_accumulator = [];\r\n /**\r\n * @param {Object} stateObject\r\n * @param {Array.} chunkNames\r\n *\r\n * @return {Array.}\r\n * @private\r\n */\r\n function getValuesList(stateObject, chunkNames) {\r\n getValuesList_accumulator.length = 0;\r\n var chunkNamesLength = chunkNames.length;\r\n\r\n for (var i = 0; i < chunkNamesLength; i++) {\r\n getValuesList_accumulator.push(stateObject[chunkNames[i]]);\r\n }\r\n\r\n return getValuesList_accumulator;\r\n }\r\n\r\n /**\r\n * @param {string} formatString\r\n * @param {Array.} rawValues\r\n *\r\n * @return {string}\r\n * @private\r\n */\r\n function getFormattedValues(formatString, rawValues) {\r\n var formattedValueString = formatString;\r\n var rawValuesLength = rawValues.length;\r\n\r\n for (var i = 0; i < rawValuesLength; i++) {\r\n formattedValueString = formattedValueString.replace(\r\n VALUE_PLACEHOLDER, +rawValues[i].toFixed(4));\r\n }\r\n\r\n return formattedValueString;\r\n }\r\n\r\n /**\r\n * Note: It's the duty of the caller to convert the Array elements of the\r\n * return value into numbers. This is a performance optimization.\r\n *\r\n * @param {string} formattedString\r\n *\r\n * @return {Array.|null}\r\n * @private\r\n */\r\n function getValuesFrom(formattedString) {\r\n return formattedString.match(R_UNFORMATTED_VALUES);\r\n }\r\n\r\n /**\r\n * @param {Object} easingObject\r\n * @param {Object} tokenData\r\n * @private\r\n */\r\n function expandEasingObject(easingObject, tokenData) {\r\n Tweenable.each(tokenData, function (prop) {\r\n var currentProp = tokenData[prop];\r\n var chunkNames = currentProp.chunkNames;\r\n var chunkLength = chunkNames.length;\r\n\r\n var easing = easingObject[prop];\r\n var i;\r\n\r\n if (typeof easing === 'string') {\r\n var easingChunks = easing.split(' ');\r\n var lastEasingChunk = easingChunks[easingChunks.length - 1];\r\n\r\n for (i = 0; i < chunkLength; i++) {\r\n easingObject[chunkNames[i]] = easingChunks[i] || lastEasingChunk;\r\n }\r\n\r\n } else {\r\n for (i = 0; i < chunkLength; i++) {\r\n easingObject[chunkNames[i]] = easing;\r\n }\r\n }\r\n\r\n delete easingObject[prop];\r\n });\r\n }\r\n\r\n /**\r\n * @param {Object} easingObject\r\n * @param {Object} tokenData\r\n * @private\r\n */\r\n function collapseEasingObject(easingObject, tokenData) {\r\n Tweenable.each(tokenData, function (prop) {\r\n var currentProp = tokenData[prop];\r\n var chunkNames = currentProp.chunkNames;\r\n var chunkLength = chunkNames.length;\r\n\r\n var firstEasing = easingObject[chunkNames[0]];\r\n var typeofEasings = typeof firstEasing;\r\n\r\n if (typeofEasings === 'string') {\r\n var composedEasingString = '';\r\n\r\n for (var i = 0; i < chunkLength; i++) {\r\n composedEasingString += ' ' + easingObject[chunkNames[i]];\r\n delete easingObject[chunkNames[i]];\r\n }\r\n\r\n easingObject[prop] = composedEasingString.substr(1);\r\n } else {\r\n easingObject[prop] = firstEasing;\r\n }\r\n });\r\n }\r\n\r\n Tweenable.prototype.filter.token = {\r\n 'tweenCreated': function (currentState, fromState, toState, easingObject) {\r\n sanitizeObjectForHexProps(currentState);\r\n sanitizeObjectForHexProps(fromState);\r\n sanitizeObjectForHexProps(toState);\r\n this._tokenData = getFormatManifests(currentState);\r\n },\r\n\r\n 'beforeTween': function (currentState, fromState, toState, easingObject) {\r\n expandEasingObject(easingObject, this._tokenData);\r\n expandFormattedProperties(currentState, this._tokenData);\r\n expandFormattedProperties(fromState, this._tokenData);\r\n expandFormattedProperties(toState, this._tokenData);\r\n },\r\n\r\n 'afterTween': function (currentState, fromState, toState, easingObject) {\r\n collapseFormattedProperties(currentState, this._tokenData);\r\n collapseFormattedProperties(fromState, this._tokenData);\r\n collapseFormattedProperties(toState, this._tokenData);\r\n collapseEasingObject(easingObject, this._tokenData);\r\n }\r\n };\r\n\r\n }(Tweenable));\r\n\r\n }).call(null);\r\n\r\n }, {}], 2: [function (require, module, exports) {\r\n // Circle shaped progress bar\r\n\r\n var Shape = require('./shape');\r\n var utils = require('./utils');\r\n\r\n var Circle = function Circle(container, options) {\r\n // Use two arcs to form a circle\r\n // See this answer http://stackoverflow.com/a/10477334/1446092\r\n this._pathTemplate =\r\n 'M 50,50 m 0,-{radius}' +\r\n ' a {radius},{radius} 0 1 1 0,{2radius}' +\r\n ' a {radius},{radius} 0 1 1 0,-{2radius}';\r\n\r\n this.containerAspectRatio = 1;\r\n\r\n Shape.apply(this, arguments);\r\n };\r\n\r\n Circle.prototype = new Shape();\r\n Circle.prototype.constructor = Circle;\r\n\r\n Circle.prototype._pathString = function _pathString(opts) {\r\n var widthOfWider = opts.strokeWidth;\r\n if (opts.trailWidth && opts.trailWidth > opts.strokeWidth) {\r\n widthOfWider = opts.trailWidth;\r\n }\r\n\r\n var r = 50 - widthOfWider / 2;\r\n\r\n return utils.render(this._pathTemplate, {\r\n radius: r,\r\n '2radius': r * 2\r\n });\r\n };\r\n\r\n Circle.prototype._trailString = function _trailString(opts) {\r\n return this._pathString(opts);\r\n };\r\n\r\n module.exports = Circle;\r\n\r\n }, { \"./shape\": 7, \"./utils\": 8 }], 3: [function (require, module, exports) {\r\n // Line shaped progress bar\r\n\r\n var Shape = require('./shape');\r\n var utils = require('./utils');\r\n\r\n var Line = function Line(container, options) {\r\n this._pathTemplate = 'M 0,{center} L 100,{center}';\r\n Shape.apply(this, arguments);\r\n };\r\n\r\n Line.prototype = new Shape();\r\n Line.prototype.constructor = Line;\r\n\r\n Line.prototype._initializeSvg = function _initializeSvg(svg, opts) {\r\n svg.setAttribute('viewBox', '0 0 100 ' + opts.strokeWidth);\r\n svg.setAttribute('preserveAspectRatio', 'none');\r\n };\r\n\r\n Line.prototype._pathString = function _pathString(opts) {\r\n return utils.render(this._pathTemplate, {\r\n center: opts.strokeWidth / 2\r\n });\r\n };\r\n\r\n Line.prototype._trailString = function _trailString(opts) {\r\n return this._pathString(opts);\r\n };\r\n\r\n module.exports = Line;\r\n\r\n }, { \"./shape\": 7, \"./utils\": 8 }], 4: [function (require, module, exports) {\r\n module.exports = {\r\n // Higher level API, different shaped progress bars\r\n Line: require('./line'),\r\n Circle: require('./circle'),\r\n SemiCircle: require('./semicircle'),\r\n\r\n // Lower level API to use any SVG path\r\n Path: require('./path'),\r\n\r\n // Base-class for creating new custom shapes\r\n // to be in line with the API of built-in shapes\r\n // Undocumented.\r\n Shape: require('./shape'),\r\n\r\n // Internal utils, undocumented.\r\n utils: require('./utils')\r\n };\r\n\r\n }, { \"./circle\": 2, \"./line\": 3, \"./path\": 5, \"./semicircle\": 6, \"./shape\": 7, \"./utils\": 8 }], 5: [function (require, module, exports) {\r\n // Lower level API to animate any kind of svg path\r\n\r\n var Tweenable = require('shifty');\r\n var utils = require('./utils');\r\n\r\n var EASING_ALIASES = {\r\n easeIn: 'easeInCubic',\r\n easeOut: 'easeOutCubic',\r\n easeInOut: 'easeInOutCubic'\r\n };\r\n\r\n var Path = function Path(path, opts) {\r\n // Default parameters for animation\r\n opts = utils.extend({\r\n duration: 800,\r\n easing: 'linear',\r\n from: {},\r\n to: {},\r\n step: function () { }\r\n }, opts);\r\n\r\n var element;\r\n if (utils.isString(path)) {\r\n element = document.querySelector(path);\r\n } else {\r\n element = path;\r\n }\r\n\r\n // Reveal .path as public attribute\r\n this.path = element;\r\n this._opts = opts;\r\n this._tweenable = null;\r\n\r\n // Set up the starting positions\r\n var length = this.path.getTotalLength();\r\n this.path.style.strokeDasharray = length + ' ' + length;\r\n this.set(0);\r\n };\r\n\r\n Path.prototype.value = function value() {\r\n var offset = this._getComputedDashOffset();\r\n var length = this.path.getTotalLength();\r\n\r\n var progress = 1 - offset / length;\r\n // Round number to prevent returning very small number like 1e-30, which\r\n // is practically 0\r\n return parseFloat(progress.toFixed(6), 10);\r\n };\r\n\r\n Path.prototype.set = function set(progress) {\r\n this.stop();\r\n\r\n this.path.style.strokeDashoffset = this._progressToOffset(progress);\r\n\r\n var step = this._opts.step;\r\n if (utils.isFunction(step)) {\r\n var easing = this._easing(this._opts.easing);\r\n var values = this._calculateTo(progress, easing);\r\n var reference = this._opts.shape || this;\r\n step(values, reference, this._opts.attachment);\r\n }\r\n };\r\n\r\n Path.prototype.stop = function stop() {\r\n this._stopTween();\r\n this.path.style.strokeDashoffset = this._getComputedDashOffset();\r\n };\r\n\r\n // Method introduced here:\r\n // http://jakearchibald.com/2013/animated-line-drawing-svg/\r\n Path.prototype.animate = function animate(progress, opts, cb) {\r\n opts = opts || {};\r\n\r\n if (utils.isFunction(opts)) {\r\n cb = opts;\r\n opts = {};\r\n }\r\n\r\n var passedOpts = utils.extend({}, opts);\r\n\r\n // Copy default opts to new object so defaults are not modified\r\n var defaultOpts = utils.extend({}, this._opts);\r\n opts = utils.extend(defaultOpts, opts);\r\n\r\n var shiftyEasing = this._easing(opts.easing);\r\n var values = this._resolveFromAndTo(progress, shiftyEasing, passedOpts);\r\n\r\n this.stop();\r\n\r\n // Trigger a layout so styles are calculated & the browser\r\n // picks up the starting position before animating\r\n this.path.getBoundingClientRect();\r\n\r\n var offset = this._getComputedDashOffset();\r\n var newOffset = this._progressToOffset(progress);\r\n\r\n var self = this;\r\n this._tweenable = new Tweenable();\r\n this._tweenable.tween({\r\n from: utils.extend({ offset: offset }, values.from),\r\n to: utils.extend({ offset: newOffset }, values.to),\r\n duration: opts.duration,\r\n easing: shiftyEasing,\r\n step: function (state) {\r\n self.path.style.strokeDashoffset = state.offset;\r\n var reference = opts.shape || self;\r\n opts.step(state, reference, opts.attachment);\r\n },\r\n finish: function (state) {\r\n if (utils.isFunction(cb)) {\r\n cb();\r\n }\r\n }\r\n });\r\n };\r\n\r\n Path.prototype._getComputedDashOffset = function _getComputedDashOffset() {\r\n var computedStyle = window.getComputedStyle(this.path, null);\r\n return parseFloat(computedStyle.getPropertyValue('stroke-dashoffset'), 10);\r\n };\r\n\r\n Path.prototype._progressToOffset = function _progressToOffset(progress) {\r\n var length = this.path.getTotalLength();\r\n return length - progress * length;\r\n };\r\n\r\n // Resolves from and to values for animation.\r\n Path.prototype._resolveFromAndTo = function _resolveFromAndTo(progress, easing, opts) {\r\n if (opts.from && opts.to) {\r\n return {\r\n from: opts.from,\r\n to: opts.to\r\n };\r\n }\r\n\r\n return {\r\n from: this._calculateFrom(easing),\r\n to: this._calculateTo(progress, easing)\r\n };\r\n };\r\n\r\n // Calculate `from` values from options passed at initialization\r\n Path.prototype._calculateFrom = function _calculateFrom(easing) {\r\n return Tweenable.interpolate(this._opts.from, this._opts.to, this.value(), easing);\r\n };\r\n\r\n // Calculate `to` values from options passed at initialization\r\n Path.prototype._calculateTo = function _calculateTo(progress, easing) {\r\n return Tweenable.interpolate(this._opts.from, this._opts.to, progress, easing);\r\n };\r\n\r\n Path.prototype._stopTween = function _stopTween() {\r\n if (this._tweenable !== null) {\r\n this._tweenable.stop();\r\n this._tweenable = null;\r\n }\r\n };\r\n\r\n Path.prototype._easing = function _easing(easing) {\r\n if (EASING_ALIASES.hasOwnProperty(easing)) {\r\n return EASING_ALIASES[easing];\r\n }\r\n\r\n return easing;\r\n };\r\n\r\n module.exports = Path;\r\n\r\n }, { \"./utils\": 8, \"shifty\": 1 }], 6: [function (require, module, exports) {\r\n // Semi-SemiCircle shaped progress bar\r\n\r\n var Shape = require('./shape');\r\n var Circle = require('./circle');\r\n var utils = require('./utils');\r\n\r\n var SemiCircle = function SemiCircle(container, options) {\r\n // Use one arc to form a SemiCircle\r\n // See this answer http://stackoverflow.com/a/10477334/1446092\r\n this._pathTemplate =\r\n 'M 50,50 m -{radius},0' +\r\n ' a {radius},{radius} 0 1 1 {2radius},0';\r\n\r\n this.containerAspectRatio = 2;\r\n\r\n Shape.apply(this, arguments);\r\n };\r\n\r\n SemiCircle.prototype = new Shape();\r\n SemiCircle.prototype.constructor = SemiCircle;\r\n\r\n SemiCircle.prototype._initializeSvg = function _initializeSvg(svg, opts) {\r\n svg.setAttribute('viewBox', '0 0 100 50');\r\n };\r\n\r\n SemiCircle.prototype._initializeTextContainer = function _initializeTextContainer(\r\n opts,\r\n container,\r\n textContainer\r\n ) {\r\n if (opts.text.style) {\r\n // Reset top style\r\n textContainer.style.top = 'auto';\r\n textContainer.style.bottom = '0';\r\n\r\n if (opts.text.alignToBottom) {\r\n utils.setStyle(textContainer, 'transform', 'translate(-50%, 0)');\r\n } else {\r\n utils.setStyle(textContainer, 'transform', 'translate(-50%, 50%)');\r\n }\r\n }\r\n };\r\n\r\n // Share functionality with Circle, just have different path\r\n SemiCircle.prototype._pathString = Circle.prototype._pathString;\r\n SemiCircle.prototype._trailString = Circle.prototype._trailString;\r\n\r\n module.exports = SemiCircle;\r\n\r\n }, { \"./circle\": 2, \"./shape\": 7, \"./utils\": 8 }], 7: [function (require, module, exports) {\r\n // Base object for different progress bar shapes\r\n\r\n var Path = require('./path');\r\n var utils = require('./utils');\r\n\r\n var DESTROYED_ERROR = 'Object is destroyed';\r\n\r\n var Shape = function Shape(container, opts) {\r\n // Throw a better error if progress bars are not initialized with `new`\r\n // keyword\r\n if (!(this instanceof Shape)) {\r\n throw new Error('Constructor was called without new keyword');\r\n }\r\n\r\n // Prevent calling constructor without parameters so inheritance\r\n // works correctly. To understand, this is how Shape is inherited:\r\n //\r\n // Line.prototype = new Shape();\r\n //\r\n // We just want to set the prototype for Line.\r\n if (arguments.length === 0) {\r\n return;\r\n }\r\n\r\n // Default parameters for progress bar creation\r\n this._opts = utils.extend({\r\n color: '#555',\r\n strokeWidth: 1.0,\r\n trailColor: null,\r\n trailWidth: null,\r\n fill: null,\r\n text: {\r\n style: {\r\n color: null,\r\n position: 'absolute',\r\n left: '50%',\r\n top: '50%',\r\n padding: 0,\r\n margin: 0,\r\n transform: {\r\n prefix: true,\r\n value: 'translate(-50%, -50%)'\r\n }\r\n },\r\n autoStyleContainer: true,\r\n alignToBottom: true,\r\n value: '',\r\n className: 'progressbar-text'\r\n },\r\n svgStyle: {\r\n display: 'block',\r\n width: '100%'\r\n }\r\n }, opts, true); // Use recursive extend\r\n\r\n // If user specifies e.g. svgStyle or text style, the whole object\r\n // should replace the defaults to make working with styles easier\r\n if (utils.isObject(opts) && opts.svgStyle !== undefined) {\r\n this._opts.svgStyle = opts.svgStyle;\r\n }\r\n if (utils.isObject(opts) && utils.isObject(opts.text) && opts.text.style !== undefined) {\r\n this._opts.text.style = opts.text.style;\r\n }\r\n\r\n var svgView = this._createSvgView(this._opts);\r\n\r\n var element;\r\n if (utils.isString(container)) {\r\n element = document.querySelector(container);\r\n } else {\r\n element = container;\r\n }\r\n\r\n if (!element) {\r\n throw new Error('Container does not exist: ' + container);\r\n }\r\n\r\n this._container = element;\r\n this._container.appendChild(svgView.svg);\r\n this._warnContainerAspectRatio(this._container);\r\n\r\n if (this._opts.svgStyle) {\r\n utils.setStyles(svgView.svg, this._opts.svgStyle);\r\n }\r\n\r\n // Expose public attributes before Path initialization\r\n this.svg = svgView.svg;\r\n this.path = svgView.path;\r\n this.trail = svgView.trail;\r\n this.text = null;\r\n\r\n var newOpts = utils.extend({\r\n attachment: undefined,\r\n shape: this\r\n }, this._opts);\r\n this._progressPath = new Path(svgView.path, newOpts);\r\n\r\n if (utils.isObject(this._opts.text) && this._opts.text.value) {\r\n this.setText(this._opts.text.value);\r\n }\r\n };\r\n\r\n Shape.prototype.animate = function animate(progress, opts, cb) {\r\n if (this._progressPath === null) {\r\n throw new Error(DESTROYED_ERROR);\r\n }\r\n\r\n this._progressPath.animate(progress, opts, cb);\r\n };\r\n\r\n Shape.prototype.stop = function stop() {\r\n if (this._progressPath === null) {\r\n throw new Error(DESTROYED_ERROR);\r\n }\r\n\r\n // Don't crash if stop is called inside step function\r\n if (this._progressPath === undefined) {\r\n return;\r\n }\r\n\r\n this._progressPath.stop();\r\n };\r\n\r\n Shape.prototype.destroy = function destroy() {\r\n if (this._progressPath === null) {\r\n throw new Error(DESTROYED_ERROR);\r\n }\r\n\r\n this.stop();\r\n this.svg.parentNode.removeChild(this.svg);\r\n this.svg = null;\r\n this.path = null;\r\n this.trail = null;\r\n this._progressPath = null;\r\n\r\n if (this.text !== null) {\r\n this.text.parentNode.removeChild(this.text);\r\n this.text = null;\r\n }\r\n };\r\n\r\n Shape.prototype.set = function set(progress) {\r\n if (this._progressPath === null) {\r\n throw new Error(DESTROYED_ERROR);\r\n }\r\n\r\n this._progressPath.set(progress);\r\n };\r\n\r\n Shape.prototype.value = function value() {\r\n if (this._progressPath === null) {\r\n throw new Error(DESTROYED_ERROR);\r\n }\r\n\r\n if (this._progressPath === undefined) {\r\n return 0;\r\n }\r\n\r\n return this._progressPath.value();\r\n };\r\n\r\n Shape.prototype.setText = function setText(newText) {\r\n if (this._progressPath === null) {\r\n throw new Error(DESTROYED_ERROR);\r\n }\r\n\r\n if (this.text === null) {\r\n // Create new text node\r\n this.text = this._createTextContainer(this._opts, this._container);\r\n this._container.appendChild(this.text);\r\n }\r\n\r\n // Remove previous text and add new\r\n if (utils.isObject(newText)) {\r\n utils.removeChildren(this.text);\r\n this.text.appendChild(newText);\r\n } else {\r\n this.text.innerHTML = newText;\r\n }\r\n };\r\n\r\n Shape.prototype._createSvgView = function _createSvgView(opts) {\r\n var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n this._initializeSvg(svg, opts);\r\n\r\n var trailPath = null;\r\n // Each option listed in the if condition are 'triggers' for creating\r\n // the trail path\r\n if (opts.trailColor || opts.trailWidth) {\r\n trailPath = this._createTrail(opts);\r\n svg.appendChild(trailPath);\r\n }\r\n\r\n var path = this._createPath(opts);\r\n svg.appendChild(path);\r\n\r\n return {\r\n svg: svg,\r\n path: path,\r\n trail: trailPath\r\n };\r\n };\r\n\r\n Shape.prototype._initializeSvg = function _initializeSvg(svg, opts) {\r\n svg.setAttribute('viewBox', '0 0 100 100');\r\n };\r\n\r\n Shape.prototype._createPath = function _createPath(opts) {\r\n var pathString = this._pathString(opts);\r\n return this._createPathElement(pathString, opts);\r\n };\r\n\r\n Shape.prototype._createTrail = function _createTrail(opts) {\r\n // Create path string with original passed options\r\n var pathString = this._trailString(opts);\r\n\r\n // Prevent modifying original\r\n var newOpts = utils.extend({}, opts);\r\n\r\n // Defaults for parameters which modify trail path\r\n if (!newOpts.trailColor) {\r\n newOpts.trailColor = '#eee';\r\n }\r\n if (!newOpts.trailWidth) {\r\n newOpts.trailWidth = newOpts.strokeWidth;\r\n }\r\n\r\n newOpts.color = newOpts.trailColor;\r\n newOpts.strokeWidth = newOpts.trailWidth;\r\n\r\n // When trail path is set, fill must be set for it instead of the\r\n // actual path to prevent trail stroke from clipping\r\n newOpts.fill = null;\r\n\r\n return this._createPathElement(pathString, newOpts);\r\n };\r\n\r\n Shape.prototype._createPathElement = function _createPathElement(pathString, opts) {\r\n var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');\r\n path.setAttribute('d', pathString);\r\n path.setAttribute('stroke', opts.color);\r\n path.setAttribute('stroke-width', opts.strokeWidth);\r\n\r\n if (opts.fill) {\r\n path.setAttribute('fill', opts.fill);\r\n } else {\r\n path.setAttribute('fill-opacity', '0');\r\n }\r\n\r\n return path;\r\n };\r\n\r\n Shape.prototype._createTextContainer = function _createTextContainer(opts, container) {\r\n var textContainer = document.createElement('div');\r\n textContainer.className = opts.text.className;\r\n\r\n var textStyle = opts.text.style;\r\n if (textStyle) {\r\n if (opts.text.autoStyleContainer) {\r\n container.style.position = 'relative';\r\n }\r\n\r\n utils.setStyles(textContainer, textStyle);\r\n // Default text color to progress bar's color\r\n if (!textStyle.color) {\r\n textContainer.style.color = opts.color;\r\n }\r\n }\r\n\r\n this._initializeTextContainer(opts, container, textContainer);\r\n return textContainer;\r\n };\r\n\r\n // Give custom shapes possibility to modify text element\r\n Shape.prototype._initializeTextContainer = function (opts, container, element) {\r\n // By default, no-op\r\n // Custom shapes should respect API options, such as text.style\r\n };\r\n\r\n Shape.prototype._pathString = function _pathString(opts) {\r\n throw new Error('Override this function for each progress bar');\r\n };\r\n\r\n Shape.prototype._trailString = function _trailString(opts) {\r\n throw new Error('Override this function for each progress bar');\r\n };\r\n\r\n Shape.prototype._warnContainerAspectRatio = function _warnContainerAspectRatio(container) {\r\n if (!this.containerAspectRatio) {\r\n return;\r\n }\r\n\r\n var computedStyle = window.getComputedStyle(container, null);\r\n var width = parseFloat(computedStyle.getPropertyValue('width'), 10);\r\n var height = parseFloat(computedStyle.getPropertyValue('height'), 10);\r\n if (!utils.floatEquals(this.containerAspectRatio, width / height)) {\r\n console.warn(\r\n 'Incorrect aspect ratio of container',\r\n this._container,\r\n 'detected:',\r\n computedStyle.getPropertyValue('width') + '(width)',\r\n '/',\r\n computedStyle.getPropertyValue('height') + '(height)',\r\n '=',\r\n width / height\r\n );\r\n\r\n console.warn(\r\n 'Aspect ratio of should be',\r\n this.containerAspectRatio\r\n );\r\n }\r\n };\r\n\r\n module.exports = Shape;\r\n\r\n }, { \"./path\": 5, \"./utils\": 8 }], 8: [function (require, module, exports) {\r\n // Utility functions\r\n\r\n var PREFIXES = 'Webkit Moz O ms'.split(' ');\r\n var FLOAT_COMPARISON_EPSILON = 0.001;\r\n\r\n // Copy all attributes from source object to destination object.\r\n // destination object is mutated.\r\n function extend(destination, source, recursive) {\r\n destination = destination || {};\r\n source = source || {};\r\n recursive = recursive || false;\r\n\r\n for (var attrName in source) {\r\n if (source.hasOwnProperty(attrName)) {\r\n var destVal = destination[attrName];\r\n var sourceVal = source[attrName];\r\n if (recursive && isObject(destVal) && isObject(sourceVal)) {\r\n destination[attrName] = extend(destVal, sourceVal, recursive);\r\n } else {\r\n destination[attrName] = sourceVal;\r\n }\r\n }\r\n }\r\n\r\n return destination;\r\n }\r\n\r\n // Renders templates with given variables. Variables must be surrounded with\r\n // braces without any spaces, e.g. {variable}\r\n // All instances of variable placeholders will be replaced with given content\r\n // Example:\r\n // render('Hello, {message}!', {message: 'world'})\r\n function render(template, vars) {\r\n var rendered = template;\r\n\r\n for (var key in vars) {\r\n if (vars.hasOwnProperty(key)) {\r\n var val = vars[key];\r\n var regExpString = '\\\\{' + key + '\\\\}';\r\n var regExp = new RegExp(regExpString, 'g');\r\n\r\n rendered = rendered.replace(regExp, val);\r\n }\r\n }\r\n\r\n return rendered;\r\n }\r\n\r\n function setStyle(element, style, value) {\r\n var elStyle = element.style; // cache for performance\r\n\r\n for (var i = 0; i < PREFIXES.length; ++i) {\r\n var prefix = PREFIXES[i];\r\n elStyle[prefix + capitalize(style)] = value;\r\n }\r\n\r\n elStyle[style] = value;\r\n }\r\n\r\n function setStyles(element, styles) {\r\n forEachObject(styles, function (styleValue, styleName) {\r\n // Allow disabling some individual styles by setting them\r\n // to null or undefined\r\n if (styleValue === null || styleValue === undefined) {\r\n return;\r\n }\r\n\r\n // If style's value is {prefix: true, value: '50%'},\r\n // Set also browser prefixed styles\r\n if (isObject(styleValue) && styleValue.prefix === true) {\r\n setStyle(element, styleName, styleValue.value);\r\n } else {\r\n element.style[styleName] = styleValue;\r\n }\r\n });\r\n }\r\n\r\n function capitalize(text) {\r\n return text.charAt(0).toUpperCase() + text.slice(1);\r\n }\r\n\r\n function isString(obj) {\r\n return typeof obj === 'string' || obj instanceof String;\r\n }\r\n\r\n function isFunction(obj) {\r\n return typeof obj === 'function';\r\n }\r\n\r\n function isArray(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]';\r\n }\r\n\r\n // Returns true if `obj` is object as in {a: 1, b: 2}, not if it's function or\r\n // array\r\n function isObject(obj) {\r\n if (isArray(obj)) {\r\n return false;\r\n }\r\n\r\n var type = typeof obj;\r\n return type === 'object' && !!obj;\r\n }\r\n\r\n function forEachObject(object, callback) {\r\n for (var key in object) {\r\n if (object.hasOwnProperty(key)) {\r\n var val = object[key];\r\n callback(val, key);\r\n }\r\n }\r\n }\r\n\r\n function floatEquals(a, b) {\r\n return Math.abs(a - b) < FLOAT_COMPARISON_EPSILON;\r\n }\r\n\r\n // https://coderwall.com/p/nygghw/don-t-use-innerhtml-to-empty-dom-elements\r\n function removeChildren(el) {\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n }\r\n\r\n module.exports = {\r\n extend: extend,\r\n render: render,\r\n setStyle: setStyle,\r\n setStyles: setStyles,\r\n capitalize: capitalize,\r\n isString: isString,\r\n isFunction: isFunction,\r\n isObject: isObject,\r\n forEachObject: forEachObject,\r\n floatEquals: floatEquals,\r\n removeChildren: removeChildren\r\n };\r\n\r\n }, {}]\r\n }, {}, [4])(4)\r\n});"]}