import { commonjsGlobal as B, getDefaultExportFromCjs as N } from "../../../../../../_virtual/_commonjsHelpers.mjs";
import { __module as E } from "../../../../../../_virtual/main.mjs";
(function(k, O) {
  (function(C, l) {
    k.exports = l();
  })(B, function() {
    return (
      /******/
      function(v) {
        var C = {};
        function l(p) {
          if (C[p])
            return C[p].exports;
          var n = C[p] = {
            /******/
            exports: {},
            /******/
            id: p,
            /******/
            loaded: !1
            /******/
          };
          return v[p].call(n.exports, n, n.exports, l), n.loaded = !0, n.exports;
        }
        return l.m = v, l.c = C, l.p = "", l(0);
      }([
        /* 0 */
        /***/
        function(v, C, l) {
          const p = l(1), n = l(2), i = new Array(4);
          function u(a) {
            for (let t = 0; t < i.length; t++)
              i[t] = 0;
            for (let t = 0; t < a.length; t++)
              i[t % 4] = (i[t % 4] << 5) - i[t % 4] + a.charCodeAt(t);
          }
          function c() {
            const a = i[0] ^ i[0] << 11;
            return i[0] = i[1], i[1] = i[2], i[2] = i[3], i[3] = i[3] ^ i[3] >> 19 ^ a ^ a >> 8, (i[3] >>> 0) / (1 << 31 >>> 0);
          }
          function g() {
            const a = Math.floor(c() * 360), t = c() * 60 + 40, x = (c() + c() + c() + c()) * 25;
            return [a / 360, t / 100, x / 100];
          }
          function A(a) {
            const t = a, x = a, r = Math.ceil(t / 2), o = t - r, f = [];
            for (let s = 0; s < x; s++) {
              let e = [];
              for (let d = 0; d < r; d++)
                e[d] = Math.floor(c() * 2.3);
              const _ = e.slice(0, o).reverse();
              e = e.concat(_);
              for (let d = 0; d < e.length; d++)
                f.push(e[d]);
            }
            return f;
          }
          function h(a, t, x, r, o, f) {
            for (let s = 0; s < r; s++)
              for (let e = 0; e < o; e++)
                a.buffer[a.index(t + s, x + e)] = f;
          }
          function z(a) {
            if (!a.seed)
              throw new Error("No seed provided");
            return u(a.seed), Object.assign({
              size: 8,
              scale: 16,
              color: g(),
              bgcolor: g(),
              spotcolor: g()
            }, a);
          }
          function w(a) {
            const t = z({ seed: a.toLowerCase() }), x = A(t.size), r = Math.sqrt(x.length), o = new p(t.size * t.scale, t.size * t.scale, 3);
            o.color(...n(...t.bgcolor));
            const f = o.color(...n(...t.color)), s = o.color(...n(...t.spotcolor));
            for (let e = 0; e < x.length; e++) {
              const _ = Math.floor(e / r), d = e % r;
              if (x[e]) {
                const b = x[e] == 1 ? f : s;
                h(o, d * t.scale, _ * t.scale, t.scale, t.scale, b);
              }
            }
            return `data:image/png;base64,${o.getBase64()}`;
          }
          v.exports = w;
        },
        /* 1 */
        /***/
        function(v, C) {
          /**
           * A handy class to calculate color values.
           *
           * @version 1.0
           * @author Robert Eisele <robert@xarg.org>
           * @copyright Copyright (c) 2010, Robert Eisele
           * @link http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/
           * @license http://www.opensource.org/licenses/bsd-license.php BSD License
           *
           */
          v.exports = function(l, p, n) {
            function i(r, o) {
              for (var f = 2; f < arguments.length; f++)
                for (var s = 0; s < arguments[f].length; s++)
                  r[o++] = arguments[f].charAt(s);
            }
            function u(r) {
              return String.fromCharCode(r >> 8 & 255, r & 255);
            }
            function c(r) {
              return String.fromCharCode(r >> 24 & 255, r >> 16 & 255, r >> 8 & 255, r & 255);
            }
            function g(r) {
              return String.fromCharCode(r & 255, r >> 8 & 255);
            }
            this.width = l, this.height = p, this.depth = n, this.pix_size = p * (l + 1), this.data_size = 2 + this.pix_size + 5 * Math.floor((65534 + this.pix_size) / 65535) + 4, this.ihdr_offs = 0, this.ihdr_size = 4 + 4 + 13 + 4, this.plte_offs = this.ihdr_offs + this.ihdr_size, this.plte_size = 4 + 4 + 3 * n + 4, this.trns_offs = this.plte_offs + this.plte_size, this.trns_size = 4 + 4 + n + 4, this.idat_offs = this.trns_offs + this.trns_size, this.idat_size = 4 + 4 + this.data_size + 4, this.iend_offs = this.idat_offs + this.idat_size, this.iend_size = 4 + 4 + 4, this.buffer_size = this.iend_offs + this.iend_size, this.buffer = new Array(), this.palette = new Object(), this.pindex = 0;
            for (var A = new Array(), h = 0; h < this.buffer_size; h++)
              this.buffer[h] = "\0";
            i(this.buffer, this.ihdr_offs, c(this.ihdr_size - 12), "IHDR", c(l), c(p), "\b"), i(this.buffer, this.plte_offs, c(this.plte_size - 12), "PLTE"), i(this.buffer, this.trns_offs, c(this.trns_size - 12), "tRNS"), i(this.buffer, this.idat_offs, c(this.idat_size - 12), "IDAT"), i(this.buffer, this.iend_offs, c(this.iend_size - 12), "IEND");
            var z = 8 + 112 << 8 | 192;
            z += 31 - z % 31, i(this.buffer, this.idat_offs + 8, u(z));
            for (var h = 0; (h << 16) - 1 < this.pix_size; h++) {
              var w, a;
              h + 65535 < this.pix_size ? (w = 65535, a = "\0") : (w = this.pix_size - (h << 16) - h, a = ""), i(this.buffer, this.idat_offs + 8 + 2 + (h << 16) + (h << 2), a, g(w), g(~w));
            }
            for (var h = 0; h < 256; h++) {
              for (var t = h, x = 0; x < 8; x++)
                t & 1 ? t = -306674912 ^ t >> 1 & 2147483647 : t = t >> 1 & 2147483647;
              A[h] = t;
            }
            this.index = function(r, o) {
              var f = o * (this.width + 1) + r + 1, s = this.idat_offs + 8 + 2 + 5 * Math.floor(f / 65535 + 1) + f;
              return s;
            }, this.color = function(r, o, f, s) {
              s = s >= 0 ? s : 255;
              var e = ((s << 8 | r) << 8 | o) << 8 | f;
              if (typeof this.palette[e] > "u") {
                if (this.pindex == this.depth)
                  return "\0";
                var _ = this.plte_offs + 8 + 3 * this.pindex;
                this.buffer[_ + 0] = String.fromCharCode(r), this.buffer[_ + 1] = String.fromCharCode(o), this.buffer[_ + 2] = String.fromCharCode(f), this.buffer[this.trns_offs + 8 + this.pindex] = String.fromCharCode(s), this.palette[e] = String.fromCharCode(this.pindex++);
              }
              return this.palette[e];
            }, this.getBase64 = function() {
              var r = this.getDump(), o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", f, s, e, _, d, b, S, D = r.length, m = 0, M = "";
              do
                f = r.charCodeAt(m), _ = f >> 2, s = r.charCodeAt(m + 1), d = (f & 3) << 4 | s >> 4, e = r.charCodeAt(m + 2), D < m + 2 ? b = 64 : b = (s & 15) << 2 | e >> 6, D < m + 3 ? S = 64 : S = e & 63, M += o.charAt(_) + o.charAt(d) + o.charAt(b) + o.charAt(S);
              while ((m += 3) < D);
              return M;
            }, this.getDump = function() {
              for (var r = 65521, o = 5552, f = 1, s = 0, e = o, _ = 0; _ < this.height; _++)
                for (var d = -1; d < this.width; d++)
                  f += this.buffer[this.index(d, _)].charCodeAt(0), s += f, (e -= 1) == 0 && (f %= r, s %= r, e = o);
              f %= r, s %= r, i(this.buffer, this.idat_offs + this.idat_size - 8, c(s << 16 | f));
              function b(S, D, m) {
                for (var M = -1, y = 4; y < m - 4; y += 1)
                  M = A[(M ^ S[D + y].charCodeAt(0)) & 255] ^ M >> 8 & 16777215;
                i(S, D + m - 4, c(M ^ -1));
              }
              return b(this.buffer, this.ihdr_offs, this.ihdr_size), b(this.buffer, this.plte_offs, this.plte_size), b(this.buffer, this.trns_offs, this.trns_size), b(this.buffer, this.idat_offs, this.idat_size), b(this.buffer, this.iend_offs, this.iend_size), `PNG\r

` + this.buffer.join("");
            };
          };
        },
        /* 2 */
        /***/
        function(v, C) {
          function l(n, i, u) {
            return u < 0 && (u += 1), u > 1 && (u -= 1), u < 1 / 6 ? n + (i - n) * 6 * u : u < 1 / 2 ? i : u < 2 / 3 ? n + (i - n) * (2 / 3 - u) * 6 : n;
          }
          function p(n, i, u) {
            let c, g, A;
            if (i == 0)
              c = g = A = u;
            else {
              const h = u < 0.5 ? u * (1 + i) : u + i - u * i, z = 2 * u - h;
              c = l(z, h, n + 1 / 3), g = l(z, h, n), A = l(z, h, n - 1 / 3);
            }
            return [Math.round(c * 255), Math.round(g * 255), Math.round(A * 255), 255];
          }
          v.exports = p;
        }
        /******/
      ])
    );
  });
})(E);
var j = E.exports;
const L = /* @__PURE__ */ N(j);
export {
  L as default
};
//# sourceMappingURL=main.mjs.map
