import "react";
import { lI as t, lz as e } from "./ant-design-icons-6bfdc7d5.js";
var r, n, o = Object.defineProperty, s = Object.getOwnPropertySymbols, i = Object.prototype.hasOwnProperty, a = Object.prototype.propertyIsEnumerable, l = (t2, e2, r2) => e2 in t2 ? o(t2, e2, { enumerable: true, configurable: true, writable: true, value: r2 }) : t2[e2] = r2, h = (t2, e2) => {
  for (var r2 in e2 || (e2 = {}))
    i.call(e2, r2) && l(t2, r2, e2[r2]);
  if (s)
    for (var r2 of s(e2))
      a.call(e2, r2) && l(t2, r2, e2[r2]);
  return t2;
};
((t2) => {
  const e2 = class {
    constructor(t3, r3, n3, o3) {
      if (this.version = t3, this.errorCorrectionLevel = r3, this.modules = [], this.isFunction = [], t3 < e2.MIN_VERSION || t3 > e2.MAX_VERSION)
        throw new RangeError("Version value out of range");
      if (o3 < -1 || o3 > 7)
        throw new RangeError("Mask value out of range");
      this.size = 4 * t3 + 17;
      let i3 = [];
      for (let t4 = 0; t4 < this.size; t4++)
        i3.push(false);
      for (let t4 = 0; t4 < this.size; t4++)
        this.modules.push(i3.slice()), this.isFunction.push(i3.slice());
      this.drawFunctionPatterns();
      const a3 = this.addEccAndInterleave(n3);
      if (this.drawCodewords(a3), -1 == o3) {
        let t4 = 1e9;
        for (let e3 = 0; e3 < 8; e3++) {
          this.applyMask(e3), this.drawFormatBits(e3);
          const r4 = this.getPenaltyScore();
          r4 < t4 && (o3 = e3, t4 = r4), this.applyMask(e3);
        }
      }
      s2(0 <= o3 && o3 <= 7), this.mask = o3, this.applyMask(o3), this.drawFormatBits(o3), this.isFunction = [];
    }
    static encodeText(r3, n3) {
      const o3 = t2.QrSegment.makeSegments(r3);
      return e2.encodeSegments(o3, n3);
    }
    static encodeBinary(r3, n3) {
      const o3 = t2.QrSegment.makeBytes(r3);
      return e2.encodeSegments([o3], n3);
    }
    static encodeSegments(t3, r3, o3 = 1, i3 = 40, l2 = -1, h2 = true) {
      if (!(e2.MIN_VERSION <= o3 && o3 <= i3 && i3 <= e2.MAX_VERSION) || l2 < -1 || l2 > 7)
        throw new RangeError("Invalid value");
      let u2, c2;
      for (u2 = o3; ; u2++) {
        const n3 = 8 * e2.getNumDataCodewords(u2, r3), o4 = a2.getTotalBits(t3, u2);
        if (o4 <= n3) {
          c2 = o4;
          break;
        }
        if (u2 >= i3)
          throw new RangeError("Data too long");
      }
      for (const t4 of [e2.Ecc.MEDIUM, e2.Ecc.QUARTILE, e2.Ecc.HIGH])
        h2 && c2 <= 8 * e2.getNumDataCodewords(u2, t4) && (r3 = t4);
      let d2 = [];
      for (const e3 of t3) {
        n2(e3.mode.modeBits, 4, d2), n2(e3.numChars, e3.mode.numCharCountBits(u2), d2);
        for (const t4 of e3.getData())
          d2.push(t4);
      }
      s2(d2.length == c2);
      const f2 = 8 * e2.getNumDataCodewords(u2, r3);
      s2(d2.length <= f2), n2(0, Math.min(4, f2 - d2.length), d2), n2(0, (8 - d2.length % 8) % 8, d2), s2(d2.length % 8 == 0);
      for (let t4 = 236; d2.length < f2; t4 ^= 253)
        n2(t4, 8, d2);
      let g2 = [];
      for (; 8 * g2.length < d2.length; )
        g2.push(0);
      return d2.forEach((t4, e3) => g2[e3 >>> 3] |= t4 << 7 - (7 & e3)), new e2(u2, r3, g2, l2);
    }
    getModule(t3, e3) {
      return 0 <= t3 && t3 < this.size && 0 <= e3 && e3 < this.size && this.modules[e3][t3];
    }
    getModules() {
      return this.modules;
    }
    drawFunctionPatterns() {
      for (let t4 = 0; t4 < this.size; t4++)
        this.setFunctionModule(6, t4, t4 % 2 == 0), this.setFunctionModule(t4, 6, t4 % 2 == 0);
      this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
      const t3 = this.getAlignmentPatternPositions(), e3 = t3.length;
      for (let r3 = 0; r3 < e3; r3++)
        for (let n3 = 0; n3 < e3; n3++)
          0 == r3 && 0 == n3 || 0 == r3 && n3 == e3 - 1 || r3 == e3 - 1 && 0 == n3 || this.drawAlignmentPattern(t3[r3], t3[n3]);
      this.drawFormatBits(0), this.drawVersion();
    }
    drawFormatBits(t3) {
      const e3 = this.errorCorrectionLevel.formatBits << 3 | t3;
      let r3 = e3;
      for (let t4 = 0; t4 < 10; t4++)
        r3 = r3 << 1 ^ 1335 * (r3 >>> 9);
      const n3 = 21522 ^ (e3 << 10 | r3);
      s2(n3 >>> 15 == 0);
      for (let t4 = 0; t4 <= 5; t4++)
        this.setFunctionModule(8, t4, o2(n3, t4));
      this.setFunctionModule(8, 7, o2(n3, 6)), this.setFunctionModule(8, 8, o2(n3, 7)), this.setFunctionModule(7, 8, o2(n3, 8));
      for (let t4 = 9; t4 < 15; t4++)
        this.setFunctionModule(14 - t4, 8, o2(n3, t4));
      for (let t4 = 0; t4 < 8; t4++)
        this.setFunctionModule(this.size - 1 - t4, 8, o2(n3, t4));
      for (let t4 = 8; t4 < 15; t4++)
        this.setFunctionModule(8, this.size - 15 + t4, o2(n3, t4));
      this.setFunctionModule(8, this.size - 8, true);
    }
    drawVersion() {
      if (this.version < 7)
        return;
      let t3 = this.version;
      for (let e4 = 0; e4 < 12; e4++)
        t3 = t3 << 1 ^ 7973 * (t3 >>> 11);
      const e3 = this.version << 12 | t3;
      s2(e3 >>> 18 == 0);
      for (let t4 = 0; t4 < 18; t4++) {
        const r3 = o2(e3, t4), n3 = this.size - 11 + t4 % 3, s3 = Math.floor(t4 / 3);
        this.setFunctionModule(n3, s3, r3), this.setFunctionModule(s3, n3, r3);
      }
    }
    drawFinderPattern(t3, e3) {
      for (let r3 = -4; r3 <= 4; r3++)
        for (let n3 = -4; n3 <= 4; n3++) {
          const o3 = Math.max(Math.abs(n3), Math.abs(r3)), s3 = t3 + n3, i3 = e3 + r3;
          0 <= s3 && s3 < this.size && 0 <= i3 && i3 < this.size && this.setFunctionModule(s3, i3, 2 != o3 && 4 != o3);
        }
    }
    drawAlignmentPattern(t3, e3) {
      for (let r3 = -2; r3 <= 2; r3++)
        for (let n3 = -2; n3 <= 2; n3++)
          this.setFunctionModule(t3 + n3, e3 + r3, 1 != Math.max(Math.abs(n3), Math.abs(r3)));
    }
    setFunctionModule(t3, e3, r3) {
      this.modules[e3][t3] = r3, this.isFunction[e3][t3] = true;
    }
    addEccAndInterleave(t3) {
      const r3 = this.version, n3 = this.errorCorrectionLevel;
      if (t3.length != e2.getNumDataCodewords(r3, n3))
        throw new RangeError("Invalid argument");
      const o3 = e2.NUM_ERROR_CORRECTION_BLOCKS[n3.ordinal][r3], i3 = e2.ECC_CODEWORDS_PER_BLOCK[n3.ordinal][r3], a3 = Math.floor(e2.getNumRawDataModules(r3) / 8), l2 = o3 - a3 % o3, h2 = Math.floor(a3 / o3);
      let u2 = [];
      const c2 = e2.reedSolomonComputeDivisor(i3);
      for (let r4 = 0, n4 = 0; r4 < o3; r4++) {
        let o4 = t3.slice(n4, n4 + h2 - i3 + (r4 < l2 ? 0 : 1));
        n4 += o4.length;
        const s3 = e2.reedSolomonComputeRemainder(o4, c2);
        r4 < l2 && o4.push(0), u2.push(o4.concat(s3));
      }
      let d2 = [];
      for (let t4 = 0; t4 < u2[0].length; t4++)
        u2.forEach((e3, r4) => {
          (t4 != h2 - i3 || r4 >= l2) && d2.push(e3[t4]);
        });
      return s2(d2.length == a3), d2;
    }
    drawCodewords(t3) {
      if (t3.length != Math.floor(e2.getNumRawDataModules(this.version) / 8))
        throw new RangeError("Invalid argument");
      let r3 = 0;
      for (let e3 = this.size - 1; e3 >= 1; e3 -= 2) {
        6 == e3 && (e3 = 5);
        for (let n3 = 0; n3 < this.size; n3++)
          for (let s3 = 0; s3 < 2; s3++) {
            const i3 = e3 - s3, a3 = !(e3 + 1 & 2) ? this.size - 1 - n3 : n3;
            !this.isFunction[a3][i3] && r3 < 8 * t3.length && (this.modules[a3][i3] = o2(t3[r3 >>> 3], 7 - (7 & r3)), r3++);
          }
      }
      s2(r3 == 8 * t3.length);
    }
    applyMask(t3) {
      if (t3 < 0 || t3 > 7)
        throw new RangeError("Mask value out of range");
      for (let e3 = 0; e3 < this.size; e3++)
        for (let r3 = 0; r3 < this.size; r3++) {
          let n3;
          switch (t3) {
            case 0:
              n3 = (r3 + e3) % 2 == 0;
              break;
            case 1:
              n3 = e3 % 2 == 0;
              break;
            case 2:
              n3 = r3 % 3 == 0;
              break;
            case 3:
              n3 = (r3 + e3) % 3 == 0;
              break;
            case 4:
              n3 = (Math.floor(r3 / 3) + Math.floor(e3 / 2)) % 2 == 0;
              break;
            case 5:
              n3 = r3 * e3 % 2 + r3 * e3 % 3 == 0;
              break;
            case 6:
              n3 = (r3 * e3 % 2 + r3 * e3 % 3) % 2 == 0;
              break;
            case 7:
              n3 = ((r3 + e3) % 2 + r3 * e3 % 3) % 2 == 0;
              break;
            default:
              throw new Error("Unreachable");
          }
          !this.isFunction[e3][r3] && n3 && (this.modules[e3][r3] = !this.modules[e3][r3]);
        }
    }
    getPenaltyScore() {
      let t3 = 0;
      for (let r4 = 0; r4 < this.size; r4++) {
        let n4 = false, o4 = 0, s3 = [0, 0, 0, 0, 0, 0, 0];
        for (let i3 = 0; i3 < this.size; i3++)
          this.modules[r4][i3] == n4 ? (o4++, 5 == o4 ? t3 += e2.PENALTY_N1 : o4 > 5 && t3++) : (this.finderPenaltyAddHistory(o4, s3), n4 || (t3 += this.finderPenaltyCountPatterns(s3) * e2.PENALTY_N3), n4 = this.modules[r4][i3], o4 = 1);
        t3 += this.finderPenaltyTerminateAndCount(n4, o4, s3) * e2.PENALTY_N3;
      }
      for (let r4 = 0; r4 < this.size; r4++) {
        let n4 = false, o4 = 0, s3 = [0, 0, 0, 0, 0, 0, 0];
        for (let i3 = 0; i3 < this.size; i3++)
          this.modules[i3][r4] == n4 ? (o4++, 5 == o4 ? t3 += e2.PENALTY_N1 : o4 > 5 && t3++) : (this.finderPenaltyAddHistory(o4, s3), n4 || (t3 += this.finderPenaltyCountPatterns(s3) * e2.PENALTY_N3), n4 = this.modules[i3][r4], o4 = 1);
        t3 += this.finderPenaltyTerminateAndCount(n4, o4, s3) * e2.PENALTY_N3;
      }
      for (let r4 = 0; r4 < this.size - 1; r4++)
        for (let n4 = 0; n4 < this.size - 1; n4++) {
          const o4 = this.modules[r4][n4];
          o4 == this.modules[r4][n4 + 1] && o4 == this.modules[r4 + 1][n4] && o4 == this.modules[r4 + 1][n4 + 1] && (t3 += e2.PENALTY_N2);
        }
      let r3 = 0;
      for (const t4 of this.modules)
        r3 = t4.reduce((t5, e3) => t5 + (e3 ? 1 : 0), r3);
      const n3 = this.size * this.size, o3 = Math.ceil(Math.abs(20 * r3 - 10 * n3) / n3) - 1;
      return s2(0 <= o3 && o3 <= 9), t3 += o3 * e2.PENALTY_N4, s2(0 <= t3 && t3 <= 2568888), t3;
    }
    getAlignmentPatternPositions() {
      if (1 == this.version)
        return [];
      {
        const t3 = Math.floor(this.version / 7) + 2, e3 = 32 == this.version ? 26 : 2 * Math.ceil((4 * this.version + 4) / (2 * t3 - 2));
        let r3 = [6];
        for (let n3 = this.size - 7; r3.length < t3; n3 -= e3)
          r3.splice(1, 0, n3);
        return r3;
      }
    }
    static getNumRawDataModules(t3) {
      if (t3 < e2.MIN_VERSION || t3 > e2.MAX_VERSION)
        throw new RangeError("Version number out of range");
      let r3 = (16 * t3 + 128) * t3 + 64;
      if (t3 >= 2) {
        const e3 = Math.floor(t3 / 7) + 2;
        r3 -= (25 * e3 - 10) * e3 - 55, t3 >= 7 && (r3 -= 36);
      }
      return s2(208 <= r3 && r3 <= 29648), r3;
    }
    static getNumDataCodewords(t3, r3) {
      return Math.floor(e2.getNumRawDataModules(t3) / 8) - e2.ECC_CODEWORDS_PER_BLOCK[r3.ordinal][t3] * e2.NUM_ERROR_CORRECTION_BLOCKS[r3.ordinal][t3];
    }
    static reedSolomonComputeDivisor(t3) {
      if (t3 < 1 || t3 > 255)
        throw new RangeError("Degree out of range");
      let r3 = [];
      for (let e3 = 0; e3 < t3 - 1; e3++)
        r3.push(0);
      r3.push(1);
      let n3 = 1;
      for (let o3 = 0; o3 < t3; o3++) {
        for (let t4 = 0; t4 < r3.length; t4++)
          r3[t4] = e2.reedSolomonMultiply(r3[t4], n3), t4 + 1 < r3.length && (r3[t4] ^= r3[t4 + 1]);
        n3 = e2.reedSolomonMultiply(n3, 2);
      }
      return r3;
    }
    static reedSolomonComputeRemainder(t3, r3) {
      let n3 = r3.map((t4) => 0);
      for (const o3 of t3) {
        const t4 = o3 ^ n3.shift();
        n3.push(0), r3.forEach((r4, o4) => n3[o4] ^= e2.reedSolomonMultiply(r4, t4));
      }
      return n3;
    }
    static reedSolomonMultiply(t3, e3) {
      if (t3 >>> 8 != 0 || e3 >>> 8 != 0)
        throw new RangeError("Byte out of range");
      let r3 = 0;
      for (let n3 = 7; n3 >= 0; n3--)
        r3 = r3 << 1 ^ 285 * (r3 >>> 7), r3 ^= (e3 >>> n3 & 1) * t3;
      return s2(r3 >>> 8 == 0), r3;
    }
    finderPenaltyCountPatterns(t3) {
      const e3 = t3[1];
      s2(e3 <= 3 * this.size);
      const r3 = e3 > 0 && t3[2] == e3 && t3[3] == 3 * e3 && t3[4] == e3 && t3[5] == e3;
      return (r3 && t3[0] >= 4 * e3 && t3[6] >= e3 ? 1 : 0) + (r3 && t3[6] >= 4 * e3 && t3[0] >= e3 ? 1 : 0);
    }
    finderPenaltyTerminateAndCount(t3, e3, r3) {
      return t3 && (this.finderPenaltyAddHistory(e3, r3), e3 = 0), e3 += this.size, this.finderPenaltyAddHistory(e3, r3), this.finderPenaltyCountPatterns(r3);
    }
    finderPenaltyAddHistory(t3, e3) {
      0 == e3[0] && (t3 += this.size), e3.pop(), e3.unshift(t3);
    }
  };
  let r2 = e2;
  function n2(t3, e3, r3) {
    if (e3 < 0 || e3 > 31 || t3 >>> e3 != 0)
      throw new RangeError("Value out of range");
    for (let n3 = e3 - 1; n3 >= 0; n3--)
      r3.push(t3 >>> n3 & 1);
  }
  function o2(t3, e3) {
    return !!(t3 >>> e3 & 1);
  }
  function s2(t3) {
    if (!t3)
      throw new Error("Assertion error");
  }
  r2.MIN_VERSION = 1, r2.MAX_VERSION = 40, r2.PENALTY_N1 = 3, r2.PENALTY_N2 = 3, r2.PENALTY_N3 = 40, r2.PENALTY_N4 = 10, r2.ECC_CODEWORDS_PER_BLOCK = [[-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28], [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]], r2.NUM_ERROR_CORRECTION_BLOCKS = [[-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25], [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49], [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68], [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]], t2.QrCode = r2;
  const i2 = class {
    constructor(t3, e3, r3) {
      if (this.mode = t3, this.numChars = e3, this.bitData = r3, e3 < 0)
        throw new RangeError("Invalid argument");
      this.bitData = r3.slice();
    }
    static makeBytes(t3) {
      let e3 = [];
      for (const r3 of t3)
        n2(r3, 8, e3);
      return new i2(i2.Mode.BYTE, t3.length, e3);
    }
    static makeNumeric(t3) {
      if (!i2.isNumeric(t3))
        throw new RangeError("String contains non-numeric characters");
      let e3 = [];
      for (let r3 = 0; r3 < t3.length; ) {
        const o3 = Math.min(t3.length - r3, 3);
        n2(parseInt(t3.substr(r3, o3), 10), 3 * o3 + 1, e3), r3 += o3;
      }
      return new i2(i2.Mode.NUMERIC, t3.length, e3);
    }
    static makeAlphanumeric(t3) {
      if (!i2.isAlphanumeric(t3))
        throw new RangeError("String contains unencodable characters in alphanumeric mode");
      let e3, r3 = [];
      for (e3 = 0; e3 + 2 <= t3.length; e3 += 2) {
        let o3 = 45 * i2.ALPHANUMERIC_CHARSET.indexOf(t3.charAt(e3));
        o3 += i2.ALPHANUMERIC_CHARSET.indexOf(t3.charAt(e3 + 1)), n2(o3, 11, r3);
      }
      return e3 < t3.length && n2(i2.ALPHANUMERIC_CHARSET.indexOf(t3.charAt(e3)), 6, r3), new i2(i2.Mode.ALPHANUMERIC, t3.length, r3);
    }
    static makeSegments(t3) {
      return "" == t3 ? [] : i2.isNumeric(t3) ? [i2.makeNumeric(t3)] : i2.isAlphanumeric(t3) ? [i2.makeAlphanumeric(t3)] : [i2.makeBytes(i2.toUtf8ByteArray(t3))];
    }
    static makeEci(t3) {
      let e3 = [];
      if (t3 < 0)
        throw new RangeError("ECI assignment value out of range");
      if (t3 < 128)
        n2(t3, 8, e3);
      else if (t3 < 16384)
        n2(2, 2, e3), n2(t3, 14, e3);
      else {
        if (!(t3 < 1e6))
          throw new RangeError("ECI assignment value out of range");
        n2(6, 3, e3), n2(t3, 21, e3);
      }
      return new i2(i2.Mode.ECI, 0, e3);
    }
    static isNumeric(t3) {
      return i2.NUMERIC_REGEX.test(t3);
    }
    static isAlphanumeric(t3) {
      return i2.ALPHANUMERIC_REGEX.test(t3);
    }
    getData() {
      return this.bitData.slice();
    }
    static getTotalBits(t3, e3) {
      let r3 = 0;
      for (const n3 of t3) {
        const t4 = n3.mode.numCharCountBits(e3);
        if (n3.numChars >= 1 << t4)
          return 1 / 0;
        r3 += 4 + t4 + n3.bitData.length;
      }
      return r3;
    }
    static toUtf8ByteArray(t3) {
      t3 = encodeURI(t3);
      let e3 = [];
      for (let r3 = 0; r3 < t3.length; r3++)
        "%" != t3.charAt(r3) ? e3.push(t3.charCodeAt(r3)) : (e3.push(parseInt(t3.substr(r3 + 1, 2), 16)), r3 += 2);
      return e3;
    }
  };
  let a2 = i2;
  a2.NUMERIC_REGEX = /^[0-9]*$/, a2.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, a2.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", t2.QrSegment = a2;
})(r || (r = {})), ((t2) => {
  const e2 = class {
    constructor(t3, e3) {
      this.ordinal = t3, this.formatBits = e3;
    }
  };
  let r2 = e2;
  r2.LOW = new e2(0, 1), r2.MEDIUM = new e2(1, 0), r2.QUARTILE = new e2(2, 3), r2.HIGH = new e2(3, 2), t2.Ecc = r2;
})((n = r || (r = {})).QrCode || (n.QrCode = {})), ((t2) => {
  ((t3) => {
    const e2 = class {
      constructor(t4, e3) {
        this.modeBits = t4, this.numBitsCharCount = e3;
      }
      numCharCountBits(t4) {
        return this.numBitsCharCount[Math.floor((t4 + 7) / 17)];
      }
    };
    let r2 = e2;
    r2.NUMERIC = new e2(1, [10, 12, 14]), r2.ALPHANUMERIC = new e2(2, [9, 11, 13]), r2.BYTE = new e2(4, [8, 16, 16]), r2.KANJI = new e2(8, [8, 10, 12]), r2.ECI = new e2(7, [0, 0, 0]), t3.Mode = r2;
  })(t2.QrSegment || (t2.QrSegment = {}));
})(r || (r = {}));
var u = r, c = { L: u.QrCode.Ecc.LOW, M: u.QrCode.Ecc.MEDIUM, Q: u.QrCode.Ecc.QUARTILE, H: u.QrCode.Ecc.HIGH }, d = 128, f = "L", g = "#FFFFFF", m = "#000000", E = false, M = 4, w = 0.1;
function C(r2) {
  const n2 = r2, { value: o2, size: l2 = d, level: C2 = f, bgColor: R = g, fgColor: A = m, includeMargin: N = E, imageSettings: p } = n2, P = ((t2, e2) => {
    var r3 = {};
    for (var n3 in t2)
      i.call(t2, n3) && e2.indexOf(n3) < 0 && (r3[n3] = t2[n3]);
    if (null != t2 && s)
      for (var n3 of s(t2))
        e2.indexOf(n3) < 0 && a.call(t2, n3) && (r3[n3] = t2[n3]);
    return r3;
  })(n2, ["value", "size", "level", "bgColor", "fgColor", "includeMargin", "imageSettings"]);
  let I = u.QrCode.encodeText(o2, c[C2]).getModules();
  const v = N ? M : 0, y = I.length + 2 * v, _ = function(t2, e2, r3, n3) {
    if (null == n3)
      return null;
    const o3 = r3 ? M : 0, s2 = t2.length + 2 * o3, i2 = Math.floor(e2 * w), a2 = s2 / e2, l3 = (n3.width || i2) * a2, h2 = (n3.height || i2) * a2, u2 = null == n3.x ? t2.length / 2 - l3 / 2 : n3.x * a2, c2 = null == n3.y ? t2.length / 2 - h2 / 2 : n3.y * a2;
    let d2 = null;
    if (n3.excavate) {
      let t3 = Math.floor(u2), e3 = Math.floor(c2);
      d2 = { x: t3, y: e3, w: Math.ceil(l3 + u2 - t3), h: Math.ceil(h2 + c2 - e3) };
    }
    return { x: u2, y: c2, h: h2, w: l3, excavation: d2 };
  }(I, l2, N, p);
  let S = null;
  var O, z;
  null != p && null != _ && (null != _.excavation && (O = I, z = _.excavation, I = O.slice().map((t2, e2) => e2 < z.y || e2 >= z.y + z.h ? t2 : t2.map((t3, e3) => (e3 < z.x || e3 >= z.x + z.w) && t3))), S = e("image", { xlinkHref: p.src, height: _.h, width: _.w, x: _.x + v, y: _.y + v, preserveAspectRatio: "none" }));
  const F = function(t2, e2 = 0) {
    const r3 = [];
    return t2.forEach(function(t3, n3) {
      let o3 = null;
      t3.forEach(function(s2, i2) {
        if (!s2 && null !== o3)
          return r3.push(`M${o3 + e2} ${n3 + e2}h${i2 - o3}v1H${o3 + e2}z`), void (o3 = null);
        if (i2 !== t3.length - 1)
          s2 && null === o3 && (o3 = i2);
        else {
          if (!s2)
            return;
          null === o3 ? r3.push(`M${i2 + e2},${n3 + e2} h1v1H${i2 + e2}z`) : r3.push(`M${o3 + e2},${n3 + e2} h${i2 + 1 - o3}v1H${o3 + e2}z`);
        }
      });
    }), r3.join("");
  }(I, v);
  return t("svg", { ...h({ height: l2, width: l2, viewBox: `0 0 ${y} ${y}` }, P), children: [e("path", { fill: R, d: `M0,0 h${y}v${y}H0z`, shapeRendering: "crispEdges" }), e("path", { fill: A, d: F, shapeRendering: "crispEdges" }), S] });
}
!function() {
  try {
    new Path2D().addPath(new Path2D());
  } catch (t2) {
    return false;
  }
}();
export {
  C as Q
};
