import { __module as w } from "./index-spin2.js";
var L = w.exports, k;
function _() {
  return k ? w.exports : (k = 1, (function(z) {
    (function(g, h) {
      z.exports ? z.exports = h() : g.Spinner = h();
    })(L, function() {
      var g = ["webkit", "Moz", "ms", "O"], h = {}, m, y;
      function f(i, e) {
        var t = document.createElement(i || "div"), n;
        for (n in e) t[n] = e[n];
        return t;
      }
      function u(i) {
        for (var e = 1, t = arguments.length; e < t; e++)
          i.appendChild(arguments[e]);
        return i;
      }
      function A(i, e, t, n) {
        var r = ["opacity", e, ~~(i * 100), t, n].join("-"), s = 0.01 + t / n * 100, o = Math.max(1 - (1 - i) / e * (100 - s), i), l = m.substring(0, m.indexOf("Animation")).toLowerCase(), a = l && "-" + l + "-" || "";
        return h[r] || (y.insertRule(
          "@" + a + "keyframes " + r + "{0%{opacity:" + o + "}" + s + "%{opacity:" + i + "}" + (s + 0.01) + "%{opacity:1}" + (s + e) % 100 + "%{opacity:" + i + "}100%{opacity:" + o + "}}",
          y.cssRules.length
        ), h[r] = 1), r;
      }
      function b(i, e) {
        var t = i.style, n, r;
        if (e = e.charAt(0).toUpperCase() + e.slice(1), t[e] !== void 0) return e;
        for (r = 0; r < g.length; r++)
          if (n = g[r] + e, t[n] !== void 0) return n;
      }
      function c(i, e) {
        for (var t in e)
          i.style[b(i, t) || t] = e[t];
        return i;
      }
      function M(i) {
        for (var e = 1; e < arguments.length; e++) {
          var t = arguments[e];
          for (var n in t)
            i[n] === void 0 && (i[n] = t[n]);
        }
        return i;
      }
      function S(i, e) {
        return typeof i == "string" ? i : i[e % i.length];
      }
      var R = {
        lines: 12,
        length: 7,
        width: 5,
        radius: 10,
        scale: 1,
        corners: 1,
        color: "#000",
        opacity: 1 / 4,
        rotate: 0,
        direction: 1,
        speed: 1,
        trail: 100,
        fps: 20,
        zIndex: 2e9,
        className: "spinner",
        top: "50%",
        left: "50%",
        shadow: !1,
        hwaccel: !1,
        position: "absolute"
        // Element positioning
      };
      function d(i) {
        this.opts = M(i || {}, d.defaults, R);
      }
      d.defaults = {}, M(d.prototype, {
        /**
         * Adds the spinner to the given target element. If this instance is already
         * spinning, it is automatically removed from its previous target b calling
         * stop() internally.
         */
        spin: function(i) {
          this.stop();
          var e = this, t = e.opts, n = e.el = f(null, { className: t.className });
          if (c(n, {
            position: t.position,
            width: 0,
            zIndex: t.zIndex,
            left: t.left,
            top: t.top
          }), i && i.insertBefore(n, i.firstChild || null), n.setAttribute("role", "progressbar"), e.lines(n, e.opts), !m) {
            var r = 0, s = (t.lines - 1) * (1 - t.direction) / 2, o, l = t.fps, a = l / t.speed, v = (1 - t.opacity) / (a * t.trail / 100), x = a / t.lines;
            (function N() {
              r++;
              for (var p = 0; p < t.lines; p++)
                o = Math.max(1 - (r + (t.lines - p) * x) % a * v, t.opacity), e.opacity(n, p * t.direction + s, o, t);
              e.timeout = e.el && setTimeout(N, ~~(1e3 / l));
            })();
          }
          return e;
        },
        stop: function() {
          var i = this.el;
          return i && (clearTimeout(this.timeout), i.parentNode && i.parentNode.removeChild(i), this.el = void 0), this;
        },
        lines: function(i, e) {
          var t = 0, n = (e.lines - 1) * (1 - e.direction) / 2, r;
          function s(o, l) {
            return c(f(), {
              position: "absolute",
              width: e.scale * (e.length + e.width) + "px",
              height: e.scale * e.width + "px",
              background: o,
              boxShadow: l,
              transformOrigin: "left",
              transform: "rotate(" + ~~(360 / e.lines * t + e.rotate) + "deg) translate(" + e.scale * e.radius + "px,0)",
              borderRadius: (e.corners * e.scale * e.width >> 1) + "px"
            });
          }
          for (; t < e.lines; t++)
            r = c(f(), {
              position: "absolute",
              top: 1 + ~(e.scale * e.width / 2) + "px",
              transform: e.hwaccel ? "translate3d(0,0,0)" : "",
              opacity: e.opacity,
              animation: m && A(e.opacity, e.trail, n + t * e.direction, e.lines) + " " + 1 / e.speed + "s linear infinite"
            }), e.shadow && u(r, c(s("#000", "0 0 4px #000"), { top: "2px" })), u(i, u(r, s(S(e.color, t), "0 0 1px rgba(0,0,0,.1)")));
          return i;
        },
        opacity: function(i, e, t) {
          e < i.childNodes.length && (i.childNodes[e].style.opacity = t);
        }
      });
      function I() {
        function i(e, t) {
          return f("<" + e + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', t);
        }
        y.addRule(".spin-vml", "behavior:url(#default#VML)"), d.prototype.lines = function(e, t) {
          var n = t.scale * (t.length + t.width), r = t.scale * 2 * n;
          function s() {
            return c(
              i("group", {
                coordsize: r + " " + r,
                coordorigin: -n + " " + -n
              }),
              { width: r, height: r }
            );
          }
          var o = -(t.width + t.length) * t.scale * 2 + "px", l = c(s(), { position: "absolute", top: o, left: o }), a;
          function v(x, N, p) {
            u(
              l,
              u(
                c(s(), { rotation: 360 / t.lines * x + "deg", left: ~~N }),
                u(
                  c(
                    i("roundrect", { arcsize: t.corners }),
                    {
                      width: n,
                      height: t.scale * t.width,
                      left: t.scale * t.radius,
                      top: -t.scale * t.width >> 1,
                      filter: p
                    }
                  ),
                  i("fill", { color: S(t.color, x), opacity: t.opacity }),
                  i("stroke", { opacity: 0 })
                  // transparent stroke to fix color bleeding upon opacity change
                )
              )
            );
          }
          if (t.shadow)
            for (a = 1; a <= t.lines; a++)
              v(a, -2, "progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");
          for (a = 1; a <= t.lines; a++) v(a);
          return u(e, l);
        }, d.prototype.opacity = function(e, t, n, r) {
          var s = e.firstChild;
          r = r.shadow && r.lines || 0, s && t + r < s.childNodes.length && (s = s.childNodes[t + r], s = s && s.firstChild, s = s && s.firstChild, s && (s.opacity = n));
        };
      }
      if (typeof document < "u") {
        y = (function() {
          var i = f("style", { type: "text/css" });
          return u(document.getElementsByTagName("head")[0], i), i.sheet || i.styleSheet;
        })();
        var C = c(f("group"), { behavior: "url(#default#VML)" });
        !b(C, "transform") && C.adj ? I() : m = b(C, "animation");
      }
      return d;
    });
  })(w), w.exports);
}
export {
  _ as __require
};
