!function(n, t) {
    "object" == typeof module && module.exports ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : n.Spinner = t()
}(this, function() {
    "use strict";
    function i(n, t) {
        var i, r = document.createElement(n || "div");
        for (i in t)
            r[i] = t[i];
        return r
    }
    function t(n) {
        for (var t = 1, i = arguments.length; i > t; t++)
            n.appendChild(arguments[t]);
        return n
    }
    function a(n, t, i, r) {
        var e = ["opacity", t, ~~(100 * n), i, r].join("-")
          , o = .01 + i / r * 100
          , s = Math.max(1 - (1 - n) / t * (100 - o), n)
          , h = u.substring(0, u.indexOf("Animation")).toLowerCase()
          , c = h && "-" + h + "-" || "";
        return l[e] || (f.insertRule("@" + c + "keyframes " + e + "{0%{opacity:" + s + "}" + o + "%{opacity:" + n + "}" + (o + .01) + "%{opacity:1}" + (o + t) % 100 + "%{opacity:" + n + "}100%{opacity:" + s + "}}", f.cssRules.length),
        l[e] = 1),
        e
    }
    function o(n, t) {
        var r, i, u = n.style;
        if (t = t.charAt(0).toUpperCase() + t.slice(1),
        void 0 !== u[t])
            return t;
        for (i = 0; i < c.length; i++)
            if (r = c[i] + t,
            void 0 !== u[r])
                return r
    }
    function n(n, t) {
        for (var i in t)
            n.style[o(n, i) || i] = t[i];
        return n
    }
    function s(n) {
        for (var r, i, t = 1; t < arguments.length; t++) {
            r = arguments[t];
            for (i in r)
                void 0 === n[i] && (n[i] = r[i])
        }
        return n
    }
    function h(n, t) {
        return "string" == typeof n ? n : n[t % n.length]
    }
    function r(n) {
        this.opts = s(n || {}, r.defaults, y)
    }
    function v() {
        function u(n, t) {
            return i("<" + n + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', t)
        }
        f.addRule(".spin-vml", "behavior:url(#default#VML)");
        r.prototype.lines = function(i, r) {
            function s() {
                return n(u("group", {
                    coordsize: o + " " + o,
                    coordorigin: -e + " " + -e
                }), {
                    width: o,
                    height: o
                })
            }
            function c(i, f, o) {
                t(a, t(n(s(), {
                    rotation: 360 / r.lines * i + "deg",
                    left: ~~f
                }), t(n(u("roundrect", {
                    arcsize: r.corners
                }), {
                    width: e,
                    height: r.scale * r.width,
                    left: r.scale * r.radius,
                    top: -r.scale * r.width >> 1,
                    filter: o
                }), u("fill", {
                    color: h(r.color, i),
                    opacity: r.opacity
                }), u("stroke", {
                    opacity: 0
                }))))
            }
            var f, e = r.scale * (r.length + r.width), o = 2 * r.scale * e, l = -(r.width + r.length) * r.scale * 2 + "px", a = n(s(), {
                position: "absolute",
                top: l,
                left: l
            });
            if (r.shadow)
                for (f = 1; f <= r.lines; f++)
                    c(f, -2, "progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");
            for (f = 1; f <= r.lines; f++)
                c(f);
            return t(i, a)
        }
        ;
        r.prototype.opacity = function(n, t, i, r) {
            var u = n.firstChild;
            r = r.shadow && r.lines || 0;
            u && t + r < u.childNodes.length && (u = u.childNodes[t + r],
            u = u && u.firstChild,
            u = u && u.firstChild,
            u && (u.opacity = i))
        }
    }
    var u, f, c = ["webkit", "Moz", "ms", "O"], l = {}, y = {
        lines: 12,
        length: 7,
        width: 5,
        radius: 10,
        scale: 1,
        corners: 1,
        color: "#000",
        opacity: .25,
        rotate: 0,
        direction: 1,
        speed: 1,
        trail: 100,
        fps: 20,
        zIndex: 2e9,
        className: "spinner",
        top: "50%",
        left: "50%",
        shadow: !1,
        hwaccel: !1,
        position: "absolute"
    }, e;
    return (r.defaults = {},
    s(r.prototype, {
        spin: function(t) {
            this.stop();
            var f = this
              , r = f.opts
              , e = f.el = i(null, {
                className: r.className
            });
            if (n(e, {
                position: r.position,
                width: 0,
                zIndex: r.zIndex,
                left: r.left,
                top: r.top
            }),
            t && t.insertBefore(e, t.firstChild || null),
            e.setAttribute("role", "progressbar"),
            f.lines(e, f.opts),
            !u) {
                var s, h = 0, l = (r.lines - 1) * (1 - r.direction) / 2, c = r.fps, o = c / r.speed, a = (1 - r.opacity) / (o * r.trail / 100), v = o / r.lines;
                !function y() {
                    h++;
                    for (var n = 0; n < r.lines; n++)
                        s = Math.max(1 - (h + (r.lines - n) * v) % o * a, r.opacity),
                        f.opacity(e, n * r.direction + l, s, r);
                    f.timeout = f.el && setTimeout(y, ~~(1e3 / c))
                }()
            }
            return f
        },
        stop: function() {
            var n = this.el;
            return n && (clearTimeout(this.timeout),
            n.parentNode && n.parentNode.removeChild(n),
            this.el = void 0),
            this
        },
        lines: function(r, f) {
            function s(t, r) {
                return n(i(), {
                    position: "absolute",
                    width: f.scale * (f.length + f.width) + "px",
                    height: f.scale * f.width + "px",
                    background: t,
                    boxShadow: r,
                    transformOrigin: "left",
                    transform: "rotate(" + ~~(360 / f.lines * e + f.rotate) + "deg) translate(" + f.scale * f.radius + "px,0)",
                    borderRadius: (f.corners * f.scale * f.width >> 1) + "px"
                })
            }
            for (var o, e = 0, c = (f.lines - 1) * (1 - f.direction) / 2; e < f.lines; e++)
                o = n(i(), {
                    position: "absolute",
                    top: 1 + ~(f.scale * f.width / 2) + "px",
                    transform: f.hwaccel ? "translate3d(0,0,0)" : "",
                    opacity: f.opacity,
                    animation: u && a(f.opacity, f.trail, c + e * f.direction, f.lines) + " " + 1 / f.speed + "s linear infinite"
                }),
                f.shadow && t(o, n(s("#000", "0 0 4px #000"), {
                    top: "2px"
                })),
                t(r, t(o, s(h(f.color, e), "0 0 1px rgba(0,0,0,.1)")));
            return r
        },
        opacity: function(n, t, i) {
            t < n.childNodes.length && (n.childNodes[t].style.opacity = i)
        }
    }),
    "undefined" != typeof document) && (f = function() {
        var n = i("style", {
            type: "text/css"
        });
        return t(document.getElementsByTagName("head")[0], n),
        n.sheet || n.styleSheet
    }(),
    e = n(i("group"), {
        behavior: "url(#default#VML)"
    }),
    !o(e, "transform") && e.adj ? v() : u = o(e, "animation")),
    r
}),
function(n, t) {
    "object" == typeof exports ? module.exports = t(require("spin.js")) : "function" == typeof define && define.amd ? define(["spin"], t) : n.Ladda = t(n.Spinner)
}(this, function(n) {
    "use strict";
    function i(n) {
        var i, r, u, f;
        return n === void 0 ? (console.warn("Ladda button target must be defined."),
        void 0) : (n.querySelector(".ladda-label") || (n.innerHTML = '<span class="ladda-label">' + n.innerHTML + "<\/span>"),
        r = n.querySelector(".ladda-spinner"),
        r || (r = document.createElement("span"),
        r.className = "ladda-spinner"),
        n.appendChild(r),
        f = {
            start: function() {
                return i || (i = o(n)),
                n.setAttribute("disabled", ""),
                n.setAttribute("data-loading", ""),
                clearTimeout(u),
                i.spin(r),
                this.setProgress(0),
                this
            },
            startAfter: function(n) {
                return clearTimeout(u),
                u = setTimeout(function() {
                    f.start()
                }, n),
                this
            },
            stop: function() {
                return n.removeAttribute("disabled"),
                n.removeAttribute("data-loading"),
                clearTimeout(u),
                i && (u = setTimeout(function() {
                    i.stop()
                }, 1e3)),
                this
            },
            toggle: function() {
                return this.isLoading() ? this.stop() : this.start(),
                this
            },
            setProgress: function(t) {
                t = Math.max(Math.min(t, 1), 0);
                var i = n.querySelector(".ladda-progress");
                0 === t && i && i.parentNode ? i.parentNode.removeChild(i) : (i || (i = document.createElement("div"),
                i.className = "ladda-progress",
                n.appendChild(i)),
                i.style.width = (t || 0) * n.offsetWidth + "px")
            },
            enable: function() {
                return this.stop(),
                this
            },
            disable: function() {
                return this.stop(),
                n.setAttribute("disabled", ""),
                this
            },
            isLoading: function() {
                return n.hasAttribute("data-loading")
            },
            remove: function() {
                clearTimeout(u);
                n.removeAttribute("disabled", "");
                n.removeAttribute("data-loading", "");
                i && (i.stop(),
                i = null);
                for (var r = 0, e = t.length; e > r; r++)
                    if (f === t[r]) {
                        t.splice(r, 1);
                        break
                    }
            }
        },
        t.push(f),
        f)
    }
    function r(n, t) {
        for (; n.parentNode && n.tagName !== t; )
            n = n.parentNode;
        if (t === n.tagName)
            return n
    }
    function u(n) {
        for (var i, t, u = ["input", "textarea", "select"], f = [], r = 0; u.length > r; r++)
            for (i = n.getElementsByTagName(u[r]),
            t = 0; i.length > t; t++)
                i[t].hasAttribute("required") && f.push(i[t]);
        return f
    }
    function f(n, t) {
        var f, e, o;
        for (t = t || {},
        f = [],
        "string" == typeof n ? f = s(document.querySelectorAll(n)) : "object" == typeof n && "string" == typeof n.nodeName && (f = [n]),
        e = 0,
        o = f.length; o > e; e++)
            (function() {
                var n = f[e], o, s;
                "function" == typeof n.addEventListener && (o = i(n),
                s = -1,
                n.addEventListener("click", function() {
                    var e = !0, h = r(n, "FORM"), f, i;
                    if (h !== void 0)
                        for (f = u(h),
                        i = 0; f.length > i; i++)
                            "" === f[i].value.replace(/^\s+|\s+$/g, "") && (e = !1),
                            "checkbox" !== f[i].type && "radio" !== f[i].type || f[i].checked || (e = !1),
                            "email" === f[i].type && (e = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/.test(f[i].value));
                    e && (o.startAfter(1),
                    "number" == typeof t.timeout && (clearTimeout(s),
                    s = setTimeout(o.stop, t.timeout)),
                    "function" == typeof t.callback && t.callback.apply(null, [o]))
                }, !1))
            }
            )()
    }
    function e() {
        for (var n = 0, i = t.length; i > n; n++)
            t[n].stop()
    }
    function o(t) {
        var u, i = t.offsetHeight;
        0 === i && (i = parseFloat(window.getComputedStyle(t).height));
        i > 32 && (i *= .8);
        t.hasAttribute("data-spinner-size") && (i = parseInt(t.getAttribute("data-spinner-size"), 10));
        t.hasAttribute("data-spinner-color") && (u = t.getAttribute("data-spinner-color"));
        var r = .2 * i
          , f = .6 * r
          , e = 7 > r ? 2 : 3;
        return new n({
            color: u || "#fff",
            lines: 12,
            radius: r,
            length: f,
            width: e,
            zIndex: "auto",
            top: "auto",
            left: "auto",
            className: ""
        })
    }
    function s(n) {
        for (var i = [], t = 0; n.length > t; t++)
            i.push(n[t]);
        return i
    }
    var t = [];
    return {
        bind: f,
        create: i,
        stopAll: e
    }
})
