/**********************
* The MIT License (MIT)
*
* Copyright (c) 2014 David Arvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
**********************/

(function (name, definition) {
    var global;

    if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
        module.exports = definition();
    } else if (typeof define === 'function' && typeof define.amd === 'object') {
        define(definition);
    } else {
        // get the global object in ES5 strict environments
        // ref: http://stackoverflow.com/questions/3277182/how-to-get-the-global-object-in-javascript
        try {
            global = Function('return this')() || (42, eval)('this');
        } catch (e) {
            global = window;
        }

        global[name] = definition();
    }
})('AnimationLoop', function () {

function AnimationLoop (options) {
    if (!(this instanceof AnimationLoop)) {
        return new AnimationLoop(options);
    }

    checkOptions(options);

    this.animations = createAnimationArray(options);
    this.startTime = null;
    this.remaining = this.animations.length;
    this.complete = false;
}

AnimationLoop.create = function (options) {
    return new this(options).start();
};

function checkOptions (options) {
    if (typeof options !== 'function' && typeof options !== 'object' && !Array.isArray(options)) {
        throw new Error('Options to AnimationLoop are not of a supported type.');
    }

    if (Array.isArray(options)) {
        var optionsOK = options.every(function (anim) {
            return typeof anim === 'function' || (typeof anim === 'object' && !Array.isArray(anim));
        });

        if (!optionsOK) {
            throw new Error('Array options to AnimationLoop are not of a supported type.');
        }
    }
}

function createAnimationArray (options) {
    if (Array.isArray(options)) {
        return options.map(createAnimationArray);
    }

    if (typeof options === 'object') {
        return [options];
    }

    if (typeof options === 'function') {
        return [{ render: options }];
    }
}

var raf = (function() {
    return window.requestAnimationFrame ||
           window.webkitRequestAnimationFrame ||
           window.mozRequestAnimationFrame;
})();

var caf = (function() {
    return window.cancelAnimationFrame ||
           window.cancelRequestAnimationFrame ||
           window.webkitCancelRequestAnimationFrame ||
           window.mozCancelRequestAnimationFrame;
})();

AnimationLoop.prototype = {
    constructor: AnimationLoop,

    start: function () {
        this.rafId = raf(this.cycle.bind(this));
        return this;
    },

    cancel: function () {
        caf(this.rafId);
        return this;
    },

    cycle: function (now) {
        var animations;
        var startTime, lastTime, runningTime, deltaT, timing;
        var pauseThreshold = this.pauseThreshold;

        if (!this.animations.length) {
            this.complete = true;
            return;
        }

        startTime = this.startTime = this.startTime || now;
        lastTime = this.lastTime = this.lastTime || now;
        runningTime = this.runningTime || now - startTime;
        deltaT = now - lastTime;

        this.lastTime = now;
        this.rafId = raf(this.cycle.bind(this));

        if (pauseThreshold && deltaT >= pauseThreshold) {
            return;
        }

        // runningTime only updates when the time between
        // frames is short enough, as defined by the user.
        // the gap can be wide if the tab becomes inactive, etc.
        // ref: hacks.mozilla.org/2011/08/animating-with-javascript-from-setinterval-to-requestanimationframe/
        this.runningTime = (runningTime += deltaT);

        timing = {
            now: now,
            deltaT: deltaT,
            startTime: startTime,
            lastTime: lastTime,
            runningTime: runningTime,
        };

        animations = this.animations.slice();
        animations.forEach(function (anim) {
            var pct, running;
            var passArgs = [timing];

            if (anim.duration) {
                pct = Math.max(0, Math.min(1, runningTime / anim.duration));
                anim.lastPct = anim.pct || pct;
                anim.pct = pct;
                passArgs.push({ pct: pct, lastPct: anim.lastPct });
            }

            if (typeof anim.before === 'function') {
                running = anim.before.apply(null, passArgs);
            }

            // only allow `false` or 'cancel'
            if (running === false || running === 'cancel') {
                anim.running = running;
            }
        }, this);

        this.animations = animations.filter(function (anim) {
            var running = anim.running;
            var passArgs = [timing];

            if (anim.duration) {
                passArgs.push({ pct: anim.pct, lastPct: anim.lastPct });
            }

            // only render if anim.before() didn't return `false` or 'cancel'
            if (running !== false && running !== 'cancel') {
                running = anim.render.apply(null, passArgs);
            }

            // if animation running time is 100% of its duration, don't queue it up again
            if (running !== false && running !== 'cancel' && anim.pct === 1) {
                running = false;
            }

            // anim.done() is run only if the animation is not canceled
            switch (running) {
            case false:
                (typeof anim.done === 'function') && anim.done.apply(null, passArgs);
            // fall through to 'cancel' case
            case 'cancel':
                this.remaining--;
                return false;
            default:
                return true;
            }
        }, this);
    },
};

return AnimationLoop;

});

@@ -2868,26 +2868,24 @@
 s)) %7B%0A      
-  
 return optio
@@ -2912,16 +2912,100 @@
 onArray)
+.reduce(function (memo, wrapped) %7B%0A        return memo.concat(wrapped);%0A      %7D, %5B%5D)
 ;%0A    %7D%0A

Fix creating an animation loop from an array